3 @@ -54,6 +54,8 @@ THE SOFTWARE.
11 unsigned char myid[8];
12 @@ -521,6 +523,9 @@ main(int argc, char **argv)
20 rc = resize_receive_buffer(1500);
22 @@ -616,6 +621,8 @@ main(int argc, char **argv)
23 FD_SET(local_sockets[i].fd, &readfds);
24 maxfd = MAX(maxfd, local_sockets[i].fd);
27 + maxfd = babeld_ubus_add_read_sock(&readfds, maxfd);
28 rc = select(maxfd + 1, &readfds, NULL, NULL, &tv);
31 @@ -684,6 +691,9 @@ main(int argc, char **argv)
36 + babeld_ubus_receive(&readfds);
39 kernel_dump_time = now.tv_sec;
40 check_neighbours_timeout = now;
41 --- a/generate-version.sh
42 +++ b/generate-version.sh
43 @@ -10,4 +10,4 @@ else
47 -echo "#define BABELD_VERSION \"$version\""
48 +echo "#define BABELD_VERSION \"$version-ubus-mod\""
51 @@ -42,6 +42,8 @@ THE SOFTWARE.
53 #include "configuration.h"
57 static struct filter *input_filters = NULL;
58 static struct filter *output_filters = NULL;
59 static struct filter *redistribute_filters = NULL;
60 @@ -1036,7 +1038,8 @@ parse_option(int c, gnc_t gnc, void *clo
61 strcmp(token, "daemonise") == 0 ||
62 strcmp(token, "skip-kernel-setup") == 0 ||
63 strcmp(token, "ipv6-subtrees") == 0 ||
64 - strcmp(token, "reflect-kernel-metric") == 0) {
65 + strcmp(token, "reflect-kernel-metric") == 0 ||
66 + strcmp(token, "ubus-bindings") == 0) {
68 c = getbool(c, &b, gnc, closure);
70 @@ -1054,6 +1057,8 @@ parse_option(int c, gnc_t gnc, void *clo
71 has_ipv6_subtrees = b;
72 else if(strcmp(token, "reflect-kernel-metric") == 0)
73 reflect_kernel_metric = b;
74 + else if(strcmp(token, "ubus-bindings") == 0)
78 } else if(strcmp(token, "protocol-group") == 0) {
81 @@ -42,6 +42,8 @@ THE SOFTWARE.
87 int local_server_socket = -1;
88 struct local_socket local_sockets[MAX_LOCAL_SOCKETS];
89 int num_local_sockets = 0;
90 @@ -191,6 +193,8 @@ local_notify_neighbour(struct neighbour
91 if(local_sockets[i].monitor)
92 local_notify_neighbour_1(&local_sockets[i], neigh, kind);
95 + ubus_notify_neighbour(neigh, kind);
99 @@ -228,6 +232,8 @@ local_notify_xroute(struct xroute *xrout
100 if(local_sockets[i].monitor)
101 local_notify_xroute_1(&local_sockets[i], xroute, kind);
104 + ubus_notify_xroute(xroute, kind);
108 @@ -273,6 +279,8 @@ local_notify_route(struct babel_route *r
109 if(local_sockets[i].monitor)
110 local_notify_route_1(&local_sockets[i], route, kind);
113 + ubus_notify_route(route, kind);
119 @@ -11,11 +11,11 @@ LDLIBS = -lrt
121 SRCS = babeld.c net.c kernel.c util.c interface.c source.c neighbour.c \
122 route.c xroute.c message.c resend.c configuration.c local.c \
123 - hmac.c rfc6234/sha224-256.c BLAKE2/ref/blake2s-ref.c
124 + hmac.c ubus.c rfc6234/sha224-256.c BLAKE2/ref/blake2s-ref.c
126 OBJS = babeld.o net.o kernel.o util.o interface.o source.o neighbour.o \
127 route.o xroute.o message.o resend.o configuration.o local.o \
128 - hmac.o rfc6234/sha224-256.o BLAKE2/ref/blake2s-ref.o
129 + hmac.o ubus.o rfc6234/sha224-256.o BLAKE2/ref/blake2s-ref.o
132 $(CC) $(CFLAGS) $(LDFLAGS) -o babeld $(OBJS) $(LDLIBS)