2 IPC integration of babeld with OpenWrt.
4 The ubus interface offers following functions:
5 - add_filter '{"ifname":"eth0", "type":0, "metric":5000}'
9 2: FILTER_TYPE_REDISTRIBUTE
10 3: FILTER_TYPE_INSTALL
11 - add_interface '{"ifname":"eth0"}'
17 All output is divided into IPv4 and IPv6.
19 Ubus notifications are sent if we receive updates for
25 - {route,xroute,neighbour}.add: Object was added
26 - {route,xroute,neighbour}.change: Object was changed
27 - {route,xroute,neighbour}.flush: Object was flushed
32 #include <sys/select.h>
38 // Whether to enable ubus bindings (boolean option).
39 extern int ubus_bindings
;
42 * Initialize ubus interface.
44 * Connect to the ubus daemon and expose the ubus functions.
46 * @return if initializing ubus was successful
48 bool babeld_add_ubus();
51 * Add ubus socket to given filedescriptor set.
53 * We need to check repeatedly if the ubus socket has something to read.
54 * The functions allows to add the ubus socket to the normal while(1)-loop of
57 * @param readfs: the filedescriptor set
58 * @param maxfd: the current maximum file descriptor
59 * @return the maximum file descriptor
61 int babeld_ubus_add_read_sock(fd_set
*readfds
, int maxfd
);
64 * Check and process ubus socket.
66 * If the ubus-socket signals that data is available, the ubus_handle_event is
69 void babeld_ubus_receive(fd_set
*readfds
);
72 * Notify the ubus bus that a new xroute is received.
74 * If a new xroute is received or changed, we will notify subscribers.
76 * @param xroute: xroute that experienced some change
77 * @param kind: kind that describes if we have a flush, add or change
79 void ubus_notify_xroute(struct xroute
*xroute
, int kind
);
82 * Notify the ubus bus that a new route is received.
84 * If a new route is received or changed, we will notify subscribers.
86 * @param route: route that experienced some change
87 * @param kind: kind that describes if we have a flush, add or change
89 void ubus_notify_route(struct babel_route
*route
, int kind
);
92 * Notify the ubus bus that a new neighbour is received.
94 * If a new neighbour is received or changed, we will notify subscribers.
96 * @param neigh: neighbour that experienced some change
97 * @param kind: kind that describes if we have a flush, add or change
99 void ubus_notify_neighbour(struct neighbour
*neigh
, int kind
);