GNU Linux-libre 6.1.90-gnu
[releases.git] / tools / include / uapi / linux / if_link.h
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;
11         __u32   tx_packets;
12         __u32   rx_bytes;
13         __u32   tx_bytes;
14         __u32   rx_errors;
15         __u32   tx_errors;
16         __u32   rx_dropped;
17         __u32   tx_dropped;
18         __u32   multicast;
19         __u32   collisions;
20         /* detailed rx_errors: */
21         __u32   rx_length_errors;
22         __u32   rx_over_errors;
23         __u32   rx_crc_errors;
24         __u32   rx_frame_errors;
25         __u32   rx_fifo_errors;
26         __u32   rx_missed_errors;
27
28         /* detailed tx_errors */
29         __u32   tx_aborted_errors;
30         __u32   tx_carrier_errors;
31         __u32   tx_fifo_errors;
32         __u32   tx_heartbeat_errors;
33         __u32   tx_window_errors;
34
35         /* for cslip etc */
36         __u32   rx_compressed;
37         __u32   tx_compressed;
38
39         __u32   rx_nohandler;
40 };
41
42 /**
43  * struct rtnl_link_stats64 - The main device statistics structure.
44  *
45  * @rx_packets: Number of good packets received by the interface.
46  *   For hardware interfaces counts all good packets received from the device
47  *   by the host, including packets which host had to drop at various stages
48  *   of processing (even in the driver).
49  *
50  * @tx_packets: Number of packets successfully transmitted.
51  *   For hardware interfaces counts packets which host was able to successfully
52  *   hand over to the device, which does not necessarily mean that packets
53  *   had been successfully transmitted out of the device, only that device
54  *   acknowledged it copied them out of host memory.
55  *
56  * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
57  *
58  *   For IEEE 802.3 devices should count the length of Ethernet Frames
59  *   excluding the FCS.
60  *
61  * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
62  *
63  *   For IEEE 802.3 devices should count the length of Ethernet Frames
64  *   excluding the FCS.
65  *
66  * @rx_errors: Total number of bad packets received on this network device.
67  *   This counter must include events counted by @rx_length_errors,
68  *   @rx_crc_errors, @rx_frame_errors and other errors not otherwise
69  *   counted.
70  *
71  * @tx_errors: Total number of transmit problems.
72  *   This counter must include events counter by @tx_aborted_errors,
73  *   @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
74  *   @tx_window_errors and other errors not otherwise counted.
75  *
76  * @rx_dropped: Number of packets received but not processed,
77  *   e.g. due to lack of resources or unsupported protocol.
78  *   For hardware interfaces this counter may include packets discarded
79  *   due to L2 address filtering but should not include packets dropped
80  *   by the device due to buffer exhaustion which are counted separately in
81  *   @rx_missed_errors (since procfs folds those two counters together).
82  *
83  * @tx_dropped: Number of packets dropped on their way to transmission,
84  *   e.g. due to lack of resources.
85  *
86  * @multicast: Multicast packets received.
87  *   For hardware interfaces this statistic is commonly calculated
88  *   at the device level (unlike @rx_packets) and therefore may include
89  *   packets which did not reach the host.
90  *
91  *   For IEEE 802.3 devices this counter may be equivalent to:
92  *
93  *    - 30.3.1.1.21 aMulticastFramesReceivedOK
94  *
95  * @collisions: Number of collisions during packet transmissions.
96  *
97  * @rx_length_errors: Number of packets dropped due to invalid length.
98  *   Part of aggregate "frame" errors in `/proc/net/dev`.
99  *
100  *   For IEEE 802.3 devices this counter should be equivalent to a sum
101  *   of the following attributes:
102  *
103  *    - 30.3.1.1.23 aInRangeLengthErrors
104  *    - 30.3.1.1.24 aOutOfRangeLengthField
105  *    - 30.3.1.1.25 aFrameTooLongErrors
106  *
107  * @rx_over_errors: Receiver FIFO overflow event counter.
108  *
109  *   Historically the count of overflow events. Such events may be
110  *   reported in the receive descriptors or via interrupts, and may
111  *   not correspond one-to-one with dropped packets.
112  *
113  *   The recommended interpretation for high speed interfaces is -
114  *   number of packets dropped because they did not fit into buffers
115  *   provided by the host, e.g. packets larger than MTU or next buffer
116  *   in the ring was not available for a scatter transfer.
117  *
118  *   Part of aggregate "frame" errors in `/proc/net/dev`.
119  *
120  *   This statistics was historically used interchangeably with
121  *   @rx_fifo_errors.
122  *
123  *   This statistic corresponds to hardware events and is not commonly used
124  *   on software devices.
125  *
126  * @rx_crc_errors: Number of packets received with a CRC error.
127  *   Part of aggregate "frame" errors in `/proc/net/dev`.
128  *
129  *   For IEEE 802.3 devices this counter must be equivalent to:
130  *
131  *    - 30.3.1.1.6 aFrameCheckSequenceErrors
132  *
133  * @rx_frame_errors: Receiver frame alignment errors.
134  *   Part of aggregate "frame" errors in `/proc/net/dev`.
135  *
136  *   For IEEE 802.3 devices this counter should be equivalent to:
137  *
138  *    - 30.3.1.1.7 aAlignmentErrors
139  *
140  * @rx_fifo_errors: Receiver FIFO error counter.
141  *
142  *   Historically the count of overflow events. Those events may be
143  *   reported in the receive descriptors or via interrupts, and may
144  *   not correspond one-to-one with dropped packets.
145  *
146  *   This statistics was used interchangeably with @rx_over_errors.
147  *   Not recommended for use in drivers for high speed interfaces.
148  *
149  *   This statistic is used on software devices, e.g. to count software
150  *   packet queue overflow (can) or sequencing errors (GRE).
151  *
152  * @rx_missed_errors: Count of packets missed by the host.
153  *   Folded into the "drop" counter in `/proc/net/dev`.
154  *
155  *   Counts number of packets dropped by the device due to lack
156  *   of buffer space. This usually indicates that the host interface
157  *   is slower than the network interface, or host is not keeping up
158  *   with the receive packet rate.
159  *
160  *   This statistic corresponds to hardware events and is not used
161  *   on software devices.
162  *
163  * @tx_aborted_errors:
164  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
165  *   For IEEE 802.3 devices capable of half-duplex operation this counter
166  *   must be equivalent to:
167  *
168  *    - 30.3.1.1.11 aFramesAbortedDueToXSColls
169  *
170  *   High speed interfaces may use this counter as a general device
171  *   discard counter.
172  *
173  * @tx_carrier_errors: Number of frame transmission errors due to loss
174  *   of carrier during transmission.
175  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
176  *
177  *   For IEEE 802.3 devices this counter must be equivalent to:
178  *
179  *    - 30.3.1.1.13 aCarrierSenseErrors
180  *
181  * @tx_fifo_errors: Number of frame transmission errors due to device
182  *   FIFO underrun / underflow. This condition occurs when the device
183  *   begins transmission of a frame but is unable to deliver the
184  *   entire frame to the transmitter in time for transmission.
185  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
186  *
187  * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
188  *   old half-duplex Ethernet.
189  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
190  *
191  *   For IEEE 802.3 devices possibly equivalent to:
192  *
193  *    - 30.3.2.1.4 aSQETestErrors
194  *
195  * @tx_window_errors: Number of frame transmission errors due
196  *   to late collisions (for Ethernet - after the first 64B of transmission).
197  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
198  *
199  *   For IEEE 802.3 devices this counter must be equivalent to:
200  *
201  *    - 30.3.1.1.10 aLateCollisions
202  *
203  * @rx_compressed: Number of correctly received compressed packets.
204  *   This counters is only meaningful for interfaces which support
205  *   packet compression (e.g. CSLIP, PPP).
206  *
207  * @tx_compressed: Number of transmitted compressed packets.
208  *   This counters is only meaningful for interfaces which support
209  *   packet compression (e.g. CSLIP, PPP).
210  *
211  * @rx_nohandler: Number of packets received on the interface
212  *   but dropped by the networking stack because the device is
213  *   not designated to receive packets (e.g. backup link in a bond).
214  */
215 struct rtnl_link_stats64 {
216         __u64   rx_packets;
217         __u64   tx_packets;
218         __u64   rx_bytes;
219         __u64   tx_bytes;
220         __u64   rx_errors;
221         __u64   tx_errors;
222         __u64   rx_dropped;
223         __u64   tx_dropped;
224         __u64   multicast;
225         __u64   collisions;
226
227         /* detailed rx_errors: */
228         __u64   rx_length_errors;
229         __u64   rx_over_errors;
230         __u64   rx_crc_errors;
231         __u64   rx_frame_errors;
232         __u64   rx_fifo_errors;
233         __u64   rx_missed_errors;
234
235         /* detailed tx_errors */
236         __u64   tx_aborted_errors;
237         __u64   tx_carrier_errors;
238         __u64   tx_fifo_errors;
239         __u64   tx_heartbeat_errors;
240         __u64   tx_window_errors;
241
242         /* for cslip etc */
243         __u64   rx_compressed;
244         __u64   tx_compressed;
245         __u64   rx_nohandler;
246 };
247
248 /* The struct should be in sync with struct ifmap */
249 struct rtnl_link_ifmap {
250         __u64   mem_start;
251         __u64   mem_end;
252         __u64   base_addr;
253         __u16   irq;
254         __u8    dma;
255         __u8    port;
256 };
257
258 /*
259  * IFLA_AF_SPEC
260  *   Contains nested attributes for address family specific attributes.
261  *   Each address family may create a attribute with the address family
262  *   number as type and create its own attribute structure in it.
263  *
264  *   Example:
265  *   [IFLA_AF_SPEC] = {
266  *       [AF_INET] = {
267  *           [IFLA_INET_CONF] = ...,
268  *       },
269  *       [AF_INET6] = {
270  *           [IFLA_INET6_FLAGS] = ...,
271  *           [IFLA_INET6_CONF] = ...,
272  *       }
273  *   }
274  */
275
276 enum {
277         IFLA_UNSPEC,
278         IFLA_ADDRESS,
279         IFLA_BROADCAST,
280         IFLA_IFNAME,
281         IFLA_MTU,
282         IFLA_LINK,
283         IFLA_QDISC,
284         IFLA_STATS,
285         IFLA_COST,
286 #define IFLA_COST IFLA_COST
287         IFLA_PRIORITY,
288 #define IFLA_PRIORITY IFLA_PRIORITY
289         IFLA_MASTER,
290 #define IFLA_MASTER IFLA_MASTER
291         IFLA_WIRELESS,          /* Wireless Extension event - see wireless.h */
292 #define IFLA_WIRELESS IFLA_WIRELESS
293         IFLA_PROTINFO,          /* Protocol specific information for a link */
294 #define IFLA_PROTINFO IFLA_PROTINFO
295         IFLA_TXQLEN,
296 #define IFLA_TXQLEN IFLA_TXQLEN
297         IFLA_MAP,
298 #define IFLA_MAP IFLA_MAP
299         IFLA_WEIGHT,
300 #define IFLA_WEIGHT IFLA_WEIGHT
301         IFLA_OPERSTATE,
302         IFLA_LINKMODE,
303         IFLA_LINKINFO,
304 #define IFLA_LINKINFO IFLA_LINKINFO
305         IFLA_NET_NS_PID,
306         IFLA_IFALIAS,
307         IFLA_NUM_VF,            /* Number of VFs if device is SR-IOV PF */
308         IFLA_VFINFO_LIST,
309         IFLA_STATS64,
310         IFLA_VF_PORTS,
311         IFLA_PORT_SELF,
312         IFLA_AF_SPEC,
313         IFLA_GROUP,             /* Group the device belongs to */
314         IFLA_NET_NS_FD,
315         IFLA_EXT_MASK,          /* Extended info mask, VFs, etc */
316         IFLA_PROMISCUITY,       /* Promiscuity count: > 0 means acts PROMISC */
317 #define IFLA_PROMISCUITY IFLA_PROMISCUITY
318         IFLA_NUM_TX_QUEUES,
319         IFLA_NUM_RX_QUEUES,
320         IFLA_CARRIER,
321         IFLA_PHYS_PORT_ID,
322         IFLA_CARRIER_CHANGES,
323         IFLA_PHYS_SWITCH_ID,
324         IFLA_LINK_NETNSID,
325         IFLA_PHYS_PORT_NAME,
326         IFLA_PROTO_DOWN,
327         IFLA_GSO_MAX_SEGS,
328         IFLA_GSO_MAX_SIZE,
329         IFLA_PAD,
330         IFLA_XDP,
331         IFLA_EVENT,
332         IFLA_NEW_NETNSID,
333         IFLA_IF_NETNSID,
334         IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, /* new alias */
335         IFLA_CARRIER_UP_COUNT,
336         IFLA_CARRIER_DOWN_COUNT,
337         IFLA_NEW_IFINDEX,
338         IFLA_MIN_MTU,
339         IFLA_MAX_MTU,
340         IFLA_PROP_LIST,
341         IFLA_ALT_IFNAME, /* Alternative ifname */
342         IFLA_PERM_ADDRESS,
343         IFLA_PROTO_DOWN_REASON,
344
345         /* device (sysfs) name as parent, used instead
346          * of IFLA_LINK where there's no parent netdev
347          */
348         IFLA_PARENT_DEV_NAME,
349         IFLA_PARENT_DEV_BUS_NAME,
350         IFLA_GRO_MAX_SIZE,
351         IFLA_TSO_MAX_SIZE,
352         IFLA_TSO_MAX_SEGS,
353
354         __IFLA_MAX
355 };
356
357
358 #define IFLA_MAX (__IFLA_MAX - 1)
359
360 enum {
361         IFLA_PROTO_DOWN_REASON_UNSPEC,
362         IFLA_PROTO_DOWN_REASON_MASK,    /* u32, mask for reason bits */
363         IFLA_PROTO_DOWN_REASON_VALUE,   /* u32, reason bit value */
364
365         __IFLA_PROTO_DOWN_REASON_CNT,
366         IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
367 };
368
369 /* backwards compatibility for userspace */
370 #ifndef __KERNEL__
371 #define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
372 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
373 #endif
374
375 enum {
376         IFLA_INET_UNSPEC,
377         IFLA_INET_CONF,
378         __IFLA_INET_MAX,
379 };
380
381 #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
382
383 /* ifi_flags.
384
385    IFF_* flags.
386
387    The only change is:
388    IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
389    more not changeable by user. They describe link media
390    characteristics and set by device driver.
391
392    Comments:
393    - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
394    - If neither of these three flags are set;
395      the interface is NBMA.
396
397    - IFF_MULTICAST does not mean anything special:
398    multicasts can be used on all not-NBMA links.
399    IFF_MULTICAST means that this media uses special encapsulation
400    for multicast frames. Apparently, all IFF_POINTOPOINT and
401    IFF_BROADCAST devices are able to use multicasts too.
402  */
403
404 /* IFLA_LINK.
405    For usual devices it is equal ifi_index.
406    If it is a "virtual interface" (f.e. tunnel), ifi_link
407    can point to real physical interface (f.e. for bandwidth calculations),
408    or maybe 0, what means, that real media is unknown (usual
409    for IPIP tunnels, when route to endpoint is allowed to change)
410  */
411
412 /* Subtype attributes for IFLA_PROTINFO */
413 enum {
414         IFLA_INET6_UNSPEC,
415         IFLA_INET6_FLAGS,       /* link flags                   */
416         IFLA_INET6_CONF,        /* sysctl parameters            */
417         IFLA_INET6_STATS,       /* statistics                   */
418         IFLA_INET6_MCAST,       /* MC things. What of them?     */
419         IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
420         IFLA_INET6_ICMP6STATS,  /* statistics (icmpv6)          */
421         IFLA_INET6_TOKEN,       /* device token                 */
422         IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
423         IFLA_INET6_RA_MTU,      /* mtu carried in the RA message */
424         __IFLA_INET6_MAX
425 };
426
427 #define IFLA_INET6_MAX  (__IFLA_INET6_MAX - 1)
428
429 enum in6_addr_gen_mode {
430         IN6_ADDR_GEN_MODE_EUI64,
431         IN6_ADDR_GEN_MODE_NONE,
432         IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
433         IN6_ADDR_GEN_MODE_RANDOM,
434 };
435
436 /* Bridge section */
437
438 enum {
439         IFLA_BR_UNSPEC,
440         IFLA_BR_FORWARD_DELAY,
441         IFLA_BR_HELLO_TIME,
442         IFLA_BR_MAX_AGE,
443         IFLA_BR_AGEING_TIME,
444         IFLA_BR_STP_STATE,
445         IFLA_BR_PRIORITY,
446         IFLA_BR_VLAN_FILTERING,
447         IFLA_BR_VLAN_PROTOCOL,
448         IFLA_BR_GROUP_FWD_MASK,
449         IFLA_BR_ROOT_ID,
450         IFLA_BR_BRIDGE_ID,
451         IFLA_BR_ROOT_PORT,
452         IFLA_BR_ROOT_PATH_COST,
453         IFLA_BR_TOPOLOGY_CHANGE,
454         IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
455         IFLA_BR_HELLO_TIMER,
456         IFLA_BR_TCN_TIMER,
457         IFLA_BR_TOPOLOGY_CHANGE_TIMER,
458         IFLA_BR_GC_TIMER,
459         IFLA_BR_GROUP_ADDR,
460         IFLA_BR_FDB_FLUSH,
461         IFLA_BR_MCAST_ROUTER,
462         IFLA_BR_MCAST_SNOOPING,
463         IFLA_BR_MCAST_QUERY_USE_IFADDR,
464         IFLA_BR_MCAST_QUERIER,
465         IFLA_BR_MCAST_HASH_ELASTICITY,
466         IFLA_BR_MCAST_HASH_MAX,
467         IFLA_BR_MCAST_LAST_MEMBER_CNT,
468         IFLA_BR_MCAST_STARTUP_QUERY_CNT,
469         IFLA_BR_MCAST_LAST_MEMBER_INTVL,
470         IFLA_BR_MCAST_MEMBERSHIP_INTVL,
471         IFLA_BR_MCAST_QUERIER_INTVL,
472         IFLA_BR_MCAST_QUERY_INTVL,
473         IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
474         IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
475         IFLA_BR_NF_CALL_IPTABLES,
476         IFLA_BR_NF_CALL_IP6TABLES,
477         IFLA_BR_NF_CALL_ARPTABLES,
478         IFLA_BR_VLAN_DEFAULT_PVID,
479         IFLA_BR_PAD,
480         IFLA_BR_VLAN_STATS_ENABLED,
481         IFLA_BR_MCAST_STATS_ENABLED,
482         IFLA_BR_MCAST_IGMP_VERSION,
483         IFLA_BR_MCAST_MLD_VERSION,
484         IFLA_BR_VLAN_STATS_PER_PORT,
485         IFLA_BR_MULTI_BOOLOPT,
486         IFLA_BR_MCAST_QUERIER_STATE,
487         __IFLA_BR_MAX,
488 };
489
490 #define IFLA_BR_MAX     (__IFLA_BR_MAX - 1)
491
492 struct ifla_bridge_id {
493         __u8    prio[2];
494         __u8    addr[6]; /* ETH_ALEN */
495 };
496
497 enum {
498         BRIDGE_MODE_UNSPEC,
499         BRIDGE_MODE_HAIRPIN,
500 };
501
502 enum {
503         IFLA_BRPORT_UNSPEC,
504         IFLA_BRPORT_STATE,      /* Spanning tree state     */
505         IFLA_BRPORT_PRIORITY,   /* "             priority  */
506         IFLA_BRPORT_COST,       /* "             cost      */
507         IFLA_BRPORT_MODE,       /* mode (hairpin)          */
508         IFLA_BRPORT_GUARD,      /* bpdu guard              */
509         IFLA_BRPORT_PROTECT,    /* root port protection    */
510         IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave    */
511         IFLA_BRPORT_LEARNING,   /* mac learning */
512         IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
513         IFLA_BRPORT_PROXYARP,   /* proxy ARP */
514         IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
515         IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
516         IFLA_BRPORT_ROOT_ID,    /* designated root */
517         IFLA_BRPORT_BRIDGE_ID,  /* designated bridge */
518         IFLA_BRPORT_DESIGNATED_PORT,
519         IFLA_BRPORT_DESIGNATED_COST,
520         IFLA_BRPORT_ID,
521         IFLA_BRPORT_NO,
522         IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
523         IFLA_BRPORT_CONFIG_PENDING,
524         IFLA_BRPORT_MESSAGE_AGE_TIMER,
525         IFLA_BRPORT_FORWARD_DELAY_TIMER,
526         IFLA_BRPORT_HOLD_TIMER,
527         IFLA_BRPORT_FLUSH,
528         IFLA_BRPORT_MULTICAST_ROUTER,
529         IFLA_BRPORT_PAD,
530         IFLA_BRPORT_MCAST_FLOOD,
531         IFLA_BRPORT_MCAST_TO_UCAST,
532         IFLA_BRPORT_VLAN_TUNNEL,
533         IFLA_BRPORT_BCAST_FLOOD,
534         IFLA_BRPORT_GROUP_FWD_MASK,
535         IFLA_BRPORT_NEIGH_SUPPRESS,
536         IFLA_BRPORT_ISOLATED,
537         IFLA_BRPORT_BACKUP_PORT,
538         IFLA_BRPORT_MRP_RING_OPEN,
539         IFLA_BRPORT_MRP_IN_OPEN,
540         IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
541         IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
542         __IFLA_BRPORT_MAX
543 };
544 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
545
546 struct ifla_cacheinfo {
547         __u32   max_reasm_len;
548         __u32   tstamp;         /* ipv6InterfaceTable updated timestamp */
549         __u32   reachable_time;
550         __u32   retrans_time;
551 };
552
553 enum {
554         IFLA_INFO_UNSPEC,
555         IFLA_INFO_KIND,
556         IFLA_INFO_DATA,
557         IFLA_INFO_XSTATS,
558         IFLA_INFO_SLAVE_KIND,
559         IFLA_INFO_SLAVE_DATA,
560         __IFLA_INFO_MAX,
561 };
562
563 #define IFLA_INFO_MAX   (__IFLA_INFO_MAX - 1)
564
565 /* VLAN section */
566
567 enum {
568         IFLA_VLAN_UNSPEC,
569         IFLA_VLAN_ID,
570         IFLA_VLAN_FLAGS,
571         IFLA_VLAN_EGRESS_QOS,
572         IFLA_VLAN_INGRESS_QOS,
573         IFLA_VLAN_PROTOCOL,
574         __IFLA_VLAN_MAX,
575 };
576
577 #define IFLA_VLAN_MAX   (__IFLA_VLAN_MAX - 1)
578
579 struct ifla_vlan_flags {
580         __u32   flags;
581         __u32   mask;
582 };
583
584 enum {
585         IFLA_VLAN_QOS_UNSPEC,
586         IFLA_VLAN_QOS_MAPPING,
587         __IFLA_VLAN_QOS_MAX
588 };
589
590 #define IFLA_VLAN_QOS_MAX       (__IFLA_VLAN_QOS_MAX - 1)
591
592 struct ifla_vlan_qos_mapping {
593         __u32 from;
594         __u32 to;
595 };
596
597 /* MACVLAN section */
598 enum {
599         IFLA_MACVLAN_UNSPEC,
600         IFLA_MACVLAN_MODE,
601         IFLA_MACVLAN_FLAGS,
602         IFLA_MACVLAN_MACADDR_MODE,
603         IFLA_MACVLAN_MACADDR,
604         IFLA_MACVLAN_MACADDR_DATA,
605         IFLA_MACVLAN_MACADDR_COUNT,
606         IFLA_MACVLAN_BC_QUEUE_LEN,
607         IFLA_MACVLAN_BC_QUEUE_LEN_USED,
608         __IFLA_MACVLAN_MAX,
609 };
610
611 #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
612
613 enum macvlan_mode {
614         MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
615         MACVLAN_MODE_VEPA    = 2, /* talk to other ports through ext bridge */
616         MACVLAN_MODE_BRIDGE  = 4, /* talk to bridge ports directly */
617         MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
618         MACVLAN_MODE_SOURCE  = 16,/* use source MAC address list to assign */
619 };
620
621 enum macvlan_macaddr_mode {
622         MACVLAN_MACADDR_ADD,
623         MACVLAN_MACADDR_DEL,
624         MACVLAN_MACADDR_FLUSH,
625         MACVLAN_MACADDR_SET,
626 };
627
628 #define MACVLAN_FLAG_NOPROMISC  1
629 #define MACVLAN_FLAG_NODST      2 /* skip dst macvlan if matching src macvlan */
630
631 /* VRF section */
632 enum {
633         IFLA_VRF_UNSPEC,
634         IFLA_VRF_TABLE,
635         __IFLA_VRF_MAX
636 };
637
638 #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
639
640 enum {
641         IFLA_VRF_PORT_UNSPEC,
642         IFLA_VRF_PORT_TABLE,
643         __IFLA_VRF_PORT_MAX
644 };
645
646 #define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
647
648 /* MACSEC section */
649 enum {
650         IFLA_MACSEC_UNSPEC,
651         IFLA_MACSEC_SCI,
652         IFLA_MACSEC_PORT,
653         IFLA_MACSEC_ICV_LEN,
654         IFLA_MACSEC_CIPHER_SUITE,
655         IFLA_MACSEC_WINDOW,
656         IFLA_MACSEC_ENCODING_SA,
657         IFLA_MACSEC_ENCRYPT,
658         IFLA_MACSEC_PROTECT,
659         IFLA_MACSEC_INC_SCI,
660         IFLA_MACSEC_ES,
661         IFLA_MACSEC_SCB,
662         IFLA_MACSEC_REPLAY_PROTECT,
663         IFLA_MACSEC_VALIDATION,
664         IFLA_MACSEC_PAD,
665         IFLA_MACSEC_OFFLOAD,
666         __IFLA_MACSEC_MAX,
667 };
668
669 #define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
670
671 /* XFRM section */
672 enum {
673         IFLA_XFRM_UNSPEC,
674         IFLA_XFRM_LINK,
675         IFLA_XFRM_IF_ID,
676         __IFLA_XFRM_MAX
677 };
678
679 #define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
680
681 enum macsec_validation_type {
682         MACSEC_VALIDATE_DISABLED = 0,
683         MACSEC_VALIDATE_CHECK = 1,
684         MACSEC_VALIDATE_STRICT = 2,
685         __MACSEC_VALIDATE_END,
686         MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
687 };
688
689 enum macsec_offload {
690         MACSEC_OFFLOAD_OFF = 0,
691         MACSEC_OFFLOAD_PHY = 1,
692         MACSEC_OFFLOAD_MAC = 2,
693         __MACSEC_OFFLOAD_END,
694         MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
695 };
696
697 /* IPVLAN section */
698 enum {
699         IFLA_IPVLAN_UNSPEC,
700         IFLA_IPVLAN_MODE,
701         IFLA_IPVLAN_FLAGS,
702         __IFLA_IPVLAN_MAX
703 };
704
705 #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
706
707 enum ipvlan_mode {
708         IPVLAN_MODE_L2 = 0,
709         IPVLAN_MODE_L3,
710         IPVLAN_MODE_L3S,
711         IPVLAN_MODE_MAX
712 };
713
714 #define IPVLAN_F_PRIVATE        0x01
715 #define IPVLAN_F_VEPA           0x02
716
717 /* VXLAN section */
718 enum {
719         IFLA_VXLAN_UNSPEC,
720         IFLA_VXLAN_ID,
721         IFLA_VXLAN_GROUP,       /* group or remote address */
722         IFLA_VXLAN_LINK,
723         IFLA_VXLAN_LOCAL,
724         IFLA_VXLAN_TTL,
725         IFLA_VXLAN_TOS,
726         IFLA_VXLAN_LEARNING,
727         IFLA_VXLAN_AGEING,
728         IFLA_VXLAN_LIMIT,
729         IFLA_VXLAN_PORT_RANGE,  /* source port */
730         IFLA_VXLAN_PROXY,
731         IFLA_VXLAN_RSC,
732         IFLA_VXLAN_L2MISS,
733         IFLA_VXLAN_L3MISS,
734         IFLA_VXLAN_PORT,        /* destination port */
735         IFLA_VXLAN_GROUP6,
736         IFLA_VXLAN_LOCAL6,
737         IFLA_VXLAN_UDP_CSUM,
738         IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
739         IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
740         IFLA_VXLAN_REMCSUM_TX,
741         IFLA_VXLAN_REMCSUM_RX,
742         IFLA_VXLAN_GBP,
743         IFLA_VXLAN_REMCSUM_NOPARTIAL,
744         IFLA_VXLAN_COLLECT_METADATA,
745         IFLA_VXLAN_LABEL,
746         IFLA_VXLAN_GPE,
747         IFLA_VXLAN_TTL_INHERIT,
748         IFLA_VXLAN_DF,
749         __IFLA_VXLAN_MAX
750 };
751 #define IFLA_VXLAN_MAX  (__IFLA_VXLAN_MAX - 1)
752
753 struct ifla_vxlan_port_range {
754         __be16  low;
755         __be16  high;
756 };
757
758 enum ifla_vxlan_df {
759         VXLAN_DF_UNSET = 0,
760         VXLAN_DF_SET,
761         VXLAN_DF_INHERIT,
762         __VXLAN_DF_END,
763         VXLAN_DF_MAX = __VXLAN_DF_END - 1,
764 };
765
766 /* GENEVE section */
767 enum {
768         IFLA_GENEVE_UNSPEC,
769         IFLA_GENEVE_ID,
770         IFLA_GENEVE_REMOTE,
771         IFLA_GENEVE_TTL,
772         IFLA_GENEVE_TOS,
773         IFLA_GENEVE_PORT,       /* destination port */
774         IFLA_GENEVE_COLLECT_METADATA,
775         IFLA_GENEVE_REMOTE6,
776         IFLA_GENEVE_UDP_CSUM,
777         IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
778         IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
779         IFLA_GENEVE_LABEL,
780         IFLA_GENEVE_TTL_INHERIT,
781         IFLA_GENEVE_DF,
782         __IFLA_GENEVE_MAX
783 };
784 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
785
786 enum ifla_geneve_df {
787         GENEVE_DF_UNSET = 0,
788         GENEVE_DF_SET,
789         GENEVE_DF_INHERIT,
790         __GENEVE_DF_END,
791         GENEVE_DF_MAX = __GENEVE_DF_END - 1,
792 };
793
794 /* Bareudp section  */
795 enum {
796         IFLA_BAREUDP_UNSPEC,
797         IFLA_BAREUDP_PORT,
798         IFLA_BAREUDP_ETHERTYPE,
799         IFLA_BAREUDP_SRCPORT_MIN,
800         IFLA_BAREUDP_MULTIPROTO_MODE,
801         __IFLA_BAREUDP_MAX
802 };
803
804 #define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
805
806 /* PPP section */
807 enum {
808         IFLA_PPP_UNSPEC,
809         IFLA_PPP_DEV_FD,
810         __IFLA_PPP_MAX
811 };
812 #define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
813
814 /* GTP section */
815
816 enum ifla_gtp_role {
817         GTP_ROLE_GGSN = 0,
818         GTP_ROLE_SGSN,
819 };
820
821 enum {
822         IFLA_GTP_UNSPEC,
823         IFLA_GTP_FD0,
824         IFLA_GTP_FD1,
825         IFLA_GTP_PDP_HASHSIZE,
826         IFLA_GTP_ROLE,
827         __IFLA_GTP_MAX,
828 };
829 #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
830
831 /* Bonding section */
832
833 enum {
834         IFLA_BOND_UNSPEC,
835         IFLA_BOND_MODE,
836         IFLA_BOND_ACTIVE_SLAVE,
837         IFLA_BOND_MIIMON,
838         IFLA_BOND_UPDELAY,
839         IFLA_BOND_DOWNDELAY,
840         IFLA_BOND_USE_CARRIER,
841         IFLA_BOND_ARP_INTERVAL,
842         IFLA_BOND_ARP_IP_TARGET,
843         IFLA_BOND_ARP_VALIDATE,
844         IFLA_BOND_ARP_ALL_TARGETS,
845         IFLA_BOND_PRIMARY,
846         IFLA_BOND_PRIMARY_RESELECT,
847         IFLA_BOND_FAIL_OVER_MAC,
848         IFLA_BOND_XMIT_HASH_POLICY,
849         IFLA_BOND_RESEND_IGMP,
850         IFLA_BOND_NUM_PEER_NOTIF,
851         IFLA_BOND_ALL_SLAVES_ACTIVE,
852         IFLA_BOND_MIN_LINKS,
853         IFLA_BOND_LP_INTERVAL,
854         IFLA_BOND_PACKETS_PER_SLAVE,
855         IFLA_BOND_AD_LACP_RATE,
856         IFLA_BOND_AD_SELECT,
857         IFLA_BOND_AD_INFO,
858         IFLA_BOND_AD_ACTOR_SYS_PRIO,
859         IFLA_BOND_AD_USER_PORT_KEY,
860         IFLA_BOND_AD_ACTOR_SYSTEM,
861         IFLA_BOND_TLB_DYNAMIC_LB,
862         IFLA_BOND_PEER_NOTIF_DELAY,
863         IFLA_BOND_AD_LACP_ACTIVE,
864         IFLA_BOND_MISSED_MAX,
865         IFLA_BOND_NS_IP6_TARGET,
866         __IFLA_BOND_MAX,
867 };
868
869 #define IFLA_BOND_MAX   (__IFLA_BOND_MAX - 1)
870
871 enum {
872         IFLA_BOND_AD_INFO_UNSPEC,
873         IFLA_BOND_AD_INFO_AGGREGATOR,
874         IFLA_BOND_AD_INFO_NUM_PORTS,
875         IFLA_BOND_AD_INFO_ACTOR_KEY,
876         IFLA_BOND_AD_INFO_PARTNER_KEY,
877         IFLA_BOND_AD_INFO_PARTNER_MAC,
878         __IFLA_BOND_AD_INFO_MAX,
879 };
880
881 #define IFLA_BOND_AD_INFO_MAX   (__IFLA_BOND_AD_INFO_MAX - 1)
882
883 enum {
884         IFLA_BOND_SLAVE_UNSPEC,
885         IFLA_BOND_SLAVE_STATE,
886         IFLA_BOND_SLAVE_MII_STATUS,
887         IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
888         IFLA_BOND_SLAVE_PERM_HWADDR,
889         IFLA_BOND_SLAVE_QUEUE_ID,
890         IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
891         IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
892         IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
893         IFLA_BOND_SLAVE_PRIO,
894         __IFLA_BOND_SLAVE_MAX,
895 };
896
897 #define IFLA_BOND_SLAVE_MAX     (__IFLA_BOND_SLAVE_MAX - 1)
898
899 /* SR-IOV virtual function management section */
900
901 enum {
902         IFLA_VF_INFO_UNSPEC,
903         IFLA_VF_INFO,
904         __IFLA_VF_INFO_MAX,
905 };
906
907 #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
908
909 enum {
910         IFLA_VF_UNSPEC,
911         IFLA_VF_MAC,            /* Hardware queue specific attributes */
912         IFLA_VF_VLAN,           /* VLAN ID and QoS */
913         IFLA_VF_TX_RATE,        /* Max TX Bandwidth Allocation */
914         IFLA_VF_SPOOFCHK,       /* Spoof Checking on/off switch */
915         IFLA_VF_LINK_STATE,     /* link state enable/disable/auto switch */
916         IFLA_VF_RATE,           /* Min and Max TX Bandwidth Allocation */
917         IFLA_VF_RSS_QUERY_EN,   /* RSS Redirection Table and Hash Key query
918                                  * on/off switch
919                                  */
920         IFLA_VF_STATS,          /* network device statistics */
921         IFLA_VF_TRUST,          /* Trust VF */
922         IFLA_VF_IB_NODE_GUID,   /* VF Infiniband node GUID */
923         IFLA_VF_IB_PORT_GUID,   /* VF Infiniband port GUID */
924         IFLA_VF_VLAN_LIST,      /* nested list of vlans, option for QinQ */
925         IFLA_VF_BROADCAST,      /* VF broadcast */
926         __IFLA_VF_MAX,
927 };
928
929 #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
930
931 struct ifla_vf_mac {
932         __u32 vf;
933         __u8 mac[32]; /* MAX_ADDR_LEN */
934 };
935
936 struct ifla_vf_broadcast {
937         __u8 broadcast[32];
938 };
939
940 struct ifla_vf_vlan {
941         __u32 vf;
942         __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
943         __u32 qos;
944 };
945
946 enum {
947         IFLA_VF_VLAN_INFO_UNSPEC,
948         IFLA_VF_VLAN_INFO,      /* VLAN ID, QoS and VLAN protocol */
949         __IFLA_VF_VLAN_INFO_MAX,
950 };
951
952 #define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
953 #define MAX_VLAN_LIST_LEN 1
954
955 struct ifla_vf_vlan_info {
956         __u32 vf;
957         __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
958         __u32 qos;
959         __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
960 };
961
962 struct ifla_vf_tx_rate {
963         __u32 vf;
964         __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
965 };
966
967 struct ifla_vf_rate {
968         __u32 vf;
969         __u32 min_tx_rate; /* Min Bandwidth in Mbps */
970         __u32 max_tx_rate; /* Max Bandwidth in Mbps */
971 };
972
973 struct ifla_vf_spoofchk {
974         __u32 vf;
975         __u32 setting;
976 };
977
978 struct ifla_vf_guid {
979         __u32 vf;
980         __u64 guid;
981 };
982
983 enum {
984         IFLA_VF_LINK_STATE_AUTO,        /* link state of the uplink */
985         IFLA_VF_LINK_STATE_ENABLE,      /* link always up */
986         IFLA_VF_LINK_STATE_DISABLE,     /* link always down */
987         __IFLA_VF_LINK_STATE_MAX,
988 };
989
990 struct ifla_vf_link_state {
991         __u32 vf;
992         __u32 link_state;
993 };
994
995 struct ifla_vf_rss_query_en {
996         __u32 vf;
997         __u32 setting;
998 };
999
1000 enum {
1001         IFLA_VF_STATS_RX_PACKETS,
1002         IFLA_VF_STATS_TX_PACKETS,
1003         IFLA_VF_STATS_RX_BYTES,
1004         IFLA_VF_STATS_TX_BYTES,
1005         IFLA_VF_STATS_BROADCAST,
1006         IFLA_VF_STATS_MULTICAST,
1007         IFLA_VF_STATS_PAD,
1008         IFLA_VF_STATS_RX_DROPPED,
1009         IFLA_VF_STATS_TX_DROPPED,
1010         __IFLA_VF_STATS_MAX,
1011 };
1012
1013 #define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
1014
1015 struct ifla_vf_trust {
1016         __u32 vf;
1017         __u32 setting;
1018 };
1019
1020 /* VF ports management section
1021  *
1022  *      Nested layout of set/get msg is:
1023  *
1024  *              [IFLA_NUM_VF]
1025  *              [IFLA_VF_PORTS]
1026  *                      [IFLA_VF_PORT]
1027  *                              [IFLA_PORT_*], ...
1028  *                      [IFLA_VF_PORT]
1029  *                              [IFLA_PORT_*], ...
1030  *                      ...
1031  *              [IFLA_PORT_SELF]
1032  *                      [IFLA_PORT_*], ...
1033  */
1034
1035 enum {
1036         IFLA_VF_PORT_UNSPEC,
1037         IFLA_VF_PORT,                   /* nest */
1038         __IFLA_VF_PORT_MAX,
1039 };
1040
1041 #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
1042
1043 enum {
1044         IFLA_PORT_UNSPEC,
1045         IFLA_PORT_VF,                   /* __u32 */
1046         IFLA_PORT_PROFILE,              /* string */
1047         IFLA_PORT_VSI_TYPE,             /* 802.1Qbg (pre-)standard VDP */
1048         IFLA_PORT_INSTANCE_UUID,        /* binary UUID */
1049         IFLA_PORT_HOST_UUID,            /* binary UUID */
1050         IFLA_PORT_REQUEST,              /* __u8 */
1051         IFLA_PORT_RESPONSE,             /* __u16, output only */
1052         __IFLA_PORT_MAX,
1053 };
1054
1055 #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
1056
1057 #define PORT_PROFILE_MAX        40
1058 #define PORT_UUID_MAX           16
1059 #define PORT_SELF_VF            -1
1060
1061 enum {
1062         PORT_REQUEST_PREASSOCIATE = 0,
1063         PORT_REQUEST_PREASSOCIATE_RR,
1064         PORT_REQUEST_ASSOCIATE,
1065         PORT_REQUEST_DISASSOCIATE,
1066 };
1067
1068 enum {
1069         PORT_VDP_RESPONSE_SUCCESS = 0,
1070         PORT_VDP_RESPONSE_INVALID_FORMAT,
1071         PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
1072         PORT_VDP_RESPONSE_UNUSED_VTID,
1073         PORT_VDP_RESPONSE_VTID_VIOLATION,
1074         PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
1075         PORT_VDP_RESPONSE_OUT_OF_SYNC,
1076         /* 0x08-0xFF reserved for future VDP use */
1077         PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
1078         PORT_PROFILE_RESPONSE_INPROGRESS,
1079         PORT_PROFILE_RESPONSE_INVALID,
1080         PORT_PROFILE_RESPONSE_BADSTATE,
1081         PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
1082         PORT_PROFILE_RESPONSE_ERROR,
1083 };
1084
1085 struct ifla_port_vsi {
1086         __u8 vsi_mgr_id;
1087         __u8 vsi_type_id[3];
1088         __u8 vsi_type_version;
1089         __u8 pad[3];
1090 };
1091
1092
1093 /* IPoIB section */
1094
1095 enum {
1096         IFLA_IPOIB_UNSPEC,
1097         IFLA_IPOIB_PKEY,
1098         IFLA_IPOIB_MODE,
1099         IFLA_IPOIB_UMCAST,
1100         __IFLA_IPOIB_MAX
1101 };
1102
1103 enum {
1104         IPOIB_MODE_DATAGRAM  = 0, /* using unreliable datagram QPs */
1105         IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
1106 };
1107
1108 #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
1109
1110
1111 /* HSR/PRP section, both uses same interface */
1112
1113 /* Different redundancy protocols for hsr device */
1114 enum {
1115         HSR_PROTOCOL_HSR,
1116         HSR_PROTOCOL_PRP,
1117         HSR_PROTOCOL_MAX,
1118 };
1119
1120 enum {
1121         IFLA_HSR_UNSPEC,
1122         IFLA_HSR_SLAVE1,
1123         IFLA_HSR_SLAVE2,
1124         IFLA_HSR_MULTICAST_SPEC,        /* Last byte of supervision addr */
1125         IFLA_HSR_SUPERVISION_ADDR,      /* Supervision frame multicast addr */
1126         IFLA_HSR_SEQ_NR,
1127         IFLA_HSR_VERSION,               /* HSR version */
1128         IFLA_HSR_PROTOCOL,              /* Indicate different protocol than
1129                                          * HSR. For example PRP.
1130                                          */
1131         __IFLA_HSR_MAX,
1132 };
1133
1134 #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
1135
1136 /* STATS section */
1137
1138 struct if_stats_msg {
1139         __u8  family;
1140         __u8  pad1;
1141         __u16 pad2;
1142         __u32 ifindex;
1143         __u32 filter_mask;
1144 };
1145
1146 /* A stats attribute can be netdev specific or a global stat.
1147  * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
1148  */
1149 enum {
1150         IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
1151         IFLA_STATS_LINK_64,
1152         IFLA_STATS_LINK_XSTATS,
1153         IFLA_STATS_LINK_XSTATS_SLAVE,
1154         IFLA_STATS_LINK_OFFLOAD_XSTATS,
1155         IFLA_STATS_AF_SPEC,
1156         __IFLA_STATS_MAX,
1157 };
1158
1159 #define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
1160
1161 #define IFLA_STATS_FILTER_BIT(ATTR)     (1 << (ATTR - 1))
1162
1163 /* These are embedded into IFLA_STATS_LINK_XSTATS:
1164  * [IFLA_STATS_LINK_XSTATS]
1165  * -> [LINK_XSTATS_TYPE_xxx]
1166  *    -> [rtnl link type specific attributes]
1167  */
1168 enum {
1169         LINK_XSTATS_TYPE_UNSPEC,
1170         LINK_XSTATS_TYPE_BRIDGE,
1171         LINK_XSTATS_TYPE_BOND,
1172         __LINK_XSTATS_TYPE_MAX
1173 };
1174 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
1175
1176 /* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
1177 enum {
1178         IFLA_OFFLOAD_XSTATS_UNSPEC,
1179         IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
1180         __IFLA_OFFLOAD_XSTATS_MAX
1181 };
1182 #define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
1183
1184 /* XDP section */
1185
1186 #define XDP_FLAGS_UPDATE_IF_NOEXIST     (1U << 0)
1187 #define XDP_FLAGS_SKB_MODE              (1U << 1)
1188 #define XDP_FLAGS_DRV_MODE              (1U << 2)
1189 #define XDP_FLAGS_HW_MODE               (1U << 3)
1190 #define XDP_FLAGS_REPLACE               (1U << 4)
1191 #define XDP_FLAGS_MODES                 (XDP_FLAGS_SKB_MODE | \
1192                                          XDP_FLAGS_DRV_MODE | \
1193                                          XDP_FLAGS_HW_MODE)
1194 #define XDP_FLAGS_MASK                  (XDP_FLAGS_UPDATE_IF_NOEXIST | \
1195                                          XDP_FLAGS_MODES | XDP_FLAGS_REPLACE)
1196
1197 /* These are stored into IFLA_XDP_ATTACHED on dump. */
1198 enum {
1199         XDP_ATTACHED_NONE = 0,
1200         XDP_ATTACHED_DRV,
1201         XDP_ATTACHED_SKB,
1202         XDP_ATTACHED_HW,
1203         XDP_ATTACHED_MULTI,
1204 };
1205
1206 enum {
1207         IFLA_XDP_UNSPEC,
1208         IFLA_XDP_FD,
1209         IFLA_XDP_ATTACHED,
1210         IFLA_XDP_FLAGS,
1211         IFLA_XDP_PROG_ID,
1212         IFLA_XDP_DRV_PROG_ID,
1213         IFLA_XDP_SKB_PROG_ID,
1214         IFLA_XDP_HW_PROG_ID,
1215         IFLA_XDP_EXPECTED_FD,
1216         __IFLA_XDP_MAX,
1217 };
1218
1219 #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
1220
1221 enum {
1222         IFLA_EVENT_NONE,
1223         IFLA_EVENT_REBOOT,              /* internal reset / reboot */
1224         IFLA_EVENT_FEATURES,            /* change in offload features */
1225         IFLA_EVENT_BONDING_FAILOVER,    /* change in active slave */
1226         IFLA_EVENT_NOTIFY_PEERS,        /* re-sent grat. arp/ndisc */
1227         IFLA_EVENT_IGMP_RESEND,         /* re-sent IGMP JOIN */
1228         IFLA_EVENT_BONDING_OPTIONS,     /* change in bonding options */
1229 };
1230
1231 /* tun section */
1232
1233 enum {
1234         IFLA_TUN_UNSPEC,
1235         IFLA_TUN_OWNER,
1236         IFLA_TUN_GROUP,
1237         IFLA_TUN_TYPE,
1238         IFLA_TUN_PI,
1239         IFLA_TUN_VNET_HDR,
1240         IFLA_TUN_PERSIST,
1241         IFLA_TUN_MULTI_QUEUE,
1242         IFLA_TUN_NUM_QUEUES,
1243         IFLA_TUN_NUM_DISABLED_QUEUES,
1244         __IFLA_TUN_MAX,
1245 };
1246
1247 #define IFLA_TUN_MAX (__IFLA_TUN_MAX - 1)
1248
1249 /* rmnet section */
1250
1251 #define RMNET_FLAGS_INGRESS_DEAGGREGATION         (1U << 0)
1252 #define RMNET_FLAGS_INGRESS_MAP_COMMANDS          (1U << 1)
1253 #define RMNET_FLAGS_INGRESS_MAP_CKSUMV4           (1U << 2)
1254 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4            (1U << 3)
1255 #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5           (1U << 4)
1256 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5            (1U << 5)
1257
1258 enum {
1259         IFLA_RMNET_UNSPEC,
1260         IFLA_RMNET_MUX_ID,
1261         IFLA_RMNET_FLAGS,
1262         __IFLA_RMNET_MAX,
1263 };
1264
1265 #define IFLA_RMNET_MAX  (__IFLA_RMNET_MAX - 1)
1266
1267 struct ifla_rmnet_flags {
1268         __u32   flags;
1269         __u32   mask;
1270 };
1271
1272 /* MCTP section */
1273
1274 enum {
1275         IFLA_MCTP_UNSPEC,
1276         IFLA_MCTP_NET,
1277         __IFLA_MCTP_MAX,
1278 };
1279
1280 #define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)
1281
1282 #endif /* _UAPI_LINUX_IF_LINK_H */