1
0

if_link.h 55 KB

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