logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

if_link.h (55388B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_IF_LINK_H
  3. #define _LINUX_IF_LINK_H
  4. #include <linux/types.h>
  5. #include <linux/netlink.h>
  6. /* This struct should be in sync with struct rtnl_link_stats64 */
  7. struct rtnl_link_stats {
  8. __u32 rx_packets;
  9. __u32 tx_packets;
  10. __u32 rx_bytes;
  11. __u32 tx_bytes;
  12. __u32 rx_errors;
  13. __u32 tx_errors;
  14. __u32 rx_dropped;
  15. __u32 tx_dropped;
  16. __u32 multicast;
  17. __u32 collisions;
  18. /* detailed rx_errors: */
  19. __u32 rx_length_errors;
  20. __u32 rx_over_errors;
  21. __u32 rx_crc_errors;
  22. __u32 rx_frame_errors;
  23. __u32 rx_fifo_errors;
  24. __u32 rx_missed_errors;
  25. /* detailed tx_errors */
  26. __u32 tx_aborted_errors;
  27. __u32 tx_carrier_errors;
  28. __u32 tx_fifo_errors;
  29. __u32 tx_heartbeat_errors;
  30. __u32 tx_window_errors;
  31. /* for cslip etc */
  32. __u32 rx_compressed;
  33. __u32 tx_compressed;
  34. __u32 rx_nohandler;
  35. };
  36. /**
  37. * struct rtnl_link_stats64 - The main device statistics structure.
  38. *
  39. * @rx_packets: Number of good packets received by the interface.
  40. * For hardware interfaces counts all good packets received from the device
  41. * by the host, including packets which host had to drop at various stages
  42. * of processing (even in the driver).
  43. *
  44. * @tx_packets: Number of packets successfully transmitted.
  45. * For hardware interfaces counts packets which host was able to successfully
  46. * hand over to the device, which does not necessarily mean that packets
  47. * had been successfully transmitted out of the device, only that device
  48. * acknowledged it copied them out of host memory.
  49. *
  50. * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
  51. *
  52. * For IEEE 802.3 devices should count the length of Ethernet Frames
  53. * excluding the FCS.
  54. *
  55. * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
  56. *
  57. * For IEEE 802.3 devices should count the length of Ethernet Frames
  58. * excluding the FCS.
  59. *
  60. * @rx_errors: Total number of bad packets received on this network device.
  61. * This counter must include events counted by @rx_length_errors,
  62. * @rx_crc_errors, @rx_frame_errors and other errors not otherwise
  63. * counted.
  64. *
  65. * @tx_errors: Total number of transmit problems.
  66. * This counter must include events counter by @tx_aborted_errors,
  67. * @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
  68. * @tx_window_errors and other errors not otherwise counted.
  69. *
  70. * @rx_dropped: Number of packets received but not processed,
  71. * e.g. due to lack of resources or unsupported protocol.
  72. * For hardware interfaces this counter may include packets discarded
  73. * due to L2 address filtering but should not include packets dropped
  74. * by the device due to buffer exhaustion which are counted separately in
  75. * @rx_missed_errors (since procfs folds those two counters together).
  76. *
  77. * @tx_dropped: Number of packets dropped on their way to transmission,
  78. * e.g. due to lack of resources.
  79. *
  80. * @multicast: Multicast packets received.
  81. * For hardware interfaces this statistic is commonly calculated
  82. * at the device level (unlike @rx_packets) and therefore may include
  83. * packets which did not reach the host.
  84. *
  85. * For IEEE 802.3 devices this counter may be equivalent to:
  86. *
  87. * - 30.3.1.1.21 aMulticastFramesReceivedOK
  88. *
  89. * @collisions: Number of collisions during packet transmissions.
  90. *
  91. * @rx_length_errors: Number of packets dropped due to invalid length.
  92. * Part of aggregate "frame" errors in `/proc/net/dev`.
  93. *
  94. * For IEEE 802.3 devices this counter should be equivalent to a sum
  95. * of the following attributes:
  96. *
  97. * - 30.3.1.1.23 aInRangeLengthErrors
  98. * - 30.3.1.1.24 aOutOfRangeLengthField
  99. * - 30.3.1.1.25 aFrameTooLongErrors
  100. *
  101. * @rx_over_errors: Receiver FIFO overflow event counter.
  102. *
  103. * Historically the count of overflow events. Such events may be
  104. * reported in the receive descriptors or via interrupts, and may
  105. * not correspond one-to-one with dropped packets.
  106. *
  107. * The recommended interpretation for high speed interfaces is -
  108. * number of packets dropped because they did not fit into buffers
  109. * provided by the host, e.g. packets larger than MTU or next buffer
  110. * in the ring was not available for a scatter transfer.
  111. *
  112. * Part of aggregate "frame" errors in `/proc/net/dev`.
  113. *
  114. * This statistics was historically used interchangeably with
  115. * @rx_fifo_errors.
  116. *
  117. * This statistic corresponds to hardware events and is not commonly used
  118. * on software devices.
  119. *
  120. * @rx_crc_errors: Number of packets received with a CRC error.
  121. * Part of aggregate "frame" errors in `/proc/net/dev`.
  122. *
  123. * For IEEE 802.3 devices this counter must be equivalent to:
  124. *
  125. * - 30.3.1.1.6 aFrameCheckSequenceErrors
  126. *
  127. * @rx_frame_errors: Receiver frame alignment errors.
  128. * Part of aggregate "frame" errors in `/proc/net/dev`.
  129. *
  130. * For IEEE 802.3 devices this counter should be equivalent to:
  131. *
  132. * - 30.3.1.1.7 aAlignmentErrors
  133. *
  134. * @rx_fifo_errors: Receiver FIFO error counter.
  135. *
  136. * Historically the count of overflow events. Those events may be
  137. * reported in the receive descriptors or via interrupts, and may
  138. * not correspond one-to-one with dropped packets.
  139. *
  140. * This statistics was used interchangeably with @rx_over_errors.
  141. * Not recommended for use in drivers for high speed interfaces.
  142. *
  143. * This statistic is used on software devices, e.g. to count software
  144. * packet queue overflow (can) or sequencing errors (GRE).
  145. *
  146. * @rx_missed_errors: Count of packets missed by the host.
  147. * Folded into the "drop" counter in `/proc/net/dev`.
  148. *
  149. * Counts number of packets dropped by the device due to lack
  150. * of buffer space. This usually indicates that the host interface
  151. * is slower than the network interface, or host is not keeping up
  152. * with the receive packet rate.
  153. *
  154. * This statistic corresponds to hardware events and is not used
  155. * on software devices.
  156. *
  157. * @tx_aborted_errors:
  158. * Part of aggregate "carrier" errors in `/proc/net/dev`.
  159. * For IEEE 802.3 devices capable of half-duplex operation this counter
  160. * must be equivalent to:
  161. *
  162. * - 30.3.1.1.11 aFramesAbortedDueToXSColls
  163. *
  164. * High speed interfaces may use this counter as a general device
  165. * discard counter.
  166. *
  167. * @tx_carrier_errors: Number of frame transmission errors due to loss
  168. * of carrier during transmission.
  169. * Part of aggregate "carrier" errors in `/proc/net/dev`.
  170. *
  171. * For IEEE 802.3 devices this counter must be equivalent to:
  172. *
  173. * - 30.3.1.1.13 aCarrierSenseErrors
  174. *
  175. * @tx_fifo_errors: Number of frame transmission errors due to device
  176. * FIFO underrun / underflow. This condition occurs when the device
  177. * begins transmission of a frame but is unable to deliver the
  178. * entire frame to the transmitter in time for transmission.
  179. * Part of aggregate "carrier" errors in `/proc/net/dev`.
  180. *
  181. * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
  182. * old half-duplex Ethernet.
  183. * Part of aggregate "carrier" errors in `/proc/net/dev`.
  184. *
  185. * For IEEE 802.3 devices possibly equivalent to:
  186. *
  187. * - 30.3.2.1.4 aSQETestErrors
  188. *
  189. * @tx_window_errors: Number of frame transmission errors due
  190. * to late collisions (for Ethernet - after the first 64B of transmission).
  191. * Part of aggregate "carrier" errors in `/proc/net/dev`.
  192. *
  193. * For IEEE 802.3 devices this counter must be equivalent to:
  194. *
  195. * - 30.3.1.1.10 aLateCollisions
  196. *
  197. * @rx_compressed: Number of correctly received compressed packets.
  198. * This counters is only meaningful for interfaces which support
  199. * packet compression (e.g. CSLIP, PPP).
  200. *
  201. * @tx_compressed: Number of transmitted compressed packets.
  202. * This counters is only meaningful for interfaces which support
  203. * packet compression (e.g. CSLIP, PPP).
  204. *
  205. * @rx_nohandler: Number of packets received on the interface
  206. * but dropped by the networking stack because the device is
  207. * not designated to receive packets (e.g. backup link in a bond).
  208. *
  209. * @rx_otherhost_dropped: Number of packets dropped due to mismatch
  210. * in destination MAC address.
  211. */
  212. struct rtnl_link_stats64 {
  213. __u64 rx_packets;
  214. __u64 tx_packets;
  215. __u64 rx_bytes;
  216. __u64 tx_bytes;
  217. __u64 rx_errors;
  218. __u64 tx_errors;
  219. __u64 rx_dropped;
  220. __u64 tx_dropped;
  221. __u64 multicast;
  222. __u64 collisions;
  223. /* detailed rx_errors: */
  224. __u64 rx_length_errors;
  225. __u64 rx_over_errors;
  226. __u64 rx_crc_errors;
  227. __u64 rx_frame_errors;
  228. __u64 rx_fifo_errors;
  229. __u64 rx_missed_errors;
  230. /* detailed tx_errors */
  231. __u64 tx_aborted_errors;
  232. __u64 tx_carrier_errors;
  233. __u64 tx_fifo_errors;
  234. __u64 tx_heartbeat_errors;
  235. __u64 tx_window_errors;
  236. /* for cslip etc */
  237. __u64 rx_compressed;
  238. __u64 tx_compressed;
  239. __u64 rx_nohandler;
  240. __u64 rx_otherhost_dropped;
  241. };
  242. /* Subset of link stats useful for in-HW collection. Meaning of the fields is as
  243. * for struct rtnl_link_stats64.
  244. */
  245. struct rtnl_hw_stats64 {
  246. __u64 rx_packets;
  247. __u64 tx_packets;
  248. __u64 rx_bytes;
  249. __u64 tx_bytes;
  250. __u64 rx_errors;
  251. __u64 tx_errors;
  252. __u64 rx_dropped;
  253. __u64 tx_dropped;
  254. __u64 multicast;
  255. };
  256. /* The struct should be in sync with struct ifmap */
  257. struct rtnl_link_ifmap {
  258. __u64 mem_start;
  259. __u64 mem_end;
  260. __u64 base_addr;
  261. __u16 irq;
  262. __u8 dma;
  263. __u8 port;
  264. };
  265. /*
  266. * IFLA_AF_SPEC
  267. * Contains nested attributes for address family specific attributes.
  268. * Each address family may create a attribute with the address family
  269. * number as type and create its own attribute structure in it.
  270. *
  271. * Example:
  272. * [IFLA_AF_SPEC] = {
  273. * [AF_INET] = {
  274. * [IFLA_INET_CONF] = ...,
  275. * },
  276. * [AF_INET6] = {
  277. * [IFLA_INET6_FLAGS] = ...,
  278. * [IFLA_INET6_CONF] = ...,
  279. * }
  280. * }
  281. */
  282. enum {
  283. IFLA_UNSPEC,
  284. IFLA_ADDRESS,
  285. IFLA_BROADCAST,
  286. IFLA_IFNAME,
  287. IFLA_MTU,
  288. IFLA_LINK,
  289. IFLA_QDISC,
  290. IFLA_STATS,
  291. IFLA_COST,
  292. #define IFLA_COST IFLA_COST
  293. IFLA_PRIORITY,
  294. #define IFLA_PRIORITY IFLA_PRIORITY
  295. IFLA_MASTER,
  296. #define IFLA_MASTER IFLA_MASTER
  297. IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
  298. #define IFLA_WIRELESS IFLA_WIRELESS
  299. IFLA_PROTINFO, /* Protocol specific information for a link */
  300. #define IFLA_PROTINFO IFLA_PROTINFO
  301. IFLA_TXQLEN,
  302. #define IFLA_TXQLEN IFLA_TXQLEN
  303. IFLA_MAP,
  304. #define IFLA_MAP IFLA_MAP
  305. IFLA_WEIGHT,
  306. #define IFLA_WEIGHT IFLA_WEIGHT
  307. IFLA_OPERSTATE,
  308. IFLA_LINKMODE,
  309. IFLA_LINKINFO,
  310. #define IFLA_LINKINFO IFLA_LINKINFO
  311. IFLA_NET_NS_PID,
  312. IFLA_IFALIAS,
  313. IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
  314. IFLA_VFINFO_LIST,
  315. IFLA_STATS64,
  316. IFLA_VF_PORTS,
  317. IFLA_PORT_SELF,
  318. IFLA_AF_SPEC,
  319. IFLA_GROUP, /* Group the device belongs to */
  320. IFLA_NET_NS_FD,
  321. IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
  322. IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
  323. #define IFLA_PROMISCUITY IFLA_PROMISCUITY
  324. IFLA_NUM_TX_QUEUES,
  325. IFLA_NUM_RX_QUEUES,
  326. IFLA_CARRIER,
  327. IFLA_PHYS_PORT_ID,
  328. IFLA_CARRIER_CHANGES,
  329. IFLA_PHYS_SWITCH_ID,
  330. IFLA_LINK_NETNSID,
  331. IFLA_PHYS_PORT_NAME,
  332. IFLA_PROTO_DOWN,
  333. IFLA_GSO_MAX_SEGS,
  334. IFLA_GSO_MAX_SIZE,
  335. IFLA_PAD,
  336. IFLA_XDP,
  337. IFLA_EVENT,
  338. IFLA_NEW_NETNSID,
  339. IFLA_IF_NETNSID,
  340. IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, /* new alias */
  341. IFLA_CARRIER_UP_COUNT,
  342. IFLA_CARRIER_DOWN_COUNT,
  343. IFLA_NEW_IFINDEX,
  344. IFLA_MIN_MTU,
  345. IFLA_MAX_MTU,
  346. IFLA_PROP_LIST,
  347. IFLA_ALT_IFNAME, /* Alternative ifname */
  348. IFLA_PERM_ADDRESS,
  349. IFLA_PROTO_DOWN_REASON,
  350. /* device (sysfs) name as parent, used instead
  351. * of IFLA_LINK where there's no parent netdev
  352. */
  353. IFLA_PARENT_DEV_NAME,
  354. IFLA_PARENT_DEV_BUS_NAME,
  355. IFLA_GRO_MAX_SIZE,
  356. IFLA_TSO_MAX_SIZE,
  357. IFLA_TSO_MAX_SEGS,
  358. IFLA_ALLMULTI, /* Allmulti count: > 0 means acts ALLMULTI */
  359. IFLA_DEVLINK_PORT,
  360. IFLA_GSO_IPV4_MAX_SIZE,
  361. IFLA_GRO_IPV4_MAX_SIZE,
  362. IFLA_DPLL_PIN,
  363. __IFLA_MAX
  364. };
  365. #define IFLA_MAX (__IFLA_MAX - 1)
  366. enum {
  367. IFLA_PROTO_DOWN_REASON_UNSPEC,
  368. IFLA_PROTO_DOWN_REASON_MASK, /* u32, mask for reason bits */
  369. IFLA_PROTO_DOWN_REASON_VALUE, /* u32, reason bit value */
  370. __IFLA_PROTO_DOWN_REASON_CNT,
  371. IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
  372. };
  373. /* backwards compatibility for userspace */
  374. #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
  375. #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
  376. enum {
  377. IFLA_INET_UNSPEC,
  378. IFLA_INET_CONF,
  379. __IFLA_INET_MAX,
  380. };
  381. #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
  382. /* ifi_flags.
  383. IFF_* flags.
  384. The only change is:
  385. IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
  386. more not changeable by user. They describe link media
  387. characteristics and set by device driver.
  388. Comments:
  389. - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
  390. - If neither of these three flags are set;
  391. the interface is NBMA.
  392. - IFF_MULTICAST does not mean anything special:
  393. multicasts can be used on all not-NBMA links.
  394. IFF_MULTICAST means that this media uses special encapsulation
  395. for multicast frames. Apparently, all IFF_POINTOPOINT and
  396. IFF_BROADCAST devices are able to use multicasts too.
  397. */
  398. /* IFLA_LINK.
  399. For usual devices it is equal ifi_index.
  400. If it is a "virtual interface" (f.e. tunnel), ifi_link
  401. can point to real physical interface (f.e. for bandwidth calculations),
  402. or maybe 0, what means, that real media is unknown (usual
  403. for IPIP tunnels, when route to endpoint is allowed to change)
  404. */
  405. /* Subtype attributes for IFLA_PROTINFO */
  406. enum {
  407. IFLA_INET6_UNSPEC,
  408. IFLA_INET6_FLAGS, /* link flags */
  409. IFLA_INET6_CONF, /* sysctl parameters */
  410. IFLA_INET6_STATS, /* statistics */
  411. IFLA_INET6_MCAST, /* MC things. What of them? */
  412. IFLA_INET6_CACHEINFO, /* time values and max reasm size */
  413. IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
  414. IFLA_INET6_TOKEN, /* device token */
  415. IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
  416. IFLA_INET6_RA_MTU, /* mtu carried in the RA message */
  417. __IFLA_INET6_MAX
  418. };
  419. #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
  420. enum in6_addr_gen_mode {
  421. IN6_ADDR_GEN_MODE_EUI64,
  422. IN6_ADDR_GEN_MODE_NONE,
  423. IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
  424. IN6_ADDR_GEN_MODE_RANDOM,
  425. };
  426. /* Bridge section */
  427. /**
  428. * DOC: Bridge enum definition
  429. *
  430. * Please *note* that the timer values in the following section are expected
  431. * in clock_t format, which is seconds multiplied by USER_HZ (generally
  432. * defined as 100).
  433. *
  434. * @IFLA_BR_FORWARD_DELAY
  435. * The bridge forwarding delay is the time spent in LISTENING state
  436. * (before moving to LEARNING) and in LEARNING state (before moving
  437. * to FORWARDING). Only relevant if STP is enabled.
  438. *
  439. * The valid values are between (2 * USER_HZ) and (30 * USER_HZ).
  440. * The default value is (15 * USER_HZ).
  441. *
  442. * @IFLA_BR_HELLO_TIME
  443. * The time between hello packets sent by the bridge, when it is a root
  444. * bridge or a designated bridge. Only relevant if STP is enabled.
  445. *
  446. * The valid values are between (1 * USER_HZ) and (10 * USER_HZ).
  447. * The default value is (2 * USER_HZ).
  448. *
  449. * @IFLA_BR_MAX_AGE
  450. * The hello packet timeout is the time until another bridge in the
  451. * spanning tree is assumed to be dead, after reception of its last hello
  452. * message. Only relevant if STP is enabled.
  453. *
  454. * The valid values are between (6 * USER_HZ) and (40 * USER_HZ).
  455. * The default value is (20 * USER_HZ).
  456. *
  457. * @IFLA_BR_AGEING_TIME
  458. * Configure the bridge's FDB entries aging time. It is the time a MAC
  459. * address will be kept in the FDB after a packet has been received from
  460. * that address. After this time has passed, entries are cleaned up.
  461. * Allow values outside the 802.1 standard specification for special cases:
  462. *
  463. * * 0 - entry never ages (all permanent)
  464. * * 1 - entry disappears (no persistence)
  465. *
  466. * The default value is (300 * USER_HZ).
  467. *
  468. * @IFLA_BR_STP_STATE
  469. * Turn spanning tree protocol on (*IFLA_BR_STP_STATE* > 0) or off
  470. * (*IFLA_BR_STP_STATE* == 0) for this bridge.
  471. *
  472. * The default value is 0 (disabled).
  473. *
  474. * @IFLA_BR_PRIORITY
  475. * Set this bridge's spanning tree priority, used during STP root bridge
  476. * election.
  477. *
  478. * The valid values are between 0 and 65535.
  479. *
  480. * @IFLA_BR_VLAN_FILTERING
  481. * Turn VLAN filtering on (*IFLA_BR_VLAN_FILTERING* > 0) or off
  482. * (*IFLA_BR_VLAN_FILTERING* == 0). When disabled, the bridge will not
  483. * consider the VLAN tag when handling packets.
  484. *
  485. * The default value is 0 (disabled).
  486. *
  487. * @IFLA_BR_VLAN_PROTOCOL
  488. * Set the protocol used for VLAN filtering.
  489. *
  490. * The valid values are 0x8100(802.1Q) or 0x88A8(802.1AD). The default value
  491. * is 0x8100(802.1Q).
  492. *
  493. * @IFLA_BR_GROUP_FWD_MASK
  494. * The group forwarding mask. This is the bitmask that is applied to
  495. * decide whether to forward incoming frames destined to link-local
  496. * addresses (of the form 01:80:C2:00:00:0X).
  497. *
  498. * The default value is 0, which means the bridge does not forward any
  499. * link-local frames coming on this port.
  500. *
  501. * @IFLA_BR_ROOT_ID
  502. * The bridge root id, read only.
  503. *
  504. * @IFLA_BR_BRIDGE_ID
  505. * The bridge id, read only.
  506. *
  507. * @IFLA_BR_ROOT_PORT
  508. * The bridge root port, read only.
  509. *
  510. * @IFLA_BR_ROOT_PATH_COST
  511. * The bridge root path cost, read only.
  512. *
  513. * @IFLA_BR_TOPOLOGY_CHANGE
  514. * The bridge topology change, read only.
  515. *
  516. * @IFLA_BR_TOPOLOGY_CHANGE_DETECTED
  517. * The bridge topology change detected, read only.
  518. *
  519. * @IFLA_BR_HELLO_TIMER
  520. * The bridge hello timer, read only.
  521. *
  522. * @IFLA_BR_TCN_TIMER
  523. * The bridge tcn timer, read only.
  524. *
  525. * @IFLA_BR_TOPOLOGY_CHANGE_TIMER
  526. * The bridge topology change timer, read only.
  527. *
  528. * @IFLA_BR_GC_TIMER
  529. * The bridge gc timer, read only.
  530. *
  531. * @IFLA_BR_GROUP_ADDR
  532. * Set the MAC address of the multicast group this bridge uses for STP.
  533. * The address must be a link-local address in standard Ethernet MAC address
  534. * format. It is an address of the form 01:80:C2:00:00:0X, with X in [0, 4..f].
  535. *
  536. * The default value is 0.
  537. *
  538. * @IFLA_BR_FDB_FLUSH
  539. * Flush bridge's fdb dynamic entries.
  540. *
  541. * @IFLA_BR_MCAST_ROUTER
  542. * Set bridge's multicast router if IGMP snooping is enabled.
  543. * The valid values are:
  544. *
  545. * * 0 - disabled.
  546. * * 1 - automatic (queried).
  547. * * 2 - permanently enabled.
  548. *
  549. * The default value is 1.
  550. *
  551. * @IFLA_BR_MCAST_SNOOPING
  552. * Turn multicast snooping on (*IFLA_BR_MCAST_SNOOPING* > 0) or off
  553. * (*IFLA_BR_MCAST_SNOOPING* == 0).
  554. *
  555. * The default value is 1.
  556. *
  557. * @IFLA_BR_MCAST_QUERY_USE_IFADDR
  558. * If enabled use the bridge's own IP address as source address for IGMP
  559. * queries (*IFLA_BR_MCAST_QUERY_USE_IFADDR* > 0) or the default of 0.0.0.0
  560. * (*IFLA_BR_MCAST_QUERY_USE_IFADDR* == 0).
  561. *
  562. * The default value is 0 (disabled).
  563. *
  564. * @IFLA_BR_MCAST_QUERIER
  565. * Enable (*IFLA_BR_MULTICAST_QUERIER* > 0) or disable
  566. * (*IFLA_BR_MULTICAST_QUERIER* == 0) IGMP querier, ie sending of multicast
  567. * queries by the bridge.
  568. *
  569. * The default value is 0 (disabled).
  570. *
  571. * @IFLA_BR_MCAST_HASH_ELASTICITY
  572. * Set multicast database hash elasticity, It is the maximum chain length in
  573. * the multicast hash table. This attribute is *deprecated* and the value
  574. * is always 16.
  575. *
  576. * @IFLA_BR_MCAST_HASH_MAX
  577. * Set maximum size of the multicast hash table
  578. *
  579. * The default value is 4096, the value must be a power of 2.
  580. *
  581. * @IFLA_BR_MCAST_LAST_MEMBER_CNT
  582. * The Last Member Query Count is the number of Group-Specific Queries
  583. * sent before the router assumes there are no local members. The Last
  584. * Member Query Count is also the number of Group-and-Source-Specific
  585. * Queries sent before the router assumes there are no listeners for a
  586. * particular source.
  587. *
  588. * The default value is 2.
  589. *
  590. * @IFLA_BR_MCAST_STARTUP_QUERY_CNT
  591. * The Startup Query Count is the number of Queries sent out on startup,
  592. * separated by the Startup Query Interval.
  593. *
  594. * The default value is 2.
  595. *
  596. * @IFLA_BR_MCAST_LAST_MEMBER_INTVL
  597. * The Last Member Query Interval is the Max Response Time inserted into
  598. * Group-Specific Queries sent in response to Leave Group messages, and
  599. * is also the amount of time between Group-Specific Query messages.
  600. *
  601. * The default value is (1 * USER_HZ).
  602. *
  603. * @IFLA_BR_MCAST_MEMBERSHIP_INTVL
  604. * The interval after which the bridge will leave a group, if no membership
  605. * reports for this group are received.
  606. *
  607. * The default value is (260 * USER_HZ).
  608. *
  609. * @IFLA_BR_MCAST_QUERIER_INTVL
  610. * The interval between queries sent by other routers. if no queries are
  611. * seen after this delay has passed, the bridge will start to send its own
  612. * queries (as if *IFLA_BR_MCAST_QUERIER_INTVL* was enabled).
  613. *
  614. * The default value is (255 * USER_HZ).
  615. *
  616. * @IFLA_BR_MCAST_QUERY_INTVL
  617. * The Query Interval is the interval between General Queries sent by
  618. * the Querier.
  619. *
  620. * The default value is (125 * USER_HZ). The minimum value is (1 * USER_HZ).
  621. *
  622. * @IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
  623. * The Max Response Time used to calculate the Max Resp Code inserted
  624. * into the periodic General Queries.
  625. *
  626. * The default value is (10 * USER_HZ).
  627. *
  628. * @IFLA_BR_MCAST_STARTUP_QUERY_INTVL
  629. * The interval between queries in the startup phase.
  630. *
  631. * The default value is (125 * USER_HZ) / 4. The minimum value is (1 * USER_HZ).
  632. *
  633. * @IFLA_BR_NF_CALL_IPTABLES
  634. * Enable (*NF_CALL_IPTABLES* > 0) or disable (*NF_CALL_IPTABLES* == 0)
  635. * iptables hooks on the bridge.
  636. *
  637. * The default value is 0 (disabled).
  638. *
  639. * @IFLA_BR_NF_CALL_IP6TABLES
  640. * Enable (*NF_CALL_IP6TABLES* > 0) or disable (*NF_CALL_IP6TABLES* == 0)
  641. * ip6tables hooks on the bridge.
  642. *
  643. * The default value is 0 (disabled).
  644. *
  645. * @IFLA_BR_NF_CALL_ARPTABLES
  646. * Enable (*NF_CALL_ARPTABLES* > 0) or disable (*NF_CALL_ARPTABLES* == 0)
  647. * arptables hooks on the bridge.
  648. *
  649. * The default value is 0 (disabled).
  650. *
  651. * @IFLA_BR_VLAN_DEFAULT_PVID
  652. * VLAN ID applied to untagged and priority-tagged incoming packets.
  653. *
  654. * The default value is 1. Setting to the special value 0 makes all ports of
  655. * this bridge not have a PVID by default, which means that they will
  656. * not accept VLAN-untagged traffic.
  657. *
  658. * @IFLA_BR_PAD
  659. * Bridge attribute padding type for netlink message.
  660. *
  661. * @IFLA_BR_VLAN_STATS_ENABLED
  662. * Enable (*IFLA_BR_VLAN_STATS_ENABLED* == 1) or disable
  663. * (*IFLA_BR_VLAN_STATS_ENABLED* == 0) per-VLAN stats accounting.
  664. *
  665. * The default value is 0 (disabled).
  666. *
  667. * @IFLA_BR_MCAST_STATS_ENABLED
  668. * Enable (*IFLA_BR_MCAST_STATS_ENABLED* > 0) or disable
  669. * (*IFLA_BR_MCAST_STATS_ENABLED* == 0) multicast (IGMP/MLD) stats
  670. * accounting.
  671. *
  672. * The default value is 0 (disabled).
  673. *
  674. * @IFLA_BR_MCAST_IGMP_VERSION
  675. * Set the IGMP version.
  676. *
  677. * The valid values are 2 and 3. The default value is 2.
  678. *
  679. * @IFLA_BR_MCAST_MLD_VERSION
  680. * Set the MLD version.
  681. *
  682. * The valid values are 1 and 2. The default value is 1.
  683. *
  684. * @IFLA_BR_VLAN_STATS_PER_PORT
  685. * Enable (*IFLA_BR_VLAN_STATS_PER_PORT* == 1) or disable
  686. * (*IFLA_BR_VLAN_STATS_PER_PORT* == 0) per-VLAN per-port stats accounting.
  687. * Can be changed only when there are no port VLANs configured.
  688. *
  689. * The default value is 0 (disabled).
  690. *
  691. * @IFLA_BR_MULTI_BOOLOPT
  692. * The multi_boolopt is used to control new boolean options to avoid adding
  693. * new netlink attributes. You can look at ``enum br_boolopt_id`` for those
  694. * options.
  695. *
  696. * @IFLA_BR_MCAST_QUERIER_STATE
  697. * Bridge mcast querier states, read only.
  698. *
  699. * @IFLA_BR_FDB_N_LEARNED
  700. * The number of dynamically learned FDB entries for the current bridge,
  701. * read only.
  702. *
  703. * @IFLA_BR_FDB_MAX_LEARNED
  704. * Set the number of max dynamically learned FDB entries for the current
  705. * bridge.
  706. */
  707. enum {
  708. IFLA_BR_UNSPEC,
  709. IFLA_BR_FORWARD_DELAY,
  710. IFLA_BR_HELLO_TIME,
  711. IFLA_BR_MAX_AGE,
  712. IFLA_BR_AGEING_TIME,
  713. IFLA_BR_STP_STATE,
  714. IFLA_BR_PRIORITY,
  715. IFLA_BR_VLAN_FILTERING,
  716. IFLA_BR_VLAN_PROTOCOL,
  717. IFLA_BR_GROUP_FWD_MASK,
  718. IFLA_BR_ROOT_ID,
  719. IFLA_BR_BRIDGE_ID,
  720. IFLA_BR_ROOT_PORT,
  721. IFLA_BR_ROOT_PATH_COST,
  722. IFLA_BR_TOPOLOGY_CHANGE,
  723. IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
  724. IFLA_BR_HELLO_TIMER,
  725. IFLA_BR_TCN_TIMER,
  726. IFLA_BR_TOPOLOGY_CHANGE_TIMER,
  727. IFLA_BR_GC_TIMER,
  728. IFLA_BR_GROUP_ADDR,
  729. IFLA_BR_FDB_FLUSH,
  730. IFLA_BR_MCAST_ROUTER,
  731. IFLA_BR_MCAST_SNOOPING,
  732. IFLA_BR_MCAST_QUERY_USE_IFADDR,
  733. IFLA_BR_MCAST_QUERIER,
  734. IFLA_BR_MCAST_HASH_ELASTICITY,
  735. IFLA_BR_MCAST_HASH_MAX,
  736. IFLA_BR_MCAST_LAST_MEMBER_CNT,
  737. IFLA_BR_MCAST_STARTUP_QUERY_CNT,
  738. IFLA_BR_MCAST_LAST_MEMBER_INTVL,
  739. IFLA_BR_MCAST_MEMBERSHIP_INTVL,
  740. IFLA_BR_MCAST_QUERIER_INTVL,
  741. IFLA_BR_MCAST_QUERY_INTVL,
  742. IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
  743. IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
  744. IFLA_BR_NF_CALL_IPTABLES,
  745. IFLA_BR_NF_CALL_IP6TABLES,
  746. IFLA_BR_NF_CALL_ARPTABLES,
  747. IFLA_BR_VLAN_DEFAULT_PVID,
  748. IFLA_BR_PAD,
  749. IFLA_BR_VLAN_STATS_ENABLED,
  750. IFLA_BR_MCAST_STATS_ENABLED,
  751. IFLA_BR_MCAST_IGMP_VERSION,
  752. IFLA_BR_MCAST_MLD_VERSION,
  753. IFLA_BR_VLAN_STATS_PER_PORT,
  754. IFLA_BR_MULTI_BOOLOPT,
  755. IFLA_BR_MCAST_QUERIER_STATE,
  756. IFLA_BR_FDB_N_LEARNED,
  757. IFLA_BR_FDB_MAX_LEARNED,
  758. __IFLA_BR_MAX,
  759. };
  760. #define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
  761. struct ifla_bridge_id {
  762. __u8 prio[2];
  763. __u8 addr[6]; /* ETH_ALEN */
  764. };
  765. /**
  766. * DOC: Bridge mode enum definition
  767. *
  768. * @BRIDGE_MODE_HAIRPIN
  769. * Controls whether traffic may be sent back out of the port on which it
  770. * was received. This option is also called reflective relay mode, and is
  771. * used to support basic VEPA (Virtual Ethernet Port Aggregator)
  772. * capabilities. By default, this flag is turned off and the bridge will
  773. * not forward traffic back out of the receiving port.
  774. */
  775. enum {
  776. BRIDGE_MODE_UNSPEC,
  777. BRIDGE_MODE_HAIRPIN,
  778. };
  779. /**
  780. * DOC: Bridge port enum definition
  781. *
  782. * @IFLA_BRPORT_STATE
  783. * The operation state of the port. Here are the valid values.
  784. *
  785. * * 0 - port is in STP *DISABLED* state. Make this port completely
  786. * inactive for STP. This is also called BPDU filter and could be used
  787. * to disable STP on an untrusted port, like a leaf virtual device.
  788. * The traffic forwarding is also stopped on this port.
  789. * * 1 - port is in STP *LISTENING* state. Only valid if STP is enabled
  790. * on the bridge. In this state the port listens for STP BPDUs and
  791. * drops all other traffic frames.
  792. * * 2 - port is in STP *LEARNING* state. Only valid if STP is enabled on
  793. * the bridge. In this state the port will accept traffic only for the
  794. * purpose of updating MAC address tables.
  795. * * 3 - port is in STP *FORWARDING* state. Port is fully active.
  796. * * 4 - port is in STP *BLOCKING* state. Only valid if STP is enabled on
  797. * the bridge. This state is used during the STP election process.
  798. * In this state, port will only process STP BPDUs.
  799. *
  800. * @IFLA_BRPORT_PRIORITY
  801. * The STP port priority. The valid values are between 0 and 255.
  802. *
  803. * @IFLA_BRPORT_COST
  804. * The STP path cost of the port. The valid values are between 1 and 65535.
  805. *
  806. * @IFLA_BRPORT_MODE
  807. * Set the bridge port mode. See *BRIDGE_MODE_HAIRPIN* for more details.
  808. *
  809. * @IFLA_BRPORT_GUARD
  810. * Controls whether STP BPDUs will be processed by the bridge port. By
  811. * default, the flag is turned off to allow BPDU processing. Turning this
  812. * flag on will disable the bridge port if a STP BPDU packet is received.
  813. *
  814. * If the bridge has Spanning Tree enabled, hostile devices on the network
  815. * may send BPDU on a port and cause network failure. Setting *guard on*
  816. * will detect and stop this by disabling the port. The port will be
  817. * restarted if the link is brought down, or removed and reattached.
  818. *
  819. * @IFLA_BRPORT_PROTECT
  820. * Controls whether a given port is allowed to become a root port or not.
  821. * Only used when STP is enabled on the bridge. By default the flag is off.
  822. *
  823. * This feature is also called root port guard. If BPDU is received from a
  824. * leaf (edge) port, it should not be elected as root port. This could
  825. * be used if using STP on a bridge and the downstream bridges are not fully
  826. * trusted; this prevents a hostile guest from rerouting traffic.
  827. *
  828. * @IFLA_BRPORT_FAST_LEAVE
  829. * This flag allows the bridge to immediately stop multicast traffic
  830. * forwarding on a port that receives an IGMP Leave message. It is only used
  831. * when IGMP snooping is enabled on the bridge. By default the flag is off.
  832. *
  833. * @IFLA_BRPORT_LEARNING
  834. * Controls whether a given port will learn *source* MAC addresses from
  835. * received traffic or not. Also controls whether dynamic FDB entries
  836. * (which can also be added by software) will be refreshed by incoming
  837. * traffic. By default this flag is on.
  838. *
  839. * @IFLA_BRPORT_UNICAST_FLOOD
  840. * Controls whether unicast traffic for which there is no FDB entry will
  841. * be flooded towards this port. By default this flag is on.
  842. *
  843. * @IFLA_BRPORT_PROXYARP
  844. * Enable proxy ARP on this port.
  845. *
  846. * @IFLA_BRPORT_LEARNING_SYNC
  847. * Controls whether a given port will sync MAC addresses learned on device
  848. * port to bridge FDB.
  849. *
  850. * @IFLA_BRPORT_PROXYARP_WIFI
  851. * Enable proxy ARP on this port which meets extended requirements by
  852. * IEEE 802.11 and Hotspot 2.0 specifications.
  853. *
  854. * @IFLA_BRPORT_ROOT_ID
  855. *
  856. * @IFLA_BRPORT_BRIDGE_ID
  857. *
  858. * @IFLA_BRPORT_DESIGNATED_PORT
  859. *
  860. * @IFLA_BRPORT_DESIGNATED_COST
  861. *
  862. * @IFLA_BRPORT_ID
  863. *
  864. * @IFLA_BRPORT_NO
  865. *
  866. * @IFLA_BRPORT_TOPOLOGY_CHANGE_ACK
  867. *
  868. * @IFLA_BRPORT_CONFIG_PENDING
  869. *
  870. * @IFLA_BRPORT_MESSAGE_AGE_TIMER
  871. *
  872. * @IFLA_BRPORT_FORWARD_DELAY_TIMER
  873. *
  874. * @IFLA_BRPORT_HOLD_TIMER
  875. *
  876. * @IFLA_BRPORT_FLUSH
  877. * Flush bridge ports' fdb dynamic entries.
  878. *
  879. * @IFLA_BRPORT_MULTICAST_ROUTER
  880. * Configure the port's multicast router presence. A port with
  881. * a multicast router will receive all multicast traffic.
  882. * The valid values are:
  883. *
  884. * * 0 disable multicast routers on this port
  885. * * 1 let the system detect the presence of routers (default)
  886. * * 2 permanently enable multicast traffic forwarding on this port
  887. * * 3 enable multicast routers temporarily on this port, not depending
  888. * on incoming queries.
  889. *
  890. * @IFLA_BRPORT_PAD
  891. *
  892. * @IFLA_BRPORT_MCAST_FLOOD
  893. * Controls whether a given port will flood multicast traffic for which
  894. * there is no MDB entry. By default this flag is on.
  895. *
  896. * @IFLA_BRPORT_MCAST_TO_UCAST
  897. * Controls whether a given port will replicate packets using unicast
  898. * instead of multicast. By default this flag is off.
  899. *
  900. * This is done by copying the packet per host and changing the multicast
  901. * destination MAC to a unicast one accordingly.
  902. *
  903. * *mcast_to_unicast* works on top of the multicast snooping feature of the
  904. * bridge. Which means unicast copies are only delivered to hosts which
  905. * are interested in unicast and signaled this via IGMP/MLD reports previously.
  906. *
  907. * This feature is intended for interface types which have a more reliable
  908. * and/or efficient way to deliver unicast packets than broadcast ones
  909. * (e.g. WiFi).
  910. *
  911. * However, it should only be enabled on interfaces where no IGMPv2/MLDv1
  912. * report suppression takes place. IGMP/MLD report suppression issue is
  913. * usually overcome by the network daemon (supplicant) enabling AP isolation
  914. * and by that separating all STAs.
  915. *
  916. * Delivery of STA-to-STA IP multicast is made possible again by enabling
  917. * and utilizing the bridge hairpin mode, which considers the incoming port
  918. * as a potential outgoing port, too (see *BRIDGE_MODE_HAIRPIN* option).
  919. * Hairpin mode is performed after multicast snooping, therefore leading
  920. * to only deliver reports to STAs running a multicast router.
  921. *
  922. * @IFLA_BRPORT_VLAN_TUNNEL
  923. * Controls whether vlan to tunnel mapping is enabled on the port.
  924. * By default this flag is off.
  925. *
  926. * @IFLA_BRPORT_BCAST_FLOOD
  927. * Controls flooding of broadcast traffic on the given port. By default
  928. * this flag is on.
  929. *
  930. * @IFLA_BRPORT_GROUP_FWD_MASK
  931. * Set the group forward mask. This is a bitmask that is applied to
  932. * decide whether to forward incoming frames destined to link-local
  933. * addresses. The addresses of the form are 01:80:C2:00:00:0X (defaults
  934. * to 0, which means the bridge does not forward any link-local frames
  935. * coming on this port).
  936. *
  937. * @IFLA_BRPORT_NEIGH_SUPPRESS
  938. * Controls whether neighbor discovery (arp and nd) proxy and suppression
  939. * is enabled on the port. By default this flag is off.
  940. *
  941. * @IFLA_BRPORT_ISOLATED
  942. * Controls whether a given port will be isolated, which means it will be
  943. * able to communicate with non-isolated ports only. By default this
  944. * flag is off.
  945. *
  946. * @IFLA_BRPORT_BACKUP_PORT
  947. * Set a backup port. If the port loses carrier all traffic will be
  948. * redirected to the configured backup port. Set the value to 0 to disable
  949. * it.
  950. *
  951. * @IFLA_BRPORT_MRP_RING_OPEN
  952. *
  953. * @IFLA_BRPORT_MRP_IN_OPEN
  954. *
  955. * @IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT
  956. * The number of per-port EHT hosts limit. The default value is 512.
  957. * Setting to 0 is not allowed.
  958. *
  959. * @IFLA_BRPORT_MCAST_EHT_HOSTS_CNT
  960. * The current number of tracked hosts, read only.
  961. *
  962. * @IFLA_BRPORT_LOCKED
  963. * Controls whether a port will be locked, meaning that hosts behind the
  964. * port will not be able to communicate through the port unless an FDB
  965. * entry with the unit's MAC address is in the FDB. The common use case is
  966. * that hosts are allowed access through authentication with the IEEE 802.1X
  967. * protocol or based on whitelists. By default this flag is off.
  968. *
  969. * Please note that secure 802.1X deployments should always use the
  970. * *BR_BOOLOPT_NO_LL_LEARN* flag, to not permit the bridge to populate its
  971. * FDB based on link-local (EAPOL) traffic received on the port.
  972. *
  973. * @IFLA_BRPORT_MAB
  974. * Controls whether a port will use MAC Authentication Bypass (MAB), a
  975. * technique through which select MAC addresses may be allowed on a locked
  976. * port, without using 802.1X authentication. Packets with an unknown source
  977. * MAC address generates a "locked" FDB entry on the incoming bridge port.
  978. * The common use case is for user space to react to these bridge FDB
  979. * notifications and optionally replace the locked FDB entry with a normal
  980. * one, allowing traffic to pass for whitelisted MAC addresses.
  981. *
  982. * Setting this flag also requires *IFLA_BRPORT_LOCKED* and
  983. * *IFLA_BRPORT_LEARNING*. *IFLA_BRPORT_LOCKED* ensures that unauthorized
  984. * data packets are dropped, and *IFLA_BRPORT_LEARNING* allows the dynamic
  985. * FDB entries installed by user space (as replacements for the locked FDB
  986. * entries) to be refreshed and/or aged out.
  987. *
  988. * @IFLA_BRPORT_MCAST_N_GROUPS
  989. *
  990. * @IFLA_BRPORT_MCAST_MAX_GROUPS
  991. * Sets the maximum number of MDB entries that can be registered for a
  992. * given port. Attempts to register more MDB entries at the port than this
  993. * limit allows will be rejected, whether they are done through netlink
  994. * (e.g. the bridge tool), or IGMP or MLD membership reports. Setting a
  995. * limit of 0 disables the limit. The default value is 0.
  996. *
  997. * @IFLA_BRPORT_NEIGH_VLAN_SUPPRESS
  998. * Controls whether neighbor discovery (arp and nd) proxy and suppression is
  999. * enabled for a given port. By default this flag is off.
  1000. *
  1001. * Note that this option only takes effect when *IFLA_BRPORT_NEIGH_SUPPRESS*
  1002. * is enabled for a given port.
  1003. *
  1004. * @IFLA_BRPORT_BACKUP_NHID
  1005. * The FDB nexthop object ID to attach to packets being redirected to a
  1006. * backup port that has VLAN tunnel mapping enabled (via the
  1007. * *IFLA_BRPORT_VLAN_TUNNEL* option). Setting a value of 0 (default) has
  1008. * the effect of not attaching any ID.
  1009. */
  1010. enum {
  1011. IFLA_BRPORT_UNSPEC,
  1012. IFLA_BRPORT_STATE, /* Spanning tree state */
  1013. IFLA_BRPORT_PRIORITY, /* " priority */
  1014. IFLA_BRPORT_COST, /* " cost */
  1015. IFLA_BRPORT_MODE, /* mode (hairpin) */
  1016. IFLA_BRPORT_GUARD, /* bpdu guard */
  1017. IFLA_BRPORT_PROTECT, /* root port protection */
  1018. IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
  1019. IFLA_BRPORT_LEARNING, /* mac learning */
  1020. IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
  1021. IFLA_BRPORT_PROXYARP, /* proxy ARP */
  1022. IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
  1023. IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
  1024. IFLA_BRPORT_ROOT_ID, /* designated root */
  1025. IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
  1026. IFLA_BRPORT_DESIGNATED_PORT,
  1027. IFLA_BRPORT_DESIGNATED_COST,
  1028. IFLA_BRPORT_ID,
  1029. IFLA_BRPORT_NO,
  1030. IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
  1031. IFLA_BRPORT_CONFIG_PENDING,
  1032. IFLA_BRPORT_MESSAGE_AGE_TIMER,
  1033. IFLA_BRPORT_FORWARD_DELAY_TIMER,
  1034. IFLA_BRPORT_HOLD_TIMER,
  1035. IFLA_BRPORT_FLUSH,
  1036. IFLA_BRPORT_MULTICAST_ROUTER,
  1037. IFLA_BRPORT_PAD,
  1038. IFLA_BRPORT_MCAST_FLOOD,
  1039. IFLA_BRPORT_MCAST_TO_UCAST,
  1040. IFLA_BRPORT_VLAN_TUNNEL,
  1041. IFLA_BRPORT_BCAST_FLOOD,
  1042. IFLA_BRPORT_GROUP_FWD_MASK,
  1043. IFLA_BRPORT_NEIGH_SUPPRESS,
  1044. IFLA_BRPORT_ISOLATED,
  1045. IFLA_BRPORT_BACKUP_PORT,
  1046. IFLA_BRPORT_MRP_RING_OPEN,
  1047. IFLA_BRPORT_MRP_IN_OPEN,
  1048. IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
  1049. IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
  1050. IFLA_BRPORT_LOCKED,
  1051. IFLA_BRPORT_MAB,
  1052. IFLA_BRPORT_MCAST_N_GROUPS,
  1053. IFLA_BRPORT_MCAST_MAX_GROUPS,
  1054. IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
  1055. IFLA_BRPORT_BACKUP_NHID,
  1056. __IFLA_BRPORT_MAX
  1057. };
  1058. #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
  1059. struct ifla_cacheinfo {
  1060. __u32 max_reasm_len;
  1061. __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
  1062. __u32 reachable_time;
  1063. __u32 retrans_time;
  1064. };
  1065. enum {
  1066. IFLA_INFO_UNSPEC,
  1067. IFLA_INFO_KIND,
  1068. IFLA_INFO_DATA,
  1069. IFLA_INFO_XSTATS,
  1070. IFLA_INFO_SLAVE_KIND,
  1071. IFLA_INFO_SLAVE_DATA,
  1072. __IFLA_INFO_MAX,
  1073. };
  1074. #define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
  1075. /* VLAN section */
  1076. enum {
  1077. IFLA_VLAN_UNSPEC,
  1078. IFLA_VLAN_ID,
  1079. IFLA_VLAN_FLAGS,
  1080. IFLA_VLAN_EGRESS_QOS,
  1081. IFLA_VLAN_INGRESS_QOS,
  1082. IFLA_VLAN_PROTOCOL,
  1083. __IFLA_VLAN_MAX,
  1084. };
  1085. #define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
  1086. struct ifla_vlan_flags {
  1087. __u32 flags;
  1088. __u32 mask;
  1089. };
  1090. enum {
  1091. IFLA_VLAN_QOS_UNSPEC,
  1092. IFLA_VLAN_QOS_MAPPING,
  1093. __IFLA_VLAN_QOS_MAX
  1094. };
  1095. #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
  1096. struct ifla_vlan_qos_mapping {
  1097. __u32 from;
  1098. __u32 to;
  1099. };
  1100. /* MACVLAN section */
  1101. enum {
  1102. IFLA_MACVLAN_UNSPEC,
  1103. IFLA_MACVLAN_MODE,
  1104. IFLA_MACVLAN_FLAGS,
  1105. IFLA_MACVLAN_MACADDR_MODE,
  1106. IFLA_MACVLAN_MACADDR,
  1107. IFLA_MACVLAN_MACADDR_DATA,
  1108. IFLA_MACVLAN_MACADDR_COUNT,
  1109. IFLA_MACVLAN_BC_QUEUE_LEN,
  1110. IFLA_MACVLAN_BC_QUEUE_LEN_USED,
  1111. IFLA_MACVLAN_BC_CUTOFF,
  1112. __IFLA_MACVLAN_MAX,
  1113. };
  1114. #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
  1115. enum macvlan_mode {
  1116. MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
  1117. MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
  1118. MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
  1119. MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
  1120. MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
  1121. };
  1122. enum macvlan_macaddr_mode {
  1123. MACVLAN_MACADDR_ADD,
  1124. MACVLAN_MACADDR_DEL,
  1125. MACVLAN_MACADDR_FLUSH,
  1126. MACVLAN_MACADDR_SET,
  1127. };
  1128. #define MACVLAN_FLAG_NOPROMISC 1
  1129. #define MACVLAN_FLAG_NODST 2 /* skip dst macvlan if matching src macvlan */
  1130. /* VRF section */
  1131. enum {
  1132. IFLA_VRF_UNSPEC,
  1133. IFLA_VRF_TABLE,
  1134. __IFLA_VRF_MAX
  1135. };
  1136. #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
  1137. enum {
  1138. IFLA_VRF_PORT_UNSPEC,
  1139. IFLA_VRF_PORT_TABLE,
  1140. __IFLA_VRF_PORT_MAX
  1141. };
  1142. #define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
  1143. /* MACSEC section */
  1144. enum {
  1145. IFLA_MACSEC_UNSPEC,
  1146. IFLA_MACSEC_SCI,
  1147. IFLA_MACSEC_PORT,
  1148. IFLA_MACSEC_ICV_LEN,
  1149. IFLA_MACSEC_CIPHER_SUITE,
  1150. IFLA_MACSEC_WINDOW,
  1151. IFLA_MACSEC_ENCODING_SA,
  1152. IFLA_MACSEC_ENCRYPT,
  1153. IFLA_MACSEC_PROTECT,
  1154. IFLA_MACSEC_INC_SCI,
  1155. IFLA_MACSEC_ES,
  1156. IFLA_MACSEC_SCB,
  1157. IFLA_MACSEC_REPLAY_PROTECT,
  1158. IFLA_MACSEC_VALIDATION,
  1159. IFLA_MACSEC_PAD,
  1160. IFLA_MACSEC_OFFLOAD,
  1161. __IFLA_MACSEC_MAX,
  1162. };
  1163. #define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
  1164. /* XFRM section */
  1165. enum {
  1166. IFLA_XFRM_UNSPEC,
  1167. IFLA_XFRM_LINK,
  1168. IFLA_XFRM_IF_ID,
  1169. IFLA_XFRM_COLLECT_METADATA,
  1170. __IFLA_XFRM_MAX
  1171. };
  1172. #define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
  1173. enum macsec_validation_type {
  1174. MACSEC_VALIDATE_DISABLED = 0,
  1175. MACSEC_VALIDATE_CHECK = 1,
  1176. MACSEC_VALIDATE_STRICT = 2,
  1177. __MACSEC_VALIDATE_END,
  1178. MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
  1179. };
  1180. enum macsec_offload {
  1181. MACSEC_OFFLOAD_OFF = 0,
  1182. MACSEC_OFFLOAD_PHY = 1,
  1183. MACSEC_OFFLOAD_MAC = 2,
  1184. __MACSEC_OFFLOAD_END,
  1185. MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
  1186. };
  1187. /* IPVLAN section */
  1188. enum {
  1189. IFLA_IPVLAN_UNSPEC,
  1190. IFLA_IPVLAN_MODE,
  1191. IFLA_IPVLAN_FLAGS,
  1192. __IFLA_IPVLAN_MAX
  1193. };
  1194. #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
  1195. enum ipvlan_mode {
  1196. IPVLAN_MODE_L2 = 0,
  1197. IPVLAN_MODE_L3,
  1198. IPVLAN_MODE_L3S,
  1199. IPVLAN_MODE_MAX
  1200. };
  1201. #define IPVLAN_F_PRIVATE 0x01
  1202. #define IPVLAN_F_VEPA 0x02
  1203. /* Tunnel RTM header */
  1204. struct tunnel_msg {
  1205. __u8 family;
  1206. __u8 flags;
  1207. __u16 reserved2;
  1208. __u32 ifindex;
  1209. };
  1210. /* netkit section */
  1211. enum netkit_action {
  1212. NETKIT_NEXT = -1,
  1213. NETKIT_PASS = 0,
  1214. NETKIT_DROP = 2,
  1215. NETKIT_REDIRECT = 7,
  1216. };
  1217. enum netkit_mode {
  1218. NETKIT_L2,
  1219. NETKIT_L3,
  1220. };
  1221. enum {
  1222. IFLA_NETKIT_UNSPEC,
  1223. IFLA_NETKIT_PEER_INFO,
  1224. IFLA_NETKIT_PRIMARY,
  1225. IFLA_NETKIT_POLICY,
  1226. IFLA_NETKIT_PEER_POLICY,
  1227. IFLA_NETKIT_MODE,
  1228. __IFLA_NETKIT_MAX,
  1229. };
  1230. #define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)
  1231. /* VXLAN section */
  1232. /* include statistics in the dump */
  1233. #define TUNNEL_MSG_FLAG_STATS 0x01
  1234. #define TUNNEL_MSG_VALID_USER_FLAGS TUNNEL_MSG_FLAG_STATS
  1235. /* Embedded inside VXLAN_VNIFILTER_ENTRY_STATS */
  1236. enum {
  1237. VNIFILTER_ENTRY_STATS_UNSPEC,
  1238. VNIFILTER_ENTRY_STATS_RX_BYTES,
  1239. VNIFILTER_ENTRY_STATS_RX_PKTS,
  1240. VNIFILTER_ENTRY_STATS_RX_DROPS,
  1241. VNIFILTER_ENTRY_STATS_RX_ERRORS,
  1242. VNIFILTER_ENTRY_STATS_TX_BYTES,
  1243. VNIFILTER_ENTRY_STATS_TX_PKTS,
  1244. VNIFILTER_ENTRY_STATS_TX_DROPS,
  1245. VNIFILTER_ENTRY_STATS_TX_ERRORS,
  1246. VNIFILTER_ENTRY_STATS_PAD,
  1247. __VNIFILTER_ENTRY_STATS_MAX
  1248. };
  1249. #define VNIFILTER_ENTRY_STATS_MAX (__VNIFILTER_ENTRY_STATS_MAX - 1)
  1250. enum {
  1251. VXLAN_VNIFILTER_ENTRY_UNSPEC,
  1252. VXLAN_VNIFILTER_ENTRY_START,
  1253. VXLAN_VNIFILTER_ENTRY_END,
  1254. VXLAN_VNIFILTER_ENTRY_GROUP,
  1255. VXLAN_VNIFILTER_ENTRY_GROUP6,
  1256. VXLAN_VNIFILTER_ENTRY_STATS,
  1257. __VXLAN_VNIFILTER_ENTRY_MAX
  1258. };
  1259. #define VXLAN_VNIFILTER_ENTRY_MAX (__VXLAN_VNIFILTER_ENTRY_MAX - 1)
  1260. enum {
  1261. VXLAN_VNIFILTER_UNSPEC,
  1262. VXLAN_VNIFILTER_ENTRY,
  1263. __VXLAN_VNIFILTER_MAX
  1264. };
  1265. #define VXLAN_VNIFILTER_MAX (__VXLAN_VNIFILTER_MAX - 1)
  1266. enum {
  1267. IFLA_VXLAN_UNSPEC,
  1268. IFLA_VXLAN_ID,
  1269. IFLA_VXLAN_GROUP, /* group or remote address */
  1270. IFLA_VXLAN_LINK,
  1271. IFLA_VXLAN_LOCAL,
  1272. IFLA_VXLAN_TTL,
  1273. IFLA_VXLAN_TOS,
  1274. IFLA_VXLAN_LEARNING,
  1275. IFLA_VXLAN_AGEING,
  1276. IFLA_VXLAN_LIMIT,
  1277. IFLA_VXLAN_PORT_RANGE, /* source port */
  1278. IFLA_VXLAN_PROXY,
  1279. IFLA_VXLAN_RSC,
  1280. IFLA_VXLAN_L2MISS,
  1281. IFLA_VXLAN_L3MISS,
  1282. IFLA_VXLAN_PORT, /* destination port */
  1283. IFLA_VXLAN_GROUP6,
  1284. IFLA_VXLAN_LOCAL6,
  1285. IFLA_VXLAN_UDP_CSUM,
  1286. IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
  1287. IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
  1288. IFLA_VXLAN_REMCSUM_TX,
  1289. IFLA_VXLAN_REMCSUM_RX,
  1290. IFLA_VXLAN_GBP,
  1291. IFLA_VXLAN_REMCSUM_NOPARTIAL,
  1292. IFLA_VXLAN_COLLECT_METADATA,
  1293. IFLA_VXLAN_LABEL,
  1294. IFLA_VXLAN_GPE,
  1295. IFLA_VXLAN_TTL_INHERIT,
  1296. IFLA_VXLAN_DF,
  1297. IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
  1298. IFLA_VXLAN_LOCALBYPASS,
  1299. IFLA_VXLAN_LABEL_POLICY, /* IPv6 flow label policy; ifla_vxlan_label_policy */
  1300. __IFLA_VXLAN_MAX
  1301. };
  1302. #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
  1303. struct ifla_vxlan_port_range {
  1304. __be16 low;
  1305. __be16 high;
  1306. };
  1307. enum ifla_vxlan_df {
  1308. VXLAN_DF_UNSET = 0,
  1309. VXLAN_DF_SET,
  1310. VXLAN_DF_INHERIT,
  1311. __VXLAN_DF_END,
  1312. VXLAN_DF_MAX = __VXLAN_DF_END - 1,
  1313. };
  1314. enum ifla_vxlan_label_policy {
  1315. VXLAN_LABEL_FIXED = 0,
  1316. VXLAN_LABEL_INHERIT = 1,
  1317. __VXLAN_LABEL_END,
  1318. VXLAN_LABEL_MAX = __VXLAN_LABEL_END - 1,
  1319. };
  1320. /* GENEVE section */
  1321. enum {
  1322. IFLA_GENEVE_UNSPEC,
  1323. IFLA_GENEVE_ID,
  1324. IFLA_GENEVE_REMOTE,
  1325. IFLA_GENEVE_TTL,
  1326. IFLA_GENEVE_TOS,
  1327. IFLA_GENEVE_PORT, /* destination port */
  1328. IFLA_GENEVE_COLLECT_METADATA,
  1329. IFLA_GENEVE_REMOTE6,
  1330. IFLA_GENEVE_UDP_CSUM,
  1331. IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
  1332. IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
  1333. IFLA_GENEVE_LABEL,
  1334. IFLA_GENEVE_TTL_INHERIT,
  1335. IFLA_GENEVE_DF,
  1336. IFLA_GENEVE_INNER_PROTO_INHERIT,
  1337. __IFLA_GENEVE_MAX
  1338. };
  1339. #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
  1340. enum ifla_geneve_df {
  1341. GENEVE_DF_UNSET = 0,
  1342. GENEVE_DF_SET,
  1343. GENEVE_DF_INHERIT,
  1344. __GENEVE_DF_END,
  1345. GENEVE_DF_MAX = __GENEVE_DF_END - 1,
  1346. };
  1347. /* Bareudp section */
  1348. enum {
  1349. IFLA_BAREUDP_UNSPEC,
  1350. IFLA_BAREUDP_PORT,
  1351. IFLA_BAREUDP_ETHERTYPE,
  1352. IFLA_BAREUDP_SRCPORT_MIN,
  1353. IFLA_BAREUDP_MULTIPROTO_MODE,
  1354. __IFLA_BAREUDP_MAX
  1355. };
  1356. #define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
  1357. /* PPP section */
  1358. enum {
  1359. IFLA_PPP_UNSPEC,
  1360. IFLA_PPP_DEV_FD,
  1361. __IFLA_PPP_MAX
  1362. };
  1363. #define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
  1364. /* GTP section */
  1365. enum ifla_gtp_role {
  1366. GTP_ROLE_GGSN = 0,
  1367. GTP_ROLE_SGSN,
  1368. };
  1369. enum {
  1370. IFLA_GTP_UNSPEC,
  1371. IFLA_GTP_FD0,
  1372. IFLA_GTP_FD1,
  1373. IFLA_GTP_PDP_HASHSIZE,
  1374. IFLA_GTP_ROLE,
  1375. IFLA_GTP_CREATE_SOCKETS,
  1376. IFLA_GTP_RESTART_COUNT,
  1377. IFLA_GTP_LOCAL,
  1378. IFLA_GTP_LOCAL6,
  1379. __IFLA_GTP_MAX,
  1380. };
  1381. #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
  1382. /* Bonding section */
  1383. enum {
  1384. IFLA_BOND_UNSPEC,
  1385. IFLA_BOND_MODE,
  1386. IFLA_BOND_ACTIVE_SLAVE,
  1387. IFLA_BOND_MIIMON,
  1388. IFLA_BOND_UPDELAY,
  1389. IFLA_BOND_DOWNDELAY,
  1390. IFLA_BOND_USE_CARRIER,
  1391. IFLA_BOND_ARP_INTERVAL,
  1392. IFLA_BOND_ARP_IP_TARGET,
  1393. IFLA_BOND_ARP_VALIDATE,
  1394. IFLA_BOND_ARP_ALL_TARGETS,
  1395. IFLA_BOND_PRIMARY,
  1396. IFLA_BOND_PRIMARY_RESELECT,
  1397. IFLA_BOND_FAIL_OVER_MAC,
  1398. IFLA_BOND_XMIT_HASH_POLICY,
  1399. IFLA_BOND_RESEND_IGMP,
  1400. IFLA_BOND_NUM_PEER_NOTIF,
  1401. IFLA_BOND_ALL_SLAVES_ACTIVE,
  1402. IFLA_BOND_MIN_LINKS,
  1403. IFLA_BOND_LP_INTERVAL,
  1404. IFLA_BOND_PACKETS_PER_SLAVE,
  1405. IFLA_BOND_AD_LACP_RATE,
  1406. IFLA_BOND_AD_SELECT,
  1407. IFLA_BOND_AD_INFO,
  1408. IFLA_BOND_AD_ACTOR_SYS_PRIO,
  1409. IFLA_BOND_AD_USER_PORT_KEY,
  1410. IFLA_BOND_AD_ACTOR_SYSTEM,
  1411. IFLA_BOND_TLB_DYNAMIC_LB,
  1412. IFLA_BOND_PEER_NOTIF_DELAY,
  1413. IFLA_BOND_AD_LACP_ACTIVE,
  1414. IFLA_BOND_MISSED_MAX,
  1415. IFLA_BOND_NS_IP6_TARGET,
  1416. IFLA_BOND_COUPLED_CONTROL,
  1417. __IFLA_BOND_MAX,
  1418. };
  1419. #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
  1420. enum {
  1421. IFLA_BOND_AD_INFO_UNSPEC,
  1422. IFLA_BOND_AD_INFO_AGGREGATOR,
  1423. IFLA_BOND_AD_INFO_NUM_PORTS,
  1424. IFLA_BOND_AD_INFO_ACTOR_KEY,
  1425. IFLA_BOND_AD_INFO_PARTNER_KEY,
  1426. IFLA_BOND_AD_INFO_PARTNER_MAC,
  1427. __IFLA_BOND_AD_INFO_MAX,
  1428. };
  1429. #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
  1430. enum {
  1431. IFLA_BOND_SLAVE_UNSPEC,
  1432. IFLA_BOND_SLAVE_STATE,
  1433. IFLA_BOND_SLAVE_MII_STATUS,
  1434. IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
  1435. IFLA_BOND_SLAVE_PERM_HWADDR,
  1436. IFLA_BOND_SLAVE_QUEUE_ID,
  1437. IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
  1438. IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
  1439. IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
  1440. IFLA_BOND_SLAVE_PRIO,
  1441. __IFLA_BOND_SLAVE_MAX,
  1442. };
  1443. #define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
  1444. /* SR-IOV virtual function management section */
  1445. enum {
  1446. IFLA_VF_INFO_UNSPEC,
  1447. IFLA_VF_INFO,
  1448. __IFLA_VF_INFO_MAX,
  1449. };
  1450. #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
  1451. enum {
  1452. IFLA_VF_UNSPEC,
  1453. IFLA_VF_MAC, /* Hardware queue specific attributes */
  1454. IFLA_VF_VLAN, /* VLAN ID and QoS */
  1455. IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
  1456. IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
  1457. IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
  1458. IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
  1459. IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
  1460. * on/off switch
  1461. */
  1462. IFLA_VF_STATS, /* network device statistics */
  1463. IFLA_VF_TRUST, /* Trust VF */
  1464. IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
  1465. IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
  1466. IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
  1467. IFLA_VF_BROADCAST, /* VF broadcast */
  1468. __IFLA_VF_MAX,
  1469. };
  1470. #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
  1471. struct ifla_vf_mac {
  1472. __u32 vf;
  1473. __u8 mac[32]; /* MAX_ADDR_LEN */
  1474. };
  1475. struct ifla_vf_broadcast {
  1476. __u8 broadcast[32];
  1477. };
  1478. struct ifla_vf_vlan {
  1479. __u32 vf;
  1480. __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
  1481. __u32 qos;
  1482. };
  1483. enum {
  1484. IFLA_VF_VLAN_INFO_UNSPEC,
  1485. IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
  1486. __IFLA_VF_VLAN_INFO_MAX,
  1487. };
  1488. #define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
  1489. #define MAX_VLAN_LIST_LEN 1
  1490. struct ifla_vf_vlan_info {
  1491. __u32 vf;
  1492. __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
  1493. __u32 qos;
  1494. __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
  1495. };
  1496. struct ifla_vf_tx_rate {
  1497. __u32 vf;
  1498. __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
  1499. };
  1500. struct ifla_vf_rate {
  1501. __u32 vf;
  1502. __u32 min_tx_rate; /* Min Bandwidth in Mbps */
  1503. __u32 max_tx_rate; /* Max Bandwidth in Mbps */
  1504. };
  1505. struct ifla_vf_spoofchk {
  1506. __u32 vf;
  1507. __u32 setting;
  1508. };
  1509. struct ifla_vf_guid {
  1510. __u32 vf;
  1511. __u64 guid;
  1512. };
  1513. enum {
  1514. IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
  1515. IFLA_VF_LINK_STATE_ENABLE, /* link always up */
  1516. IFLA_VF_LINK_STATE_DISABLE, /* link always down */
  1517. __IFLA_VF_LINK_STATE_MAX,
  1518. };
  1519. struct ifla_vf_link_state {
  1520. __u32 vf;
  1521. __u32 link_state;
  1522. };
  1523. struct ifla_vf_rss_query_en {
  1524. __u32 vf;
  1525. __u32 setting;
  1526. };
  1527. enum {
  1528. IFLA_VF_STATS_RX_PACKETS,
  1529. IFLA_VF_STATS_TX_PACKETS,
  1530. IFLA_VF_STATS_RX_BYTES,
  1531. IFLA_VF_STATS_TX_BYTES,
  1532. IFLA_VF_STATS_BROADCAST,
  1533. IFLA_VF_STATS_MULTICAST,
  1534. IFLA_VF_STATS_PAD,
  1535. IFLA_VF_STATS_RX_DROPPED,
  1536. IFLA_VF_STATS_TX_DROPPED,
  1537. __IFLA_VF_STATS_MAX,
  1538. };
  1539. #define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
  1540. struct ifla_vf_trust {
  1541. __u32 vf;
  1542. __u32 setting;
  1543. };
  1544. /* VF ports management section
  1545. *
  1546. * Nested layout of set/get msg is:
  1547. *
  1548. * [IFLA_NUM_VF]
  1549. * [IFLA_VF_PORTS]
  1550. * [IFLA_VF_PORT]
  1551. * [IFLA_PORT_*], ...
  1552. * [IFLA_VF_PORT]
  1553. * [IFLA_PORT_*], ...
  1554. * ...
  1555. * [IFLA_PORT_SELF]
  1556. * [IFLA_PORT_*], ...
  1557. */
  1558. enum {
  1559. IFLA_VF_PORT_UNSPEC,
  1560. IFLA_VF_PORT, /* nest */
  1561. __IFLA_VF_PORT_MAX,
  1562. };
  1563. #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
  1564. enum {
  1565. IFLA_PORT_UNSPEC,
  1566. IFLA_PORT_VF, /* __u32 */
  1567. IFLA_PORT_PROFILE, /* string */
  1568. IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
  1569. IFLA_PORT_INSTANCE_UUID, /* binary UUID */
  1570. IFLA_PORT_HOST_UUID, /* binary UUID */
  1571. IFLA_PORT_REQUEST, /* __u8 */
  1572. IFLA_PORT_RESPONSE, /* __u16, output only */
  1573. __IFLA_PORT_MAX,
  1574. };
  1575. #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
  1576. #define PORT_PROFILE_MAX 40
  1577. #define PORT_UUID_MAX 16
  1578. #define PORT_SELF_VF -1
  1579. enum {
  1580. PORT_REQUEST_PREASSOCIATE = 0,
  1581. PORT_REQUEST_PREASSOCIATE_RR,
  1582. PORT_REQUEST_ASSOCIATE,
  1583. PORT_REQUEST_DISASSOCIATE,
  1584. };
  1585. enum {
  1586. PORT_VDP_RESPONSE_SUCCESS = 0,
  1587. PORT_VDP_RESPONSE_INVALID_FORMAT,
  1588. PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
  1589. PORT_VDP_RESPONSE_UNUSED_VTID,
  1590. PORT_VDP_RESPONSE_VTID_VIOLATION,
  1591. PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
  1592. PORT_VDP_RESPONSE_OUT_OF_SYNC,
  1593. /* 0x08-0xFF reserved for future VDP use */
  1594. PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
  1595. PORT_PROFILE_RESPONSE_INPROGRESS,
  1596. PORT_PROFILE_RESPONSE_INVALID,
  1597. PORT_PROFILE_RESPONSE_BADSTATE,
  1598. PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
  1599. PORT_PROFILE_RESPONSE_ERROR,
  1600. };
  1601. struct ifla_port_vsi {
  1602. __u8 vsi_mgr_id;
  1603. __u8 vsi_type_id[3];
  1604. __u8 vsi_type_version;
  1605. __u8 pad[3];
  1606. };
  1607. /* IPoIB section */
  1608. enum {
  1609. IFLA_IPOIB_UNSPEC,
  1610. IFLA_IPOIB_PKEY,
  1611. IFLA_IPOIB_MODE,
  1612. IFLA_IPOIB_UMCAST,
  1613. __IFLA_IPOIB_MAX
  1614. };
  1615. enum {
  1616. IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
  1617. IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
  1618. };
  1619. #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
  1620. /* HSR/PRP section, both uses same interface */
  1621. /* Different redundancy protocols for hsr device */
  1622. enum {
  1623. HSR_PROTOCOL_HSR,
  1624. HSR_PROTOCOL_PRP,
  1625. HSR_PROTOCOL_MAX,
  1626. };
  1627. enum {
  1628. IFLA_HSR_UNSPEC,
  1629. IFLA_HSR_SLAVE1,
  1630. IFLA_HSR_SLAVE2,
  1631. IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
  1632. IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
  1633. IFLA_HSR_SEQ_NR,
  1634. IFLA_HSR_VERSION, /* HSR version */
  1635. IFLA_HSR_PROTOCOL, /* Indicate different protocol than
  1636. * HSR. For example PRP.
  1637. */
  1638. IFLA_HSR_INTERLINK, /* HSR interlink network device */
  1639. __IFLA_HSR_MAX,
  1640. };
  1641. #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
  1642. /* STATS section */
  1643. struct if_stats_msg {
  1644. __u8 family;
  1645. __u8 pad1;
  1646. __u16 pad2;
  1647. __u32 ifindex;
  1648. __u32 filter_mask;
  1649. };
  1650. /* A stats attribute can be netdev specific or a global stat.
  1651. * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
  1652. */
  1653. enum {
  1654. IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
  1655. IFLA_STATS_LINK_64,
  1656. IFLA_STATS_LINK_XSTATS,
  1657. IFLA_STATS_LINK_XSTATS_SLAVE,
  1658. IFLA_STATS_LINK_OFFLOAD_XSTATS,
  1659. IFLA_STATS_AF_SPEC,
  1660. __IFLA_STATS_MAX,
  1661. };
  1662. #define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
  1663. #define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
  1664. enum {
  1665. IFLA_STATS_GETSET_UNSPEC,
  1666. IFLA_STATS_GET_FILTERS, /* Nest of IFLA_STATS_LINK_xxx, each a u32 with
  1667. * a filter mask for the corresponding group.
  1668. */
  1669. IFLA_STATS_SET_OFFLOAD_XSTATS_L3_STATS, /* 0 or 1 as u8 */
  1670. __IFLA_STATS_GETSET_MAX,
  1671. };
  1672. #define IFLA_STATS_GETSET_MAX (__IFLA_STATS_GETSET_MAX - 1)
  1673. /* These are embedded into IFLA_STATS_LINK_XSTATS:
  1674. * [IFLA_STATS_LINK_XSTATS]
  1675. * -> [LINK_XSTATS_TYPE_xxx]
  1676. * -> [rtnl link type specific attributes]
  1677. */
  1678. enum {
  1679. LINK_XSTATS_TYPE_UNSPEC,
  1680. LINK_XSTATS_TYPE_BRIDGE,
  1681. LINK_XSTATS_TYPE_BOND,
  1682. __LINK_XSTATS_TYPE_MAX
  1683. };
  1684. #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
  1685. /* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
  1686. enum {
  1687. IFLA_OFFLOAD_XSTATS_UNSPEC,
  1688. IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
  1689. IFLA_OFFLOAD_XSTATS_HW_S_INFO, /* HW stats info. A nest */
  1690. IFLA_OFFLOAD_XSTATS_L3_STATS, /* struct rtnl_hw_stats64 */
  1691. __IFLA_OFFLOAD_XSTATS_MAX
  1692. };
  1693. #define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
  1694. enum {
  1695. IFLA_OFFLOAD_XSTATS_HW_S_INFO_UNSPEC,
  1696. IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST, /* u8 */
  1697. IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED, /* u8 */
  1698. __IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX,
  1699. };
  1700. #define IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX \
  1701. (__IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX - 1)
  1702. /* XDP section */
  1703. #define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
  1704. #define XDP_FLAGS_SKB_MODE (1U << 1)
  1705. #define XDP_FLAGS_DRV_MODE (1U << 2)
  1706. #define XDP_FLAGS_HW_MODE (1U << 3)
  1707. #define XDP_FLAGS_REPLACE (1U << 4)
  1708. #define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
  1709. XDP_FLAGS_DRV_MODE | \
  1710. XDP_FLAGS_HW_MODE)
  1711. #define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
  1712. XDP_FLAGS_MODES | XDP_FLAGS_REPLACE)
  1713. /* These are stored into IFLA_XDP_ATTACHED on dump. */
  1714. enum {
  1715. XDP_ATTACHED_NONE = 0,
  1716. XDP_ATTACHED_DRV,
  1717. XDP_ATTACHED_SKB,
  1718. XDP_ATTACHED_HW,
  1719. XDP_ATTACHED_MULTI,
  1720. };
  1721. enum {
  1722. IFLA_XDP_UNSPEC,
  1723. IFLA_XDP_FD,
  1724. IFLA_XDP_ATTACHED,
  1725. IFLA_XDP_FLAGS,
  1726. IFLA_XDP_PROG_ID,
  1727. IFLA_XDP_DRV_PROG_ID,
  1728. IFLA_XDP_SKB_PROG_ID,
  1729. IFLA_XDP_HW_PROG_ID,
  1730. IFLA_XDP_EXPECTED_FD,
  1731. __IFLA_XDP_MAX,
  1732. };
  1733. #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
  1734. enum {
  1735. IFLA_EVENT_NONE,
  1736. IFLA_EVENT_REBOOT, /* internal reset / reboot */
  1737. IFLA_EVENT_FEATURES, /* change in offload features */
  1738. IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
  1739. IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
  1740. IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
  1741. IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
  1742. };
  1743. /* tun section */
  1744. enum {
  1745. IFLA_TUN_UNSPEC,
  1746. IFLA_TUN_OWNER,
  1747. IFLA_TUN_GROUP,
  1748. IFLA_TUN_TYPE,
  1749. IFLA_TUN_PI,
  1750. IFLA_TUN_VNET_HDR,
  1751. IFLA_TUN_PERSIST,
  1752. IFLA_TUN_MULTI_QUEUE,
  1753. IFLA_TUN_NUM_QUEUES,
  1754. IFLA_TUN_NUM_DISABLED_QUEUES,
  1755. __IFLA_TUN_MAX,
  1756. };
  1757. #define IFLA_TUN_MAX (__IFLA_TUN_MAX - 1)
  1758. /* rmnet section */
  1759. #define RMNET_FLAGS_INGRESS_DEAGGREGATION (1U << 0)
  1760. #define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)
  1761. #define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)
  1762. #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)
  1763. #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4)
  1764. #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5)
  1765. enum {
  1766. IFLA_RMNET_UNSPEC,
  1767. IFLA_RMNET_MUX_ID,
  1768. IFLA_RMNET_FLAGS,
  1769. __IFLA_RMNET_MAX,
  1770. };
  1771. #define IFLA_RMNET_MAX (__IFLA_RMNET_MAX - 1)
  1772. struct ifla_rmnet_flags {
  1773. __u32 flags;
  1774. __u32 mask;
  1775. };
  1776. /* MCTP section */
  1777. enum {
  1778. IFLA_MCTP_UNSPEC,
  1779. IFLA_MCTP_NET,
  1780. __IFLA_MCTP_MAX,
  1781. };
  1782. #define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)
  1783. /* DSA section */
  1784. enum {
  1785. IFLA_DSA_UNSPEC,
  1786. IFLA_DSA_CONDUIT,
  1787. /* Deprecated, use IFLA_DSA_CONDUIT instead */
  1788. IFLA_DSA_MASTER = IFLA_DSA_CONDUIT,
  1789. __IFLA_DSA_MAX,
  1790. };
  1791. #define IFLA_DSA_MAX (__IFLA_DSA_MAX - 1)
  1792. #endif /* _LINUX_IF_LINK_H */