struct ubus_subscriber;
struct ubus_notify_request;
+static inline struct blob_attr *
+ubus_msghdr_data(struct ubus_msghdr *hdr)
+{
+ return (struct blob_attr *) (hdr + 1);
+}
+
typedef void (*ubus_lookup_handler_t)(struct ubus_context *ctx,
struct ubus_object_data *obj,
void *priv);
.n_policy = ARRAY_SIZE(_policy) \
}
+#define UBUS_METHOD_NOARG(_name, _handler) \
+ { \
+ .name = _name, \
+ .handler = _handler, \
+ }
+
struct ubus_method {
const char *name;
ubus_handler_t handler;
/* 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);