• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/include/linux/if_bridge.h

  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 _LINUX_IF_BRIDGE_H
 15 #define _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,
123         IFLA_BRIDGE_MRP,
124         IFLA_BRIDGE_CFM,
125         __IFLA_BRIDGE_MAX,
126 };
127 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
128 
129 #define BRIDGE_VLAN_INFO_MASTER (1<<0)  /* Operate on Bridge device as well */
130 #define BRIDGE_VLAN_INFO_PVID   (1<<1)  /* VLAN is PVID, ingress untagged */
131 #define BRIDGE_VLAN_INFO_UNTAGGED       (1<<2)  /* VLAN egresses untagged */
132 #define BRIDGE_VLAN_INFO_RANGE_BEGIN    (1<<3) /* VLAN is start of vlan range */
133 #define BRIDGE_VLAN_INFO_RANGE_END      (1<<4) /* VLAN is end of vlan range */
134 #define BRIDGE_VLAN_INFO_BRENTRY        (1<<5) /* Global bridge VLAN entry */
135 #define BRIDGE_VLAN_INFO_ONLY_OPTS      (1<<6) /* Skip create/delete/flags */
136 
137 struct bridge_vlan_info {
138         __u16 flags;
139         __u16 vid;
140 };
141 
142 enum {
143         IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
144         IFLA_BRIDGE_VLAN_TUNNEL_ID,
145         IFLA_BRIDGE_VLAN_TUNNEL_VID,
146         IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
147         __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
148 };
149 
150 #define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
151 
152 struct bridge_vlan_xstats {
153         __u64 rx_bytes;
154         __u64 rx_packets;
155         __u64 tx_bytes;
156         __u64 tx_packets;
157         __u16 vid;
158         __u16 flags;
159         __u32 pad2;
160 };
161 
162 enum {
163         IFLA_BRIDGE_MRP_UNSPEC,
164         IFLA_BRIDGE_MRP_INSTANCE,
165         IFLA_BRIDGE_MRP_PORT_STATE,
166         IFLA_BRIDGE_MRP_PORT_ROLE,
167         IFLA_BRIDGE_MRP_RING_STATE,
168         IFLA_BRIDGE_MRP_RING_ROLE,
169         IFLA_BRIDGE_MRP_START_TEST,
170         IFLA_BRIDGE_MRP_INFO,
171         IFLA_BRIDGE_MRP_IN_ROLE,
172         IFLA_BRIDGE_MRP_IN_STATE,
173         IFLA_BRIDGE_MRP_START_IN_TEST,
174         __IFLA_BRIDGE_MRP_MAX,
175 };
176 
177 #define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
178 
179 enum {
180         IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
181         IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
182         IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
183         IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
184         IFLA_BRIDGE_MRP_INSTANCE_PRIO,
185         __IFLA_BRIDGE_MRP_INSTANCE_MAX,
186 };
187 
188 #define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
189 
190 enum {
191         IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
192         IFLA_BRIDGE_MRP_PORT_STATE_STATE,
193         __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
194 };
195 
196 #define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
197 
198 enum {
199         IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
200         IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
201         __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
202 };
203 
204 #define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
205 
206 enum {
207         IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
208         IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
209         IFLA_BRIDGE_MRP_RING_STATE_STATE,
210         __IFLA_BRIDGE_MRP_RING_STATE_MAX,
211 };
212 
213 #define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
214 
215 enum {
216         IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
217         IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
218         IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
219         __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
220 };
221 
222 #define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
223 
224 enum {
225         IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
226         IFLA_BRIDGE_MRP_START_TEST_RING_ID,
227         IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
228         IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
229         IFLA_BRIDGE_MRP_START_TEST_PERIOD,
230         IFLA_BRIDGE_MRP_START_TEST_MONITOR,
231         __IFLA_BRIDGE_MRP_START_TEST_MAX,
232 };
233 
234 #define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
235 
236 enum {
237         IFLA_BRIDGE_MRP_INFO_UNSPEC,
238         IFLA_BRIDGE_MRP_INFO_RING_ID,
239         IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
240         IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
241         IFLA_BRIDGE_MRP_INFO_PRIO,
242         IFLA_BRIDGE_MRP_INFO_RING_STATE,
243         IFLA_BRIDGE_MRP_INFO_RING_ROLE,
244         IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
245         IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
246         IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
247         IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
248         IFLA_BRIDGE_MRP_INFO_IN_STATE,
249         IFLA_BRIDGE_MRP_INFO_IN_ROLE,
250         IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
251         IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
252         __IFLA_BRIDGE_MRP_INFO_MAX,
253 };
254 
255 #define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
256 
257 enum {
258         IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
259         IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
260         IFLA_BRIDGE_MRP_IN_STATE_STATE,
261         __IFLA_BRIDGE_MRP_IN_STATE_MAX,
262 };
263 
264 #define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
265 
266 enum {
267         IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
268         IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
269         IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
270         IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
271         IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
272         __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
273 };
274 
275 #define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
276 
277 enum {
278         IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
279         IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
280         IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
281         IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
282         IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
283         __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
284 };
285 
286 #define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
287 
288 struct br_mrp_instance {
289         __u32 ring_id;
290         __u32 p_ifindex;
291         __u32 s_ifindex;
292         __u16 prio;
293 };
294 
295 struct br_mrp_ring_state {
296         __u32 ring_id;
297         __u32 ring_state;
298 };
299 
300 struct br_mrp_ring_role {
301         __u32 ring_id;
302         __u32 ring_role;
303 };
304 
305 struct br_mrp_start_test {
306         __u32 ring_id;
307         __u32 interval;
308         __u32 max_miss;
309         __u32 period;
310         __u32 monitor;
311 };
312 
313 struct br_mrp_in_state {
314         __u32 in_state;
315         __u16 in_id;
316 };
317 
318 struct br_mrp_in_role {
319         __u32 ring_id;
320         __u32 in_role;
321         __u32 i_ifindex;
322         __u16 in_id;
323 };
324 
325 struct br_mrp_start_in_test {
326         __u32 interval;
327         __u32 max_miss;
328         __u32 period;
329         __u16 in_id;
330 };
331 
332 enum {
333         IFLA_BRIDGE_CFM_UNSPEC,
334         IFLA_BRIDGE_CFM_MEP_CREATE,
335         IFLA_BRIDGE_CFM_MEP_DELETE,
336         IFLA_BRIDGE_CFM_MEP_CONFIG,
337         IFLA_BRIDGE_CFM_CC_CONFIG,
338         IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
339         IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
340         IFLA_BRIDGE_CFM_CC_RDI,
341         IFLA_BRIDGE_CFM_CC_CCM_TX,
342         IFLA_BRIDGE_CFM_MEP_CREATE_INFO,
343         IFLA_BRIDGE_CFM_MEP_CONFIG_INFO,
344         IFLA_BRIDGE_CFM_CC_CONFIG_INFO,
345         IFLA_BRIDGE_CFM_CC_RDI_INFO,
346         IFLA_BRIDGE_CFM_CC_CCM_TX_INFO,
347         IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO,
348         IFLA_BRIDGE_CFM_MEP_STATUS_INFO,
349         IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO,
350         __IFLA_BRIDGE_CFM_MAX,
351 };
352 
353 #define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)
354 
355 enum {
356         IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
357         IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
358         IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
359         IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
360         IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
361         __IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
362 };
363 
364 #define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)
365 
366 enum {
367         IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
368         IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
369         __IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
370 };
371 
372 #define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)
373 
374 enum {
375         IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
376         IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
377         IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
378         IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
379         IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
380         __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
381 };
382 
383 #define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)
384 
385 enum {
386         IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
387         IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
388         IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
389         IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
390         IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
391         __IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
392 };
393 
394 #define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)
395 
396 enum {
397         IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
398         IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
399         IFLA_BRIDGE_CFM_CC_PEER_MEPID,
400         __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
401 };
402 
403 #define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)
404 
405 enum {
406         IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
407         IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
408         IFLA_BRIDGE_CFM_CC_RDI_RDI,
409         __IFLA_BRIDGE_CFM_CC_RDI_MAX,
410 };
411 
412 #define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)
413 
414 enum {
415         IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
416         IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
417         IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
418         IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
419         IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
420         IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
421         IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
422         IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
423         IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
424         __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
425 };
426 
427 #define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)
428 
429 enum {
430         IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC,
431         IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
432         IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
433         IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
434         IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
435         __IFLA_BRIDGE_CFM_MEP_STATUS_MAX,
436 };
437 
438 #define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1)
439 
440 enum {
441         IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC,
442         IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
443         IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
444         IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
445         IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI,
446         IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE,
447         IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE,
448         IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN,
449         IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN,
450         IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN,
451         __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX,
452 };
453 
454 #define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
455 
456 struct bridge_stp_xstats {
457         __u64 transition_blk;
458         __u64 transition_fwd;
459         __u64 rx_bpdu;
460         __u64 tx_bpdu;
461         __u64 rx_tcn;
462         __u64 tx_tcn;
463 };
464 
465 /* Bridge vlan RTM header */
466 struct br_vlan_msg {
467         __u8 family;
468         __u8 reserved1;
469         __u16 reserved2;
470         __u32 ifindex;
471 };
472 
473 enum {
474         BRIDGE_VLANDB_DUMP_UNSPEC,
475         BRIDGE_VLANDB_DUMP_FLAGS,
476         __BRIDGE_VLANDB_DUMP_MAX,
477 };
478 #define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
479 
480 /* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
481 #define BRIDGE_VLANDB_DUMPF_STATS       (1 << 0) /* Include stats in the dump */
482 
483 /* Bridge vlan RTM attributes
484  * [BRIDGE_VLANDB_ENTRY] = {
485  *     [BRIDGE_VLANDB_ENTRY_INFO]
486  *     ...
487  * }
488  */
489 enum {
490         BRIDGE_VLANDB_UNSPEC,
491         BRIDGE_VLANDB_ENTRY,
492         __BRIDGE_VLANDB_MAX,
493 };
494 #define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
495 
496 enum {
497         BRIDGE_VLANDB_ENTRY_UNSPEC,
498         BRIDGE_VLANDB_ENTRY_INFO,
499         BRIDGE_VLANDB_ENTRY_RANGE,
500         BRIDGE_VLANDB_ENTRY_STATE,
501         BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
502         BRIDGE_VLANDB_ENTRY_STATS,
503         __BRIDGE_VLANDB_ENTRY_MAX,
504 };
505 #define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
506 
507 /* [BRIDGE_VLANDB_ENTRY] = {
508  *     [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
509  *         [BRIDGE_VLANDB_TINFO_ID]
510  *         ...
511  *     }
512  * }
513  */
514 enum {
515         BRIDGE_VLANDB_TINFO_UNSPEC,
516         BRIDGE_VLANDB_TINFO_ID,
517         BRIDGE_VLANDB_TINFO_CMD,
518         __BRIDGE_VLANDB_TINFO_MAX,
519 };
520 #define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
521 
522 /* [BRIDGE_VLANDB_ENTRY] = {
523  *     [BRIDGE_VLANDB_ENTRY_STATS] = {
524  *         [BRIDGE_VLANDB_STATS_RX_BYTES]
525  *         ...
526  *     }
527  *     ...
528  * }
529  */
530 enum {
531         BRIDGE_VLANDB_STATS_UNSPEC,
532         BRIDGE_VLANDB_STATS_RX_BYTES,
533         BRIDGE_VLANDB_STATS_RX_PACKETS,
534         BRIDGE_VLANDB_STATS_TX_BYTES,
535         BRIDGE_VLANDB_STATS_TX_PACKETS,
536         BRIDGE_VLANDB_STATS_PAD,
537         __BRIDGE_VLANDB_STATS_MAX,
538 };
539 #define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
540 
541 /* Bridge multicast database attributes
542  * [MDBA_MDB] = {
543  *     [MDBA_MDB_ENTRY] = {
544  *         [MDBA_MDB_ENTRY_INFO] {
545  *              struct br_mdb_entry
546  *              [MDBA_MDB_EATTR attributes]
547  *         }
548  *     }
549  * }
550  * [MDBA_ROUTER] = {
551  *    [MDBA_ROUTER_PORT] = {
552  *        u32 ifindex
553  *        [MDBA_ROUTER_PATTR attributes]
554  *    }
555  * }
556  */
557 enum {
558         MDBA_UNSPEC,
559         MDBA_MDB,
560         MDBA_ROUTER,
561         __MDBA_MAX,
562 };
563 #define MDBA_MAX (__MDBA_MAX - 1)
564 
565 enum {
566         MDBA_MDB_UNSPEC,
567         MDBA_MDB_ENTRY,
568         __MDBA_MDB_MAX,
569 };
570 #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
571 
572 enum {
573         MDBA_MDB_ENTRY_UNSPEC,
574         MDBA_MDB_ENTRY_INFO,
575         __MDBA_MDB_ENTRY_MAX,
576 };
577 #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
578 
579 /* per mdb entry additional attributes */
580 enum {
581         MDBA_MDB_EATTR_UNSPEC,
582         MDBA_MDB_EATTR_TIMER,
583         MDBA_MDB_EATTR_SRC_LIST,
584         MDBA_MDB_EATTR_GROUP_MODE,
585         MDBA_MDB_EATTR_SOURCE,
586         MDBA_MDB_EATTR_RTPROT,
587         __MDBA_MDB_EATTR_MAX
588 };
589 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
590 
591 /* per mdb entry source */
592 enum {
593         MDBA_MDB_SRCLIST_UNSPEC,
594         MDBA_MDB_SRCLIST_ENTRY,
595         __MDBA_MDB_SRCLIST_MAX
596 };
597 #define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
598 
599 /* per mdb entry per source attributes
600  * these are embedded in MDBA_MDB_SRCLIST_ENTRY
601  */
602 enum {
603         MDBA_MDB_SRCATTR_UNSPEC,
604         MDBA_MDB_SRCATTR_ADDRESS,
605         MDBA_MDB_SRCATTR_TIMER,
606         __MDBA_MDB_SRCATTR_MAX
607 };
608 #define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
609 
610 /* multicast router types */
611 enum {
612         MDB_RTR_TYPE_DISABLED,
613         MDB_RTR_TYPE_TEMP_QUERY,
614         MDB_RTR_TYPE_PERM,
615         MDB_RTR_TYPE_TEMP
616 };
617 
618 enum {
619         MDBA_ROUTER_UNSPEC,
620         MDBA_ROUTER_PORT,
621         __MDBA_ROUTER_MAX,
622 };
623 #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
624 
625 /* router port attributes */
626 enum {
627         MDBA_ROUTER_PATTR_UNSPEC,
628         MDBA_ROUTER_PATTR_TIMER,
629         MDBA_ROUTER_PATTR_TYPE,
630         __MDBA_ROUTER_PATTR_MAX
631 };
632 #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
633 
634 struct br_port_msg {
635         __u8  family;
636         __u32 ifindex;
637 };
638 
639 struct br_mdb_entry {
640         __u32 ifindex;
641 #define MDB_TEMPORARY 0
642 #define MDB_PERMANENT 1
643         __u8 state;
644 #define MDB_FLAGS_OFFLOAD       (1 << 0)
645 #define MDB_FLAGS_FAST_LEAVE    (1 << 1)
646 #define MDB_FLAGS_STAR_EXCL     (1 << 2)
647 #define MDB_FLAGS_BLOCKED       (1 << 3)
648         __u8 flags;
649         __u16 vid;
650         struct {
651                 union {
652                         __be32  ip4;
653                         struct in6_addr ip6;
654                         unsigned char mac_addr[ETH_ALEN];
655                 } u;
656                 __be16          proto;
657         } addr;
658 };
659 
660 enum {
661         MDBA_SET_ENTRY_UNSPEC,
662         MDBA_SET_ENTRY,
663         MDBA_SET_ENTRY_ATTRS,
664         __MDBA_SET_ENTRY_MAX,
665 };
666 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
667 
668 /* [MDBA_SET_ENTRY_ATTRS] = {
669  *    [MDBE_ATTR_xxx]
670  *    ...
671  * }
672  */
673 enum {
674         MDBE_ATTR_UNSPEC,
675         MDBE_ATTR_SOURCE,
676         __MDBE_ATTR_MAX,
677 };
678 #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
679 
680 /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
681 enum {
682         BRIDGE_XSTATS_UNSPEC,
683         BRIDGE_XSTATS_VLAN,
684         BRIDGE_XSTATS_MCAST,
685         BRIDGE_XSTATS_PAD,
686         BRIDGE_XSTATS_STP,
687         __BRIDGE_XSTATS_MAX
688 };
689 #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
690 
691 enum {
692         BR_MCAST_DIR_RX,
693         BR_MCAST_DIR_TX,
694         BR_MCAST_DIR_SIZE
695 };
696 
697 /* IGMP/MLD statistics */
698 struct br_mcast_stats {
699         __u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
700         __u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
701         __u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
702         __u64 igmp_leaves[BR_MCAST_DIR_SIZE];
703         __u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
704         __u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
705         __u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
706         __u64 igmp_parse_errors;
707 
708         __u64 mld_v1queries[BR_MCAST_DIR_SIZE];
709         __u64 mld_v2queries[BR_MCAST_DIR_SIZE];
710         __u64 mld_leaves[BR_MCAST_DIR_SIZE];
711         __u64 mld_v1reports[BR_MCAST_DIR_SIZE];
712         __u64 mld_v2reports[BR_MCAST_DIR_SIZE];
713         __u64 mld_parse_errors;
714 
715         __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
716         __u64 mcast_packets[BR_MCAST_DIR_SIZE];
717 };
718 
719 /* bridge boolean options
720  * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
721  *
722  * IMPORTANT: if adding a new option do not forget to handle
723  *            it in br_boolopt_toggle/get and bridge sysfs
724  */
725 enum br_boolopt_id {
726         BR_BOOLOPT_NO_LL_LEARN,
727         BR_BOOLOPT_MAX
728 };
729 
730 /* struct br_boolopt_multi - change multiple bridge boolean options
731  *
732  * @optval: new option values (bit per option)
733  * @optmask: options to change (bit per option)
734  */
735 struct br_boolopt_multi {
736         __u32 optval;
737         __u32 optmask;
738 };
739 #endif /* _LINUX_IF_BRIDGE_H */
740 

This page was automatically generated by LXR 0.3.1.  •  OpenWrt