if_bridge.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Linux ethernet bridge
  4. *
  5. * Authors:
  6. * Lennert Buytenhek <buytenh@gnu.org>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. #ifndef _LINUX_IF_BRIDGE_H
  14. #define _LINUX_IF_BRIDGE_H
  15. #include <linux/types.h>
  16. #include <linux/if_ether.h>
  17. #include <linux/in6.h>
  18. #define SYSFS_BRIDGE_ATTR "bridge"
  19. #define SYSFS_BRIDGE_FDB "brforward"
  20. #define SYSFS_BRIDGE_PORT_SUBDIR "brif"
  21. #define SYSFS_BRIDGE_PORT_ATTR "brport"
  22. #define SYSFS_BRIDGE_PORT_LINK "bridge"
  23. #define BRCTL_VERSION 1
  24. #define BRCTL_GET_VERSION 0
  25. #define BRCTL_GET_BRIDGES 1
  26. #define BRCTL_ADD_BRIDGE 2
  27. #define BRCTL_DEL_BRIDGE 3
  28. #define BRCTL_ADD_IF 4
  29. #define BRCTL_DEL_IF 5
  30. #define BRCTL_GET_BRIDGE_INFO 6
  31. #define BRCTL_GET_PORT_LIST 7
  32. #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
  33. #define BRCTL_SET_BRIDGE_HELLO_TIME 9
  34. #define BRCTL_SET_BRIDGE_MAX_AGE 10
  35. #define BRCTL_SET_AGEING_TIME 11
  36. #define BRCTL_SET_GC_INTERVAL 12
  37. #define BRCTL_GET_PORT_INFO 13
  38. #define BRCTL_SET_BRIDGE_STP_STATE 14
  39. #define BRCTL_SET_BRIDGE_PRIORITY 15
  40. #define BRCTL_SET_PORT_PRIORITY 16
  41. #define BRCTL_SET_PATH_COST 17
  42. #define BRCTL_GET_FDB_ENTRIES 18
  43. #define BR_STATE_DISABLED 0
  44. #define BR_STATE_LISTENING 1
  45. #define BR_STATE_LEARNING 2
  46. #define BR_STATE_FORWARDING 3
  47. #define BR_STATE_BLOCKING 4
  48. struct __bridge_info {
  49. __u64 designated_root;
  50. __u64 bridge_id;
  51. __u32 root_path_cost;
  52. __u32 max_age;
  53. __u32 hello_time;
  54. __u32 forward_delay;
  55. __u32 bridge_max_age;
  56. __u32 bridge_hello_time;
  57. __u32 bridge_forward_delay;
  58. __u8 topology_change;
  59. __u8 topology_change_detected;
  60. __u8 root_port;
  61. __u8 stp_enabled;
  62. __u32 ageing_time;
  63. __u32 gc_interval;
  64. __u32 hello_timer_value;
  65. __u32 tcn_timer_value;
  66. __u32 topology_change_timer_value;
  67. __u32 gc_timer_value;
  68. };
  69. struct __port_info {
  70. __u64 designated_root;
  71. __u64 designated_bridge;
  72. __u16 port_id;
  73. __u16 designated_port;
  74. __u32 path_cost;
  75. __u32 designated_cost;
  76. __u8 state;
  77. __u8 top_change_ack;
  78. __u8 config_pending;
  79. __u8 unused0;
  80. __u32 message_age_timer_value;
  81. __u32 forward_delay_timer_value;
  82. __u32 hold_timer_value;
  83. };
  84. struct __fdb_entry {
  85. __u8 mac_addr[ETH_ALEN];
  86. __u8 port_no;
  87. __u8 is_local;
  88. __u32 ageing_timer_value;
  89. __u8 port_hi;
  90. __u8 pad0;
  91. __u16 unused;
  92. };
  93. /* Bridge Flags */
  94. #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */
  95. #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */
  96. #define BRIDGE_MODE_VEB 0 /* Default loopback mode */
  97. #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */
  98. #define BRIDGE_MODE_UNDEF 0xFFFF /* mode undefined */
  99. /* Bridge management nested attributes
  100. * [IFLA_AF_SPEC] = {
  101. * [IFLA_BRIDGE_FLAGS]
  102. * [IFLA_BRIDGE_MODE]
  103. * [IFLA_BRIDGE_VLAN_INFO]
  104. * }
  105. */
  106. enum {
  107. IFLA_BRIDGE_FLAGS,
  108. IFLA_BRIDGE_MODE,
  109. IFLA_BRIDGE_VLAN_INFO,
  110. IFLA_BRIDGE_VLAN_TUNNEL_INFO,
  111. IFLA_BRIDGE_MRP,
  112. IFLA_BRIDGE_CFM,
  113. IFLA_BRIDGE_MST,
  114. __IFLA_BRIDGE_MAX,
  115. };
  116. #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
  117. #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */
  118. #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */
  119. #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */
  120. #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */
  121. #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */
  122. #define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */
  123. #define BRIDGE_VLAN_INFO_ONLY_OPTS (1<<6) /* Skip create/delete/flags */
  124. struct bridge_vlan_info {
  125. __u16 flags;
  126. __u16 vid;
  127. };
  128. enum {
  129. IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
  130. IFLA_BRIDGE_VLAN_TUNNEL_ID,
  131. IFLA_BRIDGE_VLAN_TUNNEL_VID,
  132. IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
  133. __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
  134. };
  135. #define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
  136. struct bridge_vlan_xstats {
  137. __u64 rx_bytes;
  138. __u64 rx_packets;
  139. __u64 tx_bytes;
  140. __u64 tx_packets;
  141. __u16 vid;
  142. __u16 flags;
  143. __u32 pad2;
  144. };
  145. enum {
  146. IFLA_BRIDGE_MRP_UNSPEC,
  147. IFLA_BRIDGE_MRP_INSTANCE,
  148. IFLA_BRIDGE_MRP_PORT_STATE,
  149. IFLA_BRIDGE_MRP_PORT_ROLE,
  150. IFLA_BRIDGE_MRP_RING_STATE,
  151. IFLA_BRIDGE_MRP_RING_ROLE,
  152. IFLA_BRIDGE_MRP_START_TEST,
  153. IFLA_BRIDGE_MRP_INFO,
  154. IFLA_BRIDGE_MRP_IN_ROLE,
  155. IFLA_BRIDGE_MRP_IN_STATE,
  156. IFLA_BRIDGE_MRP_START_IN_TEST,
  157. __IFLA_BRIDGE_MRP_MAX,
  158. };
  159. #define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
  160. enum {
  161. IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
  162. IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
  163. IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
  164. IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
  165. IFLA_BRIDGE_MRP_INSTANCE_PRIO,
  166. __IFLA_BRIDGE_MRP_INSTANCE_MAX,
  167. };
  168. #define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
  169. enum {
  170. IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
  171. IFLA_BRIDGE_MRP_PORT_STATE_STATE,
  172. __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
  173. };
  174. #define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
  175. enum {
  176. IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
  177. IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
  178. __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
  179. };
  180. #define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
  181. enum {
  182. IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
  183. IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
  184. IFLA_BRIDGE_MRP_RING_STATE_STATE,
  185. __IFLA_BRIDGE_MRP_RING_STATE_MAX,
  186. };
  187. #define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
  188. enum {
  189. IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
  190. IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
  191. IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
  192. __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
  193. };
  194. #define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
  195. enum {
  196. IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
  197. IFLA_BRIDGE_MRP_START_TEST_RING_ID,
  198. IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
  199. IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
  200. IFLA_BRIDGE_MRP_START_TEST_PERIOD,
  201. IFLA_BRIDGE_MRP_START_TEST_MONITOR,
  202. __IFLA_BRIDGE_MRP_START_TEST_MAX,
  203. };
  204. #define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
  205. enum {
  206. IFLA_BRIDGE_MRP_INFO_UNSPEC,
  207. IFLA_BRIDGE_MRP_INFO_RING_ID,
  208. IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
  209. IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
  210. IFLA_BRIDGE_MRP_INFO_PRIO,
  211. IFLA_BRIDGE_MRP_INFO_RING_STATE,
  212. IFLA_BRIDGE_MRP_INFO_RING_ROLE,
  213. IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
  214. IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
  215. IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
  216. IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
  217. IFLA_BRIDGE_MRP_INFO_IN_STATE,
  218. IFLA_BRIDGE_MRP_INFO_IN_ROLE,
  219. IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
  220. IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
  221. __IFLA_BRIDGE_MRP_INFO_MAX,
  222. };
  223. #define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
  224. enum {
  225. IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
  226. IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
  227. IFLA_BRIDGE_MRP_IN_STATE_STATE,
  228. __IFLA_BRIDGE_MRP_IN_STATE_MAX,
  229. };
  230. #define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
  231. enum {
  232. IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
  233. IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
  234. IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
  235. IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
  236. IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
  237. __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
  238. };
  239. #define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
  240. enum {
  241. IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
  242. IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
  243. IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
  244. IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
  245. IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
  246. __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
  247. };
  248. #define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
  249. struct br_mrp_instance {
  250. __u32 ring_id;
  251. __u32 p_ifindex;
  252. __u32 s_ifindex;
  253. __u16 prio;
  254. };
  255. struct br_mrp_ring_state {
  256. __u32 ring_id;
  257. __u32 ring_state;
  258. };
  259. struct br_mrp_ring_role {
  260. __u32 ring_id;
  261. __u32 ring_role;
  262. };
  263. struct br_mrp_start_test {
  264. __u32 ring_id;
  265. __u32 interval;
  266. __u32 max_miss;
  267. __u32 period;
  268. __u32 monitor;
  269. };
  270. struct br_mrp_in_state {
  271. __u32 in_state;
  272. __u16 in_id;
  273. };
  274. struct br_mrp_in_role {
  275. __u32 ring_id;
  276. __u32 in_role;
  277. __u32 i_ifindex;
  278. __u16 in_id;
  279. };
  280. struct br_mrp_start_in_test {
  281. __u32 interval;
  282. __u32 max_miss;
  283. __u32 period;
  284. __u16 in_id;
  285. };
  286. enum {
  287. IFLA_BRIDGE_CFM_UNSPEC,
  288. IFLA_BRIDGE_CFM_MEP_CREATE,
  289. IFLA_BRIDGE_CFM_MEP_DELETE,
  290. IFLA_BRIDGE_CFM_MEP_CONFIG,
  291. IFLA_BRIDGE_CFM_CC_CONFIG,
  292. IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
  293. IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
  294. IFLA_BRIDGE_CFM_CC_RDI,
  295. IFLA_BRIDGE_CFM_CC_CCM_TX,
  296. IFLA_BRIDGE_CFM_MEP_CREATE_INFO,
  297. IFLA_BRIDGE_CFM_MEP_CONFIG_INFO,
  298. IFLA_BRIDGE_CFM_CC_CONFIG_INFO,
  299. IFLA_BRIDGE_CFM_CC_RDI_INFO,
  300. IFLA_BRIDGE_CFM_CC_CCM_TX_INFO,
  301. IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO,
  302. IFLA_BRIDGE_CFM_MEP_STATUS_INFO,
  303. IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO,
  304. __IFLA_BRIDGE_CFM_MAX,
  305. };
  306. #define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)
  307. enum {
  308. IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
  309. IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
  310. IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
  311. IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
  312. IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
  313. __IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
  314. };
  315. #define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)
  316. enum {
  317. IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
  318. IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
  319. __IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
  320. };
  321. #define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)
  322. enum {
  323. IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
  324. IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
  325. IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
  326. IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
  327. IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
  328. __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
  329. };
  330. #define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)
  331. enum {
  332. IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
  333. IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
  334. IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
  335. IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
  336. IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
  337. __IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
  338. };
  339. #define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)
  340. enum {
  341. IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
  342. IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
  343. IFLA_BRIDGE_CFM_CC_PEER_MEPID,
  344. __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
  345. };
  346. #define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)
  347. enum {
  348. IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
  349. IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
  350. IFLA_BRIDGE_CFM_CC_RDI_RDI,
  351. __IFLA_BRIDGE_CFM_CC_RDI_MAX,
  352. };
  353. #define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)
  354. enum {
  355. IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
  356. IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
  357. IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
  358. IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
  359. IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
  360. IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
  361. IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
  362. IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
  363. IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
  364. __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
  365. };
  366. #define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)
  367. enum {
  368. IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC,
  369. IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
  370. IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
  371. IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
  372. IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
  373. __IFLA_BRIDGE_CFM_MEP_STATUS_MAX,
  374. };
  375. #define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1)
  376. enum {
  377. IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC,
  378. IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
  379. IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
  380. IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
  381. IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI,
  382. IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE,
  383. IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE,
  384. IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN,
  385. IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN,
  386. IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN,
  387. __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX,
  388. };
  389. #define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
  390. enum {
  391. IFLA_BRIDGE_MST_UNSPEC,
  392. IFLA_BRIDGE_MST_ENTRY,
  393. __IFLA_BRIDGE_MST_MAX,
  394. };
  395. #define IFLA_BRIDGE_MST_MAX (__IFLA_BRIDGE_MST_MAX - 1)
  396. enum {
  397. IFLA_BRIDGE_MST_ENTRY_UNSPEC,
  398. IFLA_BRIDGE_MST_ENTRY_MSTI,
  399. IFLA_BRIDGE_MST_ENTRY_STATE,
  400. __IFLA_BRIDGE_MST_ENTRY_MAX,
  401. };
  402. #define IFLA_BRIDGE_MST_ENTRY_MAX (__IFLA_BRIDGE_MST_ENTRY_MAX - 1)
  403. struct bridge_stp_xstats {
  404. __u64 transition_blk;
  405. __u64 transition_fwd;
  406. __u64 rx_bpdu;
  407. __u64 tx_bpdu;
  408. __u64 rx_tcn;
  409. __u64 tx_tcn;
  410. };
  411. /* Bridge vlan RTM header */
  412. struct br_vlan_msg {
  413. __u8 family;
  414. __u8 reserved1;
  415. __u16 reserved2;
  416. __u32 ifindex;
  417. };
  418. enum {
  419. BRIDGE_VLANDB_DUMP_UNSPEC,
  420. BRIDGE_VLANDB_DUMP_FLAGS,
  421. __BRIDGE_VLANDB_DUMP_MAX,
  422. };
  423. #define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
  424. /* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
  425. #define BRIDGE_VLANDB_DUMPF_STATS (1 << 0) /* Include stats in the dump */
  426. #define BRIDGE_VLANDB_DUMPF_GLOBAL (1 << 1) /* Dump global vlan options only */
  427. /* Bridge vlan RTM attributes
  428. * [BRIDGE_VLANDB_ENTRY] = {
  429. * [BRIDGE_VLANDB_ENTRY_INFO]
  430. * ...
  431. * }
  432. * [BRIDGE_VLANDB_GLOBAL_OPTIONS] = {
  433. * [BRIDGE_VLANDB_GOPTS_ID]
  434. * ...
  435. * }
  436. */
  437. enum {
  438. BRIDGE_VLANDB_UNSPEC,
  439. BRIDGE_VLANDB_ENTRY,
  440. BRIDGE_VLANDB_GLOBAL_OPTIONS,
  441. __BRIDGE_VLANDB_MAX,
  442. };
  443. #define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
  444. enum {
  445. BRIDGE_VLANDB_ENTRY_UNSPEC,
  446. BRIDGE_VLANDB_ENTRY_INFO,
  447. BRIDGE_VLANDB_ENTRY_RANGE,
  448. BRIDGE_VLANDB_ENTRY_STATE,
  449. BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
  450. BRIDGE_VLANDB_ENTRY_STATS,
  451. BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
  452. BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS,
  453. BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS,
  454. BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS,
  455. __BRIDGE_VLANDB_ENTRY_MAX,
  456. };
  457. #define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
  458. /* [BRIDGE_VLANDB_ENTRY] = {
  459. * [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
  460. * [BRIDGE_VLANDB_TINFO_ID]
  461. * ...
  462. * }
  463. * }
  464. */
  465. enum {
  466. BRIDGE_VLANDB_TINFO_UNSPEC,
  467. BRIDGE_VLANDB_TINFO_ID,
  468. BRIDGE_VLANDB_TINFO_CMD,
  469. __BRIDGE_VLANDB_TINFO_MAX,
  470. };
  471. #define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
  472. /* [BRIDGE_VLANDB_ENTRY] = {
  473. * [BRIDGE_VLANDB_ENTRY_STATS] = {
  474. * [BRIDGE_VLANDB_STATS_RX_BYTES]
  475. * ...
  476. * }
  477. * ...
  478. * }
  479. */
  480. enum {
  481. BRIDGE_VLANDB_STATS_UNSPEC,
  482. BRIDGE_VLANDB_STATS_RX_BYTES,
  483. BRIDGE_VLANDB_STATS_RX_PACKETS,
  484. BRIDGE_VLANDB_STATS_TX_BYTES,
  485. BRIDGE_VLANDB_STATS_TX_PACKETS,
  486. BRIDGE_VLANDB_STATS_PAD,
  487. __BRIDGE_VLANDB_STATS_MAX,
  488. };
  489. #define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
  490. enum {
  491. BRIDGE_VLANDB_GOPTS_UNSPEC,
  492. BRIDGE_VLANDB_GOPTS_ID,
  493. BRIDGE_VLANDB_GOPTS_RANGE,
  494. BRIDGE_VLANDB_GOPTS_MCAST_SNOOPING,
  495. BRIDGE_VLANDB_GOPTS_MCAST_IGMP_VERSION,
  496. BRIDGE_VLANDB_GOPTS_MCAST_MLD_VERSION,
  497. BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_CNT,
  498. BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_CNT,
  499. BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_INTVL,
  500. BRIDGE_VLANDB_GOPTS_PAD,
  501. BRIDGE_VLANDB_GOPTS_MCAST_MEMBERSHIP_INTVL,
  502. BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_INTVL,
  503. BRIDGE_VLANDB_GOPTS_MCAST_QUERY_INTVL,
  504. BRIDGE_VLANDB_GOPTS_MCAST_QUERY_RESPONSE_INTVL,
  505. BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_INTVL,
  506. BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,
  507. BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,
  508. BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,
  509. BRIDGE_VLANDB_GOPTS_MSTI,
  510. __BRIDGE_VLANDB_GOPTS_MAX
  511. };
  512. #define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
  513. /* Bridge multicast database attributes
  514. * [MDBA_MDB] = {
  515. * [MDBA_MDB_ENTRY] = {
  516. * [MDBA_MDB_ENTRY_INFO] {
  517. * struct br_mdb_entry
  518. * [MDBA_MDB_EATTR attributes]
  519. * }
  520. * }
  521. * }
  522. * [MDBA_ROUTER] = {
  523. * [MDBA_ROUTER_PORT] = {
  524. * u32 ifindex
  525. * [MDBA_ROUTER_PATTR attributes]
  526. * }
  527. * }
  528. */
  529. enum {
  530. MDBA_UNSPEC,
  531. MDBA_MDB,
  532. MDBA_ROUTER,
  533. __MDBA_MAX,
  534. };
  535. #define MDBA_MAX (__MDBA_MAX - 1)
  536. enum {
  537. MDBA_MDB_UNSPEC,
  538. MDBA_MDB_ENTRY,
  539. __MDBA_MDB_MAX,
  540. };
  541. #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
  542. enum {
  543. MDBA_MDB_ENTRY_UNSPEC,
  544. MDBA_MDB_ENTRY_INFO,
  545. __MDBA_MDB_ENTRY_MAX,
  546. };
  547. #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
  548. /* per mdb entry additional attributes */
  549. enum {
  550. MDBA_MDB_EATTR_UNSPEC,
  551. MDBA_MDB_EATTR_TIMER,
  552. MDBA_MDB_EATTR_SRC_LIST,
  553. MDBA_MDB_EATTR_GROUP_MODE,
  554. MDBA_MDB_EATTR_SOURCE,
  555. MDBA_MDB_EATTR_RTPROT,
  556. MDBA_MDB_EATTR_DST,
  557. MDBA_MDB_EATTR_DST_PORT,
  558. MDBA_MDB_EATTR_VNI,
  559. MDBA_MDB_EATTR_IFINDEX,
  560. MDBA_MDB_EATTR_SRC_VNI,
  561. __MDBA_MDB_EATTR_MAX
  562. };
  563. #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
  564. /* per mdb entry source */
  565. enum {
  566. MDBA_MDB_SRCLIST_UNSPEC,
  567. MDBA_MDB_SRCLIST_ENTRY,
  568. __MDBA_MDB_SRCLIST_MAX
  569. };
  570. #define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
  571. /* per mdb entry per source attributes
  572. * these are embedded in MDBA_MDB_SRCLIST_ENTRY
  573. */
  574. enum {
  575. MDBA_MDB_SRCATTR_UNSPEC,
  576. MDBA_MDB_SRCATTR_ADDRESS,
  577. MDBA_MDB_SRCATTR_TIMER,
  578. __MDBA_MDB_SRCATTR_MAX
  579. };
  580. #define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
  581. /* multicast router types */
  582. enum {
  583. MDB_RTR_TYPE_DISABLED,
  584. MDB_RTR_TYPE_TEMP_QUERY,
  585. MDB_RTR_TYPE_PERM,
  586. MDB_RTR_TYPE_TEMP
  587. };
  588. enum {
  589. MDBA_ROUTER_UNSPEC,
  590. MDBA_ROUTER_PORT,
  591. __MDBA_ROUTER_MAX,
  592. };
  593. #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
  594. /* router port attributes */
  595. enum {
  596. MDBA_ROUTER_PATTR_UNSPEC,
  597. MDBA_ROUTER_PATTR_TIMER,
  598. MDBA_ROUTER_PATTR_TYPE,
  599. MDBA_ROUTER_PATTR_INET_TIMER,
  600. MDBA_ROUTER_PATTR_INET6_TIMER,
  601. MDBA_ROUTER_PATTR_VID,
  602. __MDBA_ROUTER_PATTR_MAX
  603. };
  604. #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
  605. struct br_port_msg {
  606. __u8 family;
  607. __u32 ifindex;
  608. };
  609. struct br_mdb_entry {
  610. __u32 ifindex;
  611. #define MDB_TEMPORARY 0
  612. #define MDB_PERMANENT 1
  613. __u8 state;
  614. #define MDB_FLAGS_OFFLOAD (1 << 0)
  615. #define MDB_FLAGS_FAST_LEAVE (1 << 1)
  616. #define MDB_FLAGS_STAR_EXCL (1 << 2)
  617. #define MDB_FLAGS_BLOCKED (1 << 3)
  618. __u8 flags;
  619. __u16 vid;
  620. struct {
  621. union {
  622. __be32 ip4;
  623. struct in6_addr ip6;
  624. unsigned char mac_addr[ETH_ALEN];
  625. } u;
  626. __be16 proto;
  627. } addr;
  628. };
  629. enum {
  630. MDBA_SET_ENTRY_UNSPEC,
  631. MDBA_SET_ENTRY,
  632. MDBA_SET_ENTRY_ATTRS,
  633. __MDBA_SET_ENTRY_MAX,
  634. };
  635. #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
  636. /* [MDBA_SET_ENTRY_ATTRS] = {
  637. * [MDBE_ATTR_xxx]
  638. * ...
  639. * }
  640. */
  641. enum {
  642. MDBE_ATTR_UNSPEC,
  643. MDBE_ATTR_SOURCE,
  644. MDBE_ATTR_SRC_LIST,
  645. MDBE_ATTR_GROUP_MODE,
  646. MDBE_ATTR_RTPROT,
  647. MDBE_ATTR_DST,
  648. MDBE_ATTR_DST_PORT,
  649. MDBE_ATTR_VNI,
  650. MDBE_ATTR_IFINDEX,
  651. MDBE_ATTR_SRC_VNI,
  652. __MDBE_ATTR_MAX,
  653. };
  654. #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
  655. /* per mdb entry source */
  656. enum {
  657. MDBE_SRC_LIST_UNSPEC,
  658. MDBE_SRC_LIST_ENTRY,
  659. __MDBE_SRC_LIST_MAX,
  660. };
  661. #define MDBE_SRC_LIST_MAX (__MDBE_SRC_LIST_MAX - 1)
  662. /* per mdb entry per source attributes
  663. * these are embedded in MDBE_SRC_LIST_ENTRY
  664. */
  665. enum {
  666. MDBE_SRCATTR_UNSPEC,
  667. MDBE_SRCATTR_ADDRESS,
  668. __MDBE_SRCATTR_MAX,
  669. };
  670. #define MDBE_SRCATTR_MAX (__MDBE_SRCATTR_MAX - 1)
  671. /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
  672. enum {
  673. BRIDGE_XSTATS_UNSPEC,
  674. BRIDGE_XSTATS_VLAN,
  675. BRIDGE_XSTATS_MCAST,
  676. BRIDGE_XSTATS_PAD,
  677. BRIDGE_XSTATS_STP,
  678. __BRIDGE_XSTATS_MAX
  679. };
  680. #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
  681. enum {
  682. BR_MCAST_DIR_RX,
  683. BR_MCAST_DIR_TX,
  684. BR_MCAST_DIR_SIZE
  685. };
  686. /* IGMP/MLD statistics */
  687. struct br_mcast_stats {
  688. __u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
  689. __u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
  690. __u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
  691. __u64 igmp_leaves[BR_MCAST_DIR_SIZE];
  692. __u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
  693. __u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
  694. __u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
  695. __u64 igmp_parse_errors;
  696. __u64 mld_v1queries[BR_MCAST_DIR_SIZE];
  697. __u64 mld_v2queries[BR_MCAST_DIR_SIZE];
  698. __u64 mld_leaves[BR_MCAST_DIR_SIZE];
  699. __u64 mld_v1reports[BR_MCAST_DIR_SIZE];
  700. __u64 mld_v2reports[BR_MCAST_DIR_SIZE];
  701. __u64 mld_parse_errors;
  702. __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
  703. __u64 mcast_packets[BR_MCAST_DIR_SIZE];
  704. };
  705. /* bridge boolean options
  706. * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
  707. * BR_BOOLOPT_MCAST_VLAN_SNOOPING - control vlan multicast snooping
  708. *
  709. * IMPORTANT: if adding a new option do not forget to handle
  710. * it in br_boolopt_toggle/get and bridge sysfs
  711. */
  712. enum br_boolopt_id {
  713. BR_BOOLOPT_NO_LL_LEARN,
  714. BR_BOOLOPT_MCAST_VLAN_SNOOPING,
  715. BR_BOOLOPT_MST_ENABLE,
  716. BR_BOOLOPT_MAX
  717. };
  718. /* struct br_boolopt_multi - change multiple bridge boolean options
  719. *
  720. * @optval: new option values (bit per option)
  721. * @optmask: options to change (bit per option)
  722. */
  723. struct br_boolopt_multi {
  724. __u32 optval;
  725. __u32 optmask;
  726. };
  727. enum {
  728. BRIDGE_QUERIER_UNSPEC,
  729. BRIDGE_QUERIER_IP_ADDRESS,
  730. BRIDGE_QUERIER_IP_PORT,
  731. BRIDGE_QUERIER_IP_OTHER_TIMER,
  732. BRIDGE_QUERIER_PAD,
  733. BRIDGE_QUERIER_IPV6_ADDRESS,
  734. BRIDGE_QUERIER_IPV6_PORT,
  735. BRIDGE_QUERIER_IPV6_OTHER_TIMER,
  736. __BRIDGE_QUERIER_MAX
  737. };
  738. #define BRIDGE_QUERIER_MAX (__BRIDGE_QUERIER_MAX - 1)
  739. #endif /* _LINUX_IF_BRIDGE_H */