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