2 * Copyright (C) 2011 Felix Fietkau <nbd@openwrt.org>
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
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.
18 #include <libubox/blob.h>
20 #define __packetdata __attribute__((packed)) __attribute__((__aligned__(4)))
22 #define UBUS_MAX_MSGLEN 65536
24 #define UBUS_SYSTEM_OBJECT_EVENT 1
25 #define UBUS_SYSTEM_OBJECT_MAX 1024
35 /* initial server message */
38 /* generic command response */
41 /* data message response */
47 /* look up one or more objects */
50 /* invoke a method on a single object */
54 UBUS_MSG_REMOVE_OBJECT
,
57 * subscribe/unsubscribe to object notifications
58 * The unsubscribe message is sent from ubusd when
59 * the object disappears
65 * send a notification to all subscribers of an object.
66 * when sent from the server, it indicates a subscription
93 UBUS_ATTR_SUBSCRIBERS
,
99 enum ubus_msg_status
{
101 UBUS_STATUS_INVALID_COMMAND
,
102 UBUS_STATUS_INVALID_ARGUMENT
,
103 UBUS_STATUS_METHOD_NOT_FOUND
,
104 UBUS_STATUS_NOT_FOUND
,
106 UBUS_STATUS_PERMISSION_DENIED
,
108 UBUS_STATUS_NOT_SUPPORTED
,
109 UBUS_STATUS_UNKNOWN_ERROR
,
110 UBUS_STATUS_CONNECTION_FAILED
,