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