Ubus
OpenWrt system message/RPC bus.
ubusmsg.h File Reference
#include <stdint.h>
#include <libubox/blob.h>

Go to the source code of this file.

Data Structures

struct  ubus_msghdr
 

Macros

#define __packetdata   __attribute__((packed)) __attribute__((__aligned__(4)))
 
#define UBUS_MSG_CHUNK_SIZE   65536
 
#define UBUS_SYSTEM_OBJECT_EVENT   1
 
#define UBUS_SYSTEM_OBJECT_ACL   2
 
#define UBUS_SYSTEM_OBJECT_MONITOR   3
 
#define UBUS_SYSTEM_OBJECT_MAX   1024
 

Enumerations

enum  ubus_msg_type {
  UBUS_MSG_HELLO , UBUS_MSG_STATUS , UBUS_MSG_DATA , UBUS_MSG_PING ,
  UBUS_MSG_LOOKUP , UBUS_MSG_INVOKE , UBUS_MSG_ADD_OBJECT , UBUS_MSG_REMOVE_OBJECT ,
  UBUS_MSG_SUBSCRIBE , UBUS_MSG_UNSUBSCRIBE , UBUS_MSG_NOTIFY , UBUS_MSG_MONITOR ,
  __UBUS_MSG_LAST
}
 
enum  ubus_msg_attr {
  UBUS_ATTR_UNSPEC , UBUS_ATTR_STATUS , UBUS_ATTR_OBJPATH , UBUS_ATTR_OBJID ,
  UBUS_ATTR_METHOD , UBUS_ATTR_OBJTYPE , UBUS_ATTR_SIGNATURE , UBUS_ATTR_DATA ,
  UBUS_ATTR_TARGET , UBUS_ATTR_ACTIVE , UBUS_ATTR_NO_REPLY , UBUS_ATTR_SUBSCRIBERS ,
  UBUS_ATTR_USER , UBUS_ATTR_GROUP , UBUS_ATTR_MAX
}
 
enum  ubus_monitor_attr {
  UBUS_MONITOR_CLIENT , UBUS_MONITOR_PEER , UBUS_MONITOR_SEND , UBUS_MONITOR_SEQ ,
  UBUS_MONITOR_TYPE , UBUS_MONITOR_DATA , UBUS_MONITOR_MAX
}
 
enum  ubus_msg_status {
  UBUS_STATUS_OK , UBUS_STATUS_INVALID_COMMAND , UBUS_STATUS_INVALID_ARGUMENT , UBUS_STATUS_METHOD_NOT_FOUND ,
  UBUS_STATUS_NOT_FOUND , UBUS_STATUS_NO_DATA , UBUS_STATUS_PERMISSION_DENIED , UBUS_STATUS_TIMEOUT ,
  UBUS_STATUS_NOT_SUPPORTED , UBUS_STATUS_UNKNOWN_ERROR , UBUS_STATUS_CONNECTION_FAILED , UBUS_STATUS_NO_MEMORY ,
  UBUS_STATUS_PARSE_ERROR , UBUS_STATUS_SYSTEM_ERROR , __UBUS_STATUS_LAST
}
 

Functions

struct ubus_msghdr __attribute__ ((packed)) __attribute__((__aligned__(4)))
 

Variables

uint8_t version
 
uint8_t type
 
uint16_t seq
 
uint32_t peer
 
enum ubus_msg_type __attribute__
 

Macro Definition Documentation

◆ __packetdata

#define __packetdata   __attribute__((packed)) __attribute__((__aligned__(4)))

Definition at line 20 of file ubusmsg.h.

◆ UBUS_MSG_CHUNK_SIZE

#define UBUS_MSG_CHUNK_SIZE   65536

Definition at line 22 of file ubusmsg.h.

◆ UBUS_SYSTEM_OBJECT_ACL

#define UBUS_SYSTEM_OBJECT_ACL   2

Definition at line 25 of file ubusmsg.h.

◆ UBUS_SYSTEM_OBJECT_EVENT

#define UBUS_SYSTEM_OBJECT_EVENT   1

Definition at line 24 of file ubusmsg.h.

◆ UBUS_SYSTEM_OBJECT_MAX

#define UBUS_SYSTEM_OBJECT_MAX   1024

Definition at line 27 of file ubusmsg.h.

◆ UBUS_SYSTEM_OBJECT_MONITOR

#define UBUS_SYSTEM_OBJECT_MONITOR   3

Definition at line 26 of file ubusmsg.h.

Enumeration Type Documentation

◆ ubus_monitor_attr

Enumerator
UBUS_MONITOR_CLIENT 
UBUS_MONITOR_PEER 
UBUS_MONITOR_SEND 
UBUS_MONITOR_SEQ 
UBUS_MONITOR_TYPE 
UBUS_MONITOR_DATA 
UBUS_MONITOR_MAX 

Definition at line 106 of file ubusmsg.h.

106  {
113 
114  /* must be last */
116 };
@ UBUS_MONITOR_DATA
Definition: ubusmsg.h:112
@ UBUS_MONITOR_CLIENT
Definition: ubusmsg.h:107
@ UBUS_MONITOR_SEND
Definition: ubusmsg.h:109
@ UBUS_MONITOR_MAX
Definition: ubusmsg.h:115
@ UBUS_MONITOR_PEER
Definition: ubusmsg.h:108
@ UBUS_MONITOR_SEQ
Definition: ubusmsg.h:110
@ UBUS_MONITOR_TYPE
Definition: ubusmsg.h:111

◆ ubus_msg_attr

Enumerator
UBUS_ATTR_UNSPEC 
UBUS_ATTR_STATUS 
UBUS_ATTR_OBJPATH 
UBUS_ATTR_OBJID 
UBUS_ATTR_METHOD 
UBUS_ATTR_OBJTYPE 
UBUS_ATTR_SIGNATURE 
UBUS_ATTR_DATA 
UBUS_ATTR_TARGET 
UBUS_ATTR_ACTIVE 
UBUS_ATTR_NO_REPLY 
UBUS_ATTR_SUBSCRIBERS 
UBUS_ATTR_USER 
UBUS_ATTR_GROUP 
UBUS_ATTR_MAX 

Definition at line 79 of file ubusmsg.h.

79  {
81 
83 
87 
90 
93 
96 
98 
101 
102  /* must be last */
104 };
@ UBUS_ATTR_OBJTYPE
Definition: ubusmsg.h:88
@ UBUS_ATTR_TARGET
Definition: ubusmsg.h:92
@ UBUS_ATTR_ACTIVE
Definition: ubusmsg.h:94
@ UBUS_ATTR_OBJPATH
Definition: ubusmsg.h:84
@ UBUS_ATTR_METHOD
Definition: ubusmsg.h:86
@ UBUS_ATTR_SUBSCRIBERS
Definition: ubusmsg.h:97
@ UBUS_ATTR_STATUS
Definition: ubusmsg.h:82
@ UBUS_ATTR_NO_REPLY
Definition: ubusmsg.h:95
@ UBUS_ATTR_OBJID
Definition: ubusmsg.h:85
@ UBUS_ATTR_SIGNATURE
Definition: ubusmsg.h:89
@ UBUS_ATTR_GROUP
Definition: ubusmsg.h:100
@ UBUS_ATTR_DATA
Definition: ubusmsg.h:91
@ UBUS_ATTR_UNSPEC
Definition: ubusmsg.h:80
@ UBUS_ATTR_USER
Definition: ubusmsg.h:99
@ UBUS_ATTR_MAX
Definition: ubusmsg.h:103

◆ ubus_msg_status

Enumerator
UBUS_STATUS_OK 
UBUS_STATUS_INVALID_COMMAND 
UBUS_STATUS_INVALID_ARGUMENT 
UBUS_STATUS_METHOD_NOT_FOUND 
UBUS_STATUS_NOT_FOUND 
UBUS_STATUS_NO_DATA 
UBUS_STATUS_PERMISSION_DENIED 
UBUS_STATUS_TIMEOUT 
UBUS_STATUS_NOT_SUPPORTED 
UBUS_STATUS_UNKNOWN_ERROR 
UBUS_STATUS_CONNECTION_FAILED 
UBUS_STATUS_NO_MEMORY 
UBUS_STATUS_PARSE_ERROR 
UBUS_STATUS_SYSTEM_ERROR 
__UBUS_STATUS_LAST 

Definition at line 118 of file ubusmsg.h.

118  {
134 };
@ UBUS_STATUS_INVALID_ARGUMENT
Definition: ubusmsg.h:121
@ UBUS_STATUS_NO_DATA
Definition: ubusmsg.h:124
@ UBUS_STATUS_TIMEOUT
Definition: ubusmsg.h:126
@ UBUS_STATUS_METHOD_NOT_FOUND
Definition: ubusmsg.h:122
@ UBUS_STATUS_NOT_FOUND
Definition: ubusmsg.h:123
@ UBUS_STATUS_INVALID_COMMAND
Definition: ubusmsg.h:120
@ UBUS_STATUS_CONNECTION_FAILED
Definition: ubusmsg.h:129
@ UBUS_STATUS_NO_MEMORY
Definition: ubusmsg.h:130
@ __UBUS_STATUS_LAST
Definition: ubusmsg.h:133
@ UBUS_STATUS_PERMISSION_DENIED
Definition: ubusmsg.h:125
@ UBUS_STATUS_OK
Definition: ubusmsg.h:119
@ UBUS_STATUS_UNKNOWN_ERROR
Definition: ubusmsg.h:128
@ UBUS_STATUS_SYSTEM_ERROR
Definition: ubusmsg.h:132
@ UBUS_STATUS_PARSE_ERROR
Definition: ubusmsg.h:131
@ UBUS_STATUS_NOT_SUPPORTED
Definition: ubusmsg.h:127

◆ ubus_msg_type

Enumerator
UBUS_MSG_HELLO 
UBUS_MSG_STATUS 
UBUS_MSG_DATA 
UBUS_MSG_PING 
UBUS_MSG_LOOKUP 
UBUS_MSG_INVOKE 
UBUS_MSG_ADD_OBJECT 
UBUS_MSG_REMOVE_OBJECT 
UBUS_MSG_SUBSCRIBE 
UBUS_MSG_UNSUBSCRIBE 
UBUS_MSG_NOTIFY 
UBUS_MSG_MONITOR 
__UBUS_MSG_LAST 

Definition at line 36 of file ubusmsg.h.

36  {
37  /* initial server message */
39 
40  /* generic command response */
42 
43  /* data message response */
45 
46  /* ping request */
48 
49  /* look up one or more objects */
51 
52  /* invoke a method on a single object */
54 
57 
58  /*
59  * subscribe/unsubscribe to object notifications
60  * The unsubscribe message is sent from ubusd when
61  * the object disappears
62  */
65 
66  /*
67  * send a notification to all subscribers of an object.
68  * when sent from the server, it indicates a subscription
69  * status change
70  */
72 
74 
75  /* must be last */
77 };
@ UBUS_MSG_INVOKE
Definition: ubusmsg.h:53
@ UBUS_MSG_DATA
Definition: ubusmsg.h:44
@ UBUS_MSG_REMOVE_OBJECT
Definition: ubusmsg.h:56
@ UBUS_MSG_STATUS
Definition: ubusmsg.h:41
@ UBUS_MSG_PING
Definition: ubusmsg.h:47
@ UBUS_MSG_ADD_OBJECT
Definition: ubusmsg.h:55
@ UBUS_MSG_LOOKUP
Definition: ubusmsg.h:50
@ UBUS_MSG_NOTIFY
Definition: ubusmsg.h:71
@ __UBUS_MSG_LAST
Definition: ubusmsg.h:76
@ UBUS_MSG_MONITOR
Definition: ubusmsg.h:73
@ UBUS_MSG_HELLO
Definition: ubusmsg.h:38
@ UBUS_MSG_SUBSCRIBE
Definition: ubusmsg.h:63
@ UBUS_MSG_UNSUBSCRIBE
Definition: ubusmsg.h:64

Function Documentation

◆ __attribute__()

struct ubus_msghdr __attribute__ ( (packed)  )

Variable Documentation

◆ __attribute__

enum ubus_msg_type __attribute__

◆ peer

uint32_t peer

Definition at line 3 of file ubusmsg.h.

◆ seq

uint16_t seq

Definition at line 2 of file ubusmsg.h.

◆ type

uint8_t type

Definition at line 1 of file ubusmsg.h.

◆ version

uint8_t version

Definition at line 0 of file ubusmsg.h.