20 struct list_head
list;
39 m = calloc(1,
sizeof(*m));
44 list_add_tail(&m->
list, &monitors);
54 list_for_each_entry_safe(m, tmp, &monitors,
list) {
79 static struct blob_buf mb;
82 if (list_empty(&monitors))
85 blob_buf_init(&mb, 0);
96 list_for_each_entry(m, &monitors,
list) {
106 const char *method,
struct blob_attr *msg)
112 if (!strcmp(method,
"add")) {
119 if (!strcmp(method,
"remove")) {
int(* recv_msg)(struct ubus_client *client, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg)
void ubus_msg_free(struct ubus_msg_buf *ub)
struct ubus_msg_buf * ubus_msg_new(void *data, int len, bool shared)
void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub)
void ubusd_monitor_init(void)
static LIST_HEAD(monitors)
void ubusd_monitor_message(struct ubus_client *cl, struct ubus_msg_buf *ub, bool send)
static struct ubus_monitor * ubusd_monitor_find(struct ubus_client *cl)
static bool ubusd_monitor_connect(struct ubus_client *cl, struct ubus_msg_buf *ub)
void ubusd_monitor_disconnect(struct ubus_client *cl)
static void ubusd_monitor_free(struct ubus_monitor *m)
static int ubusd_monitor_recv(struct ubus_client *cl, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg)
static struct ubus_object * monitor_obj
struct ubus_object * ubusd_create_object_internal(struct ubus_object_type *type, uint32_t id)
#define UBUS_SYSTEM_OBJECT_MONITOR
@ UBUS_STATUS_METHOD_NOT_FOUND
@ UBUS_STATUS_PERMISSION_DENIED
@ UBUS_STATUS_UNKNOWN_ERROR