summaryrefslogtreecommitdiff
path: root/babeld/src
Commit message (Collapse)AuthorAgeFilesLines
* babeld: update to 1.13Nick Hainke2023-07-191-19/+0
| | | | | | | | | | | | | | | | Announcement: https://alioth-lists.debian.net/pipermail/babel-users/2023-July/004100.html Babeld removed diversity routing [0], so we need to adjust ubus bindings. Further. we need to add a patch that makes local_kind accessible again: "100-local-make-local_kind-function-accessible.patch" Refresh patches: - 600-add-ubus.patch [0] - https://github.com/jech/babeld/commit/a0816083356e5d33fb71e0e30d92aa3bf335d7ea Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: add add_filter functionNick Hainke2022-03-302-1/+62
| | | | | | | | | | | | | | You can define filter functions in babeld by: in if eth0 metric 128 This commit adds the ubus equivalent to dynamically add filter on runtime: ubus call babeld add_filter '{"ifname":"eth0", "type":"input", "metric":128}' Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: remove unused return variableNick Hainke2022-02-011-1/+0
| | | | | | | | There is an unused variable in the function. Remove it. Fixes: 385200443554 ("babeld: add add_interface function"). Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: add add_interface functionNick Hainke2022-02-012-0/+38
| | | | | | | | | | | An interface can be added dynmiacally to babeld by starting babeld with the local management interface (-G) and saying: interface eth0 Add the ubus equivalent of this function: ubus call babeld add_interface '{"ifname":"eth0"}' Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: remove unnecessray blob_buf_init callsNick Hainke2021-10-161-4/+2
| | | | | | | | For some reason the buffer is initialized twice before filling it. This does not break anything but is useless. Reduce the initialization to only one. Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: free blob-buffers that are on stackNick Hainke2021-10-161-0/+11
| | | | | | | | | | | | | | As Felix mentioned: If a buffer was already allocated, blob_buf_init reuses it. You can keep reusing it as many times as you want. You only need to call blob_buf_free if you explicitly want to free the buffer memory (e.g. on exit, or if the blob_buf is on stack). http://lists.openwrt.org/pipermail/openwrt-devel/2021-October/036722.html This PR frees the blob-buffers that are on the stack. Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: update to 1.10Nick Hainke2021-06-021-2/+1
| | | | | | | | | | | | | | | 25 April 2021: babeld-1.10 * Removed the disambiguation code: source-specific routing is no longer supported for IPv4, and for IPv6 only on Linux 3.11 or later. * Fixed an issue handling of retractions with no next hop, which caused interoperability problems with BIRD. Thanks to Fabian Bläse. * If skip-kernel-setup is set, we no longer disable the rp_filter, which makes babeld work in containers. Thanks to Martin Weinelt. Remove upstreamed part of ubus patch: - local: make local_kind function accessible Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: adopt to upstream header-style (#640)Polynomdivision2021-02-092-1/+7
| | | | | | | | | | | | | babeld: adopt to upstream header-style Instead of including the headerfiles that define the structs, we add forward definitions to our headerfile. Fixes warning: ubus.h:67:32: warning: 'struct xroute' declared inside parameter list will not be visible outside of this definition or declaration void ubus_notify_xroute(struct xroute *xroute, int kind); ^~~~~~ Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: fix compiler warnings (#639)Polynomdivision2021-02-011-20/+29
| | | | | | | | | | babeld: fix compiler warnings Fixes: - "route_list_entry" points to "struct babel_route" - "format_thousands" returns a string pointer - "UBUS_METHOD_NOARG" wants a function returning an integer Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: send events via ubus (#633)Polynomdivision2021-02-012-11/+114
| | | | | | | | | | | | | | | | | | | * babeld: send events via ubus Send a notification via the ubus bus if we experience any changes in neighbours, routes or xroutes. The format looks like this: {route,xroute,neighbour}.add: Object was added {route,xroute,neighbour}.change: Object was changed {route,xroute,neighbour}.flush: Object was flushed If ubus_bindings is turned off, it will minimally effect performance, since only an if-statement has to be evaluated. If no subscriber is available, it will minimally change the performance, since only an if-statmenet that checks for subscribers has to be evaluated. Signed-off-by: Nick Hainke <vincent@systemli.org>
* babeld: add ubus bindingsNick Hainke2021-01-152-0/+429
A better integration of babeld with OpenWrt is to connect the daemon to the IPC. So far, we can only communicate via a websocket. With ubus we can send and receive commands in json format. The commit adds a ubus interface to babeld with following functions: - get_info - get_neighbours - get_xroutes - get_routes All output is divided into IPv4 and IPv6. Ubus has to be enabled by setting "config general" option 'ubus_bindings' 'true' Example: root@OpenWrt:~# ubus call babeld get_info { "babeld-version": "babeld-1.9.2", "my-id": "32:xx:xx:xx:xx:xx:xx:xx", "host": "OpenWrt" } root@OpenWrt:~# ubus call babeld get_neighbours { "IPv4": { }, "IPv6": { "fe80::xx:xx:xx:xxx": { "dev": "br-lan", "hello-reach": 65408, "uhello-reach": 0, "rxcost": 96, "txcost": 96, "rtt": 4338271, "channel": -2, "if_up": true } } } root@OpenWrt:~# ubus call babeld get_xroutes { "IPv4": { "10.0.0.3/32": { "src-prefix": "0.0.0.0/0", "metric": 0 }, "10.0.0.0/24": { "src-prefix": "0.0.0.0/0", "metric": 0 } }, "IPv6": { "fdfa:xx:xx::1/128": { "src-prefix": "::/0", "metric": 0 } } } root@OpenWrt:~# ubus call babeld get_routes { "IPv4": { "10.2.0.1/32": { "src-prefix": "0.0.0.0/0", "route_metric": 96, "route_smoothed_metric": 96, "refmetric": 0, "id": "62:xx:xx:xx:xx:xx:xx:xx", "seqno": 41381, "channels": "", "age": 17, "via": "fe80::xx:xxxx:xxxx:xxxx", "nexthop": " nexthop ", "installed": true, "feasible": true }, "IPv6": { } } Additional IPC functionality will follow. Further, we changed the version to $version-ubus-mod. Signed-off-by: Nick Hainke <vincent@systemli.org>