libmnl  1.0.4
Functions
Netlink attribute helpers

Functions

uint16_t mnl_attr_get_type (const struct nlattr *attr)
 
uint16_t mnl_attr_get_len (const struct nlattr *attr)
 
uint16_t mnl_attr_get_payload_len (const struct nlattr *attr)
 
void * mnl_attr_get_payload (const struct nlattr *attr)
 
bool mnl_attr_ok (const struct nlattr *attr, int len)
 
struct nlattr * mnl_attr_next (const struct nlattr *attr)
 
int mnl_attr_type_valid (const struct nlattr *attr, uint16_t max)
 
int mnl_attr_validate (const struct nlattr *attr, enum mnl_attr_data_type type)
 
int mnl_attr_validate2 (const struct nlattr *attr, enum mnl_attr_data_type type, size_t exp_len)
 
int mnl_attr_parse (const struct nlmsghdr *nlh, unsigned int offset, mnl_attr_cb_t cb, void *data)
 
int mnl_attr_parse_nested (const struct nlattr *nested, mnl_attr_cb_t cb, void *data)
 
int mnl_attr_parse_payload (const void *payload, size_t payload_len, mnl_attr_cb_t cb, void *data)
 
uint8_t mnl_attr_get_u8 (const struct nlattr *attr)
 
uint16_t mnl_attr_get_u16 (const struct nlattr *attr)
 
uint32_t mnl_attr_get_u32 (const struct nlattr *attr)
 
uint64_t mnl_attr_get_u64 (const struct nlattr *attr)
 
const char * mnl_attr_get_str (const struct nlattr *attr)
 
void mnl_attr_put (struct nlmsghdr *nlh, uint16_t type, size_t len, const void *data)
 
void mnl_attr_put_u8 (struct nlmsghdr *nlh, uint16_t type, uint8_t data)
 
void mnl_attr_put_u16 (struct nlmsghdr *nlh, uint16_t type, uint16_t data)
 
void mnl_attr_put_u32 (struct nlmsghdr *nlh, uint16_t type, uint32_t data)
 
void mnl_attr_put_u64 (struct nlmsghdr *nlh, uint16_t type, uint64_t data)
 
void mnl_attr_put_str (struct nlmsghdr *nlh, uint16_t type, const char *data)
 
void mnl_attr_put_strz (struct nlmsghdr *nlh, uint16_t type, const char *data)
 
struct nlattr * mnl_attr_nest_start (struct nlmsghdr *nlh, uint16_t type)
 
bool mnl_attr_put_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, size_t len, const void *data)
 
bool mnl_attr_put_u8_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint8_t data)
 
bool mnl_attr_put_u16_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint16_t data)
 
bool mnl_attr_put_u32_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint32_t data)
 
bool mnl_attr_put_u64_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, uint64_t data)
 
bool mnl_attr_put_str_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, const char *data)
 
bool mnl_attr_put_strz_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type, const char *data)
 
struct nlattr * mnl_attr_nest_start_check (struct nlmsghdr *nlh, size_t buflen, uint16_t type)
 
void mnl_attr_nest_end (struct nlmsghdr *nlh, struct nlattr *start)
 
void mnl_attr_nest_cancel (struct nlmsghdr *nlh, struct nlattr *start)
 

Detailed Description

Netlink Type-Length-Value (TLV) attribute:

        |<-- 2 bytes -->|<-- 2 bytes -->|<-- variable -->|
        -------------------------------------------------
        |     length    |      type     |      value     |
        -------------------------------------------------
        |<--------- header ------------>|<-- payload --->|

The payload of the Netlink message contains sequences of attributes that are expressed in TLV format.