1
0
mirror of https://git.openwrt.org/feed/routing.git synced 2024-06-26 17:47:32 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Nick Hainke
ea4a3f28dc babeld: add ubus bindings
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>
2021-01-15 01:13:26 +01:00
Baptiste Jonglez
3e3d16338d babeld: Update example configuration file
More example filters are provided, and new options such as "type" or
"pref_src" are given as example.

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2019-08-26 20:52:37 +02:00
Nils Schneider
234c9d97a6 babeld: fix parsing of list import_table
When parsing list options using config_load option_cb will be called
with additional options ending in _ITEM$x and _LENGTH. This ignores any
option containing _LENGTH or _ITEM as they can't possible be a valid
babeld option making a config like

    config general
        list import_table 23
        list import_table 42

work.

Signed-off-by: Nils Schneider <nils@nilsschneider.net>
2015-08-16 18:54:32 +02:00
Gabriel Kerneis
ac643416dc babeld: allow changing alternative configuration file and directory
Signed-off-by: Gabriel Kerneis <kerneis@google.com>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
2015-05-21 11:44:19 +03:00
Gabriel Kerneis
c5f795cc38 babeld: tweak configuration for source-specific features
- Enable ipv6-subtrees by default.
- Add UCI options to configure source-specific filters.

Signed-off-by: Gabriel Kerneis <kerneis@google.com>
2015-04-21 10:29:58 +02:00
Baptiste Jonglez
5a554d27cc babeld: Specify edge cases 2014-09-03 15:12:33 +02:00
Baptiste Jonglez
8fb7fe0a59 babeld: Update configuration file for new syntax 2014-08-31 00:49:27 +02:00
Gabriel Kerneis
6c4438c93b babeld: new upstream release 1.5.0
22 May 2014: babeld-1.5.0

  * Added support for an RTT-based metric -- see the description of
    "enable-timestamps" in the manual page.  This work was done by
    Baptiste Jonglez with help from Matthieu Boutier.
2014-06-01 14:15:10 +01:00
Gabriel Kerneis
c4de5a575b babeld: migrate from openwrt/packages
- Update maintainer email address
- Wait for babel to die in init script (avoid race-condition on restart)

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
2013-10-28 16:20:38 +00:00