* GNU General Public License for more details.
*/
+#ifndef __LIBUBUS_H
+#define __LIBUBUS_H
+
#include <libubox/avl.h>
#include <libubox/list.h>
#include <libubox/blobmsg.h>
uint32_t object;
uint32_t peer;
uint32_t seq;
+ bool deferred;
};
struct ubus_request {
int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req,
struct blob_attr *msg);
+static inline void ubus_defer_request(struct ubus_context *ctx,
+ struct ubus_request_data *req,
+ struct ubus_request_data *new_req)
+{
+ memcpy(new_req, req, sizeof(*req));
+ req->deferred = true;
+}
+
+void ubus_complete_deferred_request(struct ubus_context *ctx,
+ struct ubus_request_data *req, int ret);
+
/* ----------- events ----------- */
int ubus_send_event(struct ubus_context *ctx, const char *id,
{
return ubus_remove_object(ctx, &ev->obj);
}
+
+#endif