+
+static inline void ubus_defer_request(struct ubus_context *ctx,
+ struct ubus_request_data *req,
+ struct ubus_request_data *new_req)
+{
+ (void) ctx;
+ memcpy(new_req, req, sizeof(*req));
+ req->deferred = true;
+}
+
+static inline void ubus_request_set_fd(struct ubus_context *ctx,
+ struct ubus_request_data *req, int fd)
+{
+ (void) ctx;
+ req->fd = fd;
+}
+
+static inline int ubus_request_get_caller_fd(struct ubus_request_data *req)
+{
+ int fd = req->req_fd;
+ req->req_fd = -1;
+
+ return fd;
+}
+
+void ubus_complete_deferred_request(struct ubus_context *ctx,
+ struct ubus_request_data *req, int ret);
+
+/*
+ * send a notification to all subscribers of an object
+ * if timeout < 0, no reply is expected from subscribers
+ */
+int ubus_notify(struct ubus_context *ctx, struct ubus_object *obj,
+ const char *type, struct blob_attr *msg, int timeout);
+
+int ubus_notify_async(struct ubus_context *ctx, struct ubus_object *obj,
+ const char *type, struct blob_attr *msg,
+ struct ubus_notify_request *req);
+
+
+/* ----------- events ----------- */
+
+int ubus_send_event(struct ubus_context *ctx, const char *id,
+ struct blob_attr *data);
+
+int ubus_register_event_handler(struct ubus_context *ctx,
+ struct ubus_event_handler *ev,
+ const char *pattern);
+
+static inline int ubus_unregister_event_handler(struct ubus_context *ctx,
+ struct ubus_event_handler *ev)
+{
+ return ubus_remove_object(ctx, &ev->obj);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif