struct ubus_object;
struct ubus_request;
struct ubus_request_data;
+struct ubus_object_data;
+typedef void (*ubus_lookup_handler_t)(struct ubus_context *ctx,
+ struct ubus_object_data *obj,
+ void *priv);
typedef int (*ubus_handler_t)(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req,
const char *method, struct blob_attr *msg);
} msgbuf;
};
+struct ubus_object_data {
+ uint32_t id;
+ uint32_t type_id;
+ const char *path;
+ struct blob_attr *signature;
+};
+
struct ubus_request_data {
uint32_t object;
uint32_t peer;
const char *ubus_strerror(int error);
-/* ----------- helpers for message handling ----------- */
-
-struct blob_attr **ubus_parse_msg(struct blob_attr *msg);
-
/* ----------- raw request handling ----------- */
-/* start a raw request */
-int ubus_start_request(struct ubus_context *ctx, struct ubus_request *req,
- struct blob_attr *msg, int cmd, uint32_t peer);
-
/* wait for a request to complete and return its status */
int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req);
/* abort an asynchronous request */
void ubus_abort_request(struct ubus_context *ctx, struct ubus_request *req);
+/* ----------- objects ----------- */
+
+int ubus_lookup(struct ubus_context *ctx, const char *path,
+ ubus_lookup_handler_t cb, void *priv);
+
+int ubus_lookup_id(struct ubus_context *ctx, const char *path, uint32_t *id);
+
/* ----------- rpc ----------- */
/* invoke a method on a specific object */