Go to the source code of this file.
◆ ubus_notify_subscription()
void ubus_notify_subscription |
( |
struct ubus_object * |
obj | ) |
|
Definition at line 615 of file ubusd_proto.c.
617 bool active = !list_empty(&obj->subscribers);
620 blob_buf_init(&
b, 0);
struct ubus_client * client
void ubus_msg_free(struct ubus_msg_buf *ub)
void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub)
static struct ubus_msg_buf * ubus_msg_from_blob(bool shared)
static void ubus_msg_init(struct ubus_msg_buf *ub, uint8_t type, uint16_t seq, uint32_t peer)
◆ ubus_notify_unsubscribe()
Definition at line 633 of file ubusd_proto.c.
637 blob_buf_init(&
b, 0);
int ubus_unsubscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id)
struct ubus_object * target
struct ubus_object * subscriber
◆ ubus_subscribe()
Definition at line 172 of file ubusd_obj.c.
175 bool first = list_empty(&
target->subscribers);
177 s = calloc(1,
sizeof(*s));
183 list_add(&s->list, &
target->subscribers);
struct list_head subscribers target_list
struct list_head list target_list
void ubus_notify_subscription(struct ubus_object *obj)
◆ ubus_unsubscribe()
Definition at line 190 of file ubusd_obj.c.
198 if (list_empty(&obj->subscribers))
◆ ubusd_create_object()
Definition at line 129 of file ubusd_obj.c.
154 if (avl_insert(&
path, &obj->
path) != 0) {
155 free((
void *) obj->
path.key);
156 obj->
path.key = NULL;
void ubusd_send_obj_event(struct ubus_object *obj, bool add)
int ubusd_acl_check(struct ubus_client *cl, const char *obj, const char *method, enum ubusd_acl_type type)
static struct ubus_object_type * ubus_create_obj_type(struct blob_attr *sig)
static struct ubus_object_type * ubus_get_obj_type(uint32_t obj_id)
static void ubus_unref_object_type(struct ubus_object_type *type)
struct ubus_object * ubusd_create_object_internal(struct ubus_object_type *type, uint32_t id)
void ubusd_free_object(struct ubus_object *obj)
◆ ubusd_create_object_internal()
Definition at line 103 of file ubusd_obj.c.
107 obj = calloc(1,
sizeof(*obj));
115 INIT_LIST_HEAD(&obj->
list);
116 INIT_LIST_HEAD(&obj->
events);
117 INIT_LIST_HEAD(&obj->subscribers);
struct ubus_object_type * type
bool ubus_alloc_id(struct avl_tree *tree, struct ubus_id *id, uint32_t val)
◆ ubusd_find_object()
static struct ubus_object* ubusd_find_object |
( |
uint32_t |
objid | ) |
|
|
inlinestatic |
Definition at line 66 of file ubusd_obj.h.
static struct ubus_id * ubus_find_id(struct avl_tree *tree, uint32_t id)
◆ ubusd_free_object()
Definition at line 202 of file ubusd_obj.c.
209 list_for_each_entry_safe(s, tmp, &obj->subscribers, list) {
217 free((
void *) obj->
path.key);
219 if (!list_empty(&obj->
list))
220 list_del(&obj->
list);
void ubusd_event_cleanup_object(struct ubus_object *obj)
static void ubus_free_id(struct avl_tree *tree, struct ubus_id *id)
void ubus_unsubscribe(struct ubus_subscription *s)
void ubus_notify_unsubscribe(struct ubus_subscription *s)
◆ obj_types
struct avl_tree obj_types |
|
extern |
◆ objects
◆ path