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