summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
AgeCommit message (Collapse)Author
2019-05-03treewide: always init interface list heads during initializationDainis Jonitis
When allocating interface, init dhcpv4_assignments, dhcpv4_fr_ips and ia_assignments circular list heads to point to self. Avoids checking whether next pointer is not null all over the place. Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
2019-05-02dhcpv4: add support for Parameter Request List option 55Dainis Jonitis
Add client "reqopts" in ubus "ipv4leases" output. Signed-off-by: Roman Yeryomin <roman.yeryomin@ubnt.com> Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
2019-02-27ubus: always trigger an update if interface is not foundHans Dedecker
Commit 9f25dd8af76dc30e54ddcbb4a284058e598951d5 changed the logic of handle_update by only triggering an update if the interface is found in the interface list and is not set as to be ignored. However this breaks the behavior of loading the dhcp config for interfaces which were previously not yet known by netifd and as result were not yet created in the interface list. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-11dhcpv6-ia: move function definitions to odhcpd.hHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-08treewide: unify dhcpv6 and dhcpv4 assignmentsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2019-02-05treewide: use avl tree to store interfacesHans Dedecker
Store the interfaces in an avl tree iso a linear linked list Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-12-12treewide: switch to libubox ARRAY_SIZE immplementationHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-09-05odhcpd: detect broken hostnamesHans Dedecker
Check hostnames contain valid characters as defined in RFC 952 and RFC 1123. Invalid hostnames in uci configured host entries will result into a refusal to create the static lease. In case a client received hostname contains an invalid character no <hostname> <IP address> entry will be added to the lease file. In such case the leaseinfo description in the lease file will still contain the hostname but preceded by the string broken\x20 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2018-07-26ubus: avoid dumping interface state with NULL messageJo-Philipp Wich
Invoking ubus methods with NULL message is not supported anymore, so make sure that network.interface/dump is called with an empty blob buffer argument. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-21ubus: fix invalid ipv6-prefix jsonMislav Novakovic
"ipv6-prefix": [ { "<some ipv6 address>", "preferred-lifetime": 37979, "valid-lifetime": 48779, "prefix-length": 63 } ], json object is missing key, set address as key name. Line up DHCPv4 lease json info by using key name "address" Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-12-17odhcpd: Replace strerror(errno) with %m formatRosen Penev
Saves a few bytes. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2017-12-06dhcpv4: notify DHCP ACK and RELEASE via ubusHans Dedecker
If the ubus object has any subscription notify DHCP ACK and DHCP RELEASE events using ubus notifications. Signed-off-by: Borja Salazar <borja.salazar@fon.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-10-13treewide: align function namingHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-13dhcpv4: force renew nonce authentication supportHans Dedecker
Support force renew nonce authentication support in the DHCPv4 server as described in RFC3203 and RFC6704. The interface uci arameter dhcpv4_forcereconf allows to supports DHCPv4 clients which support force renew without authentication. While at it align network byte order logic for simplicity. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-11ubus: display accept reconf status for DHCPv6 assignmentsHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-09-06treewide: replace RELAYD prefix naming in macrosHans Dedecker
Remove the unfortunate RELAYD naming in the different macros Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-04-25ubus: don't segfault when there're no leasesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-04-21ubus: rework dumping IPv6 and IPv4 leasesHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-03-29ndp: keep an exact copy of IPv6 interface addressesHans Dedecker
Don't reset the final 32 bit IPv6 host suffix when storing the IPv6 addresses in the interface structure. This will allow exact lookup aand return of IPv6 addresses stored in the interface structure when needed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-12-01odhcpd: Display infinite valid lifetime as -1Hans Dedecker
Display infinite valid lifetime as -1 both in ubus and statefile Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2016-11-21ubus: Fix displayed valid paramater for both DHCPv4 and DHCPv6 leaseHans Dedecker
Fix ubus valid parameter being displayed as a negative number; also display infinite lifetime as INT32_MAX Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-12-15config: blobmsg_check_attr expects bool type as last argumentHans Dedecker
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2015-08-20Revert "RFC: dhcpv4 support openwrt alias ip addr"Steven Barth
2015-06-22dhcpv4: remove unused addr_attrs structPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-18dhcpv4: fix char ubus_get_address4 int ubus_get_mask4 functionPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: return pointerPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-15dhcpv4: add for_each ipv4-address array in ubus_get_address4 ubus_get_mask4 ↵Patrick Grimm
function Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-14dhcpv4: add ubus_get_address4 ubus_get_mask4 functionPatrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-06-14dhcpv4: read ipv4-address from UBUS to ADDRESS4Patrick Grimm
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
2015-03-29Remove prefix coloring support, refine hybrid management modeSteven Barth
2014-07-21Fix typo in ubus integrationSteven Barth
2014-03-20ubus: convert to async callsSteven Barth
2014-03-20ubus: use safe iteratorSteven Barth
2014-03-20ubus: don't redeclare variable cSteven Barth
2013-12-03Fix prefix class logicSteven Barth
2013-12-02Initial prefix class supportSteven Barth
2013-10-22Don't accidentally apply settings from foreign interfacesSteven Barth
2013-10-16Fix netifd update detectionSteven Barth
2013-10-15Handle reload mechanismSteven Barth
2013-10-15improve matching apiSteven Barth
2013-10-15ubus: register subscriberSteven Barth
2013-10-15Fix config retrieval from netifdSteven Barth
2013-10-15ifname should be l3_deviceSteven Barth
2013-10-15Fix last commitSteven Barth
2013-10-15Fix ubus message handling againSteven Barth
2013-10-15Fix blobmsg iterationSteven Barth
2013-10-14Fix unsigned / signed conversionSteven Barth
2013-10-14Fix argument parsingSteven Barth
2013-10-14Various fixesSteven Barth
2013-10-14Fix upstream detectionSteven Barth