if_link.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. #ifndef _LINUX_IF_LINK_H
  2. #define _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. #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
  145. #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
  146. enum {
  147. IFLA_INET_UNSPEC,
  148. IFLA_INET_CONF,
  149. __IFLA_INET_MAX,
  150. };
  151. #define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
  152. /* ifi_flags.
  153. IFF_* flags.
  154. The only change is:
  155. IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
  156. more not changeable by user. They describe link media
  157. characteristics and set by device driver.
  158. Comments:
  159. - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
  160. - If neither of these three flags are set;
  161. the interface is NBMA.
  162. - IFF_MULTICAST does not mean anything special:
  163. multicasts can be used on all not-NBMA links.
  164. IFF_MULTICAST means that this media uses special encapsulation
  165. for multicast frames. Apparently, all IFF_POINTOPOINT and
  166. IFF_BROADCAST devices are able to use multicasts too.
  167. */
  168. /* IFLA_LINK.
  169. For usual devices it is equal ifi_index.
  170. If it is a "virtual interface" (f.e. tunnel), ifi_link
  171. can point to real physical interface (f.e. for bandwidth calculations),
  172. or maybe 0, what means, that real media is unknown (usual
  173. for IPIP tunnels, when route to endpoint is allowed to change)
  174. */
  175. /* Subtype attributes for IFLA_PROTINFO */
  176. enum {
  177. IFLA_INET6_UNSPEC,
  178. IFLA_INET6_FLAGS, /* link flags */
  179. IFLA_INET6_CONF, /* sysctl parameters */
  180. IFLA_INET6_STATS, /* statistics */
  181. IFLA_INET6_MCAST, /* MC things. What of them? */
  182. IFLA_INET6_CACHEINFO, /* time values and max reasm size */
  183. IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
  184. IFLA_INET6_TOKEN, /* device token */
  185. IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
  186. __IFLA_INET6_MAX
  187. };
  188. #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
  189. enum in6_addr_gen_mode {
  190. IN6_ADDR_GEN_MODE_EUI64,
  191. IN6_ADDR_GEN_MODE_NONE,
  192. IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
  193. };
  194. /* Bridge section */
  195. enum {
  196. IFLA_BR_UNSPEC,
  197. IFLA_BR_FORWARD_DELAY,
  198. IFLA_BR_HELLO_TIME,
  199. IFLA_BR_MAX_AGE,
  200. IFLA_BR_AGEING_TIME,
  201. IFLA_BR_STP_STATE,
  202. IFLA_BR_PRIORITY,
  203. IFLA_BR_VLAN_FILTERING,
  204. IFLA_BR_VLAN_PROTOCOL,
  205. IFLA_BR_GROUP_FWD_MASK,
  206. IFLA_BR_ROOT_ID,
  207. IFLA_BR_BRIDGE_ID,
  208. IFLA_BR_ROOT_PORT,
  209. IFLA_BR_ROOT_PATH_COST,
  210. IFLA_BR_TOPOLOGY_CHANGE,
  211. IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
  212. IFLA_BR_HELLO_TIMER,
  213. IFLA_BR_TCN_TIMER,
  214. IFLA_BR_TOPOLOGY_CHANGE_TIMER,
  215. IFLA_BR_GC_TIMER,
  216. IFLA_BR_GROUP_ADDR,
  217. IFLA_BR_FDB_FLUSH,
  218. IFLA_BR_MCAST_ROUTER,
  219. IFLA_BR_MCAST_SNOOPING,
  220. IFLA_BR_MCAST_QUERY_USE_IFADDR,
  221. IFLA_BR_MCAST_QUERIER,
  222. IFLA_BR_MCAST_HASH_ELASTICITY,
  223. IFLA_BR_MCAST_HASH_MAX,
  224. IFLA_BR_MCAST_LAST_MEMBER_CNT,
  225. IFLA_BR_MCAST_STARTUP_QUERY_CNT,
  226. IFLA_BR_MCAST_LAST_MEMBER_INTVL,
  227. IFLA_BR_MCAST_MEMBERSHIP_INTVL,
  228. IFLA_BR_MCAST_QUERIER_INTVL,
  229. IFLA_BR_MCAST_QUERY_INTVL,
  230. IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
  231. IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
  232. IFLA_BR_NF_CALL_IPTABLES,
  233. IFLA_BR_NF_CALL_IP6TABLES,
  234. IFLA_BR_NF_CALL_ARPTABLES,
  235. IFLA_BR_VLAN_DEFAULT_PVID,
  236. __IFLA_BR_MAX,
  237. };
  238. #define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
  239. struct ifla_bridge_id {
  240. __u8 prio[2];
  241. __u8 addr[6]; /* ETH_ALEN */
  242. };
  243. enum {
  244. BRIDGE_MODE_UNSPEC,
  245. BRIDGE_MODE_HAIRPIN,
  246. };
  247. enum {
  248. IFLA_BRPORT_UNSPEC,
  249. IFLA_BRPORT_STATE, /* Spanning tree state */
  250. IFLA_BRPORT_PRIORITY, /* " priority */
  251. IFLA_BRPORT_COST, /* " cost */
  252. IFLA_BRPORT_MODE, /* mode (hairpin) */
  253. IFLA_BRPORT_GUARD, /* bpdu guard */
  254. IFLA_BRPORT_PROTECT, /* root port protection */
  255. IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
  256. IFLA_BRPORT_LEARNING, /* mac learning */
  257. IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
  258. IFLA_BRPORT_PROXYARP, /* proxy ARP */
  259. IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
  260. IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
  261. IFLA_BRPORT_ROOT_ID, /* designated root */
  262. IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
  263. IFLA_BRPORT_DESIGNATED_PORT,
  264. IFLA_BRPORT_DESIGNATED_COST,
  265. IFLA_BRPORT_ID,
  266. IFLA_BRPORT_NO,
  267. IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
  268. IFLA_BRPORT_CONFIG_PENDING,
  269. IFLA_BRPORT_MESSAGE_AGE_TIMER,
  270. IFLA_BRPORT_FORWARD_DELAY_TIMER,
  271. IFLA_BRPORT_HOLD_TIMER,
  272. IFLA_BRPORT_FLUSH,
  273. IFLA_BRPORT_MULTICAST_ROUTER,
  274. __IFLA_BRPORT_MAX
  275. };
  276. #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
  277. struct ifla_cacheinfo {
  278. __u32 max_reasm_len;
  279. __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
  280. __u32 reachable_time;
  281. __u32 retrans_time;
  282. };
  283. enum {
  284. IFLA_INFO_UNSPEC,
  285. IFLA_INFO_KIND,
  286. IFLA_INFO_DATA,
  287. IFLA_INFO_XSTATS,
  288. IFLA_INFO_SLAVE_KIND,
  289. IFLA_INFO_SLAVE_DATA,
  290. __IFLA_INFO_MAX,
  291. };
  292. #define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
  293. /* VLAN section */
  294. enum {
  295. IFLA_VLAN_UNSPEC,
  296. IFLA_VLAN_ID,
  297. IFLA_VLAN_FLAGS,
  298. IFLA_VLAN_EGRESS_QOS,
  299. IFLA_VLAN_INGRESS_QOS,
  300. IFLA_VLAN_PROTOCOL,
  301. __IFLA_VLAN_MAX,
  302. };
  303. #define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
  304. struct ifla_vlan_flags {
  305. __u32 flags;
  306. __u32 mask;
  307. };
  308. enum {
  309. IFLA_VLAN_QOS_UNSPEC,
  310. IFLA_VLAN_QOS_MAPPING,
  311. __IFLA_VLAN_QOS_MAX
  312. };
  313. #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
  314. struct ifla_vlan_qos_mapping {
  315. __u32 from;
  316. __u32 to;
  317. };
  318. /* MACVLAN section */
  319. enum {
  320. IFLA_MACVLAN_UNSPEC,
  321. IFLA_MACVLAN_MODE,
  322. IFLA_MACVLAN_FLAGS,
  323. IFLA_MACVLAN_MACADDR_MODE,
  324. IFLA_MACVLAN_MACADDR,
  325. IFLA_MACVLAN_MACADDR_DATA,
  326. IFLA_MACVLAN_MACADDR_COUNT,
  327. __IFLA_MACVLAN_MAX,
  328. };
  329. #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
  330. enum macvlan_mode {
  331. MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
  332. MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
  333. MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
  334. MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
  335. MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
  336. };
  337. enum macvlan_macaddr_mode {
  338. MACVLAN_MACADDR_ADD,
  339. MACVLAN_MACADDR_DEL,
  340. MACVLAN_MACADDR_FLUSH,
  341. MACVLAN_MACADDR_SET,
  342. };
  343. #define MACVLAN_FLAG_NOPROMISC 1
  344. /* VRF section */
  345. enum {
  346. IFLA_VRF_UNSPEC,
  347. IFLA_VRF_TABLE,
  348. __IFLA_VRF_MAX
  349. };
  350. #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
  351. /* IPVLAN section */
  352. enum {
  353. IFLA_IPVLAN_UNSPEC,
  354. IFLA_IPVLAN_MODE,
  355. __IFLA_IPVLAN_MAX
  356. };
  357. #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
  358. enum ipvlan_mode {
  359. IPVLAN_MODE_L2 = 0,
  360. IPVLAN_MODE_L3,
  361. IPVLAN_MODE_MAX
  362. };
  363. /* VXLAN section */
  364. enum {
  365. IFLA_VXLAN_UNSPEC,
  366. IFLA_VXLAN_ID,
  367. IFLA_VXLAN_GROUP, /* group or remote address */
  368. IFLA_VXLAN_LINK,
  369. IFLA_VXLAN_LOCAL,
  370. IFLA_VXLAN_TTL,
  371. IFLA_VXLAN_TOS,
  372. IFLA_VXLAN_LEARNING,
  373. IFLA_VXLAN_AGEING,
  374. IFLA_VXLAN_LIMIT,
  375. IFLA_VXLAN_PORT_RANGE, /* source port */
  376. IFLA_VXLAN_PROXY,
  377. IFLA_VXLAN_RSC,
  378. IFLA_VXLAN_L2MISS,
  379. IFLA_VXLAN_L3MISS,
  380. IFLA_VXLAN_PORT, /* destination port */
  381. IFLA_VXLAN_GROUP6,
  382. IFLA_VXLAN_LOCAL6,
  383. IFLA_VXLAN_UDP_CSUM,
  384. IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
  385. IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
  386. IFLA_VXLAN_REMCSUM_TX,
  387. IFLA_VXLAN_REMCSUM_RX,
  388. IFLA_VXLAN_GBP,
  389. IFLA_VXLAN_REMCSUM_NOPARTIAL,
  390. IFLA_VXLAN_COLLECT_METADATA,
  391. __IFLA_VXLAN_MAX
  392. };
  393. #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
  394. struct ifla_vxlan_port_range {
  395. __be16 low;
  396. __be16 high;
  397. };
  398. /* GENEVE section */
  399. enum {
  400. IFLA_GENEVE_UNSPEC,
  401. IFLA_GENEVE_ID,
  402. IFLA_GENEVE_REMOTE,
  403. IFLA_GENEVE_TTL,
  404. IFLA_GENEVE_TOS,
  405. IFLA_GENEVE_PORT, /* destination port */
  406. IFLA_GENEVE_COLLECT_METADATA,
  407. IFLA_GENEVE_REMOTE6,
  408. __IFLA_GENEVE_MAX
  409. };
  410. #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
  411. /* Bonding section */
  412. enum {
  413. IFLA_BOND_UNSPEC,
  414. IFLA_BOND_MODE,
  415. IFLA_BOND_ACTIVE_SLAVE,
  416. IFLA_BOND_MIIMON,
  417. IFLA_BOND_UPDELAY,
  418. IFLA_BOND_DOWNDELAY,
  419. IFLA_BOND_USE_CARRIER,
  420. IFLA_BOND_ARP_INTERVAL,
  421. IFLA_BOND_ARP_IP_TARGET,
  422. IFLA_BOND_ARP_VALIDATE,
  423. IFLA_BOND_ARP_ALL_TARGETS,
  424. IFLA_BOND_PRIMARY,
  425. IFLA_BOND_PRIMARY_RESELECT,
  426. IFLA_BOND_FAIL_OVER_MAC,
  427. IFLA_BOND_XMIT_HASH_POLICY,
  428. IFLA_BOND_RESEND_IGMP,
  429. IFLA_BOND_NUM_PEER_NOTIF,
  430. IFLA_BOND_ALL_SLAVES_ACTIVE,
  431. IFLA_BOND_MIN_LINKS,
  432. IFLA_BOND_LP_INTERVAL,
  433. IFLA_BOND_PACKETS_PER_SLAVE,
  434. IFLA_BOND_AD_LACP_RATE,
  435. IFLA_BOND_AD_SELECT,
  436. IFLA_BOND_AD_INFO,
  437. IFLA_BOND_AD_ACTOR_SYS_PRIO,
  438. IFLA_BOND_AD_USER_PORT_KEY,
  439. IFLA_BOND_AD_ACTOR_SYSTEM,
  440. IFLA_BOND_TLB_DYNAMIC_LB,
  441. __IFLA_BOND_MAX,
  442. };
  443. #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
  444. enum {
  445. IFLA_BOND_AD_INFO_UNSPEC,
  446. IFLA_BOND_AD_INFO_AGGREGATOR,
  447. IFLA_BOND_AD_INFO_NUM_PORTS,
  448. IFLA_BOND_AD_INFO_ACTOR_KEY,
  449. IFLA_BOND_AD_INFO_PARTNER_KEY,
  450. IFLA_BOND_AD_INFO_PARTNER_MAC,
  451. __IFLA_BOND_AD_INFO_MAX,
  452. };
  453. #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
  454. enum {
  455. IFLA_BOND_SLAVE_UNSPEC,
  456. IFLA_BOND_SLAVE_STATE,
  457. IFLA_BOND_SLAVE_MII_STATUS,
  458. IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
  459. IFLA_BOND_SLAVE_PERM_HWADDR,
  460. IFLA_BOND_SLAVE_QUEUE_ID,
  461. IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
  462. IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
  463. IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
  464. __IFLA_BOND_SLAVE_MAX,
  465. };
  466. #define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
  467. /* SR-IOV virtual function management section */
  468. enum {
  469. IFLA_VF_INFO_UNSPEC,
  470. IFLA_VF_INFO,
  471. __IFLA_VF_INFO_MAX,
  472. };
  473. #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
  474. enum {
  475. IFLA_VF_UNSPEC,
  476. IFLA_VF_MAC, /* Hardware queue specific attributes */
  477. IFLA_VF_VLAN,
  478. IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
  479. IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
  480. IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
  481. IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
  482. IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
  483. * on/off switch
  484. */
  485. IFLA_VF_STATS, /* network device statistics */
  486. IFLA_VF_TRUST, /* Trust VF */
  487. __IFLA_VF_MAX,
  488. };
  489. #define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
  490. struct ifla_vf_mac {
  491. __u32 vf;
  492. __u8 mac[32]; /* MAX_ADDR_LEN */
  493. };
  494. struct ifla_vf_vlan {
  495. __u32 vf;
  496. __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
  497. __u32 qos;
  498. };
  499. struct ifla_vf_tx_rate {
  500. __u32 vf;
  501. __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
  502. };
  503. struct ifla_vf_rate {
  504. __u32 vf;
  505. __u32 min_tx_rate; /* Min Bandwidth in Mbps */
  506. __u32 max_tx_rate; /* Max Bandwidth in Mbps */
  507. };
  508. struct ifla_vf_spoofchk {
  509. __u32 vf;
  510. __u32 setting;
  511. };
  512. enum {
  513. IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
  514. IFLA_VF_LINK_STATE_ENABLE, /* link always up */
  515. IFLA_VF_LINK_STATE_DISABLE, /* link always down */
  516. __IFLA_VF_LINK_STATE_MAX,
  517. };
  518. struct ifla_vf_link_state {
  519. __u32 vf;
  520. __u32 link_state;
  521. };
  522. struct ifla_vf_rss_query_en {
  523. __u32 vf;
  524. __u32 setting;
  525. };
  526. enum {
  527. IFLA_VF_STATS_RX_PACKETS,
  528. IFLA_VF_STATS_TX_PACKETS,
  529. IFLA_VF_STATS_RX_BYTES,
  530. IFLA_VF_STATS_TX_BYTES,
  531. IFLA_VF_STATS_BROADCAST,
  532. IFLA_VF_STATS_MULTICAST,
  533. __IFLA_VF_STATS_MAX,
  534. };
  535. #define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
  536. struct ifla_vf_trust {
  537. __u32 vf;
  538. __u32 setting;
  539. };
  540. /* VF ports management section
  541. *
  542. * Nested layout of set/get msg is:
  543. *
  544. * [IFLA_NUM_VF]
  545. * [IFLA_VF_PORTS]
  546. * [IFLA_VF_PORT]
  547. * [IFLA_PORT_*], ...
  548. * [IFLA_VF_PORT]
  549. * [IFLA_PORT_*], ...
  550. * ...
  551. * [IFLA_PORT_SELF]
  552. * [IFLA_PORT_*], ...
  553. */
  554. enum {
  555. IFLA_VF_PORT_UNSPEC,
  556. IFLA_VF_PORT, /* nest */
  557. __IFLA_VF_PORT_MAX,
  558. };
  559. #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
  560. enum {
  561. IFLA_PORT_UNSPEC,
  562. IFLA_PORT_VF, /* __u32 */
  563. IFLA_PORT_PROFILE, /* string */
  564. IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
  565. IFLA_PORT_INSTANCE_UUID, /* binary UUID */
  566. IFLA_PORT_HOST_UUID, /* binary UUID */
  567. IFLA_PORT_REQUEST, /* __u8 */
  568. IFLA_PORT_RESPONSE, /* __u16, output only */
  569. __IFLA_PORT_MAX,
  570. };
  571. #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
  572. #define PORT_PROFILE_MAX 40
  573. #define PORT_UUID_MAX 16
  574. #define PORT_SELF_VF -1
  575. enum {
  576. PORT_REQUEST_PREASSOCIATE = 0,
  577. PORT_REQUEST_PREASSOCIATE_RR,
  578. PORT_REQUEST_ASSOCIATE,
  579. PORT_REQUEST_DISASSOCIATE,
  580. };
  581. enum {
  582. PORT_VDP_RESPONSE_SUCCESS = 0,
  583. PORT_VDP_RESPONSE_INVALID_FORMAT,
  584. PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
  585. PORT_VDP_RESPONSE_UNUSED_VTID,
  586. PORT_VDP_RESPONSE_VTID_VIOLATION,
  587. PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
  588. PORT_VDP_RESPONSE_OUT_OF_SYNC,
  589. /* 0x08-0xFF reserved for future VDP use */
  590. PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
  591. PORT_PROFILE_RESPONSE_INPROGRESS,
  592. PORT_PROFILE_RESPONSE_INVALID,
  593. PORT_PROFILE_RESPONSE_BADSTATE,
  594. PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
  595. PORT_PROFILE_RESPONSE_ERROR,
  596. };
  597. struct ifla_port_vsi {
  598. __u8 vsi_mgr_id;
  599. __u8 vsi_type_id[3];
  600. __u8 vsi_type_version;
  601. __u8 pad[3];
  602. };
  603. /* IPoIB section */
  604. enum {
  605. IFLA_IPOIB_UNSPEC,
  606. IFLA_IPOIB_PKEY,
  607. IFLA_IPOIB_MODE,
  608. IFLA_IPOIB_UMCAST,
  609. __IFLA_IPOIB_MAX
  610. };
  611. enum {
  612. IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
  613. IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
  614. };
  615. #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
  616. /* HSR section */
  617. enum {
  618. IFLA_HSR_UNSPEC,
  619. IFLA_HSR_SLAVE1,
  620. IFLA_HSR_SLAVE2,
  621. IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
  622. IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
  623. IFLA_HSR_SEQ_NR,
  624. __IFLA_HSR_MAX,
  625. };
  626. #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
  627. #endif /* _LINUX_IF_LINK_H */