libubox
C utility functions for OpenWrt.
|
Go to the source code of this file.
Data Structures | |
struct | blobmsg_hdr |
struct | blobmsg_policy |
Macros | |
#define | BLOBMSG_ALIGN 2 |
#define | BLOBMSG_PADDING(len) (((len) + (1 << BLOBMSG_ALIGN) - 1) & ~((1 << BLOBMSG_ALIGN) - 1)) |
#define | blobmsg_for_each_attr(pos, attr, rem) |
#define | __blobmsg_for_each_attr(pos, attr, rem) |
Enumerations | |
enum | blobmsg_type { BLOBMSG_TYPE_UNSPEC , BLOBMSG_TYPE_ARRAY , BLOBMSG_TYPE_TABLE , BLOBMSG_TYPE_STRING , BLOBMSG_TYPE_INT64 , BLOBMSG_TYPE_INT32 , BLOBMSG_TYPE_INT16 , BLOBMSG_TYPE_INT8 , BLOBMSG_TYPE_BOOL = BLOBMSG_TYPE_INT8 , BLOBMSG_TYPE_DOUBLE , __BLOBMSG_TYPE_LAST , BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1 , BLOBMSG_CAST_INT64 = __BLOBMSG_TYPE_LAST } |
Functions | |
struct blobmsg_hdr | __attribute__ ((packed)) |
static int | blobmsg_hdrlen (unsigned int namelen) |
static void | blobmsg_clear_name (struct blob_attr *attr) |
static const char * | blobmsg_name (const struct blob_attr *attr) |
static int | blobmsg_type (const struct blob_attr *attr) |
static uint16_t | blobmsg_namelen (const struct blobmsg_hdr *hdr) |
static void * | blobmsg_data (const struct blob_attr *attr) |
static size_t | blobmsg_data_len (const struct blob_attr *attr) |
static size_t | blobmsg_len (const struct blob_attr *attr) |
bool | blobmsg_check_attr (const struct blob_attr *attr, bool name) |
bool | blobmsg_check_attr_len (const struct blob_attr *attr, bool name, size_t len) |
bool | blobmsg_check_attr_list (const struct blob_attr *attr, int type) |
bool | blobmsg_check_attr_list_len (const struct blob_attr *attr, int type, size_t len) |
int | blobmsg_check_array (const struct blob_attr *attr, int type) |
int | blobmsg_check_array_len (const struct blob_attr *attr, int type, size_t len) |
int | blobmsg_parse (const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, void *data, unsigned int len) |
int | blobmsg_parse_array (const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, void *data, unsigned int len) |
int | blobmsg_add_field (struct blob_buf *buf, int type, const char *name, const void *data, unsigned int len) |
static int | blobmsg_parse_attr (const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, struct blob_attr *data) |
static int | blobmsg_parse_array_attr (const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, struct blob_attr *data) |
static int | blobmsg_add_double (struct blob_buf *buf, const char *name, double val) |
static int | blobmsg_add_u8 (struct blob_buf *buf, const char *name, uint8_t val) |
static int | blobmsg_add_u16 (struct blob_buf *buf, const char *name, uint16_t val) |
static int | blobmsg_add_u32 (struct blob_buf *buf, const char *name, uint32_t val) |
static int | blobmsg_add_u64 (struct blob_buf *buf, const char *name, uint64_t val) |
static int | blobmsg_add_string (struct blob_buf *buf, const char *name, const char *string) |
static int | blobmsg_add_blob (struct blob_buf *buf, struct blob_attr *attr) |
void * | blobmsg_open_nested (struct blob_buf *buf, const char *name, bool array) |
static void * | blobmsg_open_array (struct blob_buf *buf, const char *name) |
static void * | blobmsg_open_table (struct blob_buf *buf, const char *name) |
static void | blobmsg_close_array (struct blob_buf *buf, void *cookie) |
static void | blobmsg_close_table (struct blob_buf *buf, void *cookie) |
static int | blobmsg_buf_init (struct blob_buf *buf) |
static uint8_t | blobmsg_get_u8 (struct blob_attr *attr) |
static bool | blobmsg_get_bool (struct blob_attr *attr) |
static uint16_t | blobmsg_get_u16 (struct blob_attr *attr) |
static uint32_t | blobmsg_get_u32 (struct blob_attr *attr) |
static uint64_t | blobmsg_get_u64 (struct blob_attr *attr) |
static uint64_t | blobmsg_cast_u64 (struct blob_attr *attr) |
static int64_t | blobmsg_cast_s64 (struct blob_attr *attr) |
static double | blobmsg_get_double (struct blob_attr *attr) |
static char * | blobmsg_get_string (struct blob_attr *attr) |
void * | blobmsg_alloc_string_buffer (struct blob_buf *buf, const char *name, unsigned int maxlen) |
void * | blobmsg_realloc_string_buffer (struct blob_buf *buf, unsigned int maxlen) |
void | blobmsg_add_string_buffer (struct blob_buf *buf) |
int | blobmsg_vprintf (struct blob_buf *buf, const char *name, const char *format, va_list arg) |
int | blobmsg_printf (struct blob_buf *buf, const char *name, const char *format,...) __attribute__((format(printf |
Variables | |
uint16_t | namelen |
uint8_t | name [] |
struct blobmsg_policy | __attribute__ |
#define __blobmsg_for_each_attr | ( | pos, | |
attr, | |||
rem | |||
) |
#define blobmsg_for_each_attr | ( | pos, | |
attr, | |||
rem | |||
) |
#define BLOBMSG_PADDING | ( | len | ) | (((len) + (1 << BLOBMSG_ALIGN) - 1) & ~((1 << BLOBMSG_ALIGN) - 1)) |
enum blobmsg_type |
struct blobmsg_hdr __attribute__ | ( | (packed) | ) |
Definition at line 241 of file blobmsg.h.
|
inlinestatic |
int blobmsg_add_field | ( | struct blob_buf * | buf, |
int | type, | ||
const char * | name, | ||
const void * | data, | ||
unsigned int | len | ||
) |
Definition at line 377 of file blobmsg.c.
|
inlinestatic |
void blobmsg_add_string_buffer | ( | struct blob_buf * | buf | ) |
Definition at line 361 of file blobmsg.c.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
void* blobmsg_alloc_string_buffer | ( | struct blob_buf * | buf, |
const char * | name, | ||
unsigned int | maxlen | ||
) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
int blobmsg_check_array | ( | const struct blob_attr * | attr, |
int | type | ||
) |
Definition at line 87 of file blobmsg.c.
int blobmsg_check_array_len | ( | const struct blob_attr * | attr, |
int | type, | ||
size_t | len | ||
) |
Definition at line 92 of file blobmsg.c.
bool blobmsg_check_attr | ( | const struct blob_attr * | attr, |
bool | name | ||
) |
bool blobmsg_check_attr_len | ( | const struct blob_attr * | attr, |
bool | name, | ||
size_t | len | ||
) |
Definition at line 58 of file blobmsg.c.
bool blobmsg_check_attr_list | ( | const struct blob_attr * | attr, |
int | type | ||
) |
Definition at line 130 of file blobmsg.c.
bool blobmsg_check_attr_list_len | ( | const struct blob_attr * | attr, |
int | type, | ||
size_t | len | ||
) |
|
inlinestatic |
Definition at line 56 of file blobmsg.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 78 of file blobmsg.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
Definition at line 250 of file blobmsg.h.
void* blobmsg_open_nested | ( | struct blob_buf * | buf, |
const char * | name, | ||
bool | array | ||
) |
Definition at line 266 of file blobmsg.c.
|
inlinestatic |
int blobmsg_parse | ( | const struct blobmsg_policy * | policy, |
int | policy_len, | ||
struct blob_attr ** | tb, | ||
void * | data, | ||
unsigned int | len | ||
) |
int blobmsg_parse_array | ( | const struct blobmsg_policy * | policy, |
int | policy_len, | ||
struct blob_attr ** | tb, | ||
void * | data, | ||
unsigned int | len | ||
) |
|
inlinestatic |
Definition at line 189 of file blobmsg.h.
|
inlinestatic |
Definition at line 182 of file blobmsg.h.
int blobmsg_printf | ( | struct blob_buf * | buf, |
const char * | name, | ||
const char * | format, | ||
... | |||
) |
void* blobmsg_realloc_string_buffer | ( | struct blob_buf * | buf, |
unsigned int | maxlen | ||
) |
|
inlinestatic |
int blobmsg_vprintf | ( | struct blob_buf * | buf, |
const char * | name, | ||
const char * | format, | ||
va_list | arg | ||
) |
struct blobmsg_policy __attribute__ |