X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_obj.h;h=5ed5ba8fe69525d0d2f4c9cb3993d721380d3853;hp=83bc3664264812250de2be1e2632392f7769ea4b;hb=9c13096b169759eabf4c528df22d605e2d6093f4;hpb=42bc27ae38d92f4fe11872b0f9d57f8d3578dcfe;ds=sidebyside diff --git a/ubusd_obj.h b/ubusd_obj.h index 83bc366..5ed5ba8 100644 --- a/ubusd_obj.h +++ b/ubusd_obj.h @@ -35,19 +35,28 @@ struct ubus_method { struct blob_attr data[]; }; +struct ubus_subscription { + struct list_head list, target_list; + struct ubus_object *subscriber, *target; +}; + struct ubus_object { struct ubus_id id; struct list_head list; struct list_head events; + struct list_head subscribers, target_list; + struct ubus_object_type *type; struct avl_node path; struct ubus_client *client; - int (*recv_msg)(struct ubus_client *client, const char *method, struct blob_attr *msg); + int (*recv_msg)(struct ubus_client *client, struct ubus_msg_buf *ub, + const char *method, struct blob_attr *msg); int event_seen; + unsigned int invoke_seq; }; struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr **attr); @@ -67,4 +76,9 @@ static inline struct ubus_object *ubusd_find_object(uint32_t objid) return obj; } +void ubus_subscribe(struct ubus_object *obj, struct ubus_object *target); +void ubus_unsubscribe(struct ubus_subscription *s); +void ubus_notify_unsubscribe(struct ubus_subscription *s); +void ubus_notify_subscription(struct ubus_object *obj); + #endif