4 #include <libubox/list.h>
5 #include <libubox/uloop.h>
6 #include <libubox/blobmsg.h>
7 #include "ubus_common.h"
12 #define UBUSD_CLIENT_BACKLOG 32
13 #define UBUS_OBJ_HASH_BITS 4
16 uint32_t refcount
; /* ~0: uses external data buffer */
17 struct ubus_msghdr hdr
;
18 struct blob_attr
*data
;
26 struct list_head objects
;
28 struct ubus_msg_buf
*tx_queue
[UBUSD_CLIENT_BACKLOG
];
29 unsigned int txq_cur
, txq_tail
, txq_ofs
;
31 struct ubus_msg_buf
*pending_msg
;
32 int pending_msg_offset
;
34 struct ubus_msghdr hdr
;
35 struct blob_attr data
;
40 struct list_head list
;
44 struct ubus_msg_buf
*ubus_msg_new(void *data
, int len
, bool shared
);
45 void ubus_msg_send(struct ubus_client
*cl
, struct ubus_msg_buf
*ub
, bool free
);
46 struct ubus_msg_buf
*ubus_msg_ref(struct ubus_msg_buf
*ub
);
47 void ubus_msg_free(struct ubus_msg_buf
*ub
);
49 struct ubus_client
*ubusd_get_client_by_id(uint32_t id
);
51 void ubusd_receive_message(struct ubus_client
*cl
, struct ubus_msg_buf
*ub
);
52 bool ubusd_send_hello(struct ubus_client
*cl
);
54 struct blob_attr
**ubus_parse_msg(struct blob_attr
*msg
);
56 void ubusd_event_init(void);
57 void ubusd_event_cleanup_object(struct ubus_object
*obj
);