Ubus
OpenWrt system message/RPC bus.
ubusd.h File Reference
#include <libubox/list.h>
#include <libubox/uloop.h>
#include <libubox/blobmsg.h>
#include "ubus_common.h"
#include "ubusd_id.h"
#include "ubusd_obj.h"
#include "ubusmsg.h"
#include "ubusd_acl.h"

Go to the source code of this file.

Data Structures

struct  ubus_msg_buf
 
struct  ubus_msg_buf_list
 
struct  ubus_client_cmd
 
struct  ubus_client
 
struct  ubus_path
 

Macros

#define UBUS_OBJ_HASH_BITS   4
 
#define UBUS_CLIENT_MAX_TXQ_LEN   UBUS_MAX_MSGLEN
 

Typedefs

typedef struct ubus_msg_buf *(* event_fill_cb) (void *priv, const char *id)
 

Functions

struct ubus_msg_bufubus_msg_new (void *data, int len, bool shared)
 
void ubus_msg_send (struct ubus_client *cl, struct ubus_msg_buf *ub)
 
ssize_t ubus_msg_writev (int fd, struct ubus_msg_buf *ub, size_t offset)
 
void ubus_msg_free (struct ubus_msg_buf *ub)
 
void ubus_msg_list_free (struct ubus_msg_buf_list *ubl)
 
struct blob_attr ** ubus_parse_msg (struct blob_attr *msg, size_t len)
 
struct ubus_clientubusd_proto_new_client (int fd, uloop_fd_handler cb)
 
void ubusd_proto_receive_message (struct ubus_client *cl, struct ubus_msg_buf *ub)
 
void ubusd_proto_free_client (struct ubus_client *cl)
 
void ubus_proto_send_msg_from_blob (struct ubus_client *cl, struct ubus_msg_buf *ub, uint8_t type)
 
int ubusd_cmd_lookup (struct ubus_client *cl, struct ubus_client_cmd *cmd)
 
void ubusd_event_init (void)
 
void ubusd_event_cleanup_object (struct ubus_object *obj)
 
void ubusd_send_obj_event (struct ubus_object *obj, bool add)
 
int ubusd_send_event (struct ubus_client *cl, const char *id, event_fill_cb fill_cb, void *cb_priv)
 
void ubusd_acl_init (void)
 
void ubusd_monitor_init (void)
 
void ubusd_monitor_message (struct ubus_client *cl, struct ubus_msg_buf *ub, bool send)
 
void ubusd_monitor_disconnect (struct ubus_client *cl)
 

Variables

struct blob_buf b
 
const char * ubusd_acl_dir
 

Macro Definition Documentation

◆ UBUS_CLIENT_MAX_TXQ_LEN

#define UBUS_CLIENT_MAX_TXQ_LEN   UBUS_MAX_MSGLEN

Definition at line 27 of file ubusd.h.

◆ UBUS_OBJ_HASH_BITS

#define UBUS_OBJ_HASH_BITS   4

Definition at line 26 of file ubusd.h.

Typedef Documentation

◆ event_fill_cb

typedef struct ubus_msg_buf*(* event_fill_cb) (void *priv, const char *id)

Definition at line 96 of file ubusd.h.

Function Documentation

◆ ubus_msg_free()

void ubus_msg_free ( struct ubus_msg_buf ub)

Definition at line 67 of file ubusd.c.

68 {
69  switch (ub->refcount) {
70  case 1:
72  if (ub->fd >= 0)
73  close(ub->fd);
74 
75  free(ub);
76  break;
77  default:
78  ub->refcount--;
79  break;
80  }
81 }
uint32_t refcount
Definition: ubusd.h:32
int fd
Definition: ubusd.h:35
#define USES_EXTERNAL_BUFFER
Definition: ubusd.c:21
Here is the caller graph for this function:

◆ ubus_msg_list_free()

void ubus_msg_list_free ( struct ubus_msg_buf_list ubl)

Definition at line 136 of file ubusd.c.

137 {
138  list_del_init(&ubl->list);
139  ubus_msg_free(ubl->msg);
140  free(ubl);
141 }
struct ubus_msg_buf * msg
Definition: ubusd.h:41
struct list_head list
Definition: ubusd.h:40
void ubus_msg_free(struct ubus_msg_buf *ub)
Definition: ubusd.c:67
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubus_msg_new()

