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