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
32 struct blob_attr data[];
36 /* initial server message */
39 /* generic command response */
42 /* data message response */
48 /* look up one or more objects */
51 /* invoke a method on a single object */
55 UBUS_MSG_REMOVE_OBJECT,
58 * subscribe/unsubscribe to object notifications
59 * The unsubscribe message is sent from ubusd when
60 * the object disappears
66 * send a notification to all subscribers of an object.
67 * when sent from the server, it indicates a subscription
97 enum ubus_msg_status {
99 UBUS_STATUS_INVALID_COMMAND,
100 UBUS_STATUS_INVALID_ARGUMENT,
101 UBUS_STATUS_METHOD_NOT_FOUND,
102 UBUS_STATUS_NOT_FOUND,
104 UBUS_STATUS_PERMISSION_DENIED,
106 UBUS_STATUS_NOT_SUPPORTED,
107 UBUS_STATUS_UNKNOWN_ERROR,
108 UBUS_STATUS_CONNECTION_FAILED,