• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _LINUX_IF_LINK_H
3 #define _LINUX_IF_LINK_H
4 
5 #include <linux/types.h>
6 #include <linux/netlink.h>
7 
8 /* This struct should be in sync with struct rtnl_link_stats64 */
9 struct rtnl_link_stats {
10 	__u32	rx_packets;		/* total packets received	*/
11 	__u32	tx_packets;		/* total packets transmitted	*/
12 	__u32	rx_bytes;		/* total bytes received 	*/
13 	__u32	tx_bytes;		/* total bytes transmitted	*/
14 	__u32	rx_errors;		/* bad packets received		*/
15 	__u32	tx_errors;		/* packet transmit problems	*/
16 	__u32	rx_dropped;		/* no space in linux buffers	*/
17 	__u32	tx_dropped;		/* no space available in linux	*/
18 	__u32	multicast;		/* multicast packets received	*/
19 	__u32	collisions;
20 
21 	/* detailed rx_errors: */
22 	__u32	rx_length_errors;
23 	__u32	rx_over_errors;		/* receiver ring buff overflow	*/
24 	__u32	rx_crc_errors;		/* recved pkt with crc error	*/
25 	__u32	rx_frame_errors;	/* recv'd frame alignment error */
26 	__u32	rx_fifo_errors;		/* recv'r fifo overrun		*/
27 	__u32	rx_missed_errors;	/* receiver missed packet	*/
28 
29 	/* detailed tx_errors */
30 	__u32	tx_aborted_errors;
31 	__u32	tx_carrier_errors;
32 	__u32	tx_fifo_errors;
33 	__u32	tx_heartbeat_errors;
34 	__u32	tx_window_errors;
35 
36 	/* for cslip etc */
37 	__u32	rx_compressed;
38 	__u32	tx_compressed;
39 
40 	__u32	rx_nohandler;		/* dropped, no handler found	*/
41 };
42 
43 /* The main device statistics structure */
44 struct rtnl_link_stats64 {
45 	__u64	rx_packets;		/* total packets received	*/
46 	__u64	tx_packets;		/* total packets transmitted	*/
47 	__u64	rx_bytes;		/* total bytes received 	*/
48 	__u64	tx_bytes;		/* total bytes transmitted	*/
49 	__u64	rx_errors;		/* bad packets received		*/
50 	__u64	tx_errors;		/* packet transmit problems	*/
51 	__u64	rx_dropped;		/* no space in linux buffers	*/
52 	__u64	tx_dropped;		/* no space available in linux	*/
53 	__u64	multicast;		/* multicast packets received	*/
54 	__u64	collisions;
55 
56 	/* detailed rx_errors: */
57 	__u64	rx_length_errors;
58 	__u64	rx_over_errors;		/* receiver ring buff overflow	*/
59 	__u64	rx_crc_errors;		/* recved pkt with crc error	*/
60 	__u64	rx_frame_errors;	/* recv'd frame alignment error */
61 	__u64	rx_fifo_errors;		/* recv'r fifo overrun		*/
62 	__u64	rx_missed_errors;	/* receiver missed packet	*/
63 
64 	/* detailed tx_errors */
65 	__u64	tx_aborted_errors;
66 	__u64	tx_carrier_errors;
67 	__u64	tx_fifo_errors;
68 	__u64	tx_heartbeat_errors;
69 	__u64	tx_window_errors;
70 
71 	/* for cslip etc */
72 	__u64	rx_compressed;
73 	__u64	tx_compressed;
74 
75 	__u64	rx_nohandler;		/* dropped, no handler found	*/
76 };
77 
78 /* The struct should be in sync with struct ifmap */
79 struct rtnl_link_ifmap {
80 	__u64	mem_start;
81 	__u64	mem_end;
82 	__u64	base_addr;
83 	__u16	irq;
84 	__u8	dma;
85 	__u8	port;
86 };
87 
88 /*
89  * IFLA_AF_SPEC
90  *   Contains nested attributes for address family specific attributes.
91  *   Each address family may create a attribute with the address family
92  *   number as type and create its own attribute structure in it.
93  *
94  *   Example:
95  *   [IFLA_AF_SPEC] = {
96  *       [AF_INET] = {
97  *           [IFLA_INET_CONF] = ...,
98  *       },
99  *       [AF_INET6] = {
100  *           [IFLA_INET6_FLAGS] = ...,
101  *           [IFLA_INET6_CONF] = ...,
102  *       }
103  *   }
104  */
105 
106 enum {
107 	IFLA_UNSPEC,
108 	IFLA_ADDRESS,
109 	IFLA_BROADCAST,
110 	IFLA_IFNAME,
111 	IFLA_MTU,
112 	IFLA_LINK,
113 	IFLA_QDISC,
114 	IFLA_STATS,
115 	IFLA_COST,
116 #define IFLA_COST IFLA_COST
117 	IFLA_PRIORITY,
118 #define IFLA_PRIORITY IFLA_PRIORITY
119 	IFLA_MASTER,
120 #define IFLA_MASTER IFLA_MASTER
121 	IFLA_WIRELESS,		/* Wireless Extension event - see wireless.h */
122 #define IFLA_WIRELESS IFLA_WIRELESS
123 	IFLA_PROTINFO,		/* Protocol specific information for a link */
124 #define IFLA_PROTINFO IFLA_PROTINFO
125 	IFLA_TXQLEN,
126 #define IFLA_TXQLEN IFLA_TXQLEN
127 	IFLA_MAP,
128 #define IFLA_MAP IFLA_MAP
129 	IFLA_WEIGHT,
130 #define IFLA_WEIGHT IFLA_WEIGHT
131 	IFLA_OPERSTATE,
132 	IFLA_LINKMODE,
133 	IFLA_LINKINFO,
134 #define IFLA_LINKINFO IFLA_LINKINFO
135 	IFLA_NET_NS_PID,
136 	IFLA_IFALIAS,
137 	IFLA_NUM_VF,		/* Number of VFs if device is SR-IOV PF */
138 	IFLA_VFINFO_LIST,
139 	IFLA_STATS64,
140 	IFLA_VF_PORTS,
141 	IFLA_PORT_SELF,
142 	IFLA_AF_SPEC,
143 	IFLA_GROUP,		/* Group the device belongs to */
144 	IFLA_NET_NS_FD,
145 	IFLA_EXT_MASK,		/* Extended info mask, VFs, etc */
146 	IFLA_PROMISCUITY,	/* Promiscuity count: > 0 means acts PROMISC */
147 #define IFLA_PROMISCUITY IFLA_PROMISCUITY
148 	IFLA_NUM_TX_QUEUES,
149 	IFLA_NUM_RX_QUEUES,
150 	IFLA_CARRIER,
151 	IFLA_PHYS_PORT_ID,
152 	IFLA_CARRIER_CHANGES,
153 	IFLA_PHYS_SWITCH_ID,
154 	IFLA_LINK_NETNSID,
155 	IFLA_PHYS_PORT_NAME,
156 	IFLA_PROTO_DOWN,
157 	IFLA_GSO_MAX_SEGS,
158 	IFLA_GSO_MAX_SIZE,
159 	IFLA_PAD,
160 	IFLA_XDP,
161 	IFLA_EVENT,
162 	IFLA_NEW_NETNSID,
163 	IFLA_IF_NETNSID,
164 	IFLA_CARRIER_UP_COUNT,
165 	IFLA_CARRIER_DOWN_COUNT,
166 	IFLA_NEW_IFINDEX,
167 	IFLA_MIN_MTU,
168 	IFLA_MAX_MTU,
169 	__IFLA_MAX
170 };
171 
172 
173 #define IFLA_MAX (__IFLA_MAX - 1)
174 
175 /* backwards compatibility for userspace */
176 #define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
177 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
178 
179 enum {
180 	IFLA_INET_UNSPEC,
181 	IFLA_INET_CONF,
182 	__IFLA_INET_MAX,
183 };
184 
185 #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
186 
187 /* ifi_flags.
188 
189    IFF_* flags.
190 
191    The only change is:
192    IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
193    more not changeable by user. They describe link media
194    characteristics and set by device driver.
195 
196    Comments:
197    - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
198    - If neither of these three flags are set;
199      the interface is NBMA.
200 
201    - IFF_MULTICAST does not mean anything special:
202    multicasts can be used on all not-NBMA links.
203    IFF_MULTICAST means that this media uses special encapsulation
204    for multicast frames. Apparently, all IFF_POINTOPOINT and
205    IFF_BROADCAST devices are able to use multicasts too.
206  */
207 
208 /* IFLA_LINK.
209    For usual devices it is equal ifi_index.
210    If it is a "virtual interface" (f.e. tunnel), ifi_link
211    can point to real physical interface (f.e. for bandwidth calculations),
212    or maybe 0, what means, that real media is unknown (usual
213    for IPIP tunnels, when route to endpoint is allowed to change)
214  */
215 
216 /* Subtype attributes for IFLA_PROTINFO */
217 enum {
218 	IFLA_INET6_UNSPEC,
219 	IFLA_INET6_FLAGS,	/* link flags			*/
220 	IFLA_INET6_CONF,	/* sysctl parameters		*/
221 	IFLA_INET6_STATS,	/* statistics			*/
222 	IFLA_INET6_MCAST,	/* MC things. What of them?	*/
223 	IFLA_INET6_CACHEINFO,	/* time values and max reasm size */
224 	IFLA_INET6_ICMP6STATS,	/* statistics (icmpv6)		*/
225 	IFLA_INET6_TOKEN,	/* device token			*/
226 	IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
227 	__IFLA_INET6_MAX
228 };
229 
230 #define IFLA_INET6_MAX	(__IFLA_INET6_MAX - 1)
231 
232 enum in6_addr_gen_mode {
233 	IN6_ADDR_GEN_MODE_EUI64,
234 	IN6_ADDR_GEN_MODE_NONE,
235 	IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
236 	IN6_ADDR_GEN_MODE_RANDOM,
237 };
238 
239 /* Bridge section */
240 
241 enum {
242 	IFLA_BR_UNSPEC,
243 	IFLA_BR_FORWARD_DELAY,
244 	IFLA_BR_HELLO_TIME,
245 	IFLA_BR_MAX_AGE,
246 	IFLA_BR_AGEING_TIME,
247 	IFLA_BR_STP_STATE,
248 	IFLA_BR_PRIORITY,
249 	IFLA_BR_VLAN_FILTERING,
250 	IFLA_BR_VLAN_PROTOCOL,
251 	IFLA_BR_GROUP_FWD_MASK,
252 	IFLA_BR_ROOT_ID,
253 	IFLA_BR_BRIDGE_ID,
254 	IFLA_BR_ROOT_PORT,
255 	IFLA_BR_ROOT_PATH_COST,
256 	IFLA_BR_TOPOLOGY_CHANGE,
257 	IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
258 	IFLA_BR_HELLO_TIMER,
259 	IFLA_BR_TCN_TIMER,
260 	IFLA_BR_TOPOLOGY_CHANGE_TIMER,
261 	IFLA_BR_GC_TIMER,
262 	IFLA_BR_GROUP_ADDR,
263 	IFLA_BR_FDB_FLUSH,
264 	IFLA_BR_MCAST_ROUTER,
265 	IFLA_BR_MCAST_SNOOPING,
266 	IFLA_BR_MCAST_QUERY_USE_IFADDR,
267 	IFLA_BR_MCAST_QUERIER,
268 	IFLA_BR_MCAST_HASH_ELASTICITY,
269 	IFLA_BR_MCAST_HASH_MAX,
270 	IFLA_BR_MCAST_LAST_MEMBER_CNT,
271 	IFLA_BR_MCAST_STARTUP_QUERY_CNT,
272 	IFLA_BR_MCAST_LAST_MEMBER_INTVL,
273 	IFLA_BR_MCAST_MEMBERSHIP_INTVL,
274 	IFLA_BR_MCAST_QUERIER_INTVL,
275 	IFLA_BR_MCAST_QUERY_INTVL,
276 	IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
277 	IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
278 	IFLA_BR_NF_CALL_IPTABLES,
279 	IFLA_BR_NF_CALL_IP6TABLES,
280 	IFLA_BR_NF_CALL_ARPTABLES,
281 	IFLA_BR_VLAN_DEFAULT_PVID,
282 	IFLA_BR_PAD,
283 	IFLA_BR_VLAN_STATS_ENABLED,
284 	IFLA_BR_MCAST_STATS_ENABLED,
285 	IFLA_BR_MCAST_IGMP_VERSION,
286 	IFLA_BR_MCAST_MLD_VERSION,
287 	__IFLA_BR_MAX,
288 };
289 
290 #define IFLA_BR_MAX	(__IFLA_BR_MAX - 1)
291 
292 struct ifla_bridge_id {
293 	__u8	prio[2];
294 	__u8	addr[6]; /* ETH_ALEN */
295 };
296 
297 enum {
298 	BRIDGE_MODE_UNSPEC,
299 	BRIDGE_MODE_HAIRPIN,
300 };
301 
302 enum {
303 	IFLA_BRPORT_UNSPEC,
304 	IFLA_BRPORT_STATE,	/* Spanning tree state     */
305 	IFLA_BRPORT_PRIORITY,	/* "             priority  */
306 	IFLA_BRPORT_COST,	/* "             cost      */
307 	IFLA_BRPORT_MODE,	/* mode (hairpin)          */
308 	IFLA_BRPORT_GUARD,	/* bpdu guard              */
309 	IFLA_BRPORT_PROTECT,	/* root port protection    */
310 	IFLA_BRPORT_FAST_LEAVE,	/* multicast fast leave    */
311 	IFLA_BRPORT_LEARNING,	/* mac learning */
312 	IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
313 	IFLA_BRPORT_PROXYARP,	/* proxy ARP */
314 	IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
315 	IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
316 	IFLA_BRPORT_ROOT_ID,	/* designated root */
317 	IFLA_BRPORT_BRIDGE_ID,	/* designated bridge */
318 	IFLA_BRPORT_DESIGNATED_PORT,
319 	IFLA_BRPORT_DESIGNATED_COST,
320 	IFLA_BRPORT_ID,
321 	IFLA_BRPORT_NO,
322 	IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
323 	IFLA_BRPORT_CONFIG_PENDING,
324 	IFLA_BRPORT_MESSAGE_AGE_TIMER,
325 	IFLA_BRPORT_FORWARD_DELAY_TIMER,
326 	IFLA_BRPORT_HOLD_TIMER,
327 	IFLA_BRPORT_FLUSH,
328 	IFLA_BRPORT_MULTICAST_ROUTER,
329 	IFLA_BRPORT_PAD,
330 	IFLA_BRPORT_MCAST_FLOOD,
331 	IFLA_BRPORT_MCAST_TO_UCAST,
332 	IFLA_BRPORT_VLAN_TUNNEL,
333 	IFLA_BRPORT_BCAST_FLOOD,
334 	IFLA_BRPORT_GROUP_FWD_MASK,
335 	IFLA_BRPORT_NEIGH_SUPPRESS,
336 	IFLA_BRPORT_ISOLATED,
337 	IFLA_BRPORT_BACKUP_PORT,
338 	__IFLA_BRPORT_MAX
339 };
340 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
341 
342 struct ifla_cacheinfo {
343 	__u32	max_reasm_len;
344 	__u32	tstamp;		/* ipv6InterfaceTable updated timestamp */
345 	__u32	reachable_time;
346 	__u32	retrans_time;
347 };
348 
349 enum {
350 	IFLA_INFO_UNSPEC,
351 	IFLA_INFO_KIND,
352 	IFLA_INFO_DATA,
353 	IFLA_INFO_XSTATS,
354 	IFLA_INFO_SLAVE_KIND,
355 	IFLA_INFO_SLAVE_DATA,
356 	__IFLA_INFO_MAX,
357 };
358 
359 #define IFLA_INFO_MAX	(__IFLA_INFO_MAX - 1)
360 
361 /* VLAN section */
362 
363 enum {
364 	IFLA_VLAN_UNSPEC,
365 	IFLA_VLAN_ID,
366 	IFLA_VLAN_FLAGS,
367 	IFLA_VLAN_EGRESS_QOS,
368 	IFLA_VLAN_INGRESS_QOS,
369 	IFLA_VLAN_PROTOCOL,
370 	__IFLA_VLAN_MAX,
371 };
372 
373 #define IFLA_VLAN_MAX	(__IFLA_VLAN_MAX - 1)
374 
375 struct ifla_vlan_flags {
376 	__u32	flags;
377 	__u32	mask;
378 };
379 
380 enum {
381 	IFLA_VLAN_QOS_UNSPEC,
382 	IFLA_VLAN_QOS_MAPPING,
383 	__IFLA_VLAN_QOS_MAX
384 };
385 
386 #define IFLA_VLAN_QOS_MAX	(__IFLA_VLAN_QOS_MAX - 1)
387 
388 struct ifla_vlan_qos_mapping {
389 	__u32 from;
390 	__u32 to;
391 };
392 
393 /* MACVLAN section */
394 enum {
395 	IFLA_MACVLAN_UNSPEC,
396 	IFLA_MACVLAN_MODE,
397 	IFLA_MACVLAN_FLAGS,
398 	IFLA_MACVLAN_MACADDR_MODE,
399 	IFLA_MACVLAN_MACADDR,
400 	IFLA_MACVLAN_MACADDR_DATA,
401 	IFLA_MACVLAN_MACADDR_COUNT,
402 	__IFLA_MACVLAN_MAX,
403 };
404 
405 #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
406 
407 enum macvlan_mode {
408 	MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
409 	MACVLAN_MODE_VEPA    = 2, /* talk to other ports through ext bridge */
410 	MACVLAN_MODE_BRIDGE  = 4, /* talk to bridge ports directly */
411 	MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
412 	MACVLAN_MODE_SOURCE  = 16,/* use source MAC address list to assign */
413 };
414 
415 enum macvlan_macaddr_mode {
416 	MACVLAN_MACADDR_ADD,
417 	MACVLAN_MACADDR_DEL,
418 	MACVLAN_MACADDR_FLUSH,
419 	MACVLAN_MACADDR_SET,
420 };
421 
422 #define MACVLAN_FLAG_NOPROMISC	1
423 
424 /* VRF section */
425 enum {
426 	IFLA_VRF_UNSPEC,
427 	IFLA_VRF_TABLE,
428 	__IFLA_VRF_MAX
429 };
430 
431 #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
432 
433 enum {
434 	IFLA_VRF_PORT_UNSPEC,
435 	IFLA_VRF_PORT_TABLE,
436 	__IFLA_VRF_PORT_MAX
437 };
438 
439 #define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
440 
441 /* MACSEC section */
442 enum {
443 	IFLA_MACSEC_UNSPEC,
444 	IFLA_MACSEC_SCI,
445 	IFLA_MACSEC_PORT,
446 	IFLA_MACSEC_ICV_LEN,
447 	IFLA_MACSEC_CIPHER_SUITE,
448 	IFLA_MACSEC_WINDOW,
449 	IFLA_MACSEC_ENCODING_SA,
450 	IFLA_MACSEC_ENCRYPT,
451 	IFLA_MACSEC_PROTECT,
452 	IFLA_MACSEC_INC_SCI,
453 	IFLA_MACSEC_ES,
454 	IFLA_MACSEC_SCB,
455 	IFLA_MACSEC_REPLAY_PROTECT,
456 	IFLA_MACSEC_VALIDATION,
457 	IFLA_MACSEC_PAD,
458 	__IFLA_MACSEC_MAX,
459 };
460 
461 #define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
462 
463 /* XFRM section */
464 enum {
465 	IFLA_XFRM_UNSPEC,
466 	IFLA_XFRM_LINK,
467 	IFLA_XFRM_IF_ID,
468 	__IFLA_XFRM_MAX
469 };
470 
471 #define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
472 
473 enum macsec_validation_type {
474 	MACSEC_VALIDATE_DISABLED = 0,
475 	MACSEC_VALIDATE_CHECK = 1,
476 	MACSEC_VALIDATE_STRICT = 2,
477 	__MACSEC_VALIDATE_END,
478 	MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
479 };
480 
481 /* IPVLAN section */
482 enum {
483 	IFLA_IPVLAN_UNSPEC,
484 	IFLA_IPVLAN_MODE,
485 	IFLA_IPVLAN_FLAGS,
486 	__IFLA_IPVLAN_MAX
487 };
488 
489 #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
490 
491 enum ipvlan_mode {
492 	IPVLAN_MODE_L2 = 0,
493 	IPVLAN_MODE_L3,
494 	IPVLAN_MODE_L3S,
495 	IPVLAN_MODE_MAX
496 };
497 
498 #define IPVLAN_F_PRIVATE	0x01
499 #define IPVLAN_F_VEPA		0x02
500 
501 /* VXLAN section */
502 enum {
503 	IFLA_VXLAN_UNSPEC,
504 	IFLA_VXLAN_ID,
505 	IFLA_VXLAN_GROUP,	/* group or remote address */
506 	IFLA_VXLAN_LINK,
507 	IFLA_VXLAN_LOCAL,
508 	IFLA_VXLAN_TTL,
509 	IFLA_VXLAN_TOS,
510 	IFLA_VXLAN_LEARNING,
511 	IFLA_VXLAN_AGEING,
512 	IFLA_VXLAN_LIMIT,
513 	IFLA_VXLAN_PORT_RANGE,	/* source port */
514 	IFLA_VXLAN_PROXY,
515 	IFLA_VXLAN_RSC,
516 	IFLA_VXLAN_L2MISS,
517 	IFLA_VXLAN_L3MISS,
518 	IFLA_VXLAN_PORT,	/* destination port */
519 	IFLA_VXLAN_GROUP6,
520 	IFLA_VXLAN_LOCAL6,
521 	IFLA_VXLAN_UDP_CSUM,
522 	IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
523 	IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
524 	IFLA_VXLAN_REMCSUM_TX,
525 	IFLA_VXLAN_REMCSUM_RX,
526 	IFLA_VXLAN_GBP,
527 	IFLA_VXLAN_REMCSUM_NOPARTIAL,
528 	IFLA_VXLAN_COLLECT_METADATA,
529 	IFLA_VXLAN_LABEL,
530 	IFLA_VXLAN_GPE,
531 	IFLA_VXLAN_TTL_INHERIT,
532 	__IFLA_VXLAN_MAX
533 };
534 #define IFLA_VXLAN_MAX	(__IFLA_VXLAN_MAX - 1)
535 
536 struct ifla_vxlan_port_range {
537 	__be16	low;
538 	__be16	high;
539 };
540 
541 /* GENEVE section */
542 enum {
543 	IFLA_GENEVE_UNSPEC,
544 	IFLA_GENEVE_ID,
545 	IFLA_GENEVE_REMOTE,
546 	IFLA_GENEVE_TTL,
547 	IFLA_GENEVE_TOS,
548 	IFLA_GENEVE_PORT,	/* destination port */
549 	IFLA_GENEVE_COLLECT_METADATA,
550 	IFLA_GENEVE_REMOTE6,
551 	IFLA_GENEVE_UDP_CSUM,
552 	IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
553 	IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
554 	IFLA_GENEVE_LABEL,
555 	__IFLA_GENEVE_MAX
556 };
557 #define IFLA_GENEVE_MAX	(__IFLA_GENEVE_MAX - 1)
558 
559 /* PPP section */
560 enum {
561 	IFLA_PPP_UNSPEC,
562 	IFLA_PPP_DEV_FD,
563 	__IFLA_PPP_MAX
564 };
565 #define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
566 
567 /* GTP section */
568 
569 enum ifla_gtp_role {
570 	GTP_ROLE_GGSN = 0,
571 	GTP_ROLE_SGSN,
572 };
573 
574 enum {
575 	IFLA_GTP_UNSPEC,
576 	IFLA_GTP_FD0,
577 	IFLA_GTP_FD1,
578 	IFLA_GTP_PDP_HASHSIZE,
579 	IFLA_GTP_ROLE,
580 	__IFLA_GTP_MAX,
581 };
582 #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
583 
584 /* Bonding section */
585 
586 enum {
587 	IFLA_BOND_UNSPEC,
588 	IFLA_BOND_MODE,
589 	IFLA_BOND_ACTIVE_SLAVE,
590 	IFLA_BOND_MIIMON,
591 	IFLA_BOND_UPDELAY,
592 	IFLA_BOND_DOWNDELAY,
593 	IFLA_BOND_USE_CARRIER,
594 	IFLA_BOND_ARP_INTERVAL,
595 	IFLA_BOND_ARP_IP_TARGET,
596 	IFLA_BOND_ARP_VALIDATE,
597 	IFLA_BOND_ARP_ALL_TARGETS,
598 	IFLA_BOND_PRIMARY,
599 	IFLA_BOND_PRIMARY_RESELECT,
600 	IFLA_BOND_FAIL_OVER_MAC,
601 	IFLA_BOND_XMIT_HASH_POLICY,
602 	IFLA_BOND_RESEND_IGMP,
603 	IFLA_BOND_NUM_PEER_NOTIF,
604 	IFLA_BOND_ALL_SLAVES_ACTIVE,
605 	IFLA_BOND_MIN_LINKS,
606 	IFLA_BOND_LP_INTERVAL,
607 	IFLA_BOND_PACKETS_PER_SLAVE,
608 	IFLA_BOND_AD_LACP_RATE,
609 	IFLA_BOND_AD_SELECT,
610 	IFLA_BOND_AD_INFO,
611 	IFLA_BOND_AD_ACTOR_SYS_PRIO,
612 	IFLA_BOND_AD_USER_PORT_KEY,
613 	IFLA_BOND_AD_ACTOR_SYSTEM,
614 	IFLA_BOND_TLB_DYNAMIC_LB,
615 	__IFLA_BOND_MAX,
616 };
617 
618 #define IFLA_BOND_MAX	(__IFLA_BOND_MAX - 1)
619 
620 enum {
621 	IFLA_BOND_AD_INFO_UNSPEC,
622 	IFLA_BOND_AD_INFO_AGGREGATOR,
623 	IFLA_BOND_AD_INFO_NUM_PORTS,
624 	IFLA_BOND_AD_INFO_ACTOR_KEY,
625 	IFLA_BOND_AD_INFO_PARTNER_KEY,
626 	IFLA_BOND_AD_INFO_PARTNER_MAC,
627 	__IFLA_BOND_AD_INFO_MAX,
628 };
629 
630 #define IFLA_BOND_AD_INFO_MAX	(__IFLA_BOND_AD_INFO_MAX - 1)
631 
632 enum {
633 	IFLA_BOND_SLAVE_UNSPEC,
634 	IFLA_BOND_SLAVE_STATE,
635 	IFLA_BOND_SLAVE_MII_STATUS,
636 	IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
637 	IFLA_BOND_SLAVE_PERM_HWADDR,
638 	IFLA_BOND_SLAVE_QUEUE_ID,
639 	IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
640 	IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
641 	IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
642 	__IFLA_BOND_SLAVE_MAX,
643 };
644 
645 #define IFLA_BOND_SLAVE_MAX	(__IFLA_BOND_SLAVE_MAX - 1)
646 
647 /* SR-IOV virtual function management section */
648 
649 enum {
650 	IFLA_VF_INFO_UNSPEC,
651 	IFLA_VF_INFO,
652 	__IFLA_VF_INFO_MAX,
653 };
654 
655 #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
656 
657 enum {
658 	IFLA_VF_UNSPEC,
659 	IFLA_VF_MAC,		/* Hardware queue specific attributes */
660 	IFLA_VF_VLAN,		/* VLAN ID and QoS */
661 	IFLA_VF_TX_RATE,	/* Max TX Bandwidth Allocation */
662 	IFLA_VF_SPOOFCHK,	/* Spoof Checking on/off switch */
663 	IFLA_VF_LINK_STATE,	/* link state enable/disable/auto switch */
664 	IFLA_VF_RATE,		/* Min and Max TX Bandwidth Allocation */
665 	IFLA_VF_RSS_QUERY_EN,	/* RSS Redirection Table and Hash Key query
666 				 * on/off switch
667 				 */
668 	IFLA_VF_STATS,		/* network device statistics */
669 	IFLA_VF_TRUST,		/* Trust VF */
670 	IFLA_VF_IB_NODE_GUID,	/* VF Infiniband node GUID */
671 	IFLA_VF_IB_PORT_GUID,	/* VF Infiniband port GUID */
672 	IFLA_VF_VLAN_LIST,	/* nested list of vlans, option for QinQ */
673 	__IFLA_VF_MAX,
674 };
675 
676 #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
677 
678 struct ifla_vf_mac {
679 	__u32 vf;
680 	__u8 mac[32]; /* MAX_ADDR_LEN */
681 };
682 
683 struct ifla_vf_vlan {
684 	__u32 vf;
685 	__u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
686 	__u32 qos;
687 };
688 
689 enum {
690 	IFLA_VF_VLAN_INFO_UNSPEC,
691 	IFLA_VF_VLAN_INFO,	/* VLAN ID, QoS and VLAN protocol */
692 	__IFLA_VF_VLAN_INFO_MAX,
693 };
694 
695 #define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
696 #define MAX_VLAN_LIST_LEN 1
697 
698 struct ifla_vf_vlan_info {
699 	__u32 vf;
700 	__u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
701 	__u32 qos;
702 	__be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
703 };
704 
705 struct ifla_vf_tx_rate {
706 	__u32 vf;
707 	__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
708 };
709 
710 struct ifla_vf_rate {
711 	__u32 vf;
712 	__u32 min_tx_rate; /* Min Bandwidth in Mbps */
713 	__u32 max_tx_rate; /* Max Bandwidth in Mbps */
714 };
715 
716 struct ifla_vf_spoofchk {
717 	__u32 vf;
718 	__u32 setting;
719 };
720 
721 struct ifla_vf_guid {
722 	__u32 vf;
723 	__u64 guid;
724 };
725 
726 enum {
727 	IFLA_VF_LINK_STATE_AUTO,	/* link state of the uplink */
728 	IFLA_VF_LINK_STATE_ENABLE,	/* link always up */
729 	IFLA_VF_LINK_STATE_DISABLE,	/* link always down */
730 	__IFLA_VF_LINK_STATE_MAX,
731 };
732 
733 struct ifla_vf_link_state {
734 	__u32 vf;
735 	__u32 link_state;
736 };
737 
738 struct ifla_vf_rss_query_en {
739 	__u32 vf;
740 	__u32 setting;
741 };
742 
743 enum {
744 	IFLA_VF_STATS_RX_PACKETS,
745 	IFLA_VF_STATS_TX_PACKETS,
746 	IFLA_VF_STATS_RX_BYTES,
747 	IFLA_VF_STATS_TX_BYTES,
748 	IFLA_VF_STATS_BROADCAST,
749 	IFLA_VF_STATS_MULTICAST,
750 	IFLA_VF_STATS_PAD,
751 	IFLA_VF_STATS_RX_DROPPED,
752 	IFLA_VF_STATS_TX_DROPPED,
753 	__IFLA_VF_STATS_MAX,
754 };
755 
756 #define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
757 
758 struct ifla_vf_trust {
759 	__u32 vf;
760 	__u32 setting;
761 };
762 
763 /* VF ports management section
764  *
765  *	Nested layout of set/get msg is:
766  *
767  *		[IFLA_NUM_VF]
768  *		[IFLA_VF_PORTS]
769  *			[IFLA_VF_PORT]
770  *				[IFLA_PORT_*], ...
771  *			[IFLA_VF_PORT]
772  *				[IFLA_PORT_*], ...
773  *			...
774  *		[IFLA_PORT_SELF]
775  *			[IFLA_PORT_*], ...
776  */
777 
778 enum {
779 	IFLA_VF_PORT_UNSPEC,
780 	IFLA_VF_PORT,			/* nest */
781 	__IFLA_VF_PORT_MAX,
782 };
783 
784 #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
785 
786 enum {
787 	IFLA_PORT_UNSPEC,
788 	IFLA_PORT_VF,			/* __u32 */
789 	IFLA_PORT_PROFILE,		/* string */
790 	IFLA_PORT_VSI_TYPE,		/* 802.1Qbg (pre-)standard VDP */
791 	IFLA_PORT_INSTANCE_UUID,	/* binary UUID */
792 	IFLA_PORT_HOST_UUID,		/* binary UUID */
793 	IFLA_PORT_REQUEST,		/* __u8 */
794 	IFLA_PORT_RESPONSE,		/* __u16, output only */
795 	__IFLA_PORT_MAX,
796 };
797 
798 #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
799 
800 #define PORT_PROFILE_MAX	40
801 #define PORT_UUID_MAX		16
802 #define PORT_SELF_VF		-1
803 
804 enum {
805 	PORT_REQUEST_PREASSOCIATE = 0,
806 	PORT_REQUEST_PREASSOCIATE_RR,
807 	PORT_REQUEST_ASSOCIATE,
808 	PORT_REQUEST_DISASSOCIATE,
809 };
810 
811 enum {
812 	PORT_VDP_RESPONSE_SUCCESS = 0,
813 	PORT_VDP_RESPONSE_INVALID_FORMAT,
814 	PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
815 	PORT_VDP_RESPONSE_UNUSED_VTID,
816 	PORT_VDP_RESPONSE_VTID_VIOLATION,
817 	PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
818 	PORT_VDP_RESPONSE_OUT_OF_SYNC,
819 	/* 0x08-0xFF reserved for future VDP use */
820 	PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
821 	PORT_PROFILE_RESPONSE_INPROGRESS,
822 	PORT_PROFILE_RESPONSE_INVALID,
823 	PORT_PROFILE_RESPONSE_BADSTATE,
824 	PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
825 	PORT_PROFILE_RESPONSE_ERROR,
826 };
827 
828 struct ifla_port_vsi {
829 	__u8 vsi_mgr_id;
830 	__u8 vsi_type_id[3];
831 	__u8 vsi_type_version;
832 	__u8 pad[3];
833 };
834 
835 
836 /* IPoIB section */
837 
838 enum {
839 	IFLA_IPOIB_UNSPEC,
840 	IFLA_IPOIB_PKEY,
841 	IFLA_IPOIB_MODE,
842 	IFLA_IPOIB_UMCAST,
843 	__IFLA_IPOIB_MAX
844 };
845 
846 enum {
847 	IPOIB_MODE_DATAGRAM  = 0, /* using unreliable datagram QPs */
848 	IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
849 };
850 
851 #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
852 
853 
854 /* HSR section */
855 
856 enum {
857 	IFLA_HSR_UNSPEC,
858 	IFLA_HSR_SLAVE1,
859 	IFLA_HSR_SLAVE2,
860 	IFLA_HSR_MULTICAST_SPEC,	/* Last byte of supervision addr */
861 	IFLA_HSR_SUPERVISION_ADDR,	/* Supervision frame multicast addr */
862 	IFLA_HSR_SEQ_NR,
863 	IFLA_HSR_VERSION,		/* HSR version */
864 	__IFLA_HSR_MAX,
865 };
866 
867 #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
868 
869 /* STATS section */
870 
871 struct if_stats_msg {
872 	__u8  family;
873 	__u8  pad1;
874 	__u16 pad2;
875 	__u32 ifindex;
876 	__u32 filter_mask;
877 };
878 
879 /* A stats attribute can be netdev specific or a global stat.
880  * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
881  */
882 enum {
883 	IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
884 	IFLA_STATS_LINK_64,
885 	IFLA_STATS_LINK_XSTATS,
886 	IFLA_STATS_LINK_XSTATS_SLAVE,
887 	IFLA_STATS_LINK_OFFLOAD_XSTATS,
888 	IFLA_STATS_AF_SPEC,
889 	__IFLA_STATS_MAX,
890 };
891 
892 #define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
893 
894 #define IFLA_STATS_FILTER_BIT(ATTR)	(1 << (ATTR - 1))
895 
896 /* These are embedded into IFLA_STATS_LINK_XSTATS:
897  * [IFLA_STATS_LINK_XSTATS]
898  * -> [LINK_XSTATS_TYPE_xxx]
899  *    -> [rtnl link type specific attributes]
900  */
901 enum {
902 	LINK_XSTATS_TYPE_UNSPEC,
903 	LINK_XSTATS_TYPE_BRIDGE,
904 	__LINK_XSTATS_TYPE_MAX
905 };
906 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
907 
908 /* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
909 enum {
910 	IFLA_OFFLOAD_XSTATS_UNSPEC,
911 	IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
912 	__IFLA_OFFLOAD_XSTATS_MAX
913 };
914 #define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
915 
916 /* XDP section */
917 
918 #define XDP_FLAGS_UPDATE_IF_NOEXIST	(1U << 0)
919 #define XDP_FLAGS_SKB_MODE		(1U << 1)
920 #define XDP_FLAGS_DRV_MODE		(1U << 2)
921 #define XDP_FLAGS_HW_MODE		(1U << 3)
922 #define XDP_FLAGS_MODES			(XDP_FLAGS_SKB_MODE | \
923 					 XDP_FLAGS_DRV_MODE | \
924 					 XDP_FLAGS_HW_MODE)
925 #define XDP_FLAGS_MASK			(XDP_FLAGS_UPDATE_IF_NOEXIST | \
926 					 XDP_FLAGS_MODES)
927 
928 /* These are stored into IFLA_XDP_ATTACHED on dump. */
929 enum {
930 	XDP_ATTACHED_NONE = 0,
931 	XDP_ATTACHED_DRV,
932 	XDP_ATTACHED_SKB,
933 	XDP_ATTACHED_HW,
934 	XDP_ATTACHED_MULTI,
935 };
936 
937 enum {
938 	IFLA_XDP_UNSPEC,
939 	IFLA_XDP_FD,
940 	IFLA_XDP_ATTACHED,
941 	IFLA_XDP_FLAGS,
942 	IFLA_XDP_PROG_ID,
943 	IFLA_XDP_DRV_PROG_ID,
944 	IFLA_XDP_SKB_PROG_ID,
945 	IFLA_XDP_HW_PROG_ID,
946 	__IFLA_XDP_MAX,
947 };
948 
949 #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
950 
951 enum {
952 	IFLA_EVENT_NONE,
953 	IFLA_EVENT_REBOOT,		/* internal reset / reboot */
954 	IFLA_EVENT_FEATURES,		/* change in offload features */
955 	IFLA_EVENT_BONDING_FAILOVER,	/* change in active slave */
956 	IFLA_EVENT_NOTIFY_PEERS,	/* re-sent grat. arp/ndisc */
957 	IFLA_EVENT_IGMP_RESEND,		/* re-sent IGMP JOIN */
958 	IFLA_EVENT_BONDING_OPTIONS,	/* change in bonding options */
959 };
960 
961 /* tun section */
962 
963 enum {
964 	IFLA_TUN_UNSPEC,
965 	IFLA_TUN_OWNER,
966 	IFLA_TUN_GROUP,
967 	IFLA_TUN_TYPE,
968 	IFLA_TUN_PI,
969 	IFLA_TUN_VNET_HDR,
970 	IFLA_TUN_PERSIST,
971 	IFLA_TUN_MULTI_QUEUE,
972 	IFLA_TUN_NUM_QUEUES,
973 	IFLA_TUN_NUM_DISABLED_QUEUES,
974 	__IFLA_TUN_MAX,
975 };
976 
977 #define IFLA_TUN_MAX (__IFLA_TUN_MAX - 1)
978 
979 /* rmnet section */
980 
981 #define RMNET_FLAGS_INGRESS_DEAGGREGATION         (1U << 0)
982 #define RMNET_FLAGS_INGRESS_MAP_COMMANDS          (1U << 1)
983 #define RMNET_FLAGS_INGRESS_MAP_CKSUMV4           (1U << 2)
984 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4            (1U << 3)
985 
986 enum {
987 	IFLA_RMNET_UNSPEC,
988 	IFLA_RMNET_MUX_ID,
989 	IFLA_RMNET_FLAGS,
990 	__IFLA_RMNET_MAX,
991 };
992 
993 #define IFLA_RMNET_MAX	(__IFLA_RMNET_MAX - 1)
994 
995 struct ifla_rmnet_flags {
996 	__u32	flags;
997 	__u32	mask;
998 };
999 
1000 #endif /* _LINUX_IF_LINK_H */
1001