libnl 1.1.4
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) },
};
@ NLA_STRING
character string
Definition: attr.h:41
@ NLA_U16
16bit integer
Definition: attr.h:38
attribute validation policy
Definition: attr.h:73
uint16_t type
Type of attribute or NLA_UNSPEC.
Definition: attr.h:75

Definition at line 73 of file attr.h.

Field Documentation

◆ type

uint16_t nla_policy::type

Definition at line 75 of file attr.h.

◆ minlen

uint16_t nla_policy::minlen

Definition at line 78 of file attr.h.

◆ maxlen

uint16_t nla_policy::maxlen

Definition at line 81 of file attr.h.