X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_obj.h;h=3fc4937165b9d49135ab58a34932b7e60167b169;hp=943ee132652e6b3146fb794ebbbb0f19232b3505;hb=df1af726e211eaaea870f7d2cbc326e5974b9b09;hpb=dbd4c2f121be08e514828f2533687b145a6e16dd diff --git a/ubusd_obj.h b/ubusd_obj.h index 943ee13..3fc4937 100644 --- a/ubusd_obj.h +++ b/ubusd_obj.h @@ -26,12 +26,32 @@ struct ubus_object { struct ubus_id id; struct list_head list; - struct ubus_object_type *type; + struct list_head events; + 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 event_seen; }; struct ubus_object *ubusd_create_object(struct ubus_client *cl, struct blob_attr **attr); +struct ubus_object *ubusd_create_object_internal(struct ubus_object_type *type, uint32_t id); void ubusd_free_object(struct ubus_object *obj); +static inline struct ubus_object *ubusd_find_object(uint32_t objid) +{ + struct ubus_object *obj; + struct ubus_id *id; + + id = ubus_find_id(&objects, objid); + if (!id) + return NULL; + + obj = container_of(id, struct ubus_object, id); + return obj; +} + #endif