18#include <netlink-private/netlink.h>
19#include <netlink/netlink.h>
20#include <netlink/attr.h>
21#include <netlink/utils.h>
22#include <netlink/object.h>
23#include <netlink/route/rtnl.h>
24#include <netlink/route/link/macsec.h>
25#include <netlink-private/route/link/api.h>
26#include <netlink-private/utils.h>
28#include <linux/if_macsec.h>
31#define MACSEC_ATTR_SCI (1 << 0)
32#define MACSEC_ATTR_ICV_LEN (1 << 1)
33#define MACSEC_ATTR_CIPHER_SUITE (1 << 2)
34#define MACSEC_ATTR_WINDOW (1 << 3)
35#define MACSEC_ATTR_ENCODING_SA (1 << 4)
36#define MACSEC_ATTR_ENCRYPT (1 << 5)
37#define MACSEC_ATTR_PROTECT (1 << 6)
38#define MACSEC_ATTR_INC_SCI (1 << 7)
39#define MACSEC_ATTR_ES (1 << 8)
40#define MACSEC_ATTR_SCB (1 << 9)
41#define MACSEC_ATTR_REPLAY_PROTECT (1 << 10)
42#define MACSEC_ATTR_VALIDATION (1 << 11)
43#define MACSEC_ATTR_PORT (1 << 12)
44#define MACSEC_ATTR_OFFLOAD (1 << 13)
50 uint64_t cipher_suite;
53 enum macsec_validation_type validate;
56 uint8_t send_sci, end_station, scb, replay_protect, protect, encrypt, offload;
61#define DEFAULT_ICV_LEN 16
65static struct nla_policy macsec_policy[IFLA_MACSEC_MAX+1] = {
67 [IFLA_MACSEC_ICV_LEN] = { .type =
NLA_U8 },
68 [IFLA_MACSEC_CIPHER_SUITE] = { .type =
NLA_U64 },
69 [IFLA_MACSEC_WINDOW] = { .type =
NLA_U32 },
70 [IFLA_MACSEC_ENCODING_SA] = { .type =
NLA_U8 },
71 [IFLA_MACSEC_ENCRYPT] = { .type =
NLA_U8 },
72 [IFLA_MACSEC_PROTECT] = { .type =
NLA_U8 },
73 [IFLA_MACSEC_INC_SCI] = { .type =
NLA_U8 },
74 [IFLA_MACSEC_ES] = { .type =
NLA_U8 },
75 [IFLA_MACSEC_SCB] = { .type =
NLA_U8 },
76 [IFLA_MACSEC_REPLAY_PROTECT] = { .type =
NLA_U8 },
77 [IFLA_MACSEC_VALIDATION] = { .type =
NLA_U8 },
78 [IFLA_MACSEC_OFFLOAD] = { .type =
NLA_U8 },
91static int macsec_alloc(
struct rtnl_link *link)
93 struct macsec_info *info;
96 link->l_info = malloc(
sizeof(
struct macsec_info));
101 memset(link->l_info, 0,
sizeof(
struct macsec_info));
104 info->cipher_suite = MACSEC_DEFAULT_CIPHER_ID;
105 info->icv_len = DEFAULT_ICV_LEN;
106 info->ce_mask = MACSEC_ATTR_CIPHER_SUITE | MACSEC_ATTR_ICV_LEN;
111static int macsec_parse(
struct rtnl_link *link,
struct nlattr *data,
112 struct nlattr *xstats)
114 struct nlattr *tb[IFLA_MACSEC_MAX+1];
115 struct macsec_info *info;
118 NL_DBG(3,
"Parsing MACsec link info\n");
123 if ((err = macsec_alloc(link)) < 0)
128 if (tb[IFLA_MACSEC_SCI]) {
130 info->ce_mask |= MACSEC_ATTR_SCI;
133 if (tb[IFLA_MACSEC_PROTECT]) {
134 info->protect =
nla_get_u8(tb[IFLA_MACSEC_PROTECT]);
135 info->ce_mask |= MACSEC_ATTR_PROTECT;
138 if (tb[IFLA_MACSEC_CIPHER_SUITE]) {
139 info->cipher_suite =
nla_get_u64(tb[IFLA_MACSEC_CIPHER_SUITE]);
140 info->ce_mask |= MACSEC_ATTR_CIPHER_SUITE;
143 if (tb[IFLA_MACSEC_ICV_LEN]) {
144 info->icv_len =
nla_get_u8(tb[IFLA_MACSEC_ICV_LEN]);
145 info->ce_mask |= MACSEC_ATTR_ICV_LEN;
148 if (tb[IFLA_MACSEC_ENCODING_SA]) {
149 info->encoding_sa =
nla_get_u8(tb[IFLA_MACSEC_ENCODING_SA]);
150 info->ce_mask |= MACSEC_ATTR_ENCODING_SA;
153 if (tb[IFLA_MACSEC_VALIDATION]) {
154 info->validate =
nla_get_u8(tb[IFLA_MACSEC_VALIDATION]);
155 info->ce_mask |= MACSEC_ATTR_VALIDATION;
158 if (tb[IFLA_MACSEC_ENCRYPT]) {
159 info->encrypt =
nla_get_u8(tb[IFLA_MACSEC_ENCRYPT]);
160 info->ce_mask |= MACSEC_ATTR_ENCRYPT;
163 if (tb[IFLA_MACSEC_OFFLOAD]) {
164 info->offload =
nla_get_u8(tb[IFLA_MACSEC_OFFLOAD]);
165 info->ce_mask |= MACSEC_ATTR_OFFLOAD;
168 if (tb[IFLA_MACSEC_INC_SCI]) {
169 info->send_sci =
nla_get_u8(tb[IFLA_MACSEC_INC_SCI]);
170 info->ce_mask |= MACSEC_ATTR_INC_SCI;
173 if (tb[IFLA_MACSEC_ES]) {
174 info->end_station =
nla_get_u8(tb[IFLA_MACSEC_ES]);
175 info->ce_mask |= MACSEC_ATTR_ES;
178 if (tb[IFLA_MACSEC_SCB]) {
180 info->ce_mask |= MACSEC_ATTR_SCB;
183 if (tb[IFLA_MACSEC_REPLAY_PROTECT]) {
184 info->replay_protect =
nla_get_u8(tb[IFLA_MACSEC_REPLAY_PROTECT]);
185 info->ce_mask |= MACSEC_ATTR_REPLAY_PROTECT;
188 if (tb[IFLA_MACSEC_WINDOW]) {
189 info->window =
nla_get_u32(tb[IFLA_MACSEC_WINDOW]);
190 info->ce_mask |= MACSEC_ATTR_WINDOW;
198static void macsec_free(
struct rtnl_link *link)
204static const char *values_on_off[] = {
"off",
"on" };
206static const char *VALIDATE_STR[] = {
207 [MACSEC_VALIDATE_DISABLED] =
"disabled",
208 [MACSEC_VALIDATE_CHECK] =
"check",
209 [MACSEC_VALIDATE_STRICT] =
"strict",
212static char *replay_protect_str(
char *buf, uint8_t replay_protect, uint8_t window)
214 if (replay_protect == 1) {
215 sprintf(buf,
"replay_protect on window %d", window);
216 }
else if (replay_protect == 0) {
217 sprintf(buf,
"replay_protect off");
226#define PRINT_FLAG(buf, i, field, c) ({ if (i->field == 1) *buf++ = c; })
228static char *flags_str(
char *buf,
unsigned char len,
struct macsec_info *info)
233 PRINT_FLAG(tmp, info, protect,
'P');
234 PRINT_FLAG(tmp, info, encrypt,
'E');
235 PRINT_FLAG(tmp, info, send_sci,
'S');
236 PRINT_FLAG(tmp, info, end_station,
'e');
237 PRINT_FLAG(tmp, info, scb,
's');
238 PRINT_FLAG(tmp, info, replay_protect,
'R');
242 switch (info->validate) {
243 case MACSEC_VALIDATE_DISABLED:
246 case MACSEC_VALIDATE_CHECK:
249 case MACSEC_VALIDATE_STRICT:
256 sprintf(tmp,
" %d", info->encoding_sa);
263 struct macsec_info *info = link->l_info;
266 nl_dump(p,
"sci %016llx <%s>", (
long long unsigned)ntohll(info->sci),
267 flags_str(tmp,
sizeof(tmp), info));
272 struct macsec_info *info = link->l_info;
276 " sci %016llx protect %s encoding_sa %d encrypt %s send_sci %s validate %s %s\n",
277 (
long long unsigned)ntohll(info->sci),
278 values_on_off[info->protect], info->encoding_sa,
279 values_on_off[info->encrypt], values_on_off[info->send_sci],
280 VALIDATE_STR[info->validate],
281 replay_protect_str(tmp, info->replay_protect, info->window));
282 nl_dump(p,
" cipher suite: %016llx, icv_len %d\n",
283 (
long long unsigned)info->cipher_suite, info->icv_len);
288 struct macsec_info *copy, *info = src->l_info;
299 memcpy(copy, info,
sizeof(
struct macsec_info));
304static int macsec_put_attrs(
struct nl_msg *msg,
struct rtnl_link *link)
306 struct macsec_info *info = link->l_info;
312 if (info->ce_mask & MACSEC_ATTR_SCI)
314 else if (info->ce_mask & MACSEC_ATTR_PORT)
315 NLA_PUT_U16(msg, IFLA_MACSEC_PORT, htons(info->port));
317 if ((info->ce_mask & MACSEC_ATTR_ENCRYPT))
318 NLA_PUT_U8(msg, IFLA_MACSEC_ENCRYPT, info->encrypt);
320 if ((info->ce_mask & MACSEC_ATTR_OFFLOAD))
321 NLA_PUT_U8(msg, IFLA_MACSEC_OFFLOAD, info->offload);
323 if (info->cipher_suite != MACSEC_DEFAULT_CIPHER_ID || info->icv_len != DEFAULT_ICV_LEN) {
324 NLA_PUT_U64(msg, IFLA_MACSEC_CIPHER_SUITE, info->cipher_suite);
325 NLA_PUT_U8(msg, IFLA_MACSEC_ICV_LEN, info->icv_len);
328 if ((info->ce_mask & MACSEC_ATTR_INC_SCI))
329 NLA_PUT_U8(msg, IFLA_MACSEC_INC_SCI, info->send_sci);
331 if ((info->ce_mask & MACSEC_ATTR_ES))
332 NLA_PUT_U8(msg, IFLA_MACSEC_ES, info->end_station);
334 if ((info->ce_mask & MACSEC_ATTR_SCB))
337 if ((info->ce_mask & MACSEC_ATTR_PROTECT))
338 NLA_PUT_U8(msg, IFLA_MACSEC_PROTECT, info->protect);
340 if ((info->ce_mask & MACSEC_ATTR_REPLAY_PROTECT)) {
341 if (info->replay_protect && !(info->ce_mask & MACSEC_ATTR_WINDOW))
344 NLA_PUT_U8(msg, IFLA_MACSEC_REPLAY_PROTECT, info->replay_protect);
345 NLA_PUT_U32(msg, IFLA_MACSEC_WINDOW, info->window);
348 if ((info->ce_mask & MACSEC_ATTR_VALIDATION))
349 NLA_PUT_U8(msg, IFLA_MACSEC_VALIDATION, info->validate);
351 if ((info->ce_mask & MACSEC_ATTR_ENCODING_SA))
352 NLA_PUT_U8(msg, IFLA_MACSEC_ENCODING_SA, info->encoding_sa);
365 struct macsec_info *a = link_a->l_info;
366 struct macsec_info *b = link_b->l_info;
368 uint32_t attrs = flags & LOOSE_COMPARISON ? b->ce_mask : ~0;
370#define MACSEC_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, MACSEC_ATTR_##ATTR, a, b, EXPR)
372 if (a->ce_mask & MACSEC_ATTR_SCI && b->ce_mask & MACSEC_ATTR_SCI)
373 diff |= MACSEC_DIFF(SCI, a->sci != b->sci);
374 else if (a->ce_mask & MACSEC_ATTR_PORT && b->ce_mask & MACSEC_ATTR_PORT)
375 diff |= MACSEC_DIFF(PORT, a->port != b->port);
377 if (a->ce_mask & MACSEC_ATTR_CIPHER_SUITE && b->ce_mask & MACSEC_ATTR_CIPHER_SUITE) {
378 diff |= MACSEC_DIFF(ICV_LEN, a->icv_len != b->icv_len);
379 diff |= MACSEC_DIFF(CIPHER_SUITE, a->cipher_suite != b->cipher_suite);
382 if (a->ce_mask & MACSEC_ATTR_REPLAY_PROTECT && b->ce_mask & MACSEC_ATTR_REPLAY_PROTECT) {
383 int d = MACSEC_DIFF(REPLAY_PROTECT, a->replay_protect != b->replay_protect);
384 if (a->replay_protect && b->replay_protect)
385 d |= MACSEC_DIFF(WINDOW, a->window != b->window);
389 diff |= MACSEC_DIFF(ENCODING_SA, a->encoding_sa != b->encoding_sa);
390 diff |= MACSEC_DIFF(ENCRYPT, a->encrypt != b->encrypt);
391 diff |= MACSEC_DIFF(PROTECT, a->protect != b->protect);
392 diff |= MACSEC_DIFF(INC_SCI, a->send_sci != b->send_sci);
393 diff |= MACSEC_DIFF(ES, a->end_station != b->end_station);
394 diff |= MACSEC_DIFF(SCB, a->scb != b->scb);
395 diff |= MACSEC_DIFF(VALIDATION, a->validate != b->validate);
402static struct rtnl_link_info_ops macsec_info_ops = {
404 .io_alloc = macsec_alloc,
405 .io_parse = macsec_parse,
410 .io_clone = macsec_clone,
411 .io_put_attrs = macsec_put_attrs,
412 .io_free = macsec_free,
413 .io_compare = macsec_compare,
416static void __init macsec_init(
void)
421static void __exit macsec_exit(
void)
427#define IS_MACSEC_LINK_ASSERT(link) \
428 if ((link)->l_info_ops != &macsec_info_ops) { \
429 APPBUG("Link is not a MACsec link. set type \"macsec\" first."); \
430 return -NLE_OPNOTSUPP; \
434struct rtnl_link *rtnl_link_macsec_alloc(
void)
458 struct macsec_info *info = link->l_info;
460 IS_MACSEC_LINK_ASSERT(link);
463 info->ce_mask |= MACSEC_ATTR_SCI;
478 struct macsec_info *info = link->l_info;
480 IS_MACSEC_LINK_ASSERT(link);
482 if (!(info->ce_mask & MACSEC_ATTR_SCI))
500 struct macsec_info *info = link->l_info;
502 IS_MACSEC_LINK_ASSERT(link);
505 info->ce_mask |= MACSEC_ATTR_PORT;
519 struct macsec_info *info = link->l_info;
521 IS_MACSEC_LINK_ASSERT(link);
523 if (!(info->ce_mask & MACSEC_ATTR_PORT))
532int rtnl_link_macsec_set_cipher_suite(
struct rtnl_link *link, uint64_t cipher_suite)
534 struct macsec_info *info = link->l_info;
536 IS_MACSEC_LINK_ASSERT(link);
538 info->cipher_suite = cipher_suite;
539 info->ce_mask |= MACSEC_ATTR_CIPHER_SUITE;
544int rtnl_link_macsec_get_cipher_suite(
struct rtnl_link *link, uint64_t *cs)
546 struct macsec_info *info = link->l_info;
548 IS_MACSEC_LINK_ASSERT(link);
550 if (!(info->ce_mask & MACSEC_ATTR_CIPHER_SUITE))
554 *cs = info->cipher_suite;
559int rtnl_link_macsec_set_icv_len(
struct rtnl_link *link, uint16_t icv_len)
561 struct macsec_info *info = link->l_info;
563 IS_MACSEC_LINK_ASSERT(link);
565 if (icv_len > MACSEC_STD_ICV_LEN)
568 info->icv_len = icv_len;
569 info->ce_mask |= MACSEC_ATTR_ICV_LEN;
574int rtnl_link_macsec_get_icv_len(
struct rtnl_link *link, uint16_t *icv_len)
576 struct macsec_info *info = link->l_info;
578 IS_MACSEC_LINK_ASSERT(link);
580 if (!(info->ce_mask & MACSEC_ATTR_ICV_LEN))
584 *icv_len = info->icv_len;
589int rtnl_link_macsec_set_protect(
struct rtnl_link *link, uint8_t protect)
591 struct macsec_info *info = link->l_info;
593 IS_MACSEC_LINK_ASSERT(link);
598 info->protect = protect;
599 info->ce_mask |= MACSEC_ATTR_PROTECT;
604int rtnl_link_macsec_get_protect(
struct rtnl_link *link, uint8_t *protect)
606 struct macsec_info *info = link->l_info;
608 IS_MACSEC_LINK_ASSERT(link);
610 if (!(info->ce_mask & MACSEC_ATTR_PROTECT))
614 *protect = info->protect;
619int rtnl_link_macsec_set_encrypt(
struct rtnl_link *link, uint8_t encrypt)
621 struct macsec_info *info = link->l_info;
623 IS_MACSEC_LINK_ASSERT(link);
628 info->encrypt = encrypt;
629 info->ce_mask |= MACSEC_ATTR_ENCRYPT;
634int rtnl_link_macsec_get_encrypt(
struct rtnl_link *link, uint8_t *encrypt)
636 struct macsec_info *info = link->l_info;
638 IS_MACSEC_LINK_ASSERT(link);
640 if (!(info->ce_mask & MACSEC_ATTR_ENCRYPT))
644 *encrypt = info->encrypt;
649int rtnl_link_macsec_set_offload(
struct rtnl_link *link, uint8_t offload)
651 struct macsec_info *info = link->l_info;
653 IS_MACSEC_LINK_ASSERT(link);
658 info->offload = offload;
659 info->ce_mask |= MACSEC_ATTR_OFFLOAD;
664int rtnl_link_macsec_get_offload(
struct rtnl_link *link, uint8_t *offload)
666 struct macsec_info *info = link->l_info;
668 IS_MACSEC_LINK_ASSERT(link);
670 if (!(info->ce_mask & MACSEC_ATTR_OFFLOAD))
674 *offload = info->offload;
679int rtnl_link_macsec_set_encoding_sa(
struct rtnl_link *link, uint8_t encoding_sa)
681 struct macsec_info *info = link->l_info;
683 IS_MACSEC_LINK_ASSERT(link);
688 info->encoding_sa = encoding_sa;
689 info->ce_mask |= MACSEC_ATTR_ENCODING_SA;
694int rtnl_link_macsec_get_encoding_sa(
struct rtnl_link *link, uint8_t *encoding_sa)
696 struct macsec_info *info = link->l_info;
698 IS_MACSEC_LINK_ASSERT(link);
700 if (!(info->ce_mask & MACSEC_ATTR_ENCODING_SA))
704 *encoding_sa = info->encoding_sa;
709int rtnl_link_macsec_set_validation_type(
struct rtnl_link *link,
enum macsec_validation_type validate)
711 struct macsec_info *info = link->l_info;
713 IS_MACSEC_LINK_ASSERT(link);
715 if (validate > MACSEC_VALIDATE_MAX)
718 info->validate = validate;
719 info->ce_mask |= MACSEC_ATTR_VALIDATION;
724int rtnl_link_macsec_get_validation_type(
struct rtnl_link *link,
enum macsec_validation_type *validate)
726 struct macsec_info *info = link->l_info;
728 IS_MACSEC_LINK_ASSERT(link);
730 if (!(info->ce_mask & MACSEC_ATTR_VALIDATION))
734 *validate = info->validate;
739int rtnl_link_macsec_set_replay_protect(
struct rtnl_link *link, uint8_t replay_protect)
741 struct macsec_info *info = link->l_info;
743 IS_MACSEC_LINK_ASSERT(link);
745 if (replay_protect > 1)
748 info->replay_protect = replay_protect;
749 info->ce_mask |= MACSEC_ATTR_REPLAY_PROTECT;
754int rtnl_link_macsec_get_replay_protect(
struct rtnl_link *link, uint8_t *replay_protect)
756 struct macsec_info *info = link->l_info;
758 IS_MACSEC_LINK_ASSERT(link);
760 if (!(info->ce_mask & MACSEC_ATTR_REPLAY_PROTECT))
764 *replay_protect = info->replay_protect;
769int rtnl_link_macsec_set_window(
struct rtnl_link *link, uint32_t window)
771 struct macsec_info *info = link->l_info;
773 IS_MACSEC_LINK_ASSERT(link);
775 info->window = window;
776 info->ce_mask |= MACSEC_ATTR_WINDOW;
781int rtnl_link_macsec_get_window(
struct rtnl_link *link, uint32_t *window)
783 struct macsec_info *info = link->l_info;
785 IS_MACSEC_LINK_ASSERT(link);
787 if (!(info->ce_mask & MACSEC_ATTR_WINDOW))
791 *window = info->window;
796int rtnl_link_macsec_set_send_sci(
struct rtnl_link *link, uint8_t send_sci)
798 struct macsec_info *info = link->l_info;
800 IS_MACSEC_LINK_ASSERT(link);
805 info->send_sci = send_sci;
806 info->ce_mask |= MACSEC_ATTR_INC_SCI;
811int rtnl_link_macsec_get_send_sci(
struct rtnl_link *link, uint8_t *send_sci)
813 struct macsec_info *info = link->l_info;
815 IS_MACSEC_LINK_ASSERT(link);
817 if (!(info->ce_mask & MACSEC_ATTR_INC_SCI))
821 *send_sci = info->send_sci;
826int rtnl_link_macsec_set_end_station(
struct rtnl_link *link, uint8_t end_station)
828 struct macsec_info *info = link->l_info;
830 IS_MACSEC_LINK_ASSERT(link);
835 info->end_station = end_station;
836 info->ce_mask |= MACSEC_ATTR_ES;
841int rtnl_link_macsec_get_end_station(
struct rtnl_link *link, uint8_t *es)
843 struct macsec_info *info = link->l_info;
845 IS_MACSEC_LINK_ASSERT(link);
847 if (!(info->ce_mask & MACSEC_ATTR_ES))
851 *es = info->end_station;
856int rtnl_link_macsec_set_scb(
struct rtnl_link *link, uint8_t scb)
858 struct macsec_info *info = link->l_info;
860 IS_MACSEC_LINK_ASSERT(link);
866 info->ce_mask |= MACSEC_ATTR_SCB;
871int rtnl_link_macsec_get_scb(
struct rtnl_link *link, uint8_t *scb)
873 struct macsec_info *info = link->l_info;
875 IS_MACSEC_LINK_ASSERT(link);
877 if (!(info->ce_mask & MACSEC_ATTR_SCB))
uint32_t nla_get_u32(const struct nlattr *nla)
Return payload of 32 bit integer attribute.
#define NLA_PUT_U16(msg, attrtype, value)
Add 16 bit integer attribute to netlink message.
#define NLA_PUT_U8(msg, attrtype, value)
Add 8 bit integer attribute to netlink message.
uint64_t nla_get_u64(const struct nlattr *nla)
Return payload of u64 attribute.
#define NLA_PUT_U32(msg, attrtype, value)
Add 32 bit integer attribute to netlink message.
uint8_t nla_get_u8(const struct nlattr *nla)
Return value of 8 bit integer attribute.
struct nlattr * nla_nest_start(struct nl_msg *msg, int attrtype)
Start a new level of nested attributes.
int nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla, const struct nla_policy *policy)
Create attribute index based on nested attribute.
#define NLA_PUT_U64(msg, attrtype, value)
Add 64 bit integer attribute to netlink message.
int nla_nest_end(struct nl_msg *msg, struct nlattr *start)
Finalize nesting of attributes.
int rtnl_link_register_info(struct rtnl_link_info_ops *ops)
Register operations for a link info type.
int rtnl_link_unregister_info(struct rtnl_link_info_ops *ops)
Unregister operations for a link info type.
struct rtnl_link * rtnl_link_alloc(void)
Allocate link object.
void rtnl_link_put(struct rtnl_link *link)
Return a link object reference.
int rtnl_link_set_type(struct rtnl_link *link, const char *type)
Set type of link object.
int rtnl_link_macsec_set_sci(struct rtnl_link *link, uint64_t sci)
Set SCI.
int rtnl_link_macsec_get_sci(struct rtnl_link *link, uint64_t *sci)
Get SCI.
int rtnl_link_macsec_set_port(struct rtnl_link *link, uint16_t port)
Set port identifier.
int rtnl_link_macsec_get_port(struct rtnl_link *link, uint16_t *port)
Get port identifier.
void nl_dump(struct nl_dump_params *params, const char *fmt,...)
Dump a formatted character string.
@ NL_DUMP_LINE
Dump object briefly on one line.
@ NL_DUMP_DETAILS
Dump all attributes but no statistics.
Attribute validation policy.
uint16_t type
Type of attribute or NLA_UNSPEC.