libubus-req: add data_cb callback handling for ubus notifications Signed-off-by: John Crispin <john@phrozen.org>
libubus: do not modify uloop_cancelled uloop_cancelled was used for two purposes within ubus_complete_request: - interrupting recursive requests on SIGINT/SIGTERM - breaking out of the poll loop in a recursive request that completed Saving/restorung uloop_cancelled was buggy, leading to SIGTERM not being processed properly. Simplify the logic by using a separate field for internal use Signed-off-by: Felix Fietkau <nbd@nbd.name>
libubus: reduce code duplication, fix indentation Signed-off-by: Felix Fietkau <nbd@nbd.name>
Allow sending a fd along a ubus_request Signed-off-by: amine.ahd <amine.ahd@gmail.com>
libubus.h: marking unused variables Inform the compiler that the variables are not gona be used to avoid compiler warnings. Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com>
libubus.h: add ubus_auto_shutdown() Add ubus_auto_shutdown function, which ensures any pending uloop_timer is cancelled before calling ubus_shutdown on the context. This avoids a condition where ubus_shutdown() is called during ubus_auto_connect attempting a reconnection. Signed-off-by: Ben Kelly <ben@benjii.net>
libubus: add monitor support Signed-off-by: Felix Fietkau <nbd@openwrt.org>
add acl code Signed-off-by: John Crispin <blogic@openwrt.org>
add optional tags to the ubus methos struct and the wrapper macros Signed-off-by: John Crispin <blogic@openwrt.org>
libubus: expose ubus_connect_ctx() in public API ubus_connect_ctx() is equivalent to ubus_connect() but accepts a pointer to a previously allocated ubus_context struct. ubus_shutdown() is made available as an alternative to ubus_free() to clean up contexts initialised by ubus_connect_ctx(). Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
libubus: move ubus_msghdr_data to libubus-internal.h Signed-off-by: Felix Fietkau <nbd@openwrt.org>
libubus: add logic to reduce msgbuf data size after 16 small messages
ubus: increase message size limit and make it configurable at build-time
libubus: refactor ubus_context msgbuf data to be dynamically allocated
libubus: always defer processing incoming invoke/unsubscribe/notify if there is a request pending This fixes recursion problems on config reload in netifd and simplifies application handling of requests Signed-off-by: Felix Fietkau <nbd@openwrt.org>
libubus: add support for defining a policy mask This allows sharing a policy array across methods, but masking out unused entries for individual methods. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
libubus: implement file descriptor passing support Signed-off-by: Felix Fietkau <nbd@openwrt.org>
add auto (re)connect logic to libubus Signed-off-by: John Crispin <blogic@openwrt.org>
libubus: pull the variable length data array out of struct ubus_msghdr to fix builds with clang Signed-off-by: Felix Fietkau <nbd@openwrt.org>
libubus: add ubus_unregister_subscriber wrapper Signed-off-by: Felix Fietkau <nbd@openwrt.org>