libnl 1.1
Data Fields

nla_policy Struct Reference

attribute validation policy More...

#include <attr.h>

Data Fields

uint16_t type
 Type of attribute or NLA_UNSPEC.
uint16_t minlen
 Minimal length of payload required to be available.
uint16_t maxlen
 Maximal length of payload required to be available.

Detailed Description

Policies are defined as arrays of this struct, the array must be accessible by attribute type up to the highest identifier to be expected.

Example:

 static struct nla_policy my_policy[ATTR_MAX+1] __read_mostly = {
        [ATTR_FOO] = { .type = NLA_U16 },
        [ATTR_BAR] = { .type = NLA_STRING },
        [ATTR_BAZ] = { .minlen = sizeof(struct mystruct) },
 };

Definition at line 73 of file attr.h.