Ubus
OpenWrt system message/RPC bus.
|
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
#include <unistd.h>
#include <glob.h>
#include <grp.h>
#include <pwd.h>
#include <libubox/vlist.h>
#include <libubox/blobmsg_json.h>
#include <libubox/avl-cmp.h>
#include <libubox/ulog.h>
#include "ubusd.h"
Go to the source code of this file.
Data Structures | |
struct | ucred |
struct | ubusd_acl_obj |
struct | ubusd_acl_file |
Macros | |
#define | _GNU_SOURCE |
Enumerations | |
enum | { ACL_ACCESS_METHODS , ACL_ACCESS_TAGS , ACL_ACCESS_PRIV , __ACL_ACCESS_MAX } |
enum | { ACL_USER , ACL_GROUP , ACL_ACCESS , ACL_PUBLISH , ACL_SUBSCRIBE , ACL_INHERIT , ACL_LISTEN , ACL_SEND , __ACL_MAX } |
Functions | |
static int | ubusd_acl_match_cred (struct ubus_client *cl, struct ubusd_acl_obj *obj) |
int | ubusd_acl_check (struct ubus_client *cl, const char *obj, const char *method, enum ubusd_acl_type type) |
int | ubusd_acl_init_client (struct ubus_client *cl, int fd) |
void | ubusd_acl_free_client (struct ubus_client *cl) |
static void | ubusd_acl_file_free (struct ubusd_acl_file *file) |
static struct ubusd_acl_obj * | ubusd_acl_alloc_obj (struct ubusd_acl_file *file, const char *obj) |
static void | ubusd_acl_add_access (struct ubusd_acl_file *file, struct blob_attr *obj) |
static void | ubusd_acl_add_subscribe (struct ubusd_acl_file *file, const char *obj) |
static void | ubusd_acl_add_publish (struct ubusd_acl_file *file, const char *obj) |
static void | ubusd_acl_add_listen (struct ubusd_acl_file *file, const char *obj) |
static void | ubusd_acl_add_send (struct ubusd_acl_file *file, const char *obj) |
static void | ubusd_acl_file_add (struct ubusd_acl_file *file) |
static void | ubusd_acl_update_cb (struct vlist_tree *tree, struct vlist_node *node_new, struct vlist_node *node_old) |
static struct ubus_msg_buf * | ubusd_create_sequence_event_msg (void *priv, const char *id) |
static | VLIST_TREE (ubusd_acl_files, avl_strcmp, ubusd_acl_update_cb, false, false) |
static int | ubusd_acl_load_file (const char *filename) |
void | ubusd_acl_load (void) |
static void | ubusd_reply_add (struct ubus_object *obj) |
static int | ubusd_reply_query (struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr, struct blob_attr *msg) |
static int | ubusd_acl_recv (struct ubus_client *cl, struct ubus_msg_buf *ub, const char *method, struct blob_attr *msg) |
void | ubusd_acl_init (void) |
Variables | |
const char * | ubusd_acl_dir = "/usr/share/acl.d" |
static struct blob_buf | bbuf |
static struct avl_tree | ubusd_acls |
static int | ubusd_acl_seq |
static struct ubus_object * | acl_obj |
static const struct blobmsg_policy | acl_obj_policy [__ACL_ACCESS_MAX] |
static const struct blobmsg_policy | acl_policy [__ACL_MAX] |
#define _GNU_SOURCE |
Definition at line 15 of file ubusd_acl.c.
anonymous enum |
Enumerator | |
---|---|
ACL_ACCESS_METHODS | |
ACL_ACCESS_TAGS | |
ACL_ACCESS_PRIV | |
__ACL_ACCESS_MAX |
Definition at line 229 of file ubusd_acl.c.
anonymous enum |
Enumerator | |
---|---|
ACL_USER | |
ACL_GROUP | |
ACL_ACCESS | |
ACL_PUBLISH | |
ACL_SUBSCRIBE | |
ACL_INHERIT | |
ACL_LISTEN | |
ACL_SEND | |
__ACL_MAX |
Definition at line 319 of file ubusd_acl.c.
|
static |
Definition at line 268 of file ubusd_acl.c.
|
static |
Definition at line 305 of file ubusd_acl.c.
|
static |
Definition at line 298 of file ubusd_acl.c.
|
static |
|
static |
Definition at line 290 of file ubusd_acl.c.
|
static |
int ubusd_acl_check | ( | struct ubus_client * | cl, |
const char * | obj, | ||
const char * | method, | ||
enum ubusd_acl_type | type | ||
) |
Definition at line 90 of file ubusd_acl.c.
|
static |
Definition at line 343 of file ubusd_acl.c.
|
static |
void ubusd_acl_free_client | ( | struct ubus_client * | cl | ) |
void ubusd_acl_init | ( | void | ) |
Definition at line 568 of file ubusd_acl.c.
int ubusd_acl_init_client | ( | struct ubus_client * | cl, |
int | fd | ||
) |
Definition at line 170 of file ubusd_acl.c.
void ubusd_acl_load | ( | void | ) |
Definition at line 445 of file ubusd_acl.c.
|
static |
Definition at line 418 of file ubusd_acl.c.
|
static |
|
static |
Definition at line 560 of file ubusd_acl.c.
|
static |
Definition at line 384 of file ubusd_acl.c.
|
static |
Definition at line 401 of file ubusd_acl.c.
|
static |
Definition at line 480 of file ubusd_acl.c.
|
static |
Definition at line 531 of file ubusd_acl.c.
|
static |
|
static |
Definition at line 75 of file ubusd_acl.c.
|
static |
Definition at line 216 of file ubusd_acl.c.
|
static |
Definition at line 312 of file ubusd_acl.c.
|
static |
Definition at line 71 of file ubusd_acl.c.
const char* ubusd_acl_dir = "/usr/share/acl.d" |
Definition at line 71 of file ubusd_acl.c.
|
static |
Definition at line 74 of file ubusd_acl.c.
|
static |
Definition at line 71 of file ubusd_acl.c.