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_MSG_CHUNK_SIZE 65536
24 #define UBUS_SYSTEM_OBJECT_EVENT 1
25 #define UBUS_SYSTEM_OBJECT_ACL 2
26 #define UBUS_SYSTEM_OBJECT_MONITOR 3
27 #define UBUS_SYSTEM_OBJECT_MAX 1024
37 /* initial server message */
40 /* generic command response */
43 /* data message response */
49 /* look up one or more objects */
52 /* invoke a method on a single object */
56 UBUS_MSG_REMOVE_OBJECT,
59 * subscribe/unsubscribe to object notifications
60 * The unsubscribe message is sent from ubusd when
61 * the object disappears
67 * send a notification to all subscribers of an object.
68 * when sent from the server, it indicates a subscription
97 UBUS_ATTR_SUBSCRIBERS,
106 enum ubus_monitor_attr {
118 enum ubus_msg_status {
120 UBUS_STATUS_INVALID_COMMAND,
121 UBUS_STATUS_INVALID_ARGUMENT,
122 UBUS_STATUS_METHOD_NOT_FOUND,
123 UBUS_STATUS_NOT_FOUND,
125 UBUS_STATUS_PERMISSION_DENIED,
127 UBUS_STATUS_NOT_SUPPORTED,
128 UBUS_STATUS_UNKNOWN_ERROR,
129 UBUS_STATUS_CONNECTION_FAILED,