if_link.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. #ifndef _UAPI_LINUX_IF_LINK_H
  2. #define _UAPI_LINUX_IF_LINK_H
  3. #include <linux/types.h>
  4. #include <linux/netlink.h>
  5. /* This struct should be in sync with struct rtnl_link_stats64 */
  6. struct rtnl_link_stats {
  7. __u32 rx_packets; /* total packets received */
  8. __u32 tx_packets; /* total packets transmitted */
  9. __u32 rx_bytes; /* total bytes received */
  10. __u32 tx_bytes; /* total bytes transmitted */
  11. __u32 rx_errors; /* bad packets received */
  12. __u32 tx_errors; /* packet transmit problems */
  13. __u32 rx_dropped; /* no space in linux buffers */
  14. __u32 tx_dropped; /* no space available in linux */
  15. __u32 multicast; /* multicast packets received */
  16. __u32 collisions;
  17. /* detailed rx_errors: */
  18. __u32 rx_length_errors;
  19. __u32 rx_over_errors; /* receiver ring buff overflow */
  20. __u32 rx_crc_errors; /* recved pkt with crc error */
  21. __u32 rx_frame_errors; /* recv'd frame alignment error */
  22. __u32 rx_fifo_errors; /* recv'r fifo overrun */
  23. __u32 rx_missed_errors; /* receiver missed packet */
  24. /* detailed tx_errors */
  25. __u32 tx_aborted_errors;
  26. __u32 tx_carrier_errors;
  27. __u32 tx_fifo_errors;
  28. __u32 tx_heartbeat_errors;
  29. __u32 tx_window_errors;
  30. /* for cslip etc */
  31. __u32 rx_compressed;
  32. __u32 tx_compressed;
  33. };
  34. /* The main device statistics structure */
  35. struct rtnl_link_stats64 {
  36. __u64 rx_packets; /* total packets received */
  37. __u64 tx_packets; /* total packets transmitted */
  38. __u64 rx_bytes; /* total bytes received */
  39. __u64 tx_bytes; /* total bytes transmitted */
  40. __u64 rx_errors; /* bad packets received */
  41. __u64 tx_errors; /* packet transmit problems */
  42. __u64 rx_dropped; /* no space in linux buffers */
  43. __u64 tx_dropped; /* no space available in linux */
  44. __u64 multicast; /* multicast packets received */
  45. __u64 collisions;
  46. /* detailed rx_errors: */
  47. __u64 rx_length_errors;
  48. __u64 rx_over_errors; /* receiver ring buff overflow */
  49. __u64 rx_crc_errors; /* recved pkt with crc error */
  50. __u64 rx_frame_errors; /* recv'd frame alignment error */
  51. __u64 rx_fifo_errors; /* recv'r fifo overrun */
  52. __u64 rx_missed_errors; /* receiver missed packet */
  53. /* detailed tx_errors */
  54. __u64 tx_aborted_errors;
  55. __u64 tx_carrier_errors;
  56. __u64 tx_fifo_errors;
  57. __u64 tx_heartbeat_errors;
  58. __u64 tx_window_errors;
  59. /* for cslip etc */
  60. __u64 rx_compressed;
  61. __u64 tx_compressed;
  62. };
  63. /* The struct should be in sync with struct ifmap */
  64. struct rtnl_link_ifmap {
  65. __u64 mem_start;
  66. __u64 mem_end;
  67. __u64 base_addr;
  68. __u16 irq;
  69. __u8 dma;
  70. __u8 port;
  71. };
  72. /*
  73. * IFLA_AF_SPEC
  74. * Contains nested attributes for address family specific attributes.
  75. * Each address family may create a attribute with the address family
  76. * number as type and create its own attribute structure in it.
  77. *
  78. * Example:
  79. * [IFLA_AF_SPEC] = {
  80. * [AF_INET] = {
  81. * [IFLA_INET_CONF] = ...,
  82. * },
  83. * [AF_INET6] = {
  84. * [IFLA_INET6_FLAGS] = ...,
  85. * [IFLA_INET6_CONF] = ...,
  86. * }
  87. * }
  88. */
  89. enum {
  90. IFLA_UNSPEC,
  91. IFLA_ADDRESS,
  92. IFLA_BROADCAST,
  93. IFLA_IFNAME,
  94. IFLA_MTU,
  95. IFLA_LINK,
  96. IFLA_QDISC,
  97. IFLA_STATS,
  98. IFLA_COST,
  99. #define IFLA_COST IFLA_COST
  100. IFLA_PRIORITY,
  101. #define IFLA_PRIORITY IFLA_PRIORITY
  102. IFLA_MASTER,
  103. #define IFLA_MASTER IFLA_MASTER
  104. IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
  105. #define IFLA_WIRELESS IFLA_WIRELESS
  106. IFLA_PROTINFO, /* Protocol specific information for a link */
  107. #define IFLA_PROTINFO IFLA_PROTINFO
  108. IFLA_TXQLEN,
  109. #define IFLA_TXQLEN IFLA_TXQLEN
  110. IFLA_MAP,
  111. #define IFLA_MAP IFLA_MAP
  112. IFLA_WEIGHT,
  113. #define IFLA_WEIGHT IFLA_WEIGHT
  114. IFLA_OPERSTATE,
  115. IFLA_LINKMODE,
  116. IFLA_LINKINFO,
  117. #define IFLA_LINKINFO IFLA_LINKINFO
  118. IFLA_NET_NS_PID,
  119. IFLA_IFALIAS,
  120. IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
  121. IFLA_VFINFO_LIST,
  122. IFLA_STATS64,
  123. IFLA_VF_PORTS,
  124. IFLA_PORT_SELF,
  125. IFLA_AF_SPEC,
  126. IFLA_GROUP, /* Group the device belongs to */
  127. IFLA_NET_NS_FD,
  128. IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
  129. IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
  130. #define IFLA_PROMISCUITY IFLA_PROMISCUITY
  131. IFLA_NUM_TX_QUEUES,
  132. IFLA_NUM_RX_QUEUES,
  133. IFLA_CARRIER,
  134. IFLA_PHYS_PORT_ID,
  135. IFLA_CARRIER_CHANGES,
  136. IFLA_PHYS_SWITCH_ID,
  137. IFLA_LINK_NETNSID,
  138. IFLA_PHYS_PORT_NAME,
  139. IFLA_PROTO_DOWN,
  140. __IFLA_MAX
  141. };
  142. #define IFLA_MAX (__IFLA_MAX - 1)
  143. /* backwards compatibility for userspace */
  144. #ifndef __KERNEL__
  145. #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
  146. #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
  147. #endif
  148. enum {
  149. IFLA_INET_UNSPEC,
  150. IFLA_INET_CONF,
  151. __IFLA_INET_MAX,
  152. };
  153. #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
  154. /* ifi_flags.
  155. IFF_* flags.
  156. The only change is:
  157. IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
  158. more not changeable by user. They describe link media
  159. characteristics and set by device driver.
  160. Comments:
  161. - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
  162. - If neither of these three flags are set;
  163. the interface is NBMA.
  164. - IFF_MULTICAST does not mean anything special:
  165. multicasts can be used on all not-NBMA links.
  166. IFF_MULTICAST means that this media uses special encapsulation
  167. for multicast frames. Apparently, all IFF_POINTOPOINT and
  168. IFF_BROADCAST devices are able to use multicasts too.
  169. */
  170. /* IFLA_LINK.
  171. For usual devices it is equal ifi_index.
  172. If it is a "virtual interface" (f.e. tunnel), ifi_link
  173. can point to real physical interface (f.e. for bandwidth calculations),
  174. or maybe 0, what means, that real media is unknown (usual
  175. for IPIP tunnels, when route to endpoint is allowed to change)
  176. */
  177. /* Subtype attributes for IFLA_PROTINFO */
  178. enum {
  179. IFLA_INET6_UNSPEC,
  180. IFLA_INET6_FLAGS, /* link flags */
  181. IFLA_INET6_CONF, /* sysctl parameters */
  182. IFLA_INET6_STATS, /* statistics */
  183. IFLA_INET6_MCAST, /* MC things. What of them? */
  184. IFLA_INET6_CACHEINFO, /* time values and max reasm size */
  185. IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
  186. IFLA_INET6_TOKEN, /* device token */
  187. IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
  188. __IFLA_INET6_MAX
  189. };
  190. #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
  191. enum in6_addr_gen_mode {
  192. IN6_ADDR_GEN_MODE_EUI64,
  193. IN6_ADDR_GEN_MODE_NONE,
  194. IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
  195. };
  196. /* Bridge section */
  197. enum {
  198. IFLA_BR_UNSPEC,
  199. IFLA_BR_FORWARD_DELAY,
  200. IFLA_BR_HELLO_TIME,
  201. IFLA_BR_MAX_AGE,
  202. IFLA_BR_AGEING_TIME,
  203. IFLA_BR_STP_STATE,
  204. IFLA_BR_PRIORITY,
  205. IFLA_BR_VLAN_FILTERING,
  206. IFLA_BR_VLAN_PROTOCOL,
  207. IFLA_BR_GROUP_FWD_MASK,
  208. IFLA_BR_ROOT_ID,
  209. IFLA_BR_BRIDGE_ID,
  210. IFLA_BR_ROOT_PORT,
  211. IFLA_BR_ROOT_PATH_COST,
  212. IFLA_BR_TOPOLOGY_CHANGE,
  213. IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
  214. IFLA_BR_HELLO_TIMER,
  215. IFLA_BR_TCN_TIMER,
  216. IFLA_BR_TOPOLOGY_CHANGE_TIMER,
  217. IFLA_BR_GC_TIMER,
  218. IFLA_BR_GROUP_ADDR,
  219. IFLA_BR_FDB_FLUSH,
  220. IFLA_BR_MCAST_ROUTER,
  221. IFLA_BR_MCAST_SNOOPING,
  222. IFLA_BR_MCAST_QUERY_USE_IFADDR,
  223. IFLA_BR_MCAST_QUERIER,
  224. IFLA_BR_MCAST_HASH_ELASTICITY,
  225. IFLA_BR_MCAST_HASH_MAX,
  226. IFLA_BR_MCAST_LAST_MEMBER_CNT,
  227. IFLA_BR_MCAST_STARTUP_QUERY_CNT,
  228. IFLA_BR_MCAST_LAST_MEMBER_INTVL,
  229. IFLA_BR_MCAST_MEMBERSHIP_INTVL,
  230. IFLA_BR_MCAST_QUERIER_INTVL,
  231. IFLA_BR_MCAST_QUERY_INTVL,
  232. IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
  233. IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
  234. IFLA_BR_NF_CALL_IPTABLES,
  235. IFLA_BR_NF_CALL_IP6TABLES,
  236. IFLA_BR_NF_CALL_ARPTABLES,
  237. IFLA_BR_VLAN_DEFAULT_PVID,
  238. __IFLA_BR_MAX,
  239. };
  240. #define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
  241. struct ifla_bridge_id {
  242. __u8 prio[2];
  243. __u8 addr[6]; /* ETH_ALEN */
  244. };
  245. enum {
  246. BRIDGE_MODE_UNSPEC,
  247. BRIDGE_MODE_HAIRPIN,
  248. };
  249. enum {
  250. IFLA_BRPORT_UNSPEC,
  251. IFLA_BRPORT_STATE, /* Spanning tree state */
  252. IFLA_BRPORT_PRIORITY, /* " priority */
  253. IFLA_BRPORT_COST, /* " cost */
  254. IFLA_BRPORT_MODE, /* mode (hairpin) */
  255. IFLA_BRPORT_GUARD, /* bpdu guard */
  256. IFLA_BRPORT_PROTECT, /* root port protection */
  257. IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
  258. IFLA_BRPORT_LEARNING, /* mac learning */
  259. IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
  260. IFLA_BRPORT_PROXYARP, /* proxy ARP */
  261. IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
  262. IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
  263. IFLA_BRPORT_ROOT_ID, /* designated root */
  264. IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
  265. IFLA_BRPORT_DESIGNATED_PORT,
  266. IFLA_BRPORT_DESIGNATED_COST,
  267. IFLA_BRPORT_ID,
  268. IFLA_BRPORT_NO,
  269. IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
  270. IFLA_BRPORT_CONFIG_PENDING,
  271. IFLA_BRPORT_MESSAGE_AGE_TIMER,
  272. IFLA_BRPORT_FORWARD_DELAY_TIMER,
  273. IFLA_BRPORT_HOLD_TIMER,
  274. IFLA_BRPORT_FLUSH,
  275. IFLA_BRPORT_MULTICAST_ROUTER,
  276. __IFLA_BRPORT_MAX
  277. };
  278. #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
  279. struct ifla_cacheinfo {
  280. __u32 max_reasm_len;
  281. __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
  282. __u32 reachable_time;
  283. __u32 retrans_time;
  284. };
  285. enum {
  286. IFLA_INFO_UNSPEC,
  287. IFLA_INFO_KIND,
  288. IFLA_INFO_DATA,
  289. IFLA_INFO_XSTATS,
  290. IFLA_INFO_SLAVE_KIND,
  291. IFLA_INFO_SLAVE_DATA,
  292. __IFLA_INFO_MAX,
  293. };
  294. #define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
  295. /* VLAN section */
  296. enum {
  297. IFLA_VLAN_UNSPEC,
  298. IFLA_VLAN_ID,
  299. IFLA_VLAN_FLAGS,
  300. IFLA_VLAN_EGRESS_QOS,
  301. IFLA_VLAN_INGRESS_QOS,
  302. IFLA_VLAN_PROTOCOL,
  303. __IFLA_VLAN_MAX,
  304. };
  305. #define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
  306. struct ifla_vlan_flags {
  307. __u32 flags;
  308. __u32 mask;
  309. };
  310. enum {
  311. IFLA_VLAN_QOS_UNSPEC,
  312. IFLA_VLAN_QOS_MAPPING,
  313. __IFLA_VLAN_QOS_MAX
  314. };
  315. #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
  316. struct ifla_vlan_qos_mapping {
  317. __u32 from;
  318. __u32 to;
  319. };
  320. /* MACVLAN section */
  321. enum {
  322. IFLA_MACVLAN_UNSPEC,
  323. IFLA_MACVLAN_MODE,
  324. IFLA_MACVLAN_FLAGS,
  325. IFLA_MACVLAN_MACADDR_MODE,
  326. IFLA_MACVLAN_MACADDR,
  327. IFLA_MACVLAN_MACADDR_DATA,
  328. IFLA_MACVLAN_MACADDR_COUNT,
  329. __IFLA_MACVLAN_MAX,
  330. };
  331. #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
  332. enum macvlan_mode {
  333. MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
  334. MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
  335. MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
  336. MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
  337. MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
  338. };
  339. enum macvlan_macaddr_mode {
  340. MACVLAN_MACADDR_ADD,
  341. MACVLAN_MACADDR_DEL,
  342. MACVLAN_MACADDR_FLUSH,
  343. MACVLAN_MACADDR_SET,
  344. };
  345. #define MACVLAN_FLAG_NOPROMISC 1
  346. /* VRF section */
  347. enum {
  348. IFLA_VRF_UNSPEC,
  349. IFLA_VRF_TABLE,
  350. __IFLA_VRF_MAX
  351. };
  352. #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
  353. /* IPVLAN section */
  354. enum {
  355. IFLA_IPVLAN_UNSPEC,
  356. IFLA_IPVLAN_MODE,
  357. __IFLA_IPVLAN_MAX
  358. };
  359. #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
  360. enum ipvlan_mode {
  361. IPVLAN_MODE_L2 = 0,
  362. IPVLAN_MODE_L3,
  363. IPVLAN_MODE_MAX
  364. };
  365. /* VXLAN section */
  366. enum {
  367. IFLA_VXLAN_UNSPEC,
  368. IFLA_VXLAN_ID,
  369. IFLA_VXLAN_GROUP, /* group or remote address */
  370. IFLA_VXLAN_LINK,
  371. IFLA_VXLAN_LOCAL,
  372. IFLA_VXLAN_TTL,
  373. IFLA_VXLAN_TOS,
  374. IFLA_VXLAN_LEARNING,
  375. IFLA_VXLAN_AGEING,
  376. IFLA_VXLAN_LIMIT,
  377. IFLA_VXLAN_PORT_RANGE, /* source port */
  378. IFLA_VXLAN_PROXY,
  379. IFLA_VXLAN_RSC,
  380. IFLA_VXLAN_L2MISS,
  381. IFLA_VXLAN_L3MISS,
  382. IFLA_VXLAN_PORT, /* destination port */
  383. IFLA_VXLAN_GROUP6,
  384. IFLA_VXLAN_LOCAL6,
  385. IFLA_VXLAN_UDP_CSUM,
  386. IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
  387. IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
  388. IFLA_VXLAN_REMCSUM_TX,
  389. IFLA_VXLAN_REMCSUM_RX,
  390. IFLA_VXLAN_GBP,
  391. IFLA_VXLAN_REMCSUM_NOPARTIAL,
  392. IFLA_VXLAN_COLLECT_METADATA,
  393. __IFLA_VXLAN_MAX
  394. };
  395. #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
  396. struct ifla_vxlan_port_range {
  397. __be16 low;
  398. __be16 high;
  399. };
  400. /* GENEVE section */
  401. enum {
  402. IFLA_GENEVE_UNSPEC,
  403. IFLA_GENEVE_ID,
  404. IFLA_GENEVE_REMOTE,
  405. IFLA_GENEVE_TTL,
  406. IFLA_GENEVE_TOS,
  407. IFLA_GENEVE_PORT, /* destination port */
  408. IFLA_GENEVE_COLLECT_METADATA,
  409. IFLA_GENEVE_REMOTE6,
  410. __IFLA_GENEVE_MAX
  411. };
  412. #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
  413. /* Bonding section */
  414. enum {
  415. IFLA_BOND_UNSPEC,
  416. IFLA_BOND_MODE,
  417. IFLA_BOND_ACTIVE_SLAVE,
  418. IFLA_BOND_MIIMON,
  419. IFLA_BOND_UPDELAY,
  420. IFLA_BOND_DOWNDELAY,
  421. IFLA_BOND_USE_CARRIER,
  422. IFLA_BOND_ARP_INTERVAL,
  423. IFLA_BOND_ARP_IP_TARGET,
  424. IFLA_BOND_ARP_VALIDATE,
  425. IFLA_BOND_ARP_ALL_TARGETS,
  426. IFLA_BOND_PRIMARY,
  427. IFLA_BOND_PRIMARY_RESELECT,
  428. IFLA_BOND_FAIL_OVER_MAC,
  429. IFLA_BOND_XMIT_HASH_POLICY,
  430. IFLA_BOND_RESEND_IGMP,
  431. IFLA_BOND_NUM_PEER_NOTIF,
  432. IFLA_BOND_ALL_SLAVES_ACTIVE,
  433. IFLA_BOND_MIN_LINKS,
  434. IFLA_BOND_LP_INTERVAL,
  435. IFLA_BOND_PACKETS_PER_SLAVE,
  436. IFLA_BOND_AD_LACP_RATE,
  437. IFLA_BOND_AD_SELECT,
  438. IFLA_BOND_AD_INFO,
  439. IFLA_BOND_AD_ACTOR_SYS_PRIO,
  440. IFLA_BOND_AD_USER_PORT_KEY,
  441. IFLA_BOND_AD_ACTOR_SYSTEM,
  442. IFLA_BOND_TLB_DYNAMIC_LB,
  443. __IFLA_BOND_MAX,
  444. };
  445. #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
  446. enum {
  447. IFLA_BOND_AD_INFO_UNSPEC,
  448. IFLA_BOND_AD_INFO_AGGREGATOR,
  449. IFLA_BOND_AD_INFO_NUM_PORTS,
  450. IFLA_BOND_AD_INFO_ACTOR_KEY,
  451. IFLA_BOND_AD_INFO_PARTNER_KEY,
  452. IFLA_BOND_AD_INFO_PARTNER_MAC,
  453. __IFLA_BOND_AD_INFO_MAX,
  454. };
  455. #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
  456. enum {
  457. IFLA_BOND_SLAVE_UNSPEC,
  458. IFLA_BOND_SLAVE_STATE,
  459. IFLA_BOND_SLAVE_MII_STATUS,
  460. IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
  461. IFLA_BOND_SLAVE_PERM_HWADDR,
  462. IFLA_BOND_SLAVE_QUEUE_ID,
  463. IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
  464. IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
  465. IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
  466. __IFLA_BOND_SLAVE_MAX,
  467. };
  468. #define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
  469. /* SR-IOV virtual function management section */
  470. enum {
  471. IFLA_VF_INFO_UNSPEC,
  472. IFLA_VF_INFO,
  473. __IFLA_VF_INFO_MAX,
  474. };
  475. #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
  476. enum {
  477. IFLA_VF_UNSPEC,
  478. IFLA_VF_MAC, /* Hardware queue specific attributes */
  479. IFLA_VF_VLAN,
  480. IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
  481. IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
  482. IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
  483. IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
  484. IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
  485. * on/off switch
  486. */
  487. IFLA_VF_STATS, /* network device statistics */
  488. IFLA_VF_TRUST, /* Trust VF */
  489. __IFLA_VF_MAX,
  490. };
  491. #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
  492. struct ifla_vf_mac {
  493. __u32 vf;
  494. __u8 mac[32]; /* MAX_ADDR_LEN */
  495. };
  496. struct ifla_vf_vlan {
  497. __u32 vf;
  498. __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
  499. __u32 qos;
  500. };
  501. struct ifla_vf_tx_rate {
  502. __u32 vf;
  503. __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
  504. };
  505. struct ifla_vf_rate {
  506. __u32 vf;
  507. __u32 min_tx_rate; /* Min Bandwidth in Mbps */
  508. __u32 max_tx_rate; /* Max Bandwidth in Mbps */
  509. };
  510. struct ifla_vf_spoofchk {
  511. __u32 vf;
  512. __u32 setting;
  513. };
  514. enum {
  515. IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
  516. IFLA_VF_LINK_STATE_ENABLE, /* link always up */
  517. IFLA_VF_LINK_STATE_DISABLE, /* link always down */
  518. __IFLA_VF_LINK_STATE_MAX,
  519. };
  520. struct ifla_vf_link_state {
  521. __u32 vf;
  522. __u32 link_state;
  523. };
  524. struct ifla_vf_rss_query_en {
  525. __u32 vf;
  526. __u32 setting;
  527. };
  528. enum {
  529. IFLA_VF_STATS_RX_PACKETS,
  530. IFLA_VF_STATS_TX_PACKETS,
  531. IFLA_VF_STATS_RX_BYTES,
  532. IFLA_VF_STATS_TX_BYTES,
  533. IFLA_VF_STATS_BROADCAST,
  534. IFLA_VF_STATS_MULTICAST,
  535. __IFLA_VF_STATS_MAX,
  536. };
  537. #define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
  538. struct ifla_vf_trust {
  539. __u32 vf;
  540. __u32 setting;
  541. };
  542. /* VF ports management section
  543. *
  544. * Nested layout of set/get msg is:
  545. *
  546. * [IFLA_NUM_VF]
  547. * [IFLA_VF_PORTS]
  548. * [IFLA_VF_PORT]
  549. * [IFLA_PORT_*], ...
  550. * [IFLA_VF_PORT]
  551. * [IFLA_PORT_*], ...
  552. * ...
  553. * [IFLA_PORT_SELF]
  554. * [IFLA_PORT_*], ...
  555. */
  556. enum {
  557. IFLA_VF_PORT_UNSPEC,
  558. IFLA_VF_PORT, /* nest */
  559. __IFLA_VF_PORT_MAX,
  560. };
  561. #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
  562. enum {
  563. IFLA_PORT_UNSPEC,
  564. IFLA_PORT_VF, /* __u32 */
  565. IFLA_PORT_PROFILE, /* string */
  566. IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
  567. IFLA_PORT_INSTANCE_UUID, /* binary UUID */
  568. IFLA_PORT_HOST_UUID, /* binary UUID */
  569. IFLA_PORT_REQUEST, /* __u8 */
  570. IFLA_PORT_RESPONSE, /* __u16, output only */
  571. __IFLA_PORT_MAX,
  572. };
  573. #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
  574. #define PORT_PROFILE_MAX 40
  575. #define PORT_UUID_MAX 16
  576. #define PORT_SELF_VF -1
  577. enum {
  578. PORT_REQUEST_PREASSOCIATE = 0,
  579. PORT_REQUEST_PREASSOCIATE_RR,
  580. PORT_REQUEST_ASSOCIATE,
  581. PORT_REQUEST_DISASSOCIATE,
  582. };
  583. enum {
  584. PORT_VDP_RESPONSE_SUCCESS = 0,
  585. PORT_VDP_RESPONSE_INVALID_FORMAT,
  586. PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
  587. PORT_VDP_RESPONSE_UNUSED_VTID,
  588. PORT_VDP_RESPONSE_VTID_VIOLATION,
  589. PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
  590. PORT_VDP_RESPONSE_OUT_OF_SYNC,
  591. /* 0x08-0xFF reserved for future VDP use */
  592. PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
  593. PORT_PROFILE_RESPONSE_INPROGRESS,
  594. PORT_PROFILE_RESPONSE_INVALID,
  595. PORT_PROFILE_RESPONSE_BADSTATE,
  596. PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
  597. PORT_PROFILE_RESPONSE_ERROR,
  598. };
  599. struct ifla_port_vsi {
  600. __u8 vsi_mgr_id;
  601. __u8 vsi_type_id[3];
  602. __u8 vsi_type_version;
  603. __u8 pad[3];
  604. };
  605. /* IPoIB section */
  606. enum {
  607. IFLA_IPOIB_UNSPEC,
  608. IFLA_IPOIB_PKEY,
  609. IFLA_IPOIB_MODE,
  610. IFLA_IPOIB_UMCAST,
  611. __IFLA_IPOIB_MAX
  612. };
  613. enum {
  614. IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
  615. IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
  616. };
  617. #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
  618. /* HSR section */
  619. enum {
  620. IFLA_HSR_UNSPEC,
  621. IFLA_HSR_SLAVE1,
  622. IFLA_HSR_SLAVE2,
  623. IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
  624. IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
  625. IFLA_HSR_SEQ_NR,
  626. __IFLA_HSR_MAX,
  627. };
  628. #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
  629. #endif /* _UAPI_LINUX_IF_LINK_H */