struct ubus_msg_buf* ubus_msg_new ( void *  data,
int  len,
bool  shared 
)

Definition at line 39 of file ubusd.c.

40 {
41  struct ubus_msg_buf *ub;
42  int buflen = sizeof(*ub);
43 
44  if (!shared)
45  buflen += len;
46 
47  ub = calloc(1, buflen);
48  if (!ub)
49  return NULL;
50 
51  ub->fd = -1;
52 
53  if (shared) {
55  ub->data = data;
56  } else {
57  ub->refcount = 1;
58  ub->data = (void *) (ub + 1);
59  if (data)
60  memcpy(ub + 1, data, len);
61  }
62 
63  ub->len = len;
64  return ub;
65 }
struct blob_attr * data
Definition: ubusd.h:34
int len
Definition: ubusd.h:36
Here is the caller graph for this function:

◆ ubus_msg_send()

void ubus_msg_send ( struct ubus_client cl,
struct ubus_msg_buf ub 
)

Definition at line 162 of file ubusd.c.

163 {
164  ssize_t written;
165 
166  if (ub->hdr.type != UBUS_MSG_MONITOR)
167  ubusd_monitor_message(cl, ub, true);
168 
169  if (list_empty(&cl->tx_queue)) {
170  written = ubus_msg_writev(cl->sock.fd, ub, 0);
171 
172  if (written < 0)
173  written = 0;
174 
175  if (written >= (ssize_t) (ub->len + sizeof(ub->hdr)))
176  return;
177 
178  cl->txq_ofs = written;
179  cl->txq_len = -written;
180 
181  /* get an event once we can write to the socket again */
182  uloop_fd_add(&cl->sock, ULOOP_READ | ULOOP_WRITE | ULOOP_EDGE_TRIGGER);
183  }
184  ubus_msg_enqueue(cl, ub);
185 }
unsigned int txq_len
Definition: ubusd.h:65
unsigned int txq_ofs
Definition: ubusd.h:64
struct list_head tx_queue
Definition: ubusd.h:63
struct uloop_fd sock
Definition: ubusd.h:52
struct ubus_msghdr hdr
Definition: ubusd.h:33
uint8_t type
Definition: ubusmsg.h:31
static void ubus_msg_enqueue(struct ubus_client *cl, struct ubus_msg_buf *ub)
Definition: ubusd.c:143
ssize_t ubus_msg_writev(int fd, struct ubus_msg_buf *ub, size_t offset)
Definition: ubusd.c:83
void ubusd_monitor_message(struct ubus_client *cl, struct ubus_msg_buf *ub, bool send)
Definition: ubusd_monitor.c:77
@ UBUS_MSG_MONITOR
Definition: ubusmsg.h:73
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubus_msg_writev()

ssize_t ubus_msg_writev ( int  fd,
struct ubus_msg_buf ub,
size_t  offset 
)

Definition at line 83 of file ubusd.c.

84 {
85  uint8_t fd_buf[CMSG_SPACE(sizeof(int))] = { 0 };
86  static struct iovec iov[2];
87  struct msghdr msghdr = { 0 };
88  struct ubus_msghdr hdr;
89  struct cmsghdr *cmsg;
90  ssize_t ret;
91  int *pfd;
92 
93  msghdr.msg_iov = iov;
94  msghdr.msg_iovlen = ARRAY_SIZE(iov);
95  msghdr.msg_control = fd_buf;
96  msghdr.msg_controllen = sizeof(fd_buf);
97 
98  cmsg = CMSG_FIRSTHDR(&msghdr);
99  cmsg->cmsg_type = SCM_RIGHTS;
100  cmsg->cmsg_level = SOL_SOCKET;
101  cmsg->cmsg_len = CMSG_LEN(sizeof(int));
102 
103  pfd = (int *) CMSG_DATA(cmsg);
104  msghdr.msg_controllen = cmsg->cmsg_len;
105 
106  *pfd = ub->fd;
107  if (ub->fd < 0 || offset) {
108  msghdr.msg_control = NULL;
109  msghdr.msg_controllen = 0;
110  }
111 
112  if (offset < sizeof(ub->hdr)) {
113  hdr.version = ub->hdr.version;
114  hdr.type = ub->hdr.type;
115  hdr.seq = cpu_to_be16(ub->hdr.seq);
116  hdr.peer = cpu_to_be32(ub->hdr.peer);
117 
118  iov[0].iov_base = ((char *) &hdr) + offset;
119  iov[0].iov_len = sizeof(hdr) - offset;
120  iov[1].iov_base = (char *) ub->data;
121  iov[1].iov_len = ub->len;
122  } else {
123  offset -= sizeof(ub->hdr);
124  iov[0].iov_base = ((char *) ub->data) + offset;
125  iov[0].iov_len = ub->len - offset;
126  msghdr.msg_iovlen = 1;
127  }
128 
129  do {
130  ret = sendmsg(fd, &msghdr, 0);
131  } while (ret < 0 && errno == EINTR);
132 
133  return ret;
134 }
uint32_t peer
Definition: ubusmsg.h:33
uint8_t version
Definition: ubusmsg.h:30
uint16_t seq
Definition: ubusmsg.h:32
Here is the caller graph for this function:

◆ ubus_parse_msg()

struct blob_attr** ubus_parse_msg ( struct blob_attr *  msg,
size_t  len 
)

Definition at line 46 of file libubus-io.c.

47 {
48  blob_parse_untrusted(msg, len, attrbuf, ubus_policy, UBUS_ATTR_MAX);
49  return attrbuf;
50 }
static const struct blob_attr_info ubus_policy[UBUS_ATTR_MAX]
Definition: libubus-io.c:34
static struct blob_attr * attrbuf[UBUS_ATTR_MAX]
Definition: libubus-io.c:44
@ UBUS_ATTR_MAX
Definition: ubusmsg.h:103
Here is the caller graph for this function:

◆ ubus_proto_send_msg_from_blob()

void ubus_proto_send_msg_from_blob ( struct ubus_client cl,
struct ubus_msg_buf ub,
uint8_t  type 
)

Definition at line 78 of file ubusd_proto.c.

80 {
81  /* keep the fd to be passed if it is UBUS_MSG_INVOKE */
82  int fd = ub->fd;
83  ub = ubus_reply_from_blob(ub, true);
84  if (!ub)
85  return;
86 
87  ub->hdr.type = type;
88  ub->fd = fd;
89 
90  ubus_msg_send(cl, ub);
91  ubus_msg_free(ub);
92 }
void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub)
Definition: ubusd.c:162
static struct ubus_msg_buf * ubus_reply_from_blob(struct ubus_msg_buf *ub, bool shared)
Definition: ubusd_proto.c:65
uint8_t type
Definition: ubusmsg.h:1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_acl_init()

void ubusd_acl_init ( void  )

Definition at line 568 of file ubusd_acl.c.

569 {
573 }
int(* recv_msg)(struct ubus_client *client, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg)
Definition: ubusd_obj.h:55
static struct avl_tree ubusd_acls
Definition: ubusd_acl.c:73
static struct ubus_object * acl_obj
Definition: ubusd_acl.c:75
static int ubusd_acl_recv(struct ubus_client *cl, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg)
Definition: ubusd_acl.c:560
void ubus_init_string_tree(struct avl_tree *tree, bool dup)
Definition: ubusd_id.c:35
struct ubus_object * ubusd_create_object_internal(struct ubus_object_type *type, uint32_t id)
Definition: ubusd_obj.c:103
#define UBUS_SYSTEM_OBJECT_ACL
Definition: ubusmsg.h:25
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_cmd_lookup()

int ubusd_cmd_lookup ( struct ubus_client cl,
struct ubus_client_cmd cmd 
)

Definition at line 285 of file ubusd_proto.c.

286 {
287  struct ubus_msg_buf *ub = cmd->msg;
288  struct blob_attr **attr;
289  int ret;
290 
291  attr = ubus_parse_msg(ub->data, blob_raw_len(ub->data));
292  ret = __ubusd_handle_lookup(cl, ub, attr, cmd);
293 
294  if (ret != -2) {
295  struct ubus_msg_buf *retmsg = cl->retmsg;
296  int *retmsg_data = blob_data(blob_data(retmsg->data));
297 
298  retmsg->hdr.seq = ub->hdr.seq;
299  retmsg->hdr.peer = ub->hdr.peer;
300 
301  *retmsg_data = htonl(ret);
302  ubus_msg_send(cl, retmsg);
303  }
304  return ret;
305 }
struct ubus_msg_buf * msg
Definition: ubusd.h:46
struct ubus_msg_buf * retmsg
Definition: ubusd.h:68
struct blob_attr ** ubus_parse_msg(struct blob_attr *msg, size_t len)
Definition: ubusd_proto.c:37
static int __ubusd_handle_lookup(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr, struct ubus_client_cmd *cmd)
Definition: ubusd_proto.c:204
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_event_cleanup_object()

void ubusd_event_cleanup_object ( struct ubus_object obj)

Definition at line 36 of file ubusd_event.c.

37 {
38  struct event_source *ev, *tmp;
39 
40  list_for_each_entry_safe(ev, tmp, &obj->events, list) {
42  }
43 }
struct ubus_object * obj
Definition: ubusd_event.c:24
struct list_head list
Definition: ubusd_event.c:23
struct list_head events
Definition: ubusd_obj.h:47
static void ubusd_delete_event_source(struct event_source *evs)
Definition: ubusd_event.c:29
Here is the caller graph for this function:

◆ ubusd_event_init()

void ubusd_event_init ( void  )

Definition at line 266 of file ubusd_event.c.

267 {
270  if (event_obj != NULL)
272 }
static struct ubus_object * event_obj
Definition: ubusd_event.c:18
static int ubusd_event_recv(struct ubus_client *cl, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg)
Definition: ubusd_event.c:231
static struct avl_tree patterns
Definition: ubusd_event.c:17
#define UBUS_SYSTEM_OBJECT_EVENT
Definition: ubusmsg.h:24
Here is the caller graph for this function:

◆ ubusd_monitor_disconnect()

void ubusd_monitor_disconnect ( struct ubus_client cl)

Definition at line 65 of file ubusd_monitor.c.

66 {
67  struct ubus_monitor *m;
68 
70  if (!m)
71  return;
72 
74 }
struct ubus_client * cl
Definition: ubusd_monitor.c:21
static struct ubus_monitor * ubusd_monitor_find(struct ubus_client *cl)
Definition: ubusd_monitor.c:50
static void ubusd_monitor_free(struct ubus_monitor *m)
Definition: ubusd_monitor.c:26
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_monitor_init()

void ubusd_monitor_init ( void  )

Definition at line 128 of file ubusd_monitor.c.

129 {
131  if (monitor_obj != NULL)
133 }
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
Definition: ubusd_monitor.c:16
#define UBUS_SYSTEM_OBJECT_MONITOR
Definition: ubusmsg.h:26
Here is the caller graph for this function:

◆ ubusd_monitor_message()

void ubusd_monitor_message ( struct ubus_client cl,
struct ubus_msg_buf ub,
bool  send 
)

Definition at line 77 of file ubusd_monitor.c.

78 {
79  static struct blob_buf mb;
80  struct ubus_monitor *m;
81 
82  if (list_empty(&monitors))
83  return;
84 
85  blob_buf_init(&mb, 0);
86  blob_put_int32(&mb, UBUS_MONITOR_CLIENT, cl->id.id);
87  blob_put_int32(&mb, UBUS_MONITOR_PEER, ub->hdr.peer);
88  blob_put_int32(&mb, UBUS_MONITOR_SEQ, ub->hdr.seq);
89  blob_put_int32(&mb, UBUS_MONITOR_TYPE, ub->hdr.type);
90  blob_put_int8(&mb, UBUS_MONITOR_SEND, send);
91  blob_put(&mb, UBUS_MONITOR_DATA, blob_data(ub->data), blob_len(ub->data));
92 
93  ub = ubus_msg_new(mb.head, blob_raw_len(mb.head), true);
95 
96  list_for_each_entry(m, &monitors, list) {
97  ub->hdr.seq = ++m->seq;
98  ubus_msg_send(m->cl, ub);
99  }
100 
101  ubus_msg_free(ub);
102 }
struct ubus_id id
Definition: ubusd.h:51
uint32_t id
Definition: ubusd_id.h:22
uint32_t seq
Definition: ubusd_monitor.c:22
struct list_head list
Definition: ubusd_monitor.c:20
struct ubus_msg_buf * ubus_msg_new(void *data, int len, bool shared)
Definition: ubusd.c:39
@ UBUS_MONITOR_DATA
Definition: ubusmsg.h:112
@ UBUS_MONITOR_CLIENT
Definition: ubusmsg.h:107
@ UBUS_MONITOR_SEND
Definition: ubusmsg.h:109
@ UBUS_MONITOR_PEER
Definition: ubusmsg.h:108
@ UBUS_MONITOR_SEQ
Definition: ubusmsg.h:110
@ UBUS_MONITOR_TYPE
Definition: ubusmsg.h:111
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_proto_free_client()

void ubusd_proto_free_client ( struct ubus_client cl)

Definition at line 600 of file ubusd_proto.c.

601 {
602  struct ubus_object *obj, *tmp;
603 
604  list_for_each_entry_safe(obj, tmp, &cl->objects, list) {
605  ubusd_free_object(obj);
606  }
607 
608  ubus_msg_free(cl->retmsg);
609  blob_buf_free(&cl->b);
610 
612  ubus_free_id(&clients, &cl->id);
613 }
struct blob_buf b
Definition: ubusd.h:53
struct list_head objects
Definition: ubusd.h:60
struct list_head list
Definition: ubusd_obj.h:45
void ubusd_acl_free_client(struct ubus_client *cl)
Definition: ubusd_acl.c:209
static void ubus_free_id(struct avl_tree *tree, struct ubus_id *id)
Definition: ubusd_id.h:29
void ubusd_free_object(struct ubus_object *obj)
Definition: ubusd_obj.c:202
static struct avl_tree clients
Definition: ubusd_proto.c:20
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_proto_new_client()

struct ubus_client* ubusd_proto_new_client ( int  fd,
uloop_fd_handler  cb 
)

Definition at line 564 of file ubusd_proto.c.

565 {
566  struct ubus_client *cl;
567 
568  cl = calloc(1, sizeof(*cl));
569  if (!cl)
570  return NULL;
571 
572  if (ubusd_acl_init_client(cl, fd))
573  goto free;
574 
575  INIT_LIST_HEAD(&cl->objects);
576  INIT_LIST_HEAD(&cl->cmd_queue);
577  INIT_LIST_HEAD(&cl->tx_queue);
578  cl->sock.fd = fd;
579  cl->sock.cb = cb;
580  cl->pending_msg_fd = -1;
581 
582  if (!ubus_alloc_id(&clients, &cl->id, 0))
583  goto free;
584 
585  if (ubusd_proto_init_retmsg(cl))
586  goto free;
587 
588  if (!ubusd_send_hello(cl))
589  goto delete;
590 
591  return cl;
592 
593 delete:
594  ubus_free_id(&clients, &cl->id);
595 free:
596  free(cl);
597  return NULL;
598 }
int(* cb)(struct ubus_context *ctx, int argc, char **argv)
Definition: cli.c:581
int pending_msg_fd
Definition: ubusd.h:70
struct list_head cmd_queue
Definition: ubusd.h:62
int ubusd_acl_init_client(struct ubus_client *cl, int fd)
Definition: ubusd_acl.c:170
bool ubus_alloc_id(struct avl_tree *tree, struct ubus_id *id, uint32_t val)
Definition: ubusd_id.c:53
static int ubusd_proto_init_retmsg(struct ubus_client *cl)
Definition: ubusd_proto.c:548
static bool ubusd_send_hello(struct ubus_client *cl)
Definition: ubusd_proto.c:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_proto_receive_message()

void ubusd_proto_receive_message ( struct ubus_client cl,
struct ubus_msg_buf ub 
)

Definition at line 512 of file ubusd_proto.c.

513 {
514  ubus_cmd_cb cb = NULL;
515  int ret;
516  struct ubus_msg_buf *retmsg = cl->retmsg;
517  int *retmsg_data = blob_data(blob_data(retmsg->data));
518 
519  retmsg->hdr.seq = ub->hdr.seq;
520  retmsg->hdr.peer = ub->hdr.peer;
521 
522  if (ub->hdr.type < __UBUS_MSG_LAST)
523  cb = handlers[ub->hdr.type];
524 
525  if (ub->hdr.type != UBUS_MSG_STATUS && ub->hdr.type != UBUS_MSG_INVOKE)
526  ubus_msg_close_fd(ub);
527 
528  /* Note: no callback should free the `ub` buffer
529  that's always done right after the callback finishes */
530  if (cb)
531  ret = cb(cl, ub, ubus_parse_msg(ub->data, blob_raw_len(ub->data)));
532  else
534 
535  /* Command has not been completed yet and got queued */
536  if (ret == -2)
537  return;
538 
539  ubus_msg_free(ub);
540 
541  if (ret == -1)
542  return;
543 
544  *retmsg_data = htonl(ret);
545  ubus_msg_send(cl, retmsg);
546 }
static const ubus_cmd_cb handlers[__UBUS_MSG_LAST]
Definition: ubusd_proto.c:499
static void ubus_msg_close_fd(struct ubus_msg_buf *ub)
Definition: ubusd_proto.c:43
int(* ubus_cmd_cb)(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr)
Definition: ubusd_proto.c:24
@ UBUS_MSG_INVOKE
Definition: ubusmsg.h:53
@ UBUS_MSG_STATUS
Definition: ubusmsg.h:41
@ __UBUS_MSG_LAST
Definition: ubusmsg.h:76
@ UBUS_STATUS_INVALID_COMMAND
Definition: ubusmsg.h:120
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubusd_send_event()

int ubusd_send_event ( struct ubus_client cl,
const char *  id,
event_fill_cb  fill_cb,
void *  cb_priv 
)

Definition at line 140 of file ubusd_event.c.

142 {
143  struct ubus_msg_buf *ub = NULL;
144  struct event_source *ev;
145  int match_len = 0;
146 
147  if (ubusd_acl_check(cl, id, NULL, UBUS_ACL_SEND))
149 
150  obj_event_seq++;
151 
152  /*
153  * Since this tree is sorted alphabetically, we can only expect to find
154  * matching entries as long as the number of matching characters
155  * between the pattern string and our string is monotonically increasing.
156  */
157  avl_for_each_element(&patterns, ev, avl) {
158  const char *key = ev->avl.key;
159  int cur_match_len;
160  bool full_match;
161 
162  full_match = ubus_strmatch_len(id, key, &cur_match_len);
163  if (cur_match_len < match_len)
164  break;
165 
166  match_len = cur_match_len;
167 
168  if (!full_match) {
169  if (!ev->partial)
170  continue;
171 
172  if (match_len != (int) strlen(key))
173  continue;
174  }
175 
176  ubusd_send_event_msg(&ub, cl, ev->obj, id, fill_cb, cb_priv);
177  }
178 
179  if (ub)
180  ubus_msg_free(ub);
181 
182  return 0;
183 }
struct avl_node avl
Definition: ubusd_event.c:25
static bool ubus_strmatch_len(const char *s1, const char *s2, int *len)
Definition: ubus_common.h:22
int ubusd_acl_check(struct ubus_client *cl, const char *obj, const char *method, enum ubusd_acl_type type)
Definition: ubusd_acl.c:90
@ UBUS_ACL_SEND
Definition: ubusd_acl.h:22
static int obj_event_seq
Definition: ubusd_event.c:20
static void ubusd_send_event_msg(struct ubus_msg_buf **ub, struct ubus_client *cl, struct ubus_object *obj, const char *id, event_fill_cb fill_cb, void *cb_priv)
Definition: ubusd_event.c:111
@ UBUS_STATUS_PERMISSION_DENIED
Definition: ubusmsg.h:125
Here is the caller graph for this function:

◆ ubusd_send_obj_event()

void ubusd_send_obj_event ( struct ubus_object obj,
bool  add 
)

Definition at line 259 of file ubusd_event.c.

260 {
261  const char *id = add ? "ubus.object.add" : "ubus.object.remove";
262 
264 }
int ubusd_send_event(struct ubus_client *cl, const char *id, event_fill_cb fill_cb, void *cb_priv)
Definition: ubusd_event.c:140
static struct ubus_msg_buf * ubusd_create_object_event_msg(void *priv, const char *id)
Definition: ubusd_event.c:243
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ b

struct blob_buf b
extern

Definition at line 1 of file ubusd_proto.c.

◆ ubusd_acl_dir

const char* ubusd_acl_dir
extern

Definition at line 71 of file ubusd_acl.c.