2 IPC integration of babeld with OpenWrt.
4 The ubus interface offers following functions:
10 All output is divided into IPv4 and IPv6.
12 Ubus notifications are sent if we receive updates for
18 - {route,xroute,neighbour}.add: Object was added
19 - {route,xroute,neighbour}.change: Object was changed
20 - {route,xroute,neighbour}.flush: Object was flushed
25 #include <sys/select.h>
31 // Whether to enable ubus bindings (boolean option).
32 extern int ubus_bindings
;
35 * Initialize ubus interface.
37 * Connect to the ubus daemon and expose the ubus functions.
39 * @return if initializing ubus was successful
41 bool babeld_add_ubus();
44 * Add ubus socket to given filedescriptor set.
46 * We need to check repeatedly if the ubus socket has something to read.
47 * The functions allows to add the ubus socket to the normal while(1)-loop of
50 * @param readfs: the filedescriptor set
51 * @param maxfd: the current maximum file descriptor
52 * @return the maximum file descriptor
54 int babeld_ubus_add_read_sock(fd_set
*readfds
, int maxfd
);
57 * Check and process ubus socket.
59 * If the ubus-socket signals that data is available, the ubus_handle_event is
62 void babeld_ubus_receive(fd_set
*readfds
);
65 * Notify the ubus bus that a new xroute is received.
67 * If a new xroute is received or changed, we will notify subscribers.
69 * @param xroute: xroute that experienced some change
70 * @param kind: kind that describes if we have a flush, add or change
72 void ubus_notify_xroute(struct xroute
*xroute
, int kind
);
75 * Notify the ubus bus that a new route is received.
77 * If a new route is received or changed, we will notify subscribers.
79 * @param route: route that experienced some change
80 * @param kind: kind that describes if we have a flush, add or change
82 void ubus_notify_route(struct babel_route
*route
, int kind
);
85 * Notify the ubus bus that a new neighbour is received.
87 * If a new neighbour is received or changed, we will notify subscribers.
89 * @param neigh: neighbour that experienced some change
90 * @param kind: kind that describes if we have a flush, add or change
92 void ubus_notify_neighbour(struct neighbour
*neigh
, int kind
);