move ubus_start_request to libubus-req.c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
1579969983
commit
2224658580
2 changed files with 16 additions and 16 deletions
|
@ -48,6 +48,22 @@ static void __ubus_process_req_data(struct ubus_request *req)
|
|||
}
|
||||
}
|
||||
|
||||
int __hidden ubus_start_request(struct ubus_context *ctx, struct ubus_request *req,
|
||||
struct blob_attr *msg, int cmd, uint32_t peer)
|
||||
{
|
||||
memset(req, 0, sizeof(*req));
|
||||
|
||||
if (msg && blob_pad_len(msg) > UBUS_MAX_MSGLEN)
|
||||
return -1;
|
||||
|
||||
INIT_LIST_HEAD(&req->list);
|
||||
INIT_LIST_HEAD(&req->pending);
|
||||
req->ctx = ctx;
|
||||
req->peer = peer;
|
||||
req->seq = ++ctx->request_seq;
|
||||
return ubus_send_msg(ctx, req->seq, msg, cmd, peer);
|
||||
}
|
||||
|
||||
void ubus_abort_request(struct ubus_context *ctx, struct ubus_request *req)
|
||||
{
|
||||
if (!list_empty(&req->list))
|
||||
|
|
16
libubus.c
16
libubus.c
|
@ -145,22 +145,6 @@ static void ubus_lookup_cb(struct ubus_request *ureq, int type, struct blob_attr
|
|||
req->cb(ureq->ctx, &obj, ureq->priv);
|
||||
}
|
||||
|
||||
int __hidden ubus_start_request(struct ubus_context *ctx, struct ubus_request *req,
|
||||
struct blob_attr *msg, int cmd, uint32_t peer)
|
||||
{
|
||||
memset(req, 0, sizeof(*req));
|
||||
|
||||
if (msg && blob_pad_len(msg) > UBUS_MAX_MSGLEN)
|
||||
return -1;
|
||||
|
||||
INIT_LIST_HEAD(&req->list);
|
||||
INIT_LIST_HEAD(&req->pending);
|
||||
req->ctx = ctx;
|
||||
req->peer = peer;
|
||||
req->seq = ++ctx->request_seq;
|
||||
return ubus_send_msg(ctx, req->seq, msg, cmd, peer);
|
||||
}
|
||||
|
||||
int ubus_lookup(struct ubus_context *ctx, const char *path,
|
||||
ubus_lookup_handler_t cb, void *priv)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue