Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | |
| 14 | #ifndef _UAPI_LINUX_IF_BRIDGE_H |
| 15 | #define _UAPI_LINUX_IF_BRIDGE_H |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/if_ether.h> |
| 19 | #include <linux/in6.h> |
| 20 | |
| 21 | #define SYSFS_BRIDGE_ATTR "bridge" |
| 22 | #define SYSFS_BRIDGE_FDB "brforward" |
| 23 | #define SYSFS_BRIDGE_PORT_SUBDIR "brif" |
| 24 | #define SYSFS_BRIDGE_PORT_ATTR "brport" |
| 25 | #define SYSFS_BRIDGE_PORT_LINK "bridge" |
| 26 | |
| 27 | #define BRCTL_VERSION 1 |
| 28 | |
| 29 | #define BRCTL_GET_VERSION 0 |
| 30 | #define BRCTL_GET_BRIDGES 1 |
| 31 | #define BRCTL_ADD_BRIDGE 2 |
| 32 | #define BRCTL_DEL_BRIDGE 3 |
| 33 | #define BRCTL_ADD_IF 4 |
| 34 | #define BRCTL_DEL_IF 5 |
| 35 | #define BRCTL_GET_BRIDGE_INFO 6 |
| 36 | #define BRCTL_GET_PORT_LIST 7 |
| 37 | #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8 |
| 38 | #define BRCTL_SET_BRIDGE_HELLO_TIME 9 |
| 39 | #define BRCTL_SET_BRIDGE_MAX_AGE 10 |
| 40 | #define BRCTL_SET_AGEING_TIME 11 |
| 41 | #define BRCTL_SET_GC_INTERVAL 12 |
| 42 | #define BRCTL_GET_PORT_INFO 13 |
| 43 | #define BRCTL_SET_BRIDGE_STP_STATE 14 |
| 44 | #define BRCTL_SET_BRIDGE_PRIORITY 15 |
| 45 | #define BRCTL_SET_PORT_PRIORITY 16 |
| 46 | #define BRCTL_SET_PATH_COST 17 |
| 47 | #define BRCTL_GET_FDB_ENTRIES 18 |
| 48 | |
| 49 | #define BR_STATE_DISABLED 0 |
| 50 | #define BR_STATE_LISTENING 1 |
| 51 | #define BR_STATE_LEARNING 2 |
| 52 | #define BR_STATE_FORWARDING 3 |
| 53 | #define BR_STATE_BLOCKING 4 |
| 54 | |
| 55 | struct __bridge_info { |
| 56 | __u64 designated_root; |
| 57 | __u64 bridge_id; |
| 58 | __u32 root_path_cost; |
| 59 | __u32 max_age; |
| 60 | __u32 hello_time; |
| 61 | __u32 forward_delay; |
| 62 | __u32 bridge_max_age; |
| 63 | __u32 bridge_hello_time; |
| 64 | __u32 bridge_forward_delay; |
| 65 | __u8 topology_change; |
| 66 | __u8 topology_change_detected; |
| 67 | __u8 root_port; |
| 68 | __u8 stp_enabled; |
| 69 | __u32 ageing_time; |
| 70 | __u32 gc_interval; |
| 71 | __u32 hello_timer_value; |
| 72 | __u32 tcn_timer_value; |
| 73 | __u32 topology_change_timer_value; |
| 74 | __u32 gc_timer_value; |
| 75 | }; |
| 76 | |
| 77 | struct __port_info { |
| 78 | __u64 designated_root; |
| 79 | __u64 designated_bridge; |
| 80 | __u16 port_id; |
| 81 | __u16 designated_port; |
| 82 | __u32 path_cost; |
| 83 | __u32 designated_cost; |
| 84 | __u8 state; |
| 85 | __u8 top_change_ack; |
| 86 | __u8 config_pending; |
| 87 | __u8 unused0; |
| 88 | __u32 message_age_timer_value; |
| 89 | __u32 forward_delay_timer_value; |
| 90 | __u32 hold_timer_value; |
| 91 | }; |
| 92 | |
| 93 | struct __fdb_entry { |
| 94 | __u8 mac_addr[ETH_ALEN]; |
| 95 | __u8 port_no; |
| 96 | __u8 is_local; |
| 97 | __u32 ageing_timer_value; |
| 98 | __u8 port_hi; |
| 99 | __u8 pad0; |
| 100 | __u16 unused; |
| 101 | }; |
| 102 | |
| 103 | /* Bridge Flags */ |
| 104 | #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */ |
| 105 | #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */ |
| 106 | |
| 107 | #define BRIDGE_MODE_VEB 0 /* Default loopback mode */ |
| 108 | #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */ |
| 109 | #define BRIDGE_MODE_UNDEF 0xFFFF /* mode undefined */ |
| 110 | |
| 111 | /* Bridge management nested attributes |
| 112 | * [IFLA_AF_SPEC] = { |
| 113 | * [IFLA_BRIDGE_FLAGS] |
| 114 | * [IFLA_BRIDGE_MODE] |
| 115 | * [IFLA_BRIDGE_VLAN_INFO] |
| 116 | * } |
| 117 | */ |
| 118 | enum { |
| 119 | IFLA_BRIDGE_FLAGS, |
| 120 | IFLA_BRIDGE_MODE, |
| 121 | IFLA_BRIDGE_VLAN_INFO, |
| 122 | IFLA_BRIDGE_VLAN_TUNNEL_INFO, |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 123 | IFLA_BRIDGE_MRP, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 124 | __IFLA_BRIDGE_MAX, |
| 125 | }; |
| 126 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) |
| 127 | |
| 128 | #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */ |
| 129 | #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */ |
| 130 | #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */ |
| 131 | #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */ |
| 132 | #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */ |
| 133 | #define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */ |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 134 | #define BRIDGE_VLAN_INFO_ONLY_OPTS (1<<6) /* Skip create/delete/flags */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 135 | |
| 136 | struct bridge_vlan_info { |
| 137 | __u16 flags; |
| 138 | __u16 vid; |
| 139 | }; |
| 140 | |
| 141 | enum { |
| 142 | IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC, |
| 143 | IFLA_BRIDGE_VLAN_TUNNEL_ID, |
| 144 | IFLA_BRIDGE_VLAN_TUNNEL_VID, |
| 145 | IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, |
| 146 | __IFLA_BRIDGE_VLAN_TUNNEL_MAX, |
| 147 | }; |
| 148 | |
| 149 | #define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1) |
| 150 | |
| 151 | struct bridge_vlan_xstats { |
| 152 | __u64 rx_bytes; |
| 153 | __u64 rx_packets; |
| 154 | __u64 tx_bytes; |
| 155 | __u64 tx_packets; |
| 156 | __u16 vid; |
| 157 | __u16 flags; |
| 158 | __u32 pad2; |
| 159 | }; |
| 160 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 161 | enum { |
| 162 | IFLA_BRIDGE_MRP_UNSPEC, |
| 163 | IFLA_BRIDGE_MRP_INSTANCE, |
| 164 | IFLA_BRIDGE_MRP_PORT_STATE, |
| 165 | IFLA_BRIDGE_MRP_PORT_ROLE, |
| 166 | IFLA_BRIDGE_MRP_RING_STATE, |
| 167 | IFLA_BRIDGE_MRP_RING_ROLE, |
| 168 | IFLA_BRIDGE_MRP_START_TEST, |
| 169 | IFLA_BRIDGE_MRP_INFO, |
| 170 | IFLA_BRIDGE_MRP_IN_ROLE, |
| 171 | IFLA_BRIDGE_MRP_IN_STATE, |
| 172 | IFLA_BRIDGE_MRP_START_IN_TEST, |
| 173 | __IFLA_BRIDGE_MRP_MAX, |
| 174 | }; |
| 175 | |
| 176 | #define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1) |
| 177 | |
| 178 | enum { |
| 179 | IFLA_BRIDGE_MRP_INSTANCE_UNSPEC, |
| 180 | IFLA_BRIDGE_MRP_INSTANCE_RING_ID, |
| 181 | IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX, |
| 182 | IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX, |
| 183 | IFLA_BRIDGE_MRP_INSTANCE_PRIO, |
| 184 | __IFLA_BRIDGE_MRP_INSTANCE_MAX, |
| 185 | }; |
| 186 | |
| 187 | #define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1) |
| 188 | |
| 189 | enum { |
| 190 | IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC, |
| 191 | IFLA_BRIDGE_MRP_PORT_STATE_STATE, |
| 192 | __IFLA_BRIDGE_MRP_PORT_STATE_MAX, |
| 193 | }; |
| 194 | |
| 195 | #define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1) |
| 196 | |
| 197 | enum { |
| 198 | IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC, |
| 199 | IFLA_BRIDGE_MRP_PORT_ROLE_ROLE, |
| 200 | __IFLA_BRIDGE_MRP_PORT_ROLE_MAX, |
| 201 | }; |
| 202 | |
| 203 | #define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1) |
| 204 | |
| 205 | enum { |
| 206 | IFLA_BRIDGE_MRP_RING_STATE_UNSPEC, |
| 207 | IFLA_BRIDGE_MRP_RING_STATE_RING_ID, |
| 208 | IFLA_BRIDGE_MRP_RING_STATE_STATE, |
| 209 | __IFLA_BRIDGE_MRP_RING_STATE_MAX, |
| 210 | }; |
| 211 | |
| 212 | #define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1) |
| 213 | |
| 214 | enum { |
| 215 | IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC, |
| 216 | IFLA_BRIDGE_MRP_RING_ROLE_RING_ID, |
| 217 | IFLA_BRIDGE_MRP_RING_ROLE_ROLE, |
| 218 | __IFLA_BRIDGE_MRP_RING_ROLE_MAX, |
| 219 | }; |
| 220 | |
| 221 | #define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1) |
| 222 | |
| 223 | enum { |
| 224 | IFLA_BRIDGE_MRP_START_TEST_UNSPEC, |
| 225 | IFLA_BRIDGE_MRP_START_TEST_RING_ID, |
| 226 | IFLA_BRIDGE_MRP_START_TEST_INTERVAL, |
| 227 | IFLA_BRIDGE_MRP_START_TEST_MAX_MISS, |
| 228 | IFLA_BRIDGE_MRP_START_TEST_PERIOD, |
| 229 | IFLA_BRIDGE_MRP_START_TEST_MONITOR, |
| 230 | __IFLA_BRIDGE_MRP_START_TEST_MAX, |
| 231 | }; |
| 232 | |
| 233 | #define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1) |
| 234 | |
| 235 | enum { |
| 236 | IFLA_BRIDGE_MRP_INFO_UNSPEC, |
| 237 | IFLA_BRIDGE_MRP_INFO_RING_ID, |
| 238 | IFLA_BRIDGE_MRP_INFO_P_IFINDEX, |
| 239 | IFLA_BRIDGE_MRP_INFO_S_IFINDEX, |
| 240 | IFLA_BRIDGE_MRP_INFO_PRIO, |
| 241 | IFLA_BRIDGE_MRP_INFO_RING_STATE, |
| 242 | IFLA_BRIDGE_MRP_INFO_RING_ROLE, |
| 243 | IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL, |
| 244 | IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS, |
| 245 | IFLA_BRIDGE_MRP_INFO_TEST_MONITOR, |
| 246 | IFLA_BRIDGE_MRP_INFO_I_IFINDEX, |
| 247 | IFLA_BRIDGE_MRP_INFO_IN_STATE, |
| 248 | IFLA_BRIDGE_MRP_INFO_IN_ROLE, |
| 249 | IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL, |
| 250 | IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS, |
| 251 | __IFLA_BRIDGE_MRP_INFO_MAX, |
| 252 | }; |
| 253 | |
| 254 | #define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1) |
| 255 | |
| 256 | enum { |
| 257 | IFLA_BRIDGE_MRP_IN_STATE_UNSPEC, |
| 258 | IFLA_BRIDGE_MRP_IN_STATE_IN_ID, |
| 259 | IFLA_BRIDGE_MRP_IN_STATE_STATE, |
| 260 | __IFLA_BRIDGE_MRP_IN_STATE_MAX, |
| 261 | }; |
| 262 | |
| 263 | #define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1) |
| 264 | |
| 265 | enum { |
| 266 | IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC, |
| 267 | IFLA_BRIDGE_MRP_IN_ROLE_RING_ID, |
| 268 | IFLA_BRIDGE_MRP_IN_ROLE_IN_ID, |
| 269 | IFLA_BRIDGE_MRP_IN_ROLE_ROLE, |
| 270 | IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX, |
| 271 | __IFLA_BRIDGE_MRP_IN_ROLE_MAX, |
| 272 | }; |
| 273 | |
| 274 | #define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1) |
| 275 | |
| 276 | enum { |
| 277 | IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC, |
| 278 | IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID, |
| 279 | IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL, |
| 280 | IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS, |
| 281 | IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD, |
| 282 | __IFLA_BRIDGE_MRP_START_IN_TEST_MAX, |
| 283 | }; |
| 284 | |
| 285 | #define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1) |
| 286 | |
| 287 | struct br_mrp_instance { |
| 288 | __u32 ring_id; |
| 289 | __u32 p_ifindex; |
| 290 | __u32 s_ifindex; |
| 291 | __u16 prio; |
| 292 | }; |
| 293 | |
| 294 | struct br_mrp_ring_state { |
| 295 | __u32 ring_id; |
| 296 | __u32 ring_state; |
| 297 | }; |
| 298 | |
| 299 | struct br_mrp_ring_role { |
| 300 | __u32 ring_id; |
| 301 | __u32 ring_role; |
| 302 | }; |
| 303 | |
| 304 | struct br_mrp_start_test { |
| 305 | __u32 ring_id; |
| 306 | __u32 interval; |
| 307 | __u32 max_miss; |
| 308 | __u32 period; |
| 309 | __u32 monitor; |
| 310 | }; |
| 311 | |
| 312 | struct br_mrp_in_state { |
| 313 | __u32 in_state; |
| 314 | __u16 in_id; |
| 315 | }; |
| 316 | |
| 317 | struct br_mrp_in_role { |
| 318 | __u32 ring_id; |
| 319 | __u32 in_role; |
| 320 | __u32 i_ifindex; |
| 321 | __u16 in_id; |
| 322 | }; |
| 323 | |
| 324 | struct br_mrp_start_in_test { |
| 325 | __u32 interval; |
| 326 | __u32 max_miss; |
| 327 | __u32 period; |
| 328 | __u16 in_id; |
| 329 | }; |
| 330 | |
| 331 | struct bridge_stp_xstats { |
| 332 | __u64 transition_blk; |
| 333 | __u64 transition_fwd; |
| 334 | __u64 rx_bpdu; |
| 335 | __u64 tx_bpdu; |
| 336 | __u64 rx_tcn; |
| 337 | __u64 tx_tcn; |
| 338 | }; |
| 339 | |
| 340 | /* Bridge vlan RTM header */ |
| 341 | struct br_vlan_msg { |
| 342 | __u8 family; |
| 343 | __u8 reserved1; |
| 344 | __u16 reserved2; |
| 345 | __u32 ifindex; |
| 346 | }; |
| 347 | |
| 348 | enum { |
| 349 | BRIDGE_VLANDB_DUMP_UNSPEC, |
| 350 | BRIDGE_VLANDB_DUMP_FLAGS, |
| 351 | __BRIDGE_VLANDB_DUMP_MAX, |
| 352 | }; |
| 353 | #define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1) |
| 354 | |
| 355 | /* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */ |
| 356 | #define BRIDGE_VLANDB_DUMPF_STATS (1 << 0) /* Include stats in the dump */ |
| 357 | |
| 358 | /* Bridge vlan RTM attributes |
| 359 | * [BRIDGE_VLANDB_ENTRY] = { |
| 360 | * [BRIDGE_VLANDB_ENTRY_INFO] |
| 361 | * ... |
| 362 | * } |
| 363 | */ |
| 364 | enum { |
| 365 | BRIDGE_VLANDB_UNSPEC, |
| 366 | BRIDGE_VLANDB_ENTRY, |
| 367 | __BRIDGE_VLANDB_MAX, |
| 368 | }; |
| 369 | #define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1) |
| 370 | |
| 371 | enum { |
| 372 | BRIDGE_VLANDB_ENTRY_UNSPEC, |
| 373 | BRIDGE_VLANDB_ENTRY_INFO, |
| 374 | BRIDGE_VLANDB_ENTRY_RANGE, |
| 375 | BRIDGE_VLANDB_ENTRY_STATE, |
| 376 | BRIDGE_VLANDB_ENTRY_TUNNEL_INFO, |
| 377 | BRIDGE_VLANDB_ENTRY_STATS, |
| 378 | __BRIDGE_VLANDB_ENTRY_MAX, |
| 379 | }; |
| 380 | #define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1) |
| 381 | |
| 382 | /* [BRIDGE_VLANDB_ENTRY] = { |
| 383 | * [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = { |
| 384 | * [BRIDGE_VLANDB_TINFO_ID] |
| 385 | * ... |
| 386 | * } |
| 387 | * } |
| 388 | */ |
| 389 | enum { |
| 390 | BRIDGE_VLANDB_TINFO_UNSPEC, |
| 391 | BRIDGE_VLANDB_TINFO_ID, |
| 392 | BRIDGE_VLANDB_TINFO_CMD, |
| 393 | __BRIDGE_VLANDB_TINFO_MAX, |
| 394 | }; |
| 395 | #define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1) |
| 396 | |
| 397 | /* [BRIDGE_VLANDB_ENTRY] = { |
| 398 | * [BRIDGE_VLANDB_ENTRY_STATS] = { |
| 399 | * [BRIDGE_VLANDB_STATS_RX_BYTES] |
| 400 | * ... |
| 401 | * } |
| 402 | * ... |
| 403 | * } |
| 404 | */ |
| 405 | enum { |
| 406 | BRIDGE_VLANDB_STATS_UNSPEC, |
| 407 | BRIDGE_VLANDB_STATS_RX_BYTES, |
| 408 | BRIDGE_VLANDB_STATS_RX_PACKETS, |
| 409 | BRIDGE_VLANDB_STATS_TX_BYTES, |
| 410 | BRIDGE_VLANDB_STATS_TX_PACKETS, |
| 411 | BRIDGE_VLANDB_STATS_PAD, |
| 412 | __BRIDGE_VLANDB_STATS_MAX, |
| 413 | }; |
| 414 | #define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1) |
| 415 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 416 | /* Bridge multicast database attributes |
| 417 | * [MDBA_MDB] = { |
| 418 | * [MDBA_MDB_ENTRY] = { |
| 419 | * [MDBA_MDB_ENTRY_INFO] { |
| 420 | * struct br_mdb_entry |
| 421 | * [MDBA_MDB_EATTR attributes] |
| 422 | * } |
| 423 | * } |
| 424 | * } |
| 425 | * [MDBA_ROUTER] = { |
| 426 | * [MDBA_ROUTER_PORT] = { |
| 427 | * u32 ifindex |
| 428 | * [MDBA_ROUTER_PATTR attributes] |
| 429 | * } |
| 430 | * } |
| 431 | */ |
| 432 | enum { |
| 433 | MDBA_UNSPEC, |
| 434 | MDBA_MDB, |
| 435 | MDBA_ROUTER, |
| 436 | __MDBA_MAX, |
| 437 | }; |
| 438 | #define MDBA_MAX (__MDBA_MAX - 1) |
| 439 | |
| 440 | enum { |
| 441 | MDBA_MDB_UNSPEC, |
| 442 | MDBA_MDB_ENTRY, |
| 443 | __MDBA_MDB_MAX, |
| 444 | }; |
| 445 | #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1) |
| 446 | |
| 447 | enum { |
| 448 | MDBA_MDB_ENTRY_UNSPEC, |
| 449 | MDBA_MDB_ENTRY_INFO, |
| 450 | __MDBA_MDB_ENTRY_MAX, |
| 451 | }; |
| 452 | #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1) |
| 453 | |
| 454 | /* per mdb entry additional attributes */ |
| 455 | enum { |
| 456 | MDBA_MDB_EATTR_UNSPEC, |
| 457 | MDBA_MDB_EATTR_TIMER, |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 458 | MDBA_MDB_EATTR_SRC_LIST, |
| 459 | MDBA_MDB_EATTR_GROUP_MODE, |
| 460 | MDBA_MDB_EATTR_SOURCE, |
| 461 | MDBA_MDB_EATTR_RTPROT, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 462 | __MDBA_MDB_EATTR_MAX |
| 463 | }; |
| 464 | #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1) |
| 465 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 466 | /* per mdb entry source */ |
| 467 | enum { |
| 468 | MDBA_MDB_SRCLIST_UNSPEC, |
| 469 | MDBA_MDB_SRCLIST_ENTRY, |
| 470 | __MDBA_MDB_SRCLIST_MAX |
| 471 | }; |
| 472 | #define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1) |
| 473 | |
| 474 | /* per mdb entry per source attributes |
| 475 | * these are embedded in MDBA_MDB_SRCLIST_ENTRY |
| 476 | */ |
| 477 | enum { |
| 478 | MDBA_MDB_SRCATTR_UNSPEC, |
| 479 | MDBA_MDB_SRCATTR_ADDRESS, |
| 480 | MDBA_MDB_SRCATTR_TIMER, |
| 481 | __MDBA_MDB_SRCATTR_MAX |
| 482 | }; |
| 483 | #define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1) |
| 484 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 485 | /* multicast router types */ |
| 486 | enum { |
| 487 | MDB_RTR_TYPE_DISABLED, |
| 488 | MDB_RTR_TYPE_TEMP_QUERY, |
| 489 | MDB_RTR_TYPE_PERM, |
| 490 | MDB_RTR_TYPE_TEMP |
| 491 | }; |
| 492 | |
| 493 | enum { |
| 494 | MDBA_ROUTER_UNSPEC, |
| 495 | MDBA_ROUTER_PORT, |
| 496 | __MDBA_ROUTER_MAX, |
| 497 | }; |
| 498 | #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1) |
| 499 | |
| 500 | /* router port attributes */ |
| 501 | enum { |
| 502 | MDBA_ROUTER_PATTR_UNSPEC, |
| 503 | MDBA_ROUTER_PATTR_TIMER, |
| 504 | MDBA_ROUTER_PATTR_TYPE, |
| 505 | __MDBA_ROUTER_PATTR_MAX |
| 506 | }; |
| 507 | #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1) |
| 508 | |
| 509 | struct br_port_msg { |
| 510 | __u8 family; |
| 511 | __u32 ifindex; |
| 512 | }; |
| 513 | |
| 514 | struct br_mdb_entry { |
| 515 | __u32 ifindex; |
| 516 | #define MDB_TEMPORARY 0 |
| 517 | #define MDB_PERMANENT 1 |
| 518 | __u8 state; |
| 519 | #define MDB_FLAGS_OFFLOAD (1 << 0) |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 520 | #define MDB_FLAGS_FAST_LEAVE (1 << 1) |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 521 | #define MDB_FLAGS_STAR_EXCL (1 << 2) |
| 522 | #define MDB_FLAGS_BLOCKED (1 << 3) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 523 | __u8 flags; |
| 524 | __u16 vid; |
| 525 | struct { |
| 526 | union { |
| 527 | __be32 ip4; |
| 528 | struct in6_addr ip6; |
| 529 | } u; |
| 530 | __be16 proto; |
| 531 | } addr; |
| 532 | }; |
| 533 | |
| 534 | enum { |
| 535 | MDBA_SET_ENTRY_UNSPEC, |
| 536 | MDBA_SET_ENTRY, |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 537 | MDBA_SET_ENTRY_ATTRS, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 538 | __MDBA_SET_ENTRY_MAX, |
| 539 | }; |
| 540 | #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1) |
| 541 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 542 | /* [MDBA_SET_ENTRY_ATTRS] = { |
| 543 | * [MDBE_ATTR_xxx] |
| 544 | * ... |
| 545 | * } |
| 546 | */ |
| 547 | enum { |
| 548 | MDBE_ATTR_UNSPEC, |
| 549 | MDBE_ATTR_SOURCE, |
| 550 | __MDBE_ATTR_MAX, |
| 551 | }; |
| 552 | #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1) |
| 553 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 554 | /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */ |
| 555 | enum { |
| 556 | BRIDGE_XSTATS_UNSPEC, |
| 557 | BRIDGE_XSTATS_VLAN, |
| 558 | BRIDGE_XSTATS_MCAST, |
| 559 | BRIDGE_XSTATS_PAD, |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 560 | BRIDGE_XSTATS_STP, |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 561 | __BRIDGE_XSTATS_MAX |
| 562 | }; |
| 563 | #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1) |
| 564 | |
| 565 | enum { |
| 566 | BR_MCAST_DIR_RX, |
| 567 | BR_MCAST_DIR_TX, |
| 568 | BR_MCAST_DIR_SIZE |
| 569 | }; |
| 570 | |
| 571 | /* IGMP/MLD statistics */ |
| 572 | struct br_mcast_stats { |
| 573 | __u64 igmp_v1queries[BR_MCAST_DIR_SIZE]; |
| 574 | __u64 igmp_v2queries[BR_MCAST_DIR_SIZE]; |
| 575 | __u64 igmp_v3queries[BR_MCAST_DIR_SIZE]; |
| 576 | __u64 igmp_leaves[BR_MCAST_DIR_SIZE]; |
| 577 | __u64 igmp_v1reports[BR_MCAST_DIR_SIZE]; |
| 578 | __u64 igmp_v2reports[BR_MCAST_DIR_SIZE]; |
| 579 | __u64 igmp_v3reports[BR_MCAST_DIR_SIZE]; |
| 580 | __u64 igmp_parse_errors; |
| 581 | |
| 582 | __u64 mld_v1queries[BR_MCAST_DIR_SIZE]; |
| 583 | __u64 mld_v2queries[BR_MCAST_DIR_SIZE]; |
| 584 | __u64 mld_leaves[BR_MCAST_DIR_SIZE]; |
| 585 | __u64 mld_v1reports[BR_MCAST_DIR_SIZE]; |
| 586 | __u64 mld_v2reports[BR_MCAST_DIR_SIZE]; |
| 587 | __u64 mld_parse_errors; |
| 588 | |
| 589 | __u64 mcast_bytes[BR_MCAST_DIR_SIZE]; |
| 590 | __u64 mcast_packets[BR_MCAST_DIR_SIZE]; |
| 591 | }; |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 592 | |
| 593 | /* bridge boolean options |
| 594 | * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets |
| 595 | * |
| 596 | * IMPORTANT: if adding a new option do not forget to handle |
| 597 | * it in br_boolopt_toggle/get and bridge sysfs |
| 598 | */ |
| 599 | enum br_boolopt_id { |
| 600 | BR_BOOLOPT_NO_LL_LEARN, |
| 601 | BR_BOOLOPT_MAX |
| 602 | }; |
| 603 | |
| 604 | /* struct br_boolopt_multi - change multiple bridge boolean options |
| 605 | * |
| 606 | * @optval: new option values (bit per option) |
| 607 | * @optmask: options to change (bit per option) |
| 608 | */ |
| 609 | struct br_boolopt_multi { |
| 610 | __u32 optval; |
| 611 | __u32 optmask; |
| 612 | }; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 613 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |