Ubus
OpenWrt system message/RPC bus.
libubus.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2014 Felix Fietkau <nbd@openwrt.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 2.1
6  * as published by the Free Software Foundation
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  */
13 
14 #ifndef __LIBUBUS_H
15 #define __LIBUBUS_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <libubox/avl.h>
22 #include <libubox/list.h>
23 #include <libubox/blobmsg.h>
24 #include <libubox/uloop.h>
25 #include <stdint.h>
26 #include "ubusmsg.h"
27 #include "ubus_common.h"
28 
29 #define UBUS_MAX_NOTIFY_PEERS 16
30 
31 struct ubus_context;
32 struct ubus_msg_src;
33 struct ubus_object;
34 struct ubus_request;
35 struct ubus_request_data;
36 struct ubus_object_data;
37 struct ubus_event_handler;
38 struct ubus_subscriber;
39 struct ubus_notify_request;
40 
42  struct ubus_msghdr hdr;
43  struct blob_attr *data;
44 };
45 
46 typedef void (*ubus_lookup_handler_t)(struct ubus_context *ctx,
47  struct ubus_object_data *obj,
48  void *priv);
49 typedef int (*ubus_handler_t)(struct ubus_context *ctx, struct ubus_object *obj,
50  struct ubus_request_data *req,
51  const char *method, struct blob_attr *msg);
52 typedef void (*ubus_state_handler_t)(struct ubus_context *ctx, struct ubus_object *obj);
53 typedef void (*ubus_remove_handler_t)(struct ubus_context *ctx,
54  struct ubus_subscriber *obj, uint32_t id);
55 typedef void (*ubus_event_handler_t)(struct ubus_context *ctx, struct ubus_event_handler *ev,
56  const char *type, struct blob_attr *msg);
57 typedef void (*ubus_data_handler_t)(struct ubus_request *req,
58  int type, struct blob_attr *msg);
59 typedef void (*ubus_fd_handler_t)(struct ubus_request *req, int fd);
60 typedef void (*ubus_complete_handler_t)(struct ubus_request *req, int ret);
62  int idx, int ret);
64  int type, struct blob_attr *msg);
65 typedef void (*ubus_connect_handler_t)(struct ubus_context *ctx);
66 typedef bool (*ubus_new_object_handler_t)(struct ubus_context *ctx, struct ubus_subscriber *sub, const char *path);
67 
68 #define UBUS_OBJECT_TYPE(_name, _methods) \
69  { \
70  .name = _name, \
71  .id = 0, \
72  .n_methods = ARRAY_SIZE(_methods), \
73  .methods = _methods \
74  }
75 
76 #define __UBUS_METHOD_NOARG(_name, _handler, _tags) \
77  .name = _name, \
78  .handler = _handler, \
79  .tags = _tags
80 
81 #define __UBUS_METHOD(_name, _handler, _policy, _tags) \
82  __UBUS_METHOD_NOARG(_name, _handler, _tags), \
83  .policy = _policy, \
84  .n_policy = ARRAY_SIZE(_policy)
85 
86 #define UBUS_METHOD(_name, _handler, _policy) \
87  { __UBUS_METHOD(_name, _handler, _policy, 0) }
88 
89 #define UBUS_METHOD_TAG(_name, _handler, _policy, _tags)\
90  { __UBUS_METHOD(_name, _handler, _policy, _tags) }
91 
92 #define UBUS_METHOD_MASK(_name, _handler, _policy, _mask) \
93  { \
94  __UBUS_METHOD(_name, _handler, _policy, 0),\
95  .mask = _mask \
96  }
97 
98 #define UBUS_METHOD_NOARG(_name, _handler) \
99  { __UBUS_METHOD_NOARG(_name, _handler, 0) }
100 
101 #define UBUS_METHOD_TAG_NOARG(_name, _handler, _tags) \
102  { __UBUS_METHOD_NOARG(_name, _handler, _tags) }
103 
104 #define UBUS_TAG_STATUS BIT(0)
105 #define UBUS_TAG_ADMIN BIT(1)
106 #define UBUS_TAG_PRIVATE BIT(2)
107 
108 struct ubus_method {
109  const char *name;
111 
112  unsigned long mask;
113  unsigned long tags;
114  const struct blobmsg_policy *policy;
115  int n_policy;
116 };
117 
119  const char *name;
120  uint32_t id;
121 
122  const struct ubus_method *methods;
124 };
125 
126 struct ubus_object {
127  struct avl_node avl;
128 
129  const char *name;
130  uint32_t id;
131 
132  const char *path;
134 
137 
138  const struct ubus_method *methods;
140 };
141 
143  struct list_head list;
144  struct ubus_object obj;
145 
149 };
150 
152  struct ubus_object obj;
153 
155 };
156 
157 struct ubus_context {
158  struct list_head requests;
159  struct avl_tree objects;
160  struct list_head pending;
161 
162  struct uloop_fd sock;
163  struct uloop_timeout pending_timer;
164 
165  uint32_t local_id;
166  uint16_t request_seq;
169 
170  void (*connection_lost)(struct ubus_context *ctx);
171  void (*monitor_cb)(struct ubus_context *ctx, uint32_t seq, struct blob_attr *data);
172 
173  struct ubus_msghdr_buf msgbuf;
174  uint32_t msgbuf_data_len;
176 
177  struct list_head auto_subscribers;
179 };
180 
182  uint32_t id;
183  uint32_t type_id;
184  const char *path;
185  struct blob_attr *signature;
186 };
187 
188 struct ubus_acl_key {
189  const char *user;
190  const char *group;
191  const char *object;
192 };
193 
195  uint32_t object;
196  uint32_t peer;
197  uint16_t seq;
198 
199  struct ubus_acl_key acl;
200 
201  /* internal use */
202  bool deferred;
203  int fd;
204  int req_fd; /* fd received from the initial request */
205 };
206 
207 struct ubus_request {
208  struct list_head list;
209 
210  struct list_head pending;
213  bool blocked;
214  bool cancelled;
215  bool notify;
216 
217  uint32_t peer;
218  uint16_t seq;
219 
224 
225  int fd;
226 
227  struct ubus_context *ctx;
228  void *priv;
229 };
230 
232  struct ubus_request req;
233 
237 
238  uint32_t pending;
239  uint32_t id[UBUS_MAX_NOTIFY_PEERS + 1];
240 };
241 
243  struct ubus_context ctx;
244  struct uloop_timeout timer;
245  const char *path;
247 };
248 
249 struct ubus_context *ubus_connect(const char *path);
250 int ubus_connect_ctx(struct ubus_context *ctx, const char *path);
251 void ubus_auto_connect(struct ubus_auto_conn *conn);
252 int ubus_reconnect(struct ubus_context *ctx, const char *path);
253 
254 /* call this only for struct ubus_context pointers returned by ubus_connect() */
255 void ubus_free(struct ubus_context *ctx);
256 
257 /* call this only for struct ubus_context pointers initialised by ubus_connect_ctx() */
258 void ubus_shutdown(struct ubus_context *ctx);
259 
260 static inline void ubus_auto_shutdown(struct ubus_auto_conn *conn)
261 {
262  uloop_timeout_cancel(&conn->timer);
263  ubus_shutdown(&conn->ctx);
264 }
265 
266 const char *ubus_strerror(int error);
267 
268 static inline void ubus_add_uloop(struct ubus_context *ctx)
269 {
270  uloop_fd_add(&ctx->sock, ULOOP_BLOCKING | ULOOP_READ);
271 }
272 
273 /* call this for read events on ctx->sock.fd when not using uloop */
274 static inline void ubus_handle_event(struct ubus_context *ctx)
275 {
276  ctx->sock.cb(&ctx->sock, ULOOP_READ);
277 }
278 
279 /* ----------- raw request handling ----------- */
280 
281 /* wait for a request to complete and return its status */
282 int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req,
283  int timeout);
284 
285 /* complete a request asynchronously */
287  struct ubus_request *req);
288 
289 /* abort an asynchronous request */
290 void ubus_abort_request(struct ubus_context *ctx, struct ubus_request *req);
291 
292 /* ----------- objects ----------- */
293 
294 int ubus_lookup(struct ubus_context *ctx, const char *path,
295  ubus_lookup_handler_t cb, void *priv);
296 
297 int ubus_lookup_id(struct ubus_context *ctx, const char *path, uint32_t *id);
298 
299 /* make an object visible to remote connections */
300 int ubus_add_object(struct ubus_context *ctx, struct ubus_object *obj);
301 
302 /* remove the object from the ubus connection */
303 int ubus_remove_object(struct ubus_context *ctx, struct ubus_object *obj);
304 
305 /* add a subscriber notifications from another object */
306 int ubus_register_subscriber(struct ubus_context *ctx, struct ubus_subscriber *obj);
307 
308 static inline int
310 {
311  if (!list_empty(&obj->list))
312  list_del_init(&obj->list);
313  return ubus_remove_object(ctx, &obj->obj);
314 }
315 
316 int ubus_subscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id);
317 int ubus_unsubscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id);
318 
319 int __ubus_monitor(struct ubus_context *ctx, const char *type);
320 
321 static inline int ubus_monitor_start(struct ubus_context *ctx)
322 {
323  return __ubus_monitor(ctx, "add");
324 }
325 
326 static inline int ubus_monitor_stop(struct ubus_context *ctx)
327 {
328  return __ubus_monitor(ctx, "remove");
329 }
330 
331 
332 /* ----------- acl ----------- */
333 
334 struct acl_object {
335  struct ubus_acl_key key;
336  struct avl_node avl;
337  struct blob_attr *acl;
338 };
339 
340 extern struct avl_tree acl_objects;
341 int ubus_register_acl(struct ubus_context *ctx);
342 
343 #define acl_for_each(o, m) \
344  if ((m)->object && (m)->user && (m)->group) \
345  avl_for_element_range(avl_find_ge_element(&acl_objects, m, o, avl), avl_find_le_element(&acl_objects, m, o, avl), o, avl)
346 
347 /* ----------- rpc ----------- */
348 
349 /* invoke a method on a specific object */
350 int ubus_invoke_fd(struct ubus_context *ctx, uint32_t obj, const char *method,
351  struct blob_attr *msg, ubus_data_handler_t cb, void *priv,
352  int timeout, int fd);
353 static inline int
354 ubus_invoke(struct ubus_context *ctx, uint32_t obj, const char *method,
355  struct blob_attr *msg, ubus_data_handler_t cb, void *priv,
356  int timeout)
357 {
358  return ubus_invoke_fd(ctx, obj, method, msg, cb, priv, timeout, -1);
359 }
360 
361 /* asynchronous version of ubus_invoke() */
362 int ubus_invoke_async_fd(struct ubus_context *ctx, uint32_t obj, const char *method,
363  struct blob_attr *msg, struct ubus_request *req, int fd);
364 static inline int
365 ubus_invoke_async(struct ubus_context *ctx, uint32_t obj, const char *method,
366  struct blob_attr *msg, struct ubus_request *req)
367 {
368  return ubus_invoke_async_fd(ctx, obj, method, msg, req, -1);
369 }
370 
371 /* send a reply to an incoming object method call */
372 int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req,
373  struct blob_attr *msg);
374 
375 static inline void ubus_defer_request(struct ubus_context *ctx,
376  struct ubus_request_data *req,
377  struct ubus_request_data *new_req)
378 {
379  (void) ctx;
380  memcpy(new_req, req, sizeof(*req));
381  req->deferred = true;
382 }
383 
384 static inline void ubus_request_set_fd(struct ubus_context *ctx,
385  struct ubus_request_data *req, int fd)
386 {
387  (void) ctx;
388  req->fd = fd;
389 }
390 
391 static inline int ubus_request_get_caller_fd(struct ubus_request_data *req)
392 {
393  int fd = req->req_fd;
394  req->req_fd = -1;
395 
396  return fd;
397 }
398 
400  struct ubus_request_data *req, int ret);
401 
402 /*
403  * send a notification to all subscribers of an object
404  * if timeout < 0, no reply is expected from subscribers
405  */
406 int ubus_notify(struct ubus_context *ctx, struct ubus_object *obj,
407  const char *type, struct blob_attr *msg, int timeout);
408 
409 int ubus_notify_async(struct ubus_context *ctx, struct ubus_object *obj,
410  const char *type, struct blob_attr *msg,
411  struct ubus_notify_request *req);
412 
413 
414 /* ----------- events ----------- */
415 
416 int ubus_send_event(struct ubus_context *ctx, const char *id,
417  struct blob_attr *data);
418 
420  struct ubus_event_handler *ev,
421  const char *pattern);
422 
424  struct ubus_event_handler *ev)
425 {
426  return ubus_remove_object(ctx, &ev->obj);
427 }
428 
429 #ifdef __cplusplus
430 }
431 #endif
432 
433 #endif
static int timeout
Definition: cli.c:21
int(* cb)(struct ubus_context *ctx, int argc, char **argv)
Definition: cli.c:581
static struct ubus_context * ctx
Definition: client.c:22
struct ubus_context * ubus_connect(const char *path)
Definition: libubus.c:351
void ubus_complete_deferred_request(struct ubus_context *ctx, struct ubus_request_data *req, int ret)
Definition: libubus-req.c:189
void ubus_auto_connect(struct ubus_auto_conn *conn)
Definition: libubus.c:345
void(* ubus_remove_handler_t)(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id)
Definition: libubus.h:53
int ubus_lookup(struct ubus_context *ctx, const char *path, ubus_lookup_handler_t cb, void *priv)
Definition: libubus.c:161
int ubus_subscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id)
Definition: libubus-sub.c:118
int ubus_notify(struct ubus_context *ctx, struct ubus_object *obj, const char *type, struct blob_attr *msg, int timeout)
Definition: libubus-req.c:311
static void ubus_defer_request(struct ubus_context *ctx, struct ubus_request_data *req, struct ubus_request_data *new_req)
Definition: libubus.h:375
static int ubus_request_get_caller_fd(struct ubus_request_data *req)
Definition: libubus.h:391
void(* ubus_complete_handler_t)(struct ubus_request *req, int ret)
Definition: libubus.h:60
static void ubus_auto_shutdown(struct ubus_auto_conn *conn)
Definition: libubus.h:260
int ubus_register_subscriber(struct ubus_context *ctx, struct ubus_subscriber *obj)
Definition: libubus-sub.c:77
int ubus_invoke_async_fd(struct ubus_context *ctx, uint32_t obj, const char *method, struct blob_attr *msg, struct ubus_request *req, int fd)
Definition: libubus-req.c:220
int ubus_invoke_fd(struct ubus_context *ctx, uint32_t obj, const char *method, struct blob_attr *msg, ubus_data_handler_t cb, void *priv, int timeout, int fd)
Definition: libubus-req.c:236
struct avl_tree acl_objects
bool(* ubus_new_object_handler_t)(struct ubus_context *ctx, struct ubus_subscriber *sub, const char *path)
Definition: libubus.h:66
int ubus_send_event(struct ubus_context *ctx, const char *id, struct blob_attr *data)
Definition: libubus.c:258
void(* ubus_fd_handler_t)(struct ubus_request *req, int fd)
Definition: libubus.h:59
#define UBUS_MAX_NOTIFY_PEERS
Definition: libubus.h:29
void ubus_free(struct ubus_context *ctx)
Definition: libubus.c:378
void ubus_shutdown(struct ubus_context *ctx)
Definition: libubus.c:367
int ubus_register_acl(struct ubus_context *ctx)
Definition: libubus-acl.c:142
void(* ubus_state_handler_t)(struct ubus_context *ctx, struct ubus_object *obj)
Definition: libubus.h:52
static void ubus_request_set_fd(struct ubus_context *ctx, struct ubus_request_data *req, int fd)
Definition: libubus.h:384
int ubus_connect_ctx(struct ubus_context *ctx, const char *path)
Definition: libubus.c:284
void ubus_abort_request(struct ubus_context *ctx, struct ubus_request *req)
Definition: libubus-req.c:80
int ubus_lookup_id(struct ubus_context *ctx, const char *path, uint32_t *id)
Definition: libubus.c:192
int ubus_remove_object(struct ubus_context *ctx, struct ubus_object *obj)
Definition: libubus-obj.c:256
static int ubus_monitor_start(struct ubus_context *ctx)
Definition: libubus.h:321
static void ubus_add_uloop(struct ubus_context *ctx)
Definition: libubus.h:268
int ubus_add_object(struct ubus_context *ctx, struct ubus_object *obj)
Definition: libubus-obj.c:209
const char * ubus_strerror(int error)
Definition: libubus.c:59
static int ubus_invoke_async(struct ubus_context *ctx, uint32_t obj, const char *method, struct blob_attr *msg, struct ubus_request *req)
Definition: libubus.h:365
void(* ubus_notify_data_handler_t)(struct ubus_notify_request *req, int type, struct blob_attr *msg)
Definition: libubus.h:63
void(* ubus_data_handler_t)(struct ubus_request *req, int type, struct blob_attr *msg)
Definition: libubus.h:57
static int ubus_unregister_subscriber(struct ubus_context *ctx, struct ubus_subscriber *obj)
Definition: libubus.h:309
int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req, struct blob_attr *msg)
Definition: libubus-req.c:205
int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, int timeout)
Definition: libubus-req.c:140
static int ubus_unregister_event_handler(struct ubus_context *ctx, struct ubus_event_handler *ev)
Definition: libubus.h:423
int ubus_notify_async(struct ubus_context *ctx, struct ubus_object *obj, const char *type, struct blob_attr *msg, struct ubus_notify_request *req)
Definition: libubus-req.c:304
int ubus_unsubscribe(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id)
Definition: libubus-sub.c:123
static void ubus_handle_event(struct ubus_context *ctx)
Definition: libubus.h:274
int ubus_reconnect(struct ubus_context *ctx, const char *path)
Definition: libubus-io.c:395
void ubus_complete_request_async(struct ubus_context *ctx, struct ubus_request *req)
Definition: libubus-req.c:90
void(* ubus_lookup_handler_t)(struct ubus_context *ctx, struct ubus_object_data *obj, void *priv)
Definition: libubus.h:46
int ubus_register_event_handler(struct ubus_context *ctx, struct ubus_event_handler *ev, const char *pattern)
Definition: libubus.c:225
int __ubus_monitor(struct ubus_context *ctx, const char *type)
Definition: libubus-req.c:495
static int ubus_monitor_stop(struct ubus_context *ctx)
Definition: libubus.h:326
static int ubus_invoke(struct ubus_context *ctx, uint32_t obj, const char *method, struct blob_attr *msg, ubus_data_handler_t cb, void *priv, int timeout)
Definition: libubus.h:354
void(* ubus_event_handler_t)(struct ubus_context *ctx, struct ubus_event_handler *ev, const char *type, struct blob_attr *msg)
Definition: libubus.h:55
int(* ubus_handler_t)(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg)
Definition: libubus.h:49
void(* ubus_connect_handler_t)(struct ubus_context *ctx)
Definition: libubus.h:65
void(* ubus_notify_complete_handler_t)(struct ubus_notify_request *req, int idx, int ret)
Definition: libubus.h:61
struct blob_attr * acl
Definition: libubus.h:337
struct ubus_acl_key key
Definition: libubus.h:335
struct avl_node avl
Definition: libubus.h:336
const char * group
Definition: libubus.h:190
const char * object
Definition: libubus.h:191
const char * user
Definition: libubus.h:189
const char * path
Definition: libubus.h:245
struct uloop_timeout timer
Definition: libubus.h:244
ubus_connect_handler_t cb
Definition: libubus.h:246
struct ubus_context ctx
Definition: libubus.h:243
int stack_depth
Definition: libubus.h:168
uint32_t msgbuf_data_len
Definition: libubus.h:174
struct uloop_timeout pending_timer
Definition: libubus.h:163
int msgbuf_reduction_counter
Definition: libubus.h:175
struct list_head requests
Definition: libubus.h:158
struct ubus_msghdr_buf msgbuf
Definition: libubus.h:173
void(* connection_lost)(struct ubus_context *ctx)
Definition: libubus.h:170
struct avl_tree objects
Definition: libubus.h:159
bool cancel_poll
Definition: libubus.h:167
void(* monitor_cb)(struct ubus_context *ctx, uint32_t seq, struct blob_attr *data)
Definition: libubus.h:171
struct list_head auto_subscribers
Definition: libubus.h:177
struct list_head pending
Definition: libubus.h:160
struct uloop_fd sock
Definition: libubus.h:162
uint32_t local_id
Definition: libubus.h:165
struct ubus_event_handler auto_subscribe_event_handler
Definition: libubus.h:178
uint16_t request_seq
Definition: libubus.h:166
ubus_event_handler_t cb
Definition: libubus.h:154
struct ubus_object obj
Definition: libubus.h:152
ubus_handler_t handler
Definition: libubus.h:110
unsigned long tags
Definition: libubus.h:113
int n_policy
Definition: libubus.h:115
const struct blobmsg_policy * policy
Definition: libubus.h:114
const char * name
Definition: libubus.h:109
unsigned long mask
Definition: libubus.h:112
struct ubus_msghdr hdr
Definition: libubus.h:42
struct blob_attr * data
Definition: libubus.h:43
uint32_t pending
Definition: libubus.h:238
struct ubus_request req
Definition: libubus.h:232
ubus_notify_complete_handler_t complete_cb
Definition: libubus.h:235
ubus_notify_complete_handler_t status_cb
Definition: libubus.h:234
ubus_notify_data_handler_t data_cb
Definition: libubus.h:236
uint32_t id
Definition: libubus.h:182
struct blob_attr * signature
Definition: libubus.h:185
const char * path
Definition: libubus.h:184
uint32_t type_id
Definition: libubus.h:183
const char * name
Definition: libubus.h:119
const struct ubus_method * methods
Definition: libubus.h:122
uint32_t id
Definition: libubus.h:120
bool has_subscribers
Definition: libubus.h:136
uint32_t id
Definition: libubus.h:130
struct ubus_object_type * type
Definition: libubus.h:133
struct avl_node avl
Definition: libubus.h:127
const char * path
Definition: libubus.h:132
const struct ubus_method * methods
Definition: libubus.h:138
ubus_state_handler_t subscribe_cb
Definition: libubus.h:135
int n_methods
Definition: libubus.h:139
const char * name
Definition: libubus.h:129
uint16_t seq
Definition: libubus.h:197
uint32_t object
Definition: libubus.h:195
uint32_t peer
Definition: libubus.h:196
struct ubus_acl_key acl
Definition: libubus.h:199
ubus_data_handler_t raw_data_cb
Definition: libubus.h:220
ubus_complete_handler_t complete_cb
Definition: libubus.h:223
bool blocked
Definition: libubus.h:213
int status_code
Definition: libubus.h:211
bool status_msg
Definition: libubus.h:212
void * priv
Definition: libubus.h:228
uint32_t peer
Definition: libubus.h:217
uint16_t seq
Definition: libubus.h:218
struct list_head pending
Definition: libubus.h:210
bool notify
Definition: libubus.h:215
ubus_data_handler_t data_cb
Definition: libubus.h:221
struct ubus_context * ctx
Definition: libubus.h:227
bool cancelled
Definition: libubus.h:214
struct list_head list
Definition: libubus.h:208
ubus_fd_handler_t fd_cb
Definition: libubus.h:222
ubus_remove_handler_t remove_cb
Definition: libubus.h:147
struct ubus_object obj
Definition: libubus.h:144
ubus_new_object_handler_t new_obj_cb
Definition: libubus.h:148
struct list_head list
Definition: libubus.h:143
ubus_handler_t cb
Definition: libubus.h:146
struct avl_tree path
Definition: ubusd_obj.c:19
uint16_t seq
Definition: ubusmsg.h:2
uint8_t type
Definition: ubusmsg.h:1