Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_LINUX_IF_LINK_H
0003 #define _UAPI_LINUX_IF_LINK_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/netlink.h>
0007 
0008 /* This struct should be in sync with struct rtnl_link_stats64 */
0009 struct rtnl_link_stats {
0010     __u32   rx_packets;
0011     __u32   tx_packets;
0012     __u32   rx_bytes;
0013     __u32   tx_bytes;
0014     __u32   rx_errors;
0015     __u32   tx_errors;
0016     __u32   rx_dropped;
0017     __u32   tx_dropped;
0018     __u32   multicast;
0019     __u32   collisions;
0020     /* detailed rx_errors: */
0021     __u32   rx_length_errors;
0022     __u32   rx_over_errors;
0023     __u32   rx_crc_errors;
0024     __u32   rx_frame_errors;
0025     __u32   rx_fifo_errors;
0026     __u32   rx_missed_errors;
0027 
0028     /* detailed tx_errors */
0029     __u32   tx_aborted_errors;
0030     __u32   tx_carrier_errors;
0031     __u32   tx_fifo_errors;
0032     __u32   tx_heartbeat_errors;
0033     __u32   tx_window_errors;
0034 
0035     /* for cslip etc */
0036     __u32   rx_compressed;
0037     __u32   tx_compressed;
0038 
0039     __u32   rx_nohandler;
0040 };
0041 
0042 /**
0043  * struct rtnl_link_stats64 - The main device statistics structure.
0044  *
0045  * @rx_packets: Number of good packets received by the interface.
0046  *   For hardware interfaces counts all good packets received from the device
0047  *   by the host, including packets which host had to drop at various stages
0048  *   of processing (even in the driver).
0049  *
0050  * @tx_packets: Number of packets successfully transmitted.
0051  *   For hardware interfaces counts packets which host was able to successfully
0052  *   hand over to the device, which does not necessarily mean that packets
0053  *   had been successfully transmitted out of the device, only that device
0054  *   acknowledged it copied them out of host memory.
0055  *
0056  * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
0057  *
0058  *   For IEEE 802.3 devices should count the length of Ethernet Frames
0059  *   excluding the FCS.
0060  *
0061  * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
0062  *
0063  *   For IEEE 802.3 devices should count the length of Ethernet Frames
0064  *   excluding the FCS.
0065  *
0066  * @rx_errors: Total number of bad packets received on this network device.
0067  *   This counter must include events counted by @rx_length_errors,
0068  *   @rx_crc_errors, @rx_frame_errors and other errors not otherwise
0069  *   counted.
0070  *
0071  * @tx_errors: Total number of transmit problems.
0072  *   This counter must include events counter by @tx_aborted_errors,
0073  *   @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
0074  *   @tx_window_errors and other errors not otherwise counted.
0075  *
0076  * @rx_dropped: Number of packets received but not processed,
0077  *   e.g. due to lack of resources or unsupported protocol.
0078  *   For hardware interfaces this counter may include packets discarded
0079  *   due to L2 address filtering but should not include packets dropped
0080  *   by the device due to buffer exhaustion which are counted separately in
0081  *   @rx_missed_errors (since procfs folds those two counters together).
0082  *
0083  * @tx_dropped: Number of packets dropped on their way to transmission,
0084  *   e.g. due to lack of resources.
0085  *
0086  * @multicast: Multicast packets received.
0087  *   For hardware interfaces this statistic is commonly calculated
0088  *   at the device level (unlike @rx_packets) and therefore may include
0089  *   packets which did not reach the host.
0090  *
0091  *   For IEEE 802.3 devices this counter may be equivalent to:
0092  *
0093  *    - 30.3.1.1.21 aMulticastFramesReceivedOK
0094  *
0095  * @collisions: Number of collisions during packet transmissions.
0096  *
0097  * @rx_length_errors: Number of packets dropped due to invalid length.
0098  *   Part of aggregate "frame" errors in `/proc/net/dev`.
0099  *
0100  *   For IEEE 802.3 devices this counter should be equivalent to a sum
0101  *   of the following attributes:
0102  *
0103  *    - 30.3.1.1.23 aInRangeLengthErrors
0104  *    - 30.3.1.1.24 aOutOfRangeLengthField
0105  *    - 30.3.1.1.25 aFrameTooLongErrors
0106  *
0107  * @rx_over_errors: Receiver FIFO overflow event counter.
0108  *
0109  *   Historically the count of overflow events. Such events may be
0110  *   reported in the receive descriptors or via interrupts, and may
0111  *   not correspond one-to-one with dropped packets.
0112  *
0113  *   The recommended interpretation for high speed interfaces is -
0114  *   number of packets dropped because they did not fit into buffers
0115  *   provided by the host, e.g. packets larger than MTU or next buffer
0116  *   in the ring was not available for a scatter transfer.
0117  *
0118  *   Part of aggregate "frame" errors in `/proc/net/dev`.
0119  *
0120  *   This statistics was historically used interchangeably with
0121  *   @rx_fifo_errors.
0122  *
0123  *   This statistic corresponds to hardware events and is not commonly used
0124  *   on software devices.
0125  *
0126  * @rx_crc_errors: Number of packets received with a CRC error.
0127  *   Part of aggregate "frame" errors in `/proc/net/dev`.
0128  *
0129  *   For IEEE 802.3 devices this counter must be equivalent to:
0130  *
0131  *    - 30.3.1.1.6 aFrameCheckSequenceErrors
0132  *
0133  * @rx_frame_errors: Receiver frame alignment errors.
0134  *   Part of aggregate "frame" errors in `/proc/net/dev`.
0135  *
0136  *   For IEEE 802.3 devices this counter should be equivalent to:
0137  *
0138  *    - 30.3.1.1.7 aAlignmentErrors
0139  *
0140  * @rx_fifo_errors: Receiver FIFO error counter.
0141  *
0142  *   Historically the count of overflow events. Those events may be
0143  *   reported in the receive descriptors or via interrupts, and may
0144  *   not correspond one-to-one with dropped packets.
0145  *
0146  *   This statistics was used interchangeably with @rx_over_errors.
0147  *   Not recommended for use in drivers for high speed interfaces.
0148  *
0149  *   This statistic is used on software devices, e.g. to count software
0150  *   packet queue overflow (can) or sequencing errors (GRE).
0151  *
0152  * @rx_missed_errors: Count of packets missed by the host.
0153  *   Folded into the "drop" counter in `/proc/net/dev`.
0154  *
0155  *   Counts number of packets dropped by the device due to lack
0156  *   of buffer space. This usually indicates that the host interface
0157  *   is slower than the network interface, or host is not keeping up
0158  *   with the receive packet rate.
0159  *
0160  *   This statistic corresponds to hardware events and is not used
0161  *   on software devices.
0162  *
0163  * @tx_aborted_errors:
0164  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
0165  *   For IEEE 802.3 devices capable of half-duplex operation this counter
0166  *   must be equivalent to:
0167  *
0168  *    - 30.3.1.1.11 aFramesAbortedDueToXSColls
0169  *
0170  *   High speed interfaces may use this counter as a general device
0171  *   discard counter.
0172  *
0173  * @tx_carrier_errors: Number of frame transmission errors due to loss
0174  *   of carrier during transmission.
0175  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
0176  *
0177  *   For IEEE 802.3 devices this counter must be equivalent to:
0178  *
0179  *    - 30.3.1.1.13 aCarrierSenseErrors
0180  *
0181  * @tx_fifo_errors: Number of frame transmission errors due to device
0182  *   FIFO underrun / underflow. This condition occurs when the device
0183  *   begins transmission of a frame but is unable to deliver the
0184  *   entire frame to the transmitter in time for transmission.
0185  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
0186  *
0187  * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
0188  *   old half-duplex Ethernet.
0189  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
0190  *
0191  *   For IEEE 802.3 devices possibly equivalent to:
0192  *
0193  *    - 30.3.2.1.4 aSQETestErrors
0194  *
0195  * @tx_window_errors: Number of frame transmission errors due
0196  *   to late collisions (for Ethernet - after the first 64B of transmission).
0197  *   Part of aggregate "carrier" errors in `/proc/net/dev`.
0198  *
0199  *   For IEEE 802.3 devices this counter must be equivalent to:
0200  *
0201  *    - 30.3.1.1.10 aLateCollisions
0202  *
0203  * @rx_compressed: Number of correctly received compressed packets.
0204  *   This counters is only meaningful for interfaces which support
0205  *   packet compression (e.g. CSLIP, PPP).
0206  *
0207  * @tx_compressed: Number of transmitted compressed packets.
0208  *   This counters is only meaningful for interfaces which support
0209  *   packet compression (e.g. CSLIP, PPP).
0210  *
0211  * @rx_nohandler: Number of packets received on the interface
0212  *   but dropped by the networking stack because the device is
0213  *   not designated to receive packets (e.g. backup link in a bond).
0214  */
0215 struct rtnl_link_stats64 {
0216     __u64   rx_packets;
0217     __u64   tx_packets;
0218     __u64   rx_bytes;
0219     __u64   tx_bytes;
0220     __u64   rx_errors;
0221     __u64   tx_errors;
0222     __u64   rx_dropped;
0223     __u64   tx_dropped;
0224     __u64   multicast;
0225     __u64   collisions;
0226 
0227     /* detailed rx_errors: */
0228     __u64   rx_length_errors;
0229     __u64   rx_over_errors;
0230     __u64   rx_crc_errors;
0231     __u64   rx_frame_errors;
0232     __u64   rx_fifo_errors;
0233     __u64   rx_missed_errors;
0234 
0235     /* detailed tx_errors */
0236     __u64   tx_aborted_errors;
0237     __u64   tx_carrier_errors;
0238     __u64   tx_fifo_errors;
0239     __u64   tx_heartbeat_errors;
0240     __u64   tx_window_errors;
0241 
0242     /* for cslip etc */
0243     __u64   rx_compressed;
0244     __u64   tx_compressed;
0245     __u64   rx_nohandler;
0246 };
0247 
0248 /* The struct should be in sync with struct ifmap */
0249 struct rtnl_link_ifmap {
0250     __u64   mem_start;
0251     __u64   mem_end;
0252     __u64   base_addr;
0253     __u16   irq;
0254     __u8    dma;
0255     __u8    port;
0256 };
0257 
0258 /*
0259  * IFLA_AF_SPEC
0260  *   Contains nested attributes for address family specific attributes.
0261  *   Each address family may create a attribute with the address family
0262  *   number as type and create its own attribute structure in it.
0263  *
0264  *   Example:
0265  *   [IFLA_AF_SPEC] = {
0266  *       [AF_INET] = {
0267  *           [IFLA_INET_CONF] = ...,
0268  *       },
0269  *       [AF_INET6] = {
0270  *           [IFLA_INET6_FLAGS] = ...,
0271  *           [IFLA_INET6_CONF] = ...,
0272  *       }
0273  *   }
0274  */
0275 
0276 enum {
0277     IFLA_UNSPEC,
0278     IFLA_ADDRESS,
0279     IFLA_BROADCAST,
0280     IFLA_IFNAME,
0281     IFLA_MTU,
0282     IFLA_LINK,
0283     IFLA_QDISC,
0284     IFLA_STATS,
0285     IFLA_COST,
0286 #define IFLA_COST IFLA_COST
0287     IFLA_PRIORITY,
0288 #define IFLA_PRIORITY IFLA_PRIORITY
0289     IFLA_MASTER,
0290 #define IFLA_MASTER IFLA_MASTER
0291     IFLA_WIRELESS,      /* Wireless Extension event - see wireless.h */
0292 #define IFLA_WIRELESS IFLA_WIRELESS
0293     IFLA_PROTINFO,      /* Protocol specific information for a link */
0294 #define IFLA_PROTINFO IFLA_PROTINFO
0295     IFLA_TXQLEN,
0296 #define IFLA_TXQLEN IFLA_TXQLEN
0297     IFLA_MAP,
0298 #define IFLA_MAP IFLA_MAP
0299     IFLA_WEIGHT,
0300 #define IFLA_WEIGHT IFLA_WEIGHT
0301     IFLA_OPERSTATE,
0302     IFLA_LINKMODE,
0303     IFLA_LINKINFO,
0304 #define IFLA_LINKINFO IFLA_LINKINFO
0305     IFLA_NET_NS_PID,
0306     IFLA_IFALIAS,
0307     IFLA_NUM_VF,        /* Number of VFs if device is SR-IOV PF */
0308     IFLA_VFINFO_LIST,
0309     IFLA_STATS64,
0310     IFLA_VF_PORTS,
0311     IFLA_PORT_SELF,
0312     IFLA_AF_SPEC,
0313     IFLA_GROUP,     /* Group the device belongs to */
0314     IFLA_NET_NS_FD,
0315     IFLA_EXT_MASK,      /* Extended info mask, VFs, etc */
0316     IFLA_PROMISCUITY,   /* Promiscuity count: > 0 means acts PROMISC */
0317 #define IFLA_PROMISCUITY IFLA_PROMISCUITY
0318     IFLA_NUM_TX_QUEUES,
0319     IFLA_NUM_RX_QUEUES,
0320     IFLA_CARRIER,
0321     IFLA_PHYS_PORT_ID,
0322     IFLA_CARRIER_CHANGES,
0323     IFLA_PHYS_SWITCH_ID,
0324     IFLA_LINK_NETNSID,
0325     IFLA_PHYS_PORT_NAME,
0326     IFLA_PROTO_DOWN,
0327     IFLA_GSO_MAX_SEGS,
0328     IFLA_GSO_MAX_SIZE,
0329     IFLA_PAD,
0330     IFLA_XDP,
0331     IFLA_EVENT,
0332     IFLA_NEW_NETNSID,
0333     IFLA_IF_NETNSID,
0334     IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, /* new alias */
0335     IFLA_CARRIER_UP_COUNT,
0336     IFLA_CARRIER_DOWN_COUNT,
0337     IFLA_NEW_IFINDEX,
0338     IFLA_MIN_MTU,
0339     IFLA_MAX_MTU,
0340     IFLA_PROP_LIST,
0341     IFLA_ALT_IFNAME, /* Alternative ifname */
0342     IFLA_PERM_ADDRESS,
0343     IFLA_PROTO_DOWN_REASON,
0344 
0345     /* device (sysfs) name as parent, used instead
0346      * of IFLA_LINK where there's no parent netdev
0347      */
0348     IFLA_PARENT_DEV_NAME,
0349     IFLA_PARENT_DEV_BUS_NAME,
0350     IFLA_GRO_MAX_SIZE,
0351     IFLA_TSO_MAX_SIZE,
0352     IFLA_TSO_MAX_SEGS,
0353 
0354     __IFLA_MAX
0355 };
0356 
0357 
0358 #define IFLA_MAX (__IFLA_MAX - 1)
0359 
0360 enum {
0361     IFLA_PROTO_DOWN_REASON_UNSPEC,
0362     IFLA_PROTO_DOWN_REASON_MASK,    /* u32, mask for reason bits */
0363     IFLA_PROTO_DOWN_REASON_VALUE,   /* u32, reason bit value */
0364 
0365     __IFLA_PROTO_DOWN_REASON_CNT,
0366     IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
0367 };
0368 
0369 /* backwards compatibility for userspace */
0370 #ifndef __KERNEL__
0371 #define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
0372 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
0373 #endif
0374 
0375 enum {
0376     IFLA_INET_UNSPEC,
0377     IFLA_INET_CONF,
0378     __IFLA_INET_MAX,
0379 };
0380 
0381 #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
0382 
0383 /* ifi_flags.
0384 
0385    IFF_* flags.
0386 
0387    The only change is:
0388    IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
0389    more not changeable by user. They describe link media
0390    characteristics and set by device driver.
0391 
0392    Comments:
0393    - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
0394    - If neither of these three flags are set;
0395      the interface is NBMA.
0396 
0397    - IFF_MULTICAST does not mean anything special:
0398    multicasts can be used on all not-NBMA links.
0399    IFF_MULTICAST means that this media uses special encapsulation
0400    for multicast frames. Apparently, all IFF_POINTOPOINT and
0401    IFF_BROADCAST devices are able to use multicasts too.
0402  */
0403 
0404 /* IFLA_LINK.
0405    For usual devices it is equal ifi_index.
0406    If it is a "virtual interface" (f.e. tunnel), ifi_link
0407    can point to real physical interface (f.e. for bandwidth calculations),
0408    or maybe 0, what means, that real media is unknown (usual
0409    for IPIP tunnels, when route to endpoint is allowed to change)
0410  */
0411 
0412 /* Subtype attributes for IFLA_PROTINFO */
0413 enum {
0414     IFLA_INET6_UNSPEC,
0415     IFLA_INET6_FLAGS,   /* link flags           */
0416     IFLA_INET6_CONF,    /* sysctl parameters        */
0417     IFLA_INET6_STATS,   /* statistics           */
0418     IFLA_INET6_MCAST,   /* MC things. What of them? */
0419     IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
0420     IFLA_INET6_ICMP6STATS,  /* statistics (icmpv6)      */
0421     IFLA_INET6_TOKEN,   /* device token         */
0422     IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
0423     IFLA_INET6_RA_MTU,  /* mtu carried in the RA message */
0424     __IFLA_INET6_MAX
0425 };
0426 
0427 #define IFLA_INET6_MAX  (__IFLA_INET6_MAX - 1)
0428 
0429 enum in6_addr_gen_mode {
0430     IN6_ADDR_GEN_MODE_EUI64,
0431     IN6_ADDR_GEN_MODE_NONE,
0432     IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
0433     IN6_ADDR_GEN_MODE_RANDOM,
0434 };
0435 
0436 /* Bridge section */
0437 
0438 enum {
0439     IFLA_BR_UNSPEC,
0440     IFLA_BR_FORWARD_DELAY,
0441     IFLA_BR_HELLO_TIME,
0442     IFLA_BR_MAX_AGE,
0443     IFLA_BR_AGEING_TIME,
0444     IFLA_BR_STP_STATE,
0445     IFLA_BR_PRIORITY,
0446     IFLA_BR_VLAN_FILTERING,
0447     IFLA_BR_VLAN_PROTOCOL,
0448     IFLA_BR_GROUP_FWD_MASK,
0449     IFLA_BR_ROOT_ID,
0450     IFLA_BR_BRIDGE_ID,
0451     IFLA_BR_ROOT_PORT,
0452     IFLA_BR_ROOT_PATH_COST,
0453     IFLA_BR_TOPOLOGY_CHANGE,
0454     IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
0455     IFLA_BR_HELLO_TIMER,
0456     IFLA_BR_TCN_TIMER,
0457     IFLA_BR_TOPOLOGY_CHANGE_TIMER,
0458     IFLA_BR_GC_TIMER,
0459     IFLA_BR_GROUP_ADDR,
0460     IFLA_BR_FDB_FLUSH,
0461     IFLA_BR_MCAST_ROUTER,
0462     IFLA_BR_MCAST_SNOOPING,
0463     IFLA_BR_MCAST_QUERY_USE_IFADDR,
0464     IFLA_BR_MCAST_QUERIER,
0465     IFLA_BR_MCAST_HASH_ELASTICITY,
0466     IFLA_BR_MCAST_HASH_MAX,
0467     IFLA_BR_MCAST_LAST_MEMBER_CNT,
0468     IFLA_BR_MCAST_STARTUP_QUERY_CNT,
0469     IFLA_BR_MCAST_LAST_MEMBER_INTVL,
0470     IFLA_BR_MCAST_MEMBERSHIP_INTVL,
0471     IFLA_BR_MCAST_QUERIER_INTVL,
0472     IFLA_BR_MCAST_QUERY_INTVL,
0473     IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
0474     IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
0475     IFLA_BR_NF_CALL_IPTABLES,
0476     IFLA_BR_NF_CALL_IP6TABLES,
0477     IFLA_BR_NF_CALL_ARPTABLES,
0478     IFLA_BR_VLAN_DEFAULT_PVID,
0479     IFLA_BR_PAD,
0480     IFLA_BR_VLAN_STATS_ENABLED,
0481     IFLA_BR_MCAST_STATS_ENABLED,
0482     IFLA_BR_MCAST_IGMP_VERSION,
0483     IFLA_BR_MCAST_MLD_VERSION,
0484     IFLA_BR_VLAN_STATS_PER_PORT,
0485     IFLA_BR_MULTI_BOOLOPT,
0486     IFLA_BR_MCAST_QUERIER_STATE,
0487     __IFLA_BR_MAX,
0488 };
0489 
0490 #define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
0491 
0492 struct ifla_bridge_id {
0493     __u8    prio[2];
0494     __u8    addr[6]; /* ETH_ALEN */
0495 };
0496 
0497 enum {
0498     BRIDGE_MODE_UNSPEC,
0499     BRIDGE_MODE_HAIRPIN,
0500 };
0501 
0502 enum {
0503     IFLA_BRPORT_UNSPEC,
0504     IFLA_BRPORT_STATE,  /* Spanning tree state     */
0505     IFLA_BRPORT_PRIORITY,   /* "             priority  */
0506     IFLA_BRPORT_COST,   /* "             cost      */
0507     IFLA_BRPORT_MODE,   /* mode (hairpin)          */
0508     IFLA_BRPORT_GUARD,  /* bpdu guard              */
0509     IFLA_BRPORT_PROTECT,    /* root port protection    */
0510     IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave    */
0511     IFLA_BRPORT_LEARNING,   /* mac learning */
0512     IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
0513     IFLA_BRPORT_PROXYARP,   /* proxy ARP */
0514     IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
0515     IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
0516     IFLA_BRPORT_ROOT_ID,    /* designated root */
0517     IFLA_BRPORT_BRIDGE_ID,  /* designated bridge */
0518     IFLA_BRPORT_DESIGNATED_PORT,
0519     IFLA_BRPORT_DESIGNATED_COST,
0520     IFLA_BRPORT_ID,
0521     IFLA_BRPORT_NO,
0522     IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
0523     IFLA_BRPORT_CONFIG_PENDING,
0524     IFLA_BRPORT_MESSAGE_AGE_TIMER,
0525     IFLA_BRPORT_FORWARD_DELAY_TIMER,
0526     IFLA_BRPORT_HOLD_TIMER,
0527     IFLA_BRPORT_FLUSH,
0528     IFLA_BRPORT_MULTICAST_ROUTER,
0529     IFLA_BRPORT_PAD,
0530     IFLA_BRPORT_MCAST_FLOOD,
0531     IFLA_BRPORT_MCAST_TO_UCAST,
0532     IFLA_BRPORT_VLAN_TUNNEL,
0533     IFLA_BRPORT_BCAST_FLOOD,
0534     IFLA_BRPORT_GROUP_FWD_MASK,
0535     IFLA_BRPORT_NEIGH_SUPPRESS,
0536     IFLA_BRPORT_ISOLATED,
0537     IFLA_BRPORT_BACKUP_PORT,
0538     IFLA_BRPORT_MRP_RING_OPEN,
0539     IFLA_BRPORT_MRP_IN_OPEN,
0540     IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
0541     IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
0542     __IFLA_BRPORT_MAX
0543 };
0544 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
0545 
0546 struct ifla_cacheinfo {
0547     __u32   max_reasm_len;
0548     __u32   tstamp;     /* ipv6InterfaceTable updated timestamp */
0549     __u32   reachable_time;
0550     __u32   retrans_time;
0551 };
0552 
0553 enum {
0554     IFLA_INFO_UNSPEC,
0555     IFLA_INFO_KIND,
0556     IFLA_INFO_DATA,
0557     IFLA_INFO_XSTATS,
0558     IFLA_INFO_SLAVE_KIND,
0559     IFLA_INFO_SLAVE_DATA,
0560     __IFLA_INFO_MAX,
0561 };
0562 
0563 #define IFLA_INFO_MAX   (__IFLA_INFO_MAX - 1)
0564 
0565 /* VLAN section */
0566 
0567 enum {
0568     IFLA_VLAN_UNSPEC,
0569     IFLA_VLAN_ID,
0570     IFLA_VLAN_FLAGS,
0571     IFLA_VLAN_EGRESS_QOS,
0572     IFLA_VLAN_INGRESS_QOS,
0573     IFLA_VLAN_PROTOCOL,
0574     __IFLA_VLAN_MAX,
0575 };
0576 
0577 #define IFLA_VLAN_MAX   (__IFLA_VLAN_MAX - 1)
0578 
0579 struct ifla_vlan_flags {
0580     __u32   flags;
0581     __u32   mask;
0582 };
0583 
0584 enum {
0585     IFLA_VLAN_QOS_UNSPEC,
0586     IFLA_VLAN_QOS_MAPPING,
0587     __IFLA_VLAN_QOS_MAX
0588 };
0589 
0590 #define IFLA_VLAN_QOS_MAX   (__IFLA_VLAN_QOS_MAX - 1)
0591 
0592 struct ifla_vlan_qos_mapping {
0593     __u32 from;
0594     __u32 to;
0595 };
0596 
0597 /* MACVLAN section */
0598 enum {
0599     IFLA_MACVLAN_UNSPEC,
0600     IFLA_MACVLAN_MODE,
0601     IFLA_MACVLAN_FLAGS,
0602     IFLA_MACVLAN_MACADDR_MODE,
0603     IFLA_MACVLAN_MACADDR,
0604     IFLA_MACVLAN_MACADDR_DATA,
0605     IFLA_MACVLAN_MACADDR_COUNT,
0606     IFLA_MACVLAN_BC_QUEUE_LEN,
0607     IFLA_MACVLAN_BC_QUEUE_LEN_USED,
0608     __IFLA_MACVLAN_MAX,
0609 };
0610 
0611 #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
0612 
0613 enum macvlan_mode {
0614     MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
0615     MACVLAN_MODE_VEPA    = 2, /* talk to other ports through ext bridge */
0616     MACVLAN_MODE_BRIDGE  = 4, /* talk to bridge ports directly */
0617     MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
0618     MACVLAN_MODE_SOURCE  = 16,/* use source MAC address list to assign */
0619 };
0620 
0621 enum macvlan_macaddr_mode {
0622     MACVLAN_MACADDR_ADD,
0623     MACVLAN_MACADDR_DEL,
0624     MACVLAN_MACADDR_FLUSH,
0625     MACVLAN_MACADDR_SET,
0626 };
0627 
0628 #define MACVLAN_FLAG_NOPROMISC  1
0629 #define MACVLAN_FLAG_NODST  2 /* skip dst macvlan if matching src macvlan */
0630 
0631 /* VRF section */
0632 enum {
0633     IFLA_VRF_UNSPEC,
0634     IFLA_VRF_TABLE,
0635     __IFLA_VRF_MAX
0636 };
0637 
0638 #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
0639 
0640 enum {
0641     IFLA_VRF_PORT_UNSPEC,
0642     IFLA_VRF_PORT_TABLE,
0643     __IFLA_VRF_PORT_MAX
0644 };
0645 
0646 #define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
0647 
0648 /* MACSEC section */
0649 enum {
0650     IFLA_MACSEC_UNSPEC,
0651     IFLA_MACSEC_SCI,
0652     IFLA_MACSEC_PORT,
0653     IFLA_MACSEC_ICV_LEN,
0654     IFLA_MACSEC_CIPHER_SUITE,
0655     IFLA_MACSEC_WINDOW,
0656     IFLA_MACSEC_ENCODING_SA,
0657     IFLA_MACSEC_ENCRYPT,
0658     IFLA_MACSEC_PROTECT,
0659     IFLA_MACSEC_INC_SCI,
0660     IFLA_MACSEC_ES,
0661     IFLA_MACSEC_SCB,
0662     IFLA_MACSEC_REPLAY_PROTECT,
0663     IFLA_MACSEC_VALIDATION,
0664     IFLA_MACSEC_PAD,
0665     IFLA_MACSEC_OFFLOAD,
0666     __IFLA_MACSEC_MAX,
0667 };
0668 
0669 #define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
0670 
0671 /* XFRM section */
0672 enum {
0673     IFLA_XFRM_UNSPEC,
0674     IFLA_XFRM_LINK,
0675     IFLA_XFRM_IF_ID,
0676     __IFLA_XFRM_MAX
0677 };
0678 
0679 #define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
0680 
0681 enum macsec_validation_type {
0682     MACSEC_VALIDATE_DISABLED = 0,
0683     MACSEC_VALIDATE_CHECK = 1,
0684     MACSEC_VALIDATE_STRICT = 2,
0685     __MACSEC_VALIDATE_END,
0686     MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
0687 };
0688 
0689 enum macsec_offload {
0690     MACSEC_OFFLOAD_OFF = 0,
0691     MACSEC_OFFLOAD_PHY = 1,
0692     MACSEC_OFFLOAD_MAC = 2,
0693     __MACSEC_OFFLOAD_END,
0694     MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
0695 };
0696 
0697 /* IPVLAN section */
0698 enum {
0699     IFLA_IPVLAN_UNSPEC,
0700     IFLA_IPVLAN_MODE,
0701     IFLA_IPVLAN_FLAGS,
0702     __IFLA_IPVLAN_MAX
0703 };
0704 
0705 #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
0706 
0707 enum ipvlan_mode {
0708     IPVLAN_MODE_L2 = 0,
0709     IPVLAN_MODE_L3,
0710     IPVLAN_MODE_L3S,
0711     IPVLAN_MODE_MAX
0712 };
0713 
0714 #define IPVLAN_F_PRIVATE    0x01
0715 #define IPVLAN_F_VEPA       0x02
0716 
0717 /* VXLAN section */
0718 enum {
0719     IFLA_VXLAN_UNSPEC,
0720     IFLA_VXLAN_ID,
0721     IFLA_VXLAN_GROUP,   /* group or remote address */
0722     IFLA_VXLAN_LINK,
0723     IFLA_VXLAN_LOCAL,
0724     IFLA_VXLAN_TTL,
0725     IFLA_VXLAN_TOS,
0726     IFLA_VXLAN_LEARNING,
0727     IFLA_VXLAN_AGEING,
0728     IFLA_VXLAN_LIMIT,
0729     IFLA_VXLAN_PORT_RANGE,  /* source port */
0730     IFLA_VXLAN_PROXY,
0731     IFLA_VXLAN_RSC,
0732     IFLA_VXLAN_L2MISS,
0733     IFLA_VXLAN_L3MISS,
0734     IFLA_VXLAN_PORT,    /* destination port */
0735     IFLA_VXLAN_GROUP6,
0736     IFLA_VXLAN_LOCAL6,
0737     IFLA_VXLAN_UDP_CSUM,
0738     IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
0739     IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
0740     IFLA_VXLAN_REMCSUM_TX,
0741     IFLA_VXLAN_REMCSUM_RX,
0742     IFLA_VXLAN_GBP,
0743     IFLA_VXLAN_REMCSUM_NOPARTIAL,
0744     IFLA_VXLAN_COLLECT_METADATA,
0745     IFLA_VXLAN_LABEL,
0746     IFLA_VXLAN_GPE,
0747     IFLA_VXLAN_TTL_INHERIT,
0748     IFLA_VXLAN_DF,
0749     __IFLA_VXLAN_MAX
0750 };
0751 #define IFLA_VXLAN_MAX  (__IFLA_VXLAN_MAX - 1)
0752 
0753 struct ifla_vxlan_port_range {
0754     __be16  low;
0755     __be16  high;
0756 };
0757 
0758 enum ifla_vxlan_df {
0759     VXLAN_DF_UNSET = 0,
0760     VXLAN_DF_SET,
0761     VXLAN_DF_INHERIT,
0762     __VXLAN_DF_END,
0763     VXLAN_DF_MAX = __VXLAN_DF_END - 1,
0764 };
0765 
0766 /* GENEVE section */
0767 enum {
0768     IFLA_GENEVE_UNSPEC,
0769     IFLA_GENEVE_ID,
0770     IFLA_GENEVE_REMOTE,
0771     IFLA_GENEVE_TTL,
0772     IFLA_GENEVE_TOS,
0773     IFLA_GENEVE_PORT,   /* destination port */
0774     IFLA_GENEVE_COLLECT_METADATA,
0775     IFLA_GENEVE_REMOTE6,
0776     IFLA_GENEVE_UDP_CSUM,
0777     IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
0778     IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
0779     IFLA_GENEVE_LABEL,
0780     IFLA_GENEVE_TTL_INHERIT,
0781     IFLA_GENEVE_DF,
0782     __IFLA_GENEVE_MAX
0783 };
0784 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
0785 
0786 enum ifla_geneve_df {
0787     GENEVE_DF_UNSET = 0,
0788     GENEVE_DF_SET,
0789     GENEVE_DF_INHERIT,
0790     __GENEVE_DF_END,
0791     GENEVE_DF_MAX = __GENEVE_DF_END - 1,
0792 };
0793 
0794 /* Bareudp section  */
0795 enum {
0796     IFLA_BAREUDP_UNSPEC,
0797     IFLA_BAREUDP_PORT,
0798     IFLA_BAREUDP_ETHERTYPE,
0799     IFLA_BAREUDP_SRCPORT_MIN,
0800     IFLA_BAREUDP_MULTIPROTO_MODE,
0801     __IFLA_BAREUDP_MAX
0802 };
0803 
0804 #define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
0805 
0806 /* PPP section */
0807 enum {
0808     IFLA_PPP_UNSPEC,
0809     IFLA_PPP_DEV_FD,
0810     __IFLA_PPP_MAX
0811 };
0812 #define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
0813 
0814 /* GTP section */
0815 
0816 enum ifla_gtp_role {
0817     GTP_ROLE_GGSN = 0,
0818     GTP_ROLE_SGSN,
0819 };
0820 
0821 enum {
0822     IFLA_GTP_UNSPEC,
0823     IFLA_GTP_FD0,
0824     IFLA_GTP_FD1,
0825     IFLA_GTP_PDP_HASHSIZE,
0826     IFLA_GTP_ROLE,
0827     __IFLA_GTP_MAX,
0828 };
0829 #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
0830 
0831 /* Bonding section */
0832 
0833 enum {
0834     IFLA_BOND_UNSPEC,
0835     IFLA_BOND_MODE,
0836     IFLA_BOND_ACTIVE_SLAVE,
0837     IFLA_BOND_MIIMON,
0838     IFLA_BOND_UPDELAY,
0839     IFLA_BOND_DOWNDELAY,
0840     IFLA_BOND_USE_CARRIER,
0841     IFLA_BOND_ARP_INTERVAL,
0842     IFLA_BOND_ARP_IP_TARGET,
0843     IFLA_BOND_ARP_VALIDATE,
0844     IFLA_BOND_ARP_ALL_TARGETS,
0845     IFLA_BOND_PRIMARY,
0846     IFLA_BOND_PRIMARY_RESELECT,
0847     IFLA_BOND_FAIL_OVER_MAC,
0848     IFLA_BOND_XMIT_HASH_POLICY,
0849     IFLA_BOND_RESEND_IGMP,
0850     IFLA_BOND_NUM_PEER_NOTIF,
0851     IFLA_BOND_ALL_SLAVES_ACTIVE,
0852     IFLA_BOND_MIN_LINKS,
0853     IFLA_BOND_LP_INTERVAL,
0854     IFLA_BOND_PACKETS_PER_SLAVE,
0855     IFLA_BOND_AD_LACP_RATE,
0856     IFLA_BOND_AD_SELECT,
0857     IFLA_BOND_AD_INFO,
0858     IFLA_BOND_AD_ACTOR_SYS_PRIO,
0859     IFLA_BOND_AD_USER_PORT_KEY,
0860     IFLA_BOND_AD_ACTOR_SYSTEM,
0861     IFLA_BOND_TLB_DYNAMIC_LB,
0862     IFLA_BOND_PEER_NOTIF_DELAY,
0863     IFLA_BOND_AD_LACP_ACTIVE,
0864     IFLA_BOND_MISSED_MAX,
0865     IFLA_BOND_NS_IP6_TARGET,
0866     __IFLA_BOND_MAX,
0867 };
0868 
0869 #define IFLA_BOND_MAX   (__IFLA_BOND_MAX - 1)
0870 
0871 enum {
0872     IFLA_BOND_AD_INFO_UNSPEC,
0873     IFLA_BOND_AD_INFO_AGGREGATOR,
0874     IFLA_BOND_AD_INFO_NUM_PORTS,
0875     IFLA_BOND_AD_INFO_ACTOR_KEY,
0876     IFLA_BOND_AD_INFO_PARTNER_KEY,
0877     IFLA_BOND_AD_INFO_PARTNER_MAC,
0878     __IFLA_BOND_AD_INFO_MAX,
0879 };
0880 
0881 #define IFLA_BOND_AD_INFO_MAX   (__IFLA_BOND_AD_INFO_MAX - 1)
0882 
0883 enum {
0884     IFLA_BOND_SLAVE_UNSPEC,
0885     IFLA_BOND_SLAVE_STATE,
0886     IFLA_BOND_SLAVE_MII_STATUS,
0887     IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
0888     IFLA_BOND_SLAVE_PERM_HWADDR,
0889     IFLA_BOND_SLAVE_QUEUE_ID,
0890     IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
0891     IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
0892     IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
0893     IFLA_BOND_SLAVE_PRIO,
0894     __IFLA_BOND_SLAVE_MAX,
0895 };
0896 
0897 #define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
0898 
0899 /* SR-IOV virtual function management section */
0900 
0901 enum {
0902     IFLA_VF_INFO_UNSPEC,
0903     IFLA_VF_INFO,
0904     __IFLA_VF_INFO_MAX,
0905 };
0906 
0907 #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
0908 
0909 enum {
0910     IFLA_VF_UNSPEC,
0911     IFLA_VF_MAC,        /* Hardware queue specific attributes */
0912     IFLA_VF_VLAN,       /* VLAN ID and QoS */
0913     IFLA_VF_TX_RATE,    /* Max TX Bandwidth Allocation */
0914     IFLA_VF_SPOOFCHK,   /* Spoof Checking on/off switch */
0915     IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
0916     IFLA_VF_RATE,       /* Min and Max TX Bandwidth Allocation */
0917     IFLA_VF_RSS_QUERY_EN,   /* RSS Redirection Table and Hash Key query
0918                  * on/off switch
0919                  */
0920     IFLA_VF_STATS,      /* network device statistics */
0921     IFLA_VF_TRUST,      /* Trust VF */
0922     IFLA_VF_IB_NODE_GUID,   /* VF Infiniband node GUID */
0923     IFLA_VF_IB_PORT_GUID,   /* VF Infiniband port GUID */
0924     IFLA_VF_VLAN_LIST,  /* nested list of vlans, option for QinQ */
0925     IFLA_VF_BROADCAST,  /* VF broadcast */
0926     __IFLA_VF_MAX,
0927 };
0928 
0929 #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
0930 
0931 struct ifla_vf_mac {
0932     __u32 vf;
0933     __u8 mac[32]; /* MAX_ADDR_LEN */
0934 };
0935 
0936 struct ifla_vf_broadcast {
0937     __u8 broadcast[32];
0938 };
0939 
0940 struct ifla_vf_vlan {
0941     __u32 vf;
0942     __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
0943     __u32 qos;
0944 };
0945 
0946 enum {
0947     IFLA_VF_VLAN_INFO_UNSPEC,
0948     IFLA_VF_VLAN_INFO,  /* VLAN ID, QoS and VLAN protocol */
0949     __IFLA_VF_VLAN_INFO_MAX,
0950 };
0951 
0952 #define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
0953 #define MAX_VLAN_LIST_LEN 1
0954 
0955 struct ifla_vf_vlan_info {
0956     __u32 vf;
0957     __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
0958     __u32 qos;
0959     __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
0960 };
0961 
0962 struct ifla_vf_tx_rate {
0963     __u32 vf;
0964     __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
0965 };
0966 
0967 struct ifla_vf_rate {
0968     __u32 vf;
0969     __u32 min_tx_rate; /* Min Bandwidth in Mbps */
0970     __u32 max_tx_rate; /* Max Bandwidth in Mbps */
0971 };
0972 
0973 struct ifla_vf_spoofchk {
0974     __u32 vf;
0975     __u32 setting;
0976 };
0977 
0978 struct ifla_vf_guid {
0979     __u32 vf;
0980     __u64 guid;
0981 };
0982 
0983 enum {
0984     IFLA_VF_LINK_STATE_AUTO,    /* link state of the uplink */
0985     IFLA_VF_LINK_STATE_ENABLE,  /* link always up */
0986     IFLA_VF_LINK_STATE_DISABLE, /* link always down */
0987     __IFLA_VF_LINK_STATE_MAX,
0988 };
0989 
0990 struct ifla_vf_link_state {
0991     __u32 vf;
0992     __u32 link_state;
0993 };
0994 
0995 struct ifla_vf_rss_query_en {
0996     __u32 vf;
0997     __u32 setting;
0998 };
0999 
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 */