summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
AgeCommit message (Collapse)Author
2016-09-14interface-ip: DNS name server sorting support in resolv.conf.autoHans Dedecker
Interface name servers when being written to resolv.conf.auto are sorted based on the following parameters: -Primary sorting key is interface dns_metric; name servers having lowest interface dns_metric are listed first -Secondary sorting key is interface metric; in case of equal interface dns_metric name servers having lowest interface metric are listed first -Finally alphabetical order of the interface names in case of equal interface dns_metric and metric In case the resolver queries the multiple servers in the order listed; sorting is usefull in the following scenarios : -Name resolving over a main and backup interface -Assign priority to IPv6 name servers over IPv4 or vice versa Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-08-26device: prepare for adding device handlers dynamicallyArne Kappen
- remove const from device handler struct - pass device handler type to create function Signed-off-by: Arne Kappen <akappen@inet.tu-berlin.de> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
2016-06-06system-linux: Replace device_get by device_find where appropriateHans Dedecker
Replace device_get by device_find so it's clear a device needs to be found present in the device list. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-02-01ubus: Fix possible segfaultHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-12-19interface: Trigger interface update event when interface data is updated via ↵Hans Dedecker
ubus Interface update event will trigger an interface hotplug event and an ubus notify event which will inform subscribers about the updated interface data field Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-11-19ubus: export dynamic-flag for interfacesSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2015-08-25Changes for more readability.Yousong Zhou
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-06-08Fix removal of dynamic interfacesSteven Barth
Also remove obsolete "del_dynamic" call (use "down" instead) Signed-off-by: Steven Barth <steven@midlink.org>
2015-04-14Cleanup issues reported by scan-buildSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-30netifd: Allow to add link devices which can be marked as non externalHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-07-29add_dynamic: remove redundant codeSteven Barth
device_config is unneeded since add_dynamic is used to create aliases checking of setup state is unneeded because of race condition fixes Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-28ubus: add del_dynamic as complement to add_dynamicSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-07-25Only add dynamic interfaces if the underlying interface is readySteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-06-18netifd: Route type supportHans Dedecker
Patch adds route type support in netifd by means of the route parameter type. By default the route type was unicast; the parameter adss support for local/broadcast/multicast/unicast routes which will be put into the appropriate routing table. If route type parameter is unset the route type will be unicast as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-06-05add a interface. prefix to ubus_notify callsJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-04-24netifd: Mark interface as dynamic after it has been added in the interface listHans Dedecker
Adding an interface in the interface list in case of a config update will override the node version of the old interface and thus overriding the dynamic interface marker. In case of config update interface_set_dynamic is done on an invalid interface pointer as the new interface pointer has been freed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-04-19ubus: check the l3_dev pointer before dereferencing itFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-21ubus: use list_empty() instead of the compat wrapperFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-20ubus: fix displaying interface data itemsFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-11Revert "ubus events: don't incorrectly announce an interface as being up"Felix Fietkau
Made obsolete by b114b86c70766f67f503077ad1de013c17fbf366 This reverts commit 4d1a597f65bbb49aa843112812d5ca929478c706.
2014-03-05ubus events: don't incorrectly announce an interface as being upSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2014-02-17wireless: add a "get_validate" methode to ubusJohn Crispin
Signed-off-by: John Crispin <blogic@openwrt.org>
2014-02-14netifd : Fix ubus route src mask printingHans Dedecker
Fix printing of route src mask attribute when it contains 3 digits Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2014-01-17Add indicator-flags to ubus and hotplug update-eventsSteven Barth
2013-12-12Set dynamic interface flag after adding them so the version is preservedSteven Barth
2013-12-08netifd: Don't export default route via UBUS when disabledHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2013-12-08netifd: Export ip4table/ip6table via UBUSHans Dedecker
Export ip4table/ip6table parameters via UBUS to facilitate route inspection and usage by other applications Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2013-11-29wireless: add support for global up/down commandFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-11-29add initial support for handling wireless devices via scriptsFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-11-27IPv6: add class support to regular IPv6 addressesSteven Barth
2013-10-30IPv6: Export delegation setting via ubusSteven Barth
This allows foreign prefix delegators to quickly distinguish between managed and unmanaged prefixes. Signed-off-by: Steven Barth <steven@midlink.org>
2013-10-22add helper function for adding/removing devices to interfacesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-19interface: rework code to get rid of arbitrary IFNAMSIZ limitation for ↵Felix Fietkau
interface names Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-19interface: remove "dynamic" argument for interface_init, add the ↵Felix Fietkau
interface_set_dynamic function instead Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-18Add source-restricted routesSteven Barth
2013-10-17Add protocol update notifications and hotplug legacy callsSteven Barth
2013-10-17Add ubus function to create nested interfacesSteven Barth
2013-10-17Add ubus methods for global interface statusSteven Barth
2013-05-30IPv6: reorganize prefix assignmentSteven Barth
* put parameters in a more suitable place * add support for prefix classes
2013-05-13Add support for IPv6 and interface target-routes & dependenciesSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2013-04-04Expose route table if route is not in the main tableJo-Philipp Wich
2013-04-03Rewrite IPv6 prefix assignmentSteven Barth
2013-02-01Improved IPv6 featuresetSteven Barth
* Fix reloading of ula-prefixes * Added support for temporary addresses and routes * Added support for offlink addresses * Improved status-output for assigned prefixes
2013-01-29ubus: add a network.interface object to access network.interface.* methods ↵Felix Fietkau
without racing wrt. object add/remove Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-15Initial IPv6 prefix supportSteven Barth
Signed-off-by: Steven Barth <steven@midlink.org>
2013-01-06fix removal of unknown deviceNathan Hintz
Netifd will crash if an attempt is made to remove a device that is not known to netifd. For instance: ubus call network.interface.lan remove_device "{ \"name\": \"xxx\" }" Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
2012-12-03fix error checking of asprintfFrank Meerkötter
see man asprintf [...] RETURN VALUE When successful, these functions return the number of bytes printed, just like sprintf(3). If memory allocation wasn't possible, or some other error occurs, these functions will return -1, and the contents of strp is undefined. Signed-off-by: Frank Meerkötter <frank@meerkoetter.org>
2012-10-29use FD_CLOEXEC instead of tracking lists of fdsFelix Fietkau
2012-10-19fix device_lock/device_unlock imbalancesFelix Fietkau
2012-09-13ubus.c: now that disabled routes are in the inactive subtable it makes no ↵Jo-Philipp Wich
sense to expose the enabled attribute anymore