+/* add a subscriber notifications from another object */
+int ubus_register_subscriber(struct ubus_context *ctx, struct ubus_subscriber *obj);
+
+static inline int
+ubus_unregister_subscriber(struct ubus_context *ctx, struct ubus_subscriber *obj)
+{
+ return ubus_remove_object(ctx, &obj->obj);
+}
+
+int ubus_subscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id);
+int ubus_unsubscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id);
+
+int __ubus_monitor(struct ubus_context *ctx, const char *type);
+
+static inline int ubus_monitor_start(struct ubus_context *ctx)
+{
+ return __ubus_monitor(ctx, "add");
+}
+
+static inline int ubus_monitor_stop(struct ubus_context *ctx)
+{
+ return __ubus_monitor(ctx, "remove");
+}
+
+
+/* ----------- acl ----------- */
+
+struct acl_object {
+ struct ubus_acl_key key;
+ struct avl_node avl;
+ struct blob_attr *acl;
+};
+
+extern struct avl_tree acl_objects;
+int ubus_register_acl(struct ubus_context *ctx);
+
+#define acl_for_each(o, m) \
+ if ((m)->object && (m)->user && (m)->group) \
+ avl_for_element_range(avl_find_ge_element(&acl_objects, m, o, avl), avl_find_le_element(&acl_objects, m, o, avl), o, avl)
+