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