#include <unistd.h>
#include <libubox/blob.h>
#include <libubox/blobmsg.h>
#include "libubus.h"
#include <libubox/avl-cmp.h>
Go to the source code of this file.
|
static int | acl_cmp (const void *k1, const void *k2, void *ptr) |
|
| AVL_TREE (acl_objects, acl_cmp, true, NULL) |
|
static void | acl_add (struct blob_attr *obj) |
|
static void | acl_recv_cb (struct ubus_request *req, int type, struct blob_attr *msg) |
|
static void | acl_query (struct ubus_context *ctx) |
|
static void | acl_subscribe_cb (struct ubus_context *ctx, struct ubus_event_handler *ev, const char *type, struct blob_attr *msg) |
|
int | ubus_register_acl (struct ubus_context *ctx) |
|
◆ anonymous enum
Enumerator |
---|
ACL_OBJ_OBJECT | |
ACL_OBJ_USER | |
ACL_OBJ_GROUP | |
ACL_OBJ_ACL | |
__ACL_OBJ_MAX | |
Definition at line 47 of file libubus-acl.c.
◆ anonymous enum
Enumerator |
---|
ACL_POLICY_SEQ | |
ACL_POLICY_ACL | |
__ACL_POLICY_MAX | |
Definition at line 89 of file libubus-acl.c.
◆ acl_add()
static void acl_add |
( |
struct blob_attr * |
obj | ) |
|
|
static |
Definition at line 63 of file libubus-acl.c.
69 blobmsg_data_len(obj));
77 acl = calloc(1,
sizeof(*
acl));
static const struct blobmsg_policy acl_obj_policy[__ACL_OBJ_MAX]
struct avl_tree acl_objects
◆ acl_cmp()
static int acl_cmp |
( |
const void * |
k1, |
|
|
const void * |
k2, |
|
|
void * |
ptr |
|
) |
| |
|
static |
◆ acl_query()
Definition at line 127 of file libubus-acl.c.
static struct ubus_context * ctx
static void acl_recv_cb(struct ubus_request *req, int type, struct blob_attr *msg)
static struct ubus_request acl_req
void ubus_complete_request_async(struct ubus_context *ctx, struct ubus_request *req)
static int ubus_invoke_async(struct ubus_context *ctx, uint32_t obj, const char *method, struct blob_attr *msg, struct ubus_request *req)
ubus_data_handler_t data_cb
#define UBUS_SYSTEM_OBJECT_ACL
◆ acl_recv_cb()
static void acl_recv_cb |
( |
struct ubus_request * |
req, |
|
|
int |
type, |
|
|
struct blob_attr * |
msg |
|
) |
| |
|
static |
Definition at line 100 of file libubus-acl.c.
104 struct blob_attr *cur;
118 blobmsg_data_len(msg));
static void acl_add(struct blob_attr *obj)
static const struct blobmsg_policy acl_policy[__ACL_POLICY_MAX]
static struct blob_attr * acl_blob
◆ acl_subscribe_cb()
Definition at line 134 of file libubus-acl.c.
137 if (strcmp(
type,
"ubus.acl.sequence"))
static void acl_query(struct ubus_context *ctx)
◆ AVL_TREE()
◆ ubus_register_acl()
Definition at line 142 of file libubus-acl.c.
static struct ubus_event_handler acl_event
static void acl_subscribe_cb(struct ubus_context *ctx, struct ubus_event_handler *ev, const char *type, struct blob_attr *msg)
int ubus_register_event_handler(struct ubus_context *ctx, struct ubus_event_handler *ev, const char *pattern)
◆ acl_blob
struct blob_attr* acl_blob |
|
static |
◆ acl_event
◆ acl_obj_policy
Initial value:= {
[
ACL_OBJ_USER] = { .name =
"user", .type = BLOBMSG_TYPE_STRING },
[
ACL_OBJ_GROUP] = { .name =
"group", .type = BLOBMSG_TYPE_STRING },
[
ACL_OBJ_ACL] = { .name =
"acl", .type = BLOBMSG_TYPE_TABLE },
}
Definition at line 45 of file libubus-acl.c.
◆ acl_policy
◆ acl_req