19#include <netlink-private/netlink.h>
20#include <netlink/netlink.h>
21#include <netlink/attr.h>
22#include <netlink/utils.h>
23#include <netlink/object.h>
24#include <netlink/route/rtnl.h>
25#include <netlink-private/route/link/api.h>
26#include <netlink/route/link/vxlan.h>
28#include <linux/if_link.h>
31#define VXLAN_ATTR_ID (1<<0)
32#define VXLAN_ATTR_GROUP (1<<1)
33#define VXLAN_ATTR_LINK (1<<2)
34#define VXLAN_ATTR_LOCAL (1<<3)
35#define VXLAN_ATTR_TTL (1<<4)
36#define VXLAN_ATTR_TOS (1<<5)
37#define VXLAN_ATTR_LEARNING (1<<6)
38#define VXLAN_ATTR_AGEING (1<<7)
39#define VXLAN_ATTR_LIMIT (1<<8)
40#define VXLAN_ATTR_PORT_RANGE (1<<9)
41#define VXLAN_ATTR_PROXY (1<<10)
42#define VXLAN_ATTR_RSC (1<<11)
43#define VXLAN_ATTR_L2MISS (1<<12)
44#define VXLAN_ATTR_L3MISS (1<<13)
45#define VXLAN_ATTR_GROUP6 (1<<14)
46#define VXLAN_ATTR_LOCAL6 (1<<15)
47#define VXLAN_ATTR_PORT (1<<16)
48#define VXLAN_ATTR_UDP_CSUM (1<<17)
49#define VXLAN_ATTR_UDP_ZERO_CSUM6_TX (1<<18)
50#define VXLAN_ATTR_UDP_ZERO_CSUM6_RX (1<<19)
51#define VXLAN_ATTR_REMCSUM_TX (1<<20)
52#define VXLAN_ATTR_REMCSUM_RX (1<<21)
53#define VXLAN_ATTR_COLLECT_METADATA (1<<22)
54#define VXLAN_ATTR_LABEL (1<<23)
55#define VXLAN_ATTR_FLAGS (1<<24)
61 struct in6_addr vxi_group6;
64 struct in6_addr vxi_local6;
71 struct ifla_vxlan_port_range vxi_port_range;
78 uint8_t vxi_udp_zero_csum6_tx;
79 uint8_t vxi_udp_zero_csum6_rx;
80 uint8_t vxi_remcsum_tx;
81 uint8_t vxi_remcsum_rx;
82 uint8_t vxi_collect_metadata;
89static struct nla_policy vxlan_policy[IFLA_VXLAN_MAX+1] = {
91 [IFLA_VXLAN_GROUP] = { .minlen =
sizeof(uint32_t) },
92 [IFLA_VXLAN_GROUP6] = { .minlen =
sizeof(
struct in6_addr) },
93 [IFLA_VXLAN_LINK] = { .type =
NLA_U32 },
94 [IFLA_VXLAN_LOCAL] = { .minlen =
sizeof(uint32_t) },
95 [IFLA_VXLAN_LOCAL6] = { .minlen =
sizeof(
struct in6_addr) },
96 [IFLA_VXLAN_TTL] = { .type =
NLA_U8 },
97 [IFLA_VXLAN_TOS] = { .type =
NLA_U8 },
98 [IFLA_VXLAN_LABEL] = { .type =
NLA_U32 },
99 [IFLA_VXLAN_LEARNING] = { .type =
NLA_U8 },
100 [IFLA_VXLAN_AGEING] = { .type =
NLA_U32 },
101 [IFLA_VXLAN_LIMIT] = { .type =
NLA_U32 },
102 [IFLA_VXLAN_PORT_RANGE] = { .minlen =
sizeof(
struct ifla_vxlan_port_range) },
103 [IFLA_VXLAN_PROXY] = { .type =
NLA_U8 },
104 [IFLA_VXLAN_RSC] = { .type =
NLA_U8 },
105 [IFLA_VXLAN_L2MISS] = { .type =
NLA_U8 },
106 [IFLA_VXLAN_L3MISS] = { .type =
NLA_U8 },
107 [IFLA_VXLAN_COLLECT_METADATA] = { .type =
NLA_U8 },
108 [IFLA_VXLAN_PORT] = { .type =
NLA_U16 },
109 [IFLA_VXLAN_UDP_CSUM] = { .type =
NLA_U8 },
110 [IFLA_VXLAN_UDP_ZERO_CSUM6_TX] = { .type =
NLA_U8 },
111 [IFLA_VXLAN_UDP_ZERO_CSUM6_RX] = { .type =
NLA_U8 },
112 [IFLA_VXLAN_REMCSUM_TX] = { .type =
NLA_U8 },
113 [IFLA_VXLAN_REMCSUM_RX] = { .type =
NLA_U8 },
114 [IFLA_VXLAN_GBP] = { .type =
NLA_FLAG, },
115 [IFLA_VXLAN_GPE] = { .type =
NLA_FLAG, },
116 [IFLA_VXLAN_REMCSUM_NOPARTIAL] = { .type =
NLA_FLAG },
119static int vxlan_alloc(
struct rtnl_link *link)
121 struct vxlan_info *vxi;
124 memset(link->l_info, 0,
sizeof(*vxi));
126 if ((vxi = calloc(1,
sizeof(*vxi))) == NULL)
135static int vxlan_parse(
struct rtnl_link *link,
struct nlattr *data,
136 struct nlattr *xstats)
138 struct nlattr *tb[IFLA_VXLAN_MAX+1];
139 struct vxlan_info *vxi;
142 NL_DBG(3,
"Parsing VXLAN link info\n");
147 if ((err = vxlan_alloc(link)) < 0)
152 if (tb[IFLA_VXLAN_ID]) {
154 vxi->ce_mask |= VXLAN_ATTR_ID;
157 if (tb[IFLA_VXLAN_GROUP6]) {
158 nla_memcpy(&vxi->vxi_group6, tb[IFLA_VXLAN_GROUP6],
159 sizeof(vxi->vxi_group6));
160 vxi->ce_mask |= VXLAN_ATTR_GROUP6;
163 if (tb[IFLA_VXLAN_GROUP]) {
164 nla_memcpy(&vxi->vxi_group, tb[IFLA_VXLAN_GROUP],
165 sizeof(vxi->vxi_group));
166 vxi->ce_mask |= VXLAN_ATTR_GROUP;
167 vxi->ce_mask &= ~VXLAN_ATTR_GROUP6;
170 if (tb[IFLA_VXLAN_LINK]) {
172 vxi->ce_mask |= VXLAN_ATTR_LINK;
175 if (tb[IFLA_VXLAN_LOCAL6]) {
176 nla_memcpy(&vxi->vxi_local6, tb[IFLA_VXLAN_LOCAL6],
177 sizeof(vxi->vxi_local6));
178 vxi->ce_mask |= VXLAN_ATTR_LOCAL6;
181 if (tb[IFLA_VXLAN_LOCAL]) {
182 nla_memcpy(&vxi->vxi_local, tb[IFLA_VXLAN_LOCAL],
183 sizeof(vxi->vxi_local));
184 vxi->ce_mask |= VXLAN_ATTR_LOCAL;
185 vxi->ce_mask &= ~VXLAN_ATTR_LOCAL6;
188 if (tb[IFLA_VXLAN_TTL]) {
189 vxi->vxi_ttl =
nla_get_u8(tb[IFLA_VXLAN_TTL]);
190 vxi->ce_mask |= VXLAN_ATTR_TTL;
193 if (tb[IFLA_VXLAN_TOS]) {
194 vxi->vxi_tos =
nla_get_u8(tb[IFLA_VXLAN_TOS]);
195 vxi->ce_mask |= VXLAN_ATTR_TOS;
198 if (tb[IFLA_VXLAN_LEARNING]) {
199 vxi->vxi_learning =
nla_get_u8(tb[IFLA_VXLAN_LEARNING]);
200 vxi->ce_mask |= VXLAN_ATTR_LEARNING;
203 if (tb[IFLA_VXLAN_AGEING]) {
204 vxi->vxi_ageing =
nla_get_u32(tb[IFLA_VXLAN_AGEING]);
205 vxi->ce_mask |= VXLAN_ATTR_AGEING;
208 if (tb[IFLA_VXLAN_LIMIT]) {
209 vxi->vxi_limit =
nla_get_u32(tb[IFLA_VXLAN_LIMIT]);
210 vxi->ce_mask |= VXLAN_ATTR_LIMIT;
213 if (tb[IFLA_VXLAN_PORT_RANGE]) {
214 nla_memcpy(&vxi->vxi_port_range, tb[IFLA_VXLAN_PORT_RANGE],
215 sizeof(vxi->vxi_port_range));
216 vxi->ce_mask |= VXLAN_ATTR_PORT_RANGE;
219 if (tb[IFLA_VXLAN_PROXY]) {
220 vxi->vxi_proxy =
nla_get_u8(tb[IFLA_VXLAN_PROXY]);
221 vxi->ce_mask |= VXLAN_ATTR_PROXY;
224 if (tb[IFLA_VXLAN_RSC]) {
225 vxi->vxi_rsc =
nla_get_u8(tb[IFLA_VXLAN_RSC]);
226 vxi->ce_mask |= VXLAN_ATTR_RSC;
229 if (tb[IFLA_VXLAN_L2MISS]) {
230 vxi->vxi_l2miss =
nla_get_u8(tb[IFLA_VXLAN_L2MISS]);
231 vxi->ce_mask |= VXLAN_ATTR_L2MISS;
234 if (tb[IFLA_VXLAN_L3MISS]) {
235 vxi->vxi_l3miss =
nla_get_u8(tb[IFLA_VXLAN_L3MISS]);
236 vxi->ce_mask |= VXLAN_ATTR_L3MISS;
239 if (tb[IFLA_VXLAN_PORT]) {
241 vxi->ce_mask |= VXLAN_ATTR_PORT;
244 if (tb[IFLA_VXLAN_UDP_CSUM]) {
245 vxi->vxi_udp_csum =
nla_get_u8(tb[IFLA_VXLAN_UDP_CSUM]);
246 vxi->ce_mask |= VXLAN_ATTR_UDP_CSUM;
249 if (tb[IFLA_VXLAN_UDP_ZERO_CSUM6_TX]) {
250 vxi->vxi_udp_zero_csum6_tx =
nla_get_u8(tb[IFLA_VXLAN_UDP_ZERO_CSUM6_TX]);
251 vxi->ce_mask |= VXLAN_ATTR_UDP_ZERO_CSUM6_TX;
254 if (tb[IFLA_VXLAN_UDP_ZERO_CSUM6_RX]) {
255 vxi->vxi_udp_zero_csum6_rx =
nla_get_u8(tb[IFLA_VXLAN_UDP_ZERO_CSUM6_RX]);
256 vxi->ce_mask |= VXLAN_ATTR_UDP_ZERO_CSUM6_RX;
259 if (tb[IFLA_VXLAN_REMCSUM_TX]) {
260 vxi->vxi_remcsum_tx =
nla_get_u8(tb[IFLA_VXLAN_REMCSUM_TX]);
261 vxi->ce_mask |= VXLAN_ATTR_REMCSUM_TX;
264 if (tb[IFLA_VXLAN_REMCSUM_RX]) {
265 vxi->vxi_remcsum_rx =
nla_get_u8(tb[IFLA_VXLAN_REMCSUM_RX]);
266 vxi->ce_mask |= VXLAN_ATTR_REMCSUM_RX;
269 if (tb[IFLA_VXLAN_GBP])
270 vxi->vxi_flags |= RTNL_LINK_VXLAN_F_GBP;
272 if (tb[IFLA_VXLAN_REMCSUM_NOPARTIAL])
273 vxi->vxi_flags |= RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL;
275 if (tb[IFLA_VXLAN_COLLECT_METADATA]) {
276 vxi->vxi_collect_metadata =
nla_get_u8(tb[IFLA_VXLAN_COLLECT_METADATA]);
277 vxi->ce_mask |= VXLAN_ATTR_COLLECT_METADATA;
280 if (tb[IFLA_VXLAN_LABEL]) {
281 vxi->vxi_label =
nla_get_u32(tb[IFLA_VXLAN_LABEL]);
282 vxi->ce_mask |= VXLAN_ATTR_LABEL;
285 if (tb[IFLA_VXLAN_GPE])
286 vxi->vxi_flags |= RTNL_LINK_VXLAN_F_GPE;
294static void vxlan_free(
struct rtnl_link *link)
296 struct vxlan_info *vxi = link->l_info;
304 struct vxlan_info *vxi = link->l_info;
306 nl_dump(p,
"vxlan-id %u", vxi->vxi_id);
311 struct vxlan_info *vxi = link->l_info;
312 char *name, addr[INET6_ADDRSTRLEN];
315 nl_dump_line(p,
" vxlan-id %u\n", vxi->vxi_id);
317 if (vxi->ce_mask & VXLAN_ATTR_GROUP) {
319 nl_dump_line(p,
"%s\n",
320 _nl_inet_ntop(AF_INET, &vxi->vxi_group, addr));
321 }
else if (vxi->ce_mask & VXLAN_ATTR_GROUP6) {
323 nl_dump_line(p,
"%s\n",
324 _nl_inet_ntop(AF_INET6, &vxi->vxi_group6, addr));
327 if (vxi->ce_mask & VXLAN_ATTR_LINK) {
331 parent = link_lookup(link->ce_cache, vxi->vxi_link);
336 nl_dump_line(p,
"%s\n", name);
338 nl_dump_line(p,
"%u\n", vxi->vxi_link);
341 if (vxi->ce_mask & VXLAN_ATTR_LOCAL) {
343 nl_dump_line(p,
"%s\n",
344 _nl_inet_ntop(AF_INET, &vxi->vxi_local, addr));
345 }
else if (vxi->ce_mask & VXLAN_ATTR_LOCAL6) {
347 nl_dump_line(p,
"%s\n",
348 _nl_inet_ntop(AF_INET6, &vxi->vxi_local6, addr));
351 if (vxi->ce_mask & VXLAN_ATTR_TTL) {
354 nl_dump_line(p,
"%u\n", vxi->vxi_ttl);
356 nl_dump_line(p,
"inherit\n");
359 if (vxi->ce_mask & VXLAN_ATTR_TOS) {
361 if (vxi->vxi_tos == 1)
362 nl_dump_line(p,
"inherit\n");
364 nl_dump_line(p,
"%#x\n", vxi->vxi_tos);
367 if (vxi->ce_mask & VXLAN_ATTR_LEARNING) {
369 if (vxi->vxi_learning)
370 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_learning);
372 nl_dump_line(p,
"disabled\n");
375 if (vxi->ce_mask & VXLAN_ATTR_AGEING) {
378 nl_dump_line(p,
"%u seconds\n", vxi->vxi_ageing);
380 nl_dump_line(p,
"disabled\n");
383 if (vxi->ce_mask & VXLAN_ATTR_LIMIT) {
386 nl_dump_line(p,
"%u\n", vxi->vxi_limit);
388 nl_dump_line(p,
"unlimited\n");
391 if (vxi->ce_mask & VXLAN_ATTR_PORT_RANGE)
392 nl_dump_line(p,
" port range %u - %u\n",
393 ntohs(vxi->vxi_port_range.low),
394 ntohs(vxi->vxi_port_range.high));
396 if (vxi->ce_mask & VXLAN_ATTR_PROXY) {
399 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_proxy);
401 nl_dump_line(p,
"disabled\n");
404 if (vxi->ce_mask & VXLAN_ATTR_RSC) {
407 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_rsc);
409 nl_dump_line(p,
"disabled\n");
412 if (vxi->ce_mask & VXLAN_ATTR_L2MISS) {
415 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_l2miss);
417 nl_dump_line(p,
"disabled\n");
420 if (vxi->ce_mask & VXLAN_ATTR_L3MISS) {
423 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_l3miss);
425 nl_dump_line(p,
"disabled\n");
428 if (vxi->ce_mask & VXLAN_ATTR_PORT) {
430 nl_dump_line(p,
"%u\n", ntohs(vxi->vxi_port));
433 if (vxi->ce_mask & VXLAN_ATTR_UDP_CSUM) {
435 if (vxi->vxi_udp_csum)
436 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_udp_csum);
438 nl_dump_line(p,
"disabled\n");
441 if (vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_TX) {
442 nl_dump(p,
" udp-zero-csum6-tx ");
443 if (vxi->vxi_udp_zero_csum6_tx)
444 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_udp_zero_csum6_tx);
446 nl_dump_line(p,
"disabled\n");
449 if (vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_RX) {
450 nl_dump(p,
" udp-zero-csum6-rx ");
451 if (vxi->vxi_udp_zero_csum6_rx)
452 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_udp_zero_csum6_rx);
454 nl_dump_line(p,
"disabled\n");
457 if (vxi->ce_mask & VXLAN_ATTR_REMCSUM_TX) {
459 if (vxi->vxi_remcsum_tx)
460 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_remcsum_tx);
462 nl_dump_line(p,
"disabled\n");
465 if (vxi->ce_mask & VXLAN_ATTR_REMCSUM_RX) {
467 if (vxi->vxi_remcsum_rx)
468 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_remcsum_rx);
470 nl_dump_line(p,
"disabled\n");
473 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_GBP)
476 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL)
477 nl_dump(p,
" rncsum-nopartial\n");
479 if (vxi->ce_mask & VXLAN_ATTR_COLLECT_METADATA) {
481 if (vxi->vxi_collect_metadata)
482 nl_dump_line(p,
"enabled (%#x)\n", vxi->vxi_collect_metadata);
484 nl_dump_line(p,
"disabled\n");
487 if (vxi->ce_mask & VXLAN_ATTR_LABEL) {
489 nl_dump_line(p,
"%u\n", ntohl(vxi->vxi_label));
492 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_GPE)
498 struct vxlan_info *vdst, *vsrc = src->l_info;
509 memcpy(vdst, vsrc,
sizeof(
struct vxlan_info));
514static int vxlan_put_attrs(
struct nl_msg *msg,
struct rtnl_link *link)
516 struct vxlan_info *vxi = link->l_info;
522 if (vxi->ce_mask & VXLAN_ATTR_ID)
525 if (vxi->ce_mask & VXLAN_ATTR_GROUP)
526 NLA_PUT(msg, IFLA_VXLAN_GROUP,
sizeof(vxi->vxi_group), &vxi->vxi_group);
528 if (vxi->ce_mask & VXLAN_ATTR_GROUP6)
529 NLA_PUT(msg, IFLA_VXLAN_GROUP6,
sizeof(vxi->vxi_group6), &vxi->vxi_group6);
531 if (vxi->ce_mask & VXLAN_ATTR_LINK)
534 if (vxi->ce_mask & VXLAN_ATTR_LOCAL)
535 NLA_PUT(msg, IFLA_VXLAN_LOCAL,
sizeof(vxi->vxi_local), &vxi->vxi_local);
537 if (vxi->ce_mask & VXLAN_ATTR_LOCAL6)
538 NLA_PUT(msg, IFLA_VXLAN_LOCAL6,
sizeof(vxi->vxi_local6), &vxi->vxi_local6);
540 if (vxi->ce_mask & VXLAN_ATTR_TTL)
541 NLA_PUT_U8(msg, IFLA_VXLAN_TTL, vxi->vxi_ttl);
543 if (vxi->ce_mask & VXLAN_ATTR_TOS)
544 NLA_PUT_U8(msg, IFLA_VXLAN_TOS, vxi->vxi_tos);
546 if (vxi->ce_mask & VXLAN_ATTR_LEARNING)
547 NLA_PUT_U8(msg, IFLA_VXLAN_LEARNING, vxi->vxi_learning);
549 if (vxi->ce_mask & VXLAN_ATTR_AGEING)
550 NLA_PUT_U32(msg, IFLA_VXLAN_AGEING, vxi->vxi_ageing);
552 if (vxi->ce_mask & VXLAN_ATTR_LIMIT)
553 NLA_PUT_U32(msg, IFLA_VXLAN_LIMIT, vxi->vxi_limit);
555 if (vxi->ce_mask & VXLAN_ATTR_PORT_RANGE)
556 NLA_PUT(msg, IFLA_VXLAN_PORT_RANGE,
sizeof(vxi->vxi_port_range),
557 &vxi->vxi_port_range);
559 if (vxi->ce_mask & VXLAN_ATTR_PROXY)
560 NLA_PUT_U8(msg, IFLA_VXLAN_PROXY, vxi->vxi_proxy);
562 if (vxi->ce_mask & VXLAN_ATTR_RSC)
563 NLA_PUT_U8(msg, IFLA_VXLAN_RSC, vxi->vxi_rsc);
565 if (vxi->ce_mask & VXLAN_ATTR_L2MISS)
566 NLA_PUT_U8(msg, IFLA_VXLAN_L2MISS, vxi->vxi_l2miss);
568 if (vxi->ce_mask & VXLAN_ATTR_L3MISS)
569 NLA_PUT_U8(msg, IFLA_VXLAN_L3MISS, vxi->vxi_l3miss);
571 if (vxi->ce_mask & VXLAN_ATTR_PORT)
574 if (vxi->ce_mask & VXLAN_ATTR_UDP_CSUM)
575 NLA_PUT_U8(msg, IFLA_VXLAN_UDP_CSUM, vxi->vxi_udp_csum);
577 if (vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_TX)
578 NLA_PUT_U8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, vxi->vxi_udp_zero_csum6_tx);
580 if (vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_RX)
581 NLA_PUT_U8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, vxi->vxi_udp_zero_csum6_rx);
583 if (vxi->ce_mask & VXLAN_ATTR_REMCSUM_TX)
584 NLA_PUT_U8(msg, IFLA_VXLAN_REMCSUM_TX, vxi->vxi_remcsum_tx);
586 if (vxi->ce_mask & VXLAN_ATTR_REMCSUM_RX)
587 NLA_PUT_U8(msg, IFLA_VXLAN_REMCSUM_RX, vxi->vxi_remcsum_rx);
589 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_GBP)
592 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL)
595 if (vxi->ce_mask & VXLAN_ATTR_COLLECT_METADATA)
596 NLA_PUT_U8(msg, IFLA_VXLAN_COLLECT_METADATA, vxi->vxi_collect_metadata);
598 if (vxi->ce_mask & VXLAN_ATTR_LABEL)
599 NLA_PUT_U32(msg, IFLA_VXLAN_LABEL, vxi->vxi_label);
601 if (vxi->vxi_flags & RTNL_LINK_VXLAN_F_GPE)
614 struct vxlan_info *a = link_a->l_info;
615 struct vxlan_info *b = link_b->l_info;
617 uint32_t attrs = flags & LOOSE_COMPARISON ? b->ce_mask : ~0;
619#define VXLAN_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, VXLAN_ATTR_##ATTR, a, b, EXPR)
621 diff |= VXLAN_DIFF(ID, a->vxi_id != b->vxi_id);
622 diff |= VXLAN_DIFF(GROUP, a->vxi_group != b->vxi_group);
623 diff |= VXLAN_DIFF(LINK, a->vxi_link != b->vxi_link);
624 diff |= VXLAN_DIFF(LOCAL, a->vxi_local != b->vxi_local);
625 diff |= VXLAN_DIFF(TOS, a->vxi_tos != b->vxi_tos);
626 diff |= VXLAN_DIFF(TTL, a->vxi_ttl != b->vxi_ttl);
627 diff |= VXLAN_DIFF(LEARNING, a->vxi_learning != b->vxi_learning);
628 diff |= VXLAN_DIFF(AGEING, a->vxi_ageing != b->vxi_ageing);
629 diff |= VXLAN_DIFF(LIMIT, a->vxi_limit != b->vxi_limit);
630 diff |= VXLAN_DIFF(PORT_RANGE,
631 a->vxi_port_range.low != b->vxi_port_range.low);
632 diff |= VXLAN_DIFF(PORT_RANGE,
633 a->vxi_port_range.high != b->vxi_port_range.high);
634 diff |= VXLAN_DIFF(PROXY, a->vxi_proxy != b->vxi_proxy);
635 diff |= VXLAN_DIFF(RSC, a->vxi_proxy != b->vxi_proxy);
636 diff |= VXLAN_DIFF(L2MISS, a->vxi_proxy != b->vxi_proxy);
637 diff |= VXLAN_DIFF(L3MISS, a->vxi_proxy != b->vxi_proxy);
638 diff |= VXLAN_DIFF(PORT, a->vxi_port != b->vxi_port);
639 diff |= VXLAN_DIFF(GROUP6, memcmp(&a->vxi_group6, &b->vxi_group6,
sizeof(a->vxi_group6)) != 0);
640 diff |= VXLAN_DIFF(LOCAL6, memcmp(&a->vxi_local6, &b->vxi_local6,
sizeof(a->vxi_local6)) != 0);
641 diff |= VXLAN_DIFF(UDP_CSUM, a->vxi_proxy != b->vxi_proxy);
642 diff |= VXLAN_DIFF(UDP_ZERO_CSUM6_TX, a->vxi_proxy != b->vxi_proxy);
643 diff |= VXLAN_DIFF(UDP_ZERO_CSUM6_RX, a->vxi_proxy != b->vxi_proxy);
644 diff |= VXLAN_DIFF(REMCSUM_TX, a->vxi_proxy != b->vxi_proxy);
645 diff |= VXLAN_DIFF(REMCSUM_RX, a->vxi_proxy != b->vxi_proxy);
646 diff |= VXLAN_DIFF(COLLECT_METADATA, a->vxi_collect_metadata != b->vxi_collect_metadata);
647 diff |= VXLAN_DIFF(LABEL, a->vxi_label != b->vxi_label);
648 diff |= VXLAN_DIFF(FLAGS, a->vxi_flags != b->vxi_flags);
654static struct rtnl_link_info_ops vxlan_info_ops = {
656 .io_alloc = vxlan_alloc,
657 .io_parse = vxlan_parse,
662 .io_clone = vxlan_clone,
663 .io_put_attrs = vxlan_put_attrs,
664 .io_free = vxlan_free,
665 .io_compare = vxlan_compare,
669#define IS_VXLAN_LINK_ASSERT(link) \
670 if ((link)->l_info_ops != &vxlan_info_ops) { \
671 APPBUG("Link is not a vxlan link. set type \"vxlan\" first."); \
672 return -NLE_OPNOTSUPP; \
709 return link->l_info_ops && !strcmp(link->l_info_ops->io_name,
"vxlan");
721 struct vxlan_info *vxi = link->l_info;
723 IS_VXLAN_LINK_ASSERT(link);
725 if (
id > VXLAN_ID_MAX)
729 vxi->ce_mask |= VXLAN_ATTR_ID;
743 struct vxlan_info *vxi = link->l_info;
745 IS_VXLAN_LINK_ASSERT(link);
750 if (vxi->ce_mask & VXLAN_ATTR_ID)
767 struct vxlan_info *vxi = link->l_info;
769 IS_VXLAN_LINK_ASSERT(link);
774 sizeof(vxi->vxi_group));
775 vxi->ce_mask |= VXLAN_ATTR_GROUP;
776 vxi->ce_mask &= ~VXLAN_ATTR_GROUP6;
780 sizeof(vxi->vxi_group6));
781 vxi->ce_mask |= VXLAN_ATTR_GROUP6;
782 vxi->ce_mask &= ~VXLAN_ATTR_GROUP;
798 struct vxlan_info *vxi = link->l_info;
800 IS_VXLAN_LINK_ASSERT(link);
805 if (vxi->ce_mask & VXLAN_ATTR_GROUP)
806 *addr =
nl_addr_build(AF_INET, &vxi->vxi_group,
sizeof(vxi->vxi_group));
807 else if (vxi->ce_mask & VXLAN_ATTR_GROUP6)
808 *addr =
nl_addr_build(AF_INET6, &vxi->vxi_group6,
sizeof(vxi->vxi_group6));
824 struct vxlan_info *vxi = link->l_info;
826 IS_VXLAN_LINK_ASSERT(link);
828 vxi->vxi_link = index;
829 vxi->ce_mask |= VXLAN_ATTR_LINK;
843 struct vxlan_info *vxi = link->l_info;
845 IS_VXLAN_LINK_ASSERT(link);
850 if (!(vxi->ce_mask & VXLAN_ATTR_LINK))
853 *index = vxi->vxi_link;
867 struct vxlan_info *vxi = link->l_info;
869 IS_VXLAN_LINK_ASSERT(link);
874 sizeof(vxi->vxi_local));
875 vxi->ce_mask |= VXLAN_ATTR_LOCAL;
876 vxi->ce_mask &= ~VXLAN_ATTR_LOCAL6;
880 sizeof(vxi->vxi_local6));
881 vxi->ce_mask |= VXLAN_ATTR_LOCAL6;
882 vxi->ce_mask &= ~VXLAN_ATTR_LOCAL;
898 struct vxlan_info *vxi = link->l_info;
900 IS_VXLAN_LINK_ASSERT(link);
905 if (vxi->ce_mask & VXLAN_ATTR_LOCAL)
906 *addr =
nl_addr_build(AF_INET, &vxi->vxi_local,
sizeof(vxi->vxi_local));
907 else if (vxi->ce_mask & VXLAN_ATTR_LOCAL6)
908 *addr =
nl_addr_build(AF_INET6, &vxi->vxi_local6,
sizeof(vxi->vxi_local6));
924 struct vxlan_info *vxi = link->l_info;
926 IS_VXLAN_LINK_ASSERT(link);
929 vxi->ce_mask |= VXLAN_ATTR_TTL;
942 struct vxlan_info *vxi = link->l_info;
944 IS_VXLAN_LINK_ASSERT(link);
946 if (!(vxi->ce_mask & VXLAN_ATTR_TTL))
961 struct vxlan_info *vxi = link->l_info;
963 IS_VXLAN_LINK_ASSERT(link);
966 vxi->ce_mask |= VXLAN_ATTR_TOS;
979 struct vxlan_info *vxi = link->l_info;
981 IS_VXLAN_LINK_ASSERT(link);
983 if (!(vxi->ce_mask & VXLAN_ATTR_TOS))
998 struct vxlan_info *vxi = link->l_info;
1000 IS_VXLAN_LINK_ASSERT(link);
1002 vxi->vxi_learning = learning;
1003 vxi->ce_mask |= VXLAN_ATTR_LEARNING;
1016 struct vxlan_info *vxi = link->l_info;
1018 IS_VXLAN_LINK_ASSERT(link);
1020 if (!(vxi->ce_mask & VXLAN_ATTR_LEARNING))
1023 return vxi->vxi_learning;
1057 struct vxlan_info *vxi = link->l_info;
1059 IS_VXLAN_LINK_ASSERT(link);
1061 vxi->vxi_ageing = expiry;
1062 vxi->ce_mask |= VXLAN_ATTR_AGEING;
1076 struct vxlan_info *vxi = link->l_info;
1078 IS_VXLAN_LINK_ASSERT(link);
1083 if (vxi->ce_mask & VXLAN_ATTR_AGEING)
1084 *expiry = vxi->vxi_ageing;
1100 struct vxlan_info *vxi = link->l_info;
1102 IS_VXLAN_LINK_ASSERT(link);
1104 vxi->vxi_limit = limit;
1105 vxi->ce_mask |= VXLAN_ATTR_LIMIT;
1119 struct vxlan_info *vxi = link->l_info;
1121 IS_VXLAN_LINK_ASSERT(link);
1126 if (vxi->ce_mask & VXLAN_ATTR_LIMIT)
1127 *limit = vxi->vxi_limit;
1142 struct ifla_vxlan_port_range *range)
1144 struct vxlan_info *vxi = link->l_info;
1146 IS_VXLAN_LINK_ASSERT(link);
1151 memcpy(&vxi->vxi_port_range, range,
sizeof(vxi->vxi_port_range));
1152 vxi->ce_mask |= VXLAN_ATTR_PORT_RANGE;
1165 struct ifla_vxlan_port_range *range)
1167 struct vxlan_info *vxi = link->l_info;
1169 IS_VXLAN_LINK_ASSERT(link);
1174 if (vxi->ce_mask & VXLAN_ATTR_PORT_RANGE)
1175 memcpy(range, &vxi->vxi_port_range,
sizeof(*range));
1191 struct vxlan_info *vxi = link->l_info;
1193 IS_VXLAN_LINK_ASSERT(link);
1195 vxi->vxi_proxy = proxy;
1196 vxi->ce_mask |= VXLAN_ATTR_PROXY;
1209 struct vxlan_info *vxi = link->l_info;
1211 IS_VXLAN_LINK_ASSERT(link);
1213 if (!(vxi->ce_mask & VXLAN_ATTR_PROXY))
1216 return vxi->vxi_proxy;
1250 struct vxlan_info *vxi = link->l_info;
1252 IS_VXLAN_LINK_ASSERT(link);
1255 vxi->ce_mask |= VXLAN_ATTR_RSC;
1268 struct vxlan_info *vxi = link->l_info;
1270 IS_VXLAN_LINK_ASSERT(link);
1272 if (!(vxi->ce_mask & VXLAN_ATTR_RSC))
1275 return vxi->vxi_rsc;
1309 struct vxlan_info *vxi = link->l_info;
1311 IS_VXLAN_LINK_ASSERT(link);
1313 vxi->vxi_l2miss = miss;
1314 vxi->ce_mask |= VXLAN_ATTR_L2MISS;
1327 struct vxlan_info *vxi = link->l_info;
1329 IS_VXLAN_LINK_ASSERT(link);
1331 if (!(vxi->ce_mask & VXLAN_ATTR_L2MISS))
1334 return vxi->vxi_l2miss;
1368 struct vxlan_info *vxi = link->l_info;
1370 IS_VXLAN_LINK_ASSERT(link);
1372 vxi->vxi_l3miss = miss;
1373 vxi->ce_mask |= VXLAN_ATTR_L3MISS;
1386 struct vxlan_info *vxi = link->l_info;
1388 IS_VXLAN_LINK_ASSERT(link);
1390 if (!(vxi->ce_mask & VXLAN_ATTR_L3MISS))
1393 return vxi->vxi_l3miss;
1427 struct vxlan_info *vxi = link->l_info;
1429 IS_VXLAN_LINK_ASSERT(link);
1431 vxi->vxi_port = htons(port);
1432 vxi->ce_mask |= VXLAN_ATTR_PORT;
1446 struct vxlan_info *vxi = link->l_info;
1448 IS_VXLAN_LINK_ASSERT(link);
1453 if (!(vxi->ce_mask & VXLAN_ATTR_PORT))
1456 *port = ntohs(vxi->vxi_port);
1470 struct vxlan_info *vxi = link->l_info;
1472 IS_VXLAN_LINK_ASSERT(link);
1474 vxi->vxi_udp_csum = csum;
1475 vxi->ce_mask |= VXLAN_ATTR_UDP_CSUM;
1488 struct vxlan_info *vxi = link->l_info;
1490 IS_VXLAN_LINK_ASSERT(link);
1492 if (!(vxi->ce_mask & VXLAN_ATTR_UDP_CSUM))
1495 return vxi->vxi_udp_csum;
1507 struct vxlan_info *vxi = link->l_info;
1509 IS_VXLAN_LINK_ASSERT(link);
1511 vxi->vxi_udp_zero_csum6_tx = csum;
1512 vxi->ce_mask |= VXLAN_ATTR_UDP_ZERO_CSUM6_TX;
1525 struct vxlan_info *vxi = link->l_info;
1527 IS_VXLAN_LINK_ASSERT(link);
1529 if (!(vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_TX))
1532 return vxi->vxi_udp_zero_csum6_tx;
1544 struct vxlan_info *vxi = link->l_info;
1546 IS_VXLAN_LINK_ASSERT(link);
1548 vxi->vxi_udp_zero_csum6_rx = csum;
1549 vxi->ce_mask |= VXLAN_ATTR_UDP_ZERO_CSUM6_RX;
1562 struct vxlan_info *vxi = link->l_info;
1564 IS_VXLAN_LINK_ASSERT(link);
1566 if (!(vxi->ce_mask & VXLAN_ATTR_UDP_ZERO_CSUM6_RX))
1569 return vxi->vxi_udp_zero_csum6_rx;
1581 struct vxlan_info *vxi = link->l_info;
1583 IS_VXLAN_LINK_ASSERT(link);
1585 vxi->vxi_remcsum_tx = csum;
1586 vxi->ce_mask |= VXLAN_ATTR_REMCSUM_TX;
1599 struct vxlan_info *vxi = link->l_info;
1601 IS_VXLAN_LINK_ASSERT(link);
1603 if (!(vxi->ce_mask & VXLAN_ATTR_REMCSUM_TX))
1606 return vxi->vxi_remcsum_tx;
1618 struct vxlan_info *vxi = link->l_info;
1620 IS_VXLAN_LINK_ASSERT(link);
1622 vxi->vxi_remcsum_rx = csum;
1623 vxi->ce_mask |= VXLAN_ATTR_REMCSUM_RX;
1636 struct vxlan_info *vxi = link->l_info;
1638 IS_VXLAN_LINK_ASSERT(link);
1640 if (!(vxi->ce_mask & VXLAN_ATTR_REMCSUM_RX))
1643 return vxi->vxi_remcsum_rx;
1655 struct vxlan_info *vxi = link->l_info;
1657 IS_VXLAN_LINK_ASSERT(link);
1659 vxi->vxi_collect_metadata = collect;
1660 vxi->ce_mask |= VXLAN_ATTR_COLLECT_METADATA;
1673 struct vxlan_info *vxi = link->l_info;
1675 IS_VXLAN_LINK_ASSERT(link);
1677 if (!(vxi->ce_mask & VXLAN_ATTR_COLLECT_METADATA))
1680 return vxi->vxi_collect_metadata;
1692 struct vxlan_info *vxi = link->l_info;
1694 IS_VXLAN_LINK_ASSERT(link);
1696 vxi->vxi_label = htonl(label);
1697 vxi->ce_mask |= VXLAN_ATTR_LABEL;
1711 struct vxlan_info *vxi = link->l_info;
1713 IS_VXLAN_LINK_ASSERT(link);
1718 if (!(vxi->ce_mask & VXLAN_ATTR_LABEL))
1721 *label = ntohl(vxi->vxi_label);
1736 struct vxlan_info *vxi = link->l_info;
1738 IS_VXLAN_LINK_ASSERT(link);
1740 if (flags & ~(RTNL_LINK_VXLAN_F_GBP | RTNL_LINK_VXLAN_F_GPE | RTNL_LINK_VXLAN_F_REMCSUM_NOPARTIAL))
1744 vxi->vxi_flags |= flags;
1746 vxi->vxi_flags &= ~flags;
1760 struct vxlan_info *vxi = link->l_info;
1762 IS_VXLAN_LINK_ASSERT(link);
1764 *out_flags = vxi->vxi_flags;
1770static void __init vxlan_init(
void)
1775static void __exit vxlan_exit(
void)
struct nl_addr * nl_addr_build(int family, const void *buf, size_t size)
Allocate abstract address based on a binary address.
void * nl_addr_get_binary_addr(const struct nl_addr *addr)
Get binary address of abstract address object.
int nl_addr_get_family(const struct nl_addr *addr)
Return address family.
unsigned int nl_addr_get_len(const struct nl_addr *addr)
Get length of binary address of abstract address object.
uint32_t nla_get_u32(const struct nlattr *nla)
Return payload of 32 bit integer attribute.
uint16_t nla_get_u16(const struct nlattr *nla)
Return payload of 16 bit integer attribute.
#define NLA_PUT_FLAG(msg, attrtype)
Add flag attribute to netlink message.
#define NLA_PUT_U8(msg, attrtype, value)
Add 8 bit integer attribute to netlink message.
#define NLA_PUT(msg, attrtype, attrlen, data)
Add unspecific attribute to netlink message.
#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.
int nla_memcpy(void *dest, const struct nlattr *src, int count)
Copy attribute payload to another memory area.
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.
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.
char * rtnl_link_get_name(struct rtnl_link *link)
Return name of 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.
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.
int rtnl_link_vxlan_get_tos(struct rtnl_link *link)
Get IP ToS value to use for VXLAN.
int rtnl_link_vxlan_get_rsc(struct rtnl_link *link)
Get Route Short Circuit status to use for VXLAN.
int rtnl_link_vxlan_disable_learning(struct rtnl_link *link)
Disable VXLAN address learning.
int rtnl_link_vxlan_get_port_range(struct rtnl_link *link, struct ifla_vxlan_port_range *range)
Get range of UDP port numbers to use for VXLAN.
int rtnl_link_vxlan_set_udp_zero_csum6_rx(struct rtnl_link *link, uint8_t csum)
Set skip UDP checksum received over IPv6 status to use for VXLAN.
int rtnl_link_vxlan_get_ttl(struct rtnl_link *link)
Get IP TTL value to use for VXLAN.
int rtnl_link_vxlan_get_learning(struct rtnl_link *link)
Get VXLAN learning status.
int rtnl_link_vxlan_set_learning(struct rtnl_link *link, uint8_t learning)
Set VXLAN learning status.
int rtnl_link_vxlan_get_label(struct rtnl_link *link, uint32_t *label)
Get flow label to use for VXLAN.
int rtnl_link_vxlan_set_tos(struct rtnl_link *link, uint8_t tos)
Set IP ToS value to use for VXLAN.
int rtnl_link_vxlan_set_port(struct rtnl_link *link, uint32_t port)
Set UDP destination port to use for VXLAN.
int rtnl_link_vxlan_get_proxy(struct rtnl_link *link)
Get ARP proxy status to use for VXLAN.
int rtnl_link_vxlan_enable_rsc(struct rtnl_link *link)
Enable Route Short Circuit.
int rtnl_link_vxlan_set_group(struct rtnl_link *link, struct nl_addr *addr)
Set VXLAN multicast IP address.
int rtnl_link_vxlan_enable_proxy(struct rtnl_link *link)
Enable ARP proxy.
int rtnl_link_vxlan_disable_l3miss(struct rtnl_link *link)
Disable netlink IP ADDR miss notifications.
int rtnl_link_vxlan_set_local(struct rtnl_link *link, struct nl_addr *addr)
Set source address to use for VXLAN.
int rtnl_link_vxlan_set_remcsum_rx(struct rtnl_link *link, uint8_t csum)
Set remote offload receive checksum status to use for VXLAN.
int rtnl_link_vxlan_set_flags(struct rtnl_link *link, uint32_t flags, int enable)
Set VXLAN flags RTNL_LINK_VXLAN_F_*.
int rtnl_link_vxlan_set_udp_csum(struct rtnl_link *link, uint8_t csum)
Set UDP checksum status to use for VXLAN.
int rtnl_link_vxlan_get_udp_zero_csum6_rx(struct rtnl_link *link)
Get skip UDP checksum received over IPv6 status to use for VXLAN.
int rtnl_link_vxlan_set_link(struct rtnl_link *link, uint32_t index)
Set physical device to use for VXLAN.
int rtnl_link_vxlan_enable_l2miss(struct rtnl_link *link)
Enable netlink LLADDR miss notifications.
int rtnl_link_vxlan_get_flags(struct rtnl_link *link, uint32_t *out_flags)
Get VXLAN flags RTNL_LINK_VXLAN_F_*.
int rtnl_link_vxlan_get_remcsum_rx(struct rtnl_link *link)
Get remote offload receive checksum status to use for VXLAN.
int rtnl_link_vxlan_get_group(struct rtnl_link *link, struct nl_addr **addr)
Get VXLAN multicast IP address.
int rtnl_link_vxlan_set_port_range(struct rtnl_link *link, struct ifla_vxlan_port_range *range)
Set range of UDP port numbers to use for VXLAN.
int rtnl_link_vxlan_set_collect_metadata(struct rtnl_link *link, uint8_t collect)
Set collect metadata status to use for VXLAN.
int rtnl_link_vxlan_get_l2miss(struct rtnl_link *link)
Get netlink LLADDR miss notification status to use for VXLAN.
int rtnl_link_vxlan_set_id(struct rtnl_link *link, uint32_t id)
Set VXLAN Network Identifier.
int rtnl_link_vxlan_get_collect_metadata(struct rtnl_link *link)
Get collect metadata status to use for VXLAN.
int rtnl_link_vxlan_disable_l2miss(struct rtnl_link *link)
Disable netlink LLADDR miss notifications.
int rtnl_link_vxlan_set_limit(struct rtnl_link *link, uint32_t limit)
Set maximum number of forwarding database entries to use for VXLAN.
int rtnl_link_vxlan_set_label(struct rtnl_link *link, uint32_t label)
Set flow label to use for VXLAN.
int rtnl_link_is_vxlan(struct rtnl_link *link)
Check if link is a VXLAN link.
int rtnl_link_vxlan_set_remcsum_tx(struct rtnl_link *link, uint8_t csum)
Set remote offload transmit checksum status to use for VXLAN.
int rtnl_link_vxlan_get_local(struct rtnl_link *link, struct nl_addr **addr)
Get source address to use for VXLAN.
int rtnl_link_vxlan_get_link(struct rtnl_link *link, uint32_t *index)
Get physical device to use for VXLAN.
int rtnl_link_vxlan_set_proxy(struct rtnl_link *link, uint8_t proxy)
Set ARP proxy status to use for VXLAN.
int rtnl_link_vxlan_enable_learning(struct rtnl_link *link)
Enable VXLAN address learning.
int rtnl_link_vxlan_set_ttl(struct rtnl_link *link, uint8_t ttl)
Set IP TTL value to use for VXLAN.
struct rtnl_link * rtnl_link_vxlan_alloc(void)
Allocate link object of type VXLAN.
int rtnl_link_vxlan_get_udp_zero_csum6_tx(struct rtnl_link *link)
Get skip UDP checksum transmitted over IPv6 status to use for VXLAN.
int rtnl_link_vxlan_get_l3miss(struct rtnl_link *link)
Get netlink IP ADDR miss notification status to use for VXLAN.
int rtnl_link_vxlan_get_remcsum_tx(struct rtnl_link *link)
Get remote offload transmit checksum status to use for VXLAN.
int rtnl_link_vxlan_get_port(struct rtnl_link *link, uint32_t *port)
Get UDP destination port to use for VXLAN.
int rtnl_link_vxlan_disable_proxy(struct rtnl_link *link)
Disable ARP proxy.
int rtnl_link_vxlan_set_l2miss(struct rtnl_link *link, uint8_t miss)
Set netlink LLADDR miss notification status to use for VXLAN.
int rtnl_link_vxlan_set_ageing(struct rtnl_link *link, uint32_t expiry)
Set expiration timer value to use for VXLAN.
int rtnl_link_vxlan_get_id(struct rtnl_link *link, uint32_t *id)
Get VXLAN Network Identifier.
int rtnl_link_vxlan_disable_rsc(struct rtnl_link *link)
Disable Route Short Circuit.
int rtnl_link_vxlan_set_rsc(struct rtnl_link *link, uint8_t rsc)
Set Route Short Circuit status to use for VXLAN.
int rtnl_link_vxlan_set_l3miss(struct rtnl_link *link, uint8_t miss)
Set netlink IP ADDR miss notification status to use for VXLAN.
int rtnl_link_vxlan_set_udp_zero_csum6_tx(struct rtnl_link *link, uint8_t csum)
Set skip UDP checksum transmitted over IPv6 status to use for VXLAN.
int rtnl_link_vxlan_get_udp_csum(struct rtnl_link *link)
Get UDP checksum status to use for VXLAN.
int rtnl_link_vxlan_enable_l3miss(struct rtnl_link *link)
Enable netlink IP ADDR miss notifications.
int rtnl_link_vxlan_get_limit(struct rtnl_link *link, uint32_t *limit)
Get maximum number of forwarding database entries to use for VXLAN.
int rtnl_link_vxlan_get_ageing(struct rtnl_link *link, uint32_t *expiry)
Get expiration timer value to use for VXLAN.
Attribute validation policy.
uint16_t type
Type of attribute or NLA_UNSPEC.