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