+ return -1;
+}
+
+static int ubusd_handle_notify(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr)
+{
+ struct ubus_object *obj = NULL;
+ struct ubus_subscription *s;
+ struct ubus_id *id;
+ const char *method;
+ bool no_reply = false;
+ void *c;
+
+ if (!attr[UBUS_ATTR_METHOD] || !attr[UBUS_ATTR_OBJID])
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
+ if (attr[UBUS_ATTR_NO_REPLY])
+ no_reply = blob_get_int8(attr[UBUS_ATTR_NO_REPLY]);
+
+ id = ubus_find_id(&objects, blob_get_u32(attr[UBUS_ATTR_OBJID]));
+ if (!id)
+ return UBUS_STATUS_NOT_FOUND;
+
+ obj = container_of(id, struct ubus_object, id);
+ if (obj->client != cl)
+ return UBUS_STATUS_PERMISSION_DENIED;
+
+ if (!no_reply) {
+ blob_buf_init(&b, 0);
+ blob_put_int32(&b, UBUS_ATTR_OBJID, id->id);
+ c = blob_nest_start(&b, UBUS_ATTR_SUBSCRIBERS);
+ list_for_each_entry(s, &obj->subscribers, list) {
+ blob_put_int32(&b, 0, s->subscriber->id.id);
+ }
+ blob_nest_end(&b, c);
+ blob_put_int32(&b, UBUS_ATTR_STATUS, 0);
+ ubus_send_msg_from_blob(cl, ub, UBUS_MSG_STATUS);
+ }