X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=ubusd_obj.h;h=d0573f057cd0ab6227d2e7a623d683c94284085a;hb=c382792d9893ed1b0c1e1b0db2ad9a7eaa7a78e1;hp=3fc4937165b9d49135ab58a34932b7e60167b169;hpb=96e0b8ca42d49aceb9e727a498ee1a951f2ddf75;p=project%2Fubus.git diff --git a/ubusd_obj.h b/ubusd_obj.h index 3fc4937..d0573f0 100644 --- a/ubusd_obj.h +++ b/ubusd_obj.h @@ -1,3 +1,16 @@ +/* + * Copyright (C) 2011 Felix Fietkau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #ifndef __UBUSD_OBJ_H #define __UBUSD_OBJ_H @@ -22,12 +35,20 @@ struct ubus_method { struct blob_attr data[]; }; +struct ubus_watch { + struct list_head watcher_list, watched_list; + struct ubus_object *watcher, *watched; + char method[]; +}; + struct ubus_object { struct ubus_id id; struct list_head list; struct list_head events; + struct list_head watchers, watched; + struct ubus_object_type *type; struct avl_node path; @@ -35,6 +56,7 @@ struct ubus_object { int (*recv_msg)(struct ubus_client *client, 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); @@ -54,4 +76,8 @@ static inline struct ubus_object *ubusd_find_object(uint32_t objid) return obj; } +void ubus_watch_new(struct ubus_object *obj, struct ubus_object *target, const char *method); +void ubus_watch_free(struct ubus_watch *w); +void ubus_proto_notify_watch(struct ubus_watch *w); + #endif