summaryrefslogtreecommitdiff
path: root/include/uapi/linux/if_bridge.h
blob: 94cc9444d749e67d2c173f0e8c9a6457615b8696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 *	Linux ethernet bridge
 *
 *	Authors:
 *	Lennert Buytenhek		<buytenh@gnu.org>
 *
 *	This program is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU General Public License
 *	as published by the Free Software Foundation; either version
 *	2 of the License, or (at your option) any later version.
 */

#ifndef _UAPI_LINUX_IF_BRIDGE_H
#define _UAPI_LINUX_IF_BRIDGE_H

#include <linux/types.h>
#include <linux/if_ether.h>
#include <linux/in6.h>

#define SYSFS_BRIDGE_ATTR	"bridge"
#define SYSFS_BRIDGE_FDB	"brforward"
#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
#define SYSFS_BRIDGE_PORT_ATTR	"brport"
#define SYSFS_BRIDGE_PORT_LINK	"bridge"

#define BRCTL_VERSION 1

#define BRCTL_GET_VERSION 0
#define BRCTL_GET_BRIDGES 1
#define BRCTL_ADD_BRIDGE 2
#define BRCTL_DEL_BRIDGE 3
#define BRCTL_ADD_IF 4
#define BRCTL_DEL_IF 5
#define BRCTL_GET_BRIDGE_INFO 6
#define BRCTL_GET_PORT_LIST 7
#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
#define BRCTL_SET_BRIDGE_HELLO_TIME 9
#define BRCTL_SET_BRIDGE_MAX_AGE 10
#define BRCTL_SET_AGEING_TIME 11
#define BRCTL_SET_GC_INTERVAL 12
#define BRCTL_GET_PORT_INFO 13
#define BRCTL_SET_BRIDGE_STP_STATE 14
#define BRCTL_SET_BRIDGE_PRIORITY 15
#define BRCTL_SET_PORT_PRIORITY 16
#define BRCTL_SET_PATH_COST 17
#define BRCTL_GET_FDB_ENTRIES 18

#define BR_STATE_DISABLED 0
#define BR_STATE_LISTENING 1
#define BR_STATE_LEARNING 2
#define BR_STATE_FORWARDING 3
#define BR_STATE_BLOCKING 4

struct __bridge_info {
	__u64 designated_root;
	__u64 bridge_id;
	__u32 root_path_cost;
	__u32 max_age;
	__u32 hello_time;
	__u32 forward_delay;
	__u32 bridge_max_age;
	__u32 bridge_hello_time;
	__u32 bridge_forward_delay;
	__u8 topology_change;
	__u8 topology_change_detected;
	__u8 root_port;
	__u8 stp_enabled;
	__u32 ageing_time;
	__u32 gc_interval;
	__u32 hello_timer_value;
	__u32 tcn_timer_value;
	__u32 topology_change_timer_value;
	__u32 gc_timer_value;
};

struct __port_info {
	__u64 designated_root;
	__u64 designated_bridge;
	__u16 port_id;
	__u16 designated_port;
	__u32 path_cost;
	__u32 designated_cost;
	__u8 state;
	__u8 top_change_ack;
	__u8 config_pending;
	__u8 unused0;
	__u32 message_age_timer_value;
	__u32 forward_delay_timer_value;
	__u32 hold_timer_value;
};

struct __fdb_entry {
	__u8 mac_addr[ETH_ALEN];
	__u8 port_no;
	__u8 is_local;
	__u32 ageing_timer_value;
	__u8 port_hi;
	__u8 pad0;
	__u16 unused;
};

/* Bridge Flags */
#define BRIDGE_FLAGS_MASTER	1	/* Bridge command to/from master */
#define BRIDGE_FLAGS_SELF	2	/* Bridge command to/from lowerdev */

#define BRIDGE_MODE_VEB		0	/* Default loopback mode */
#define BRIDGE_MODE_VEPA	1	/* 802.1Qbg defined VEPA mode */
#define BRIDGE_MODE_UNDEF	0xFFFF  /* mode undefined */

/* Bridge management nested attributes
 * [IFLA_AF_SPEC] = {
 *     [IFLA_BRIDGE_FLAGS]
 *     [IFLA_BRIDGE_MODE]
 *     [IFLA_BRIDGE_VLAN_INFO]
 * }
 */
enum {
	IFLA_BRIDGE_FLAGS,
	IFLA_BRIDGE_MODE,
	IFLA_BRIDGE_VLAN_INFO,
	IFLA_BRIDGE_VLAN_TUNNEL_INFO,
	IFLA_BRIDGE_MRP,
	IFLA_BRIDGE_CFM,
	__IFLA_BRIDGE_MAX,
};
#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)

#define BRIDGE_VLAN_INFO_MASTER	(1<<0)	/* Operate on Bridge device as well */
#define BRIDGE_VLAN_INFO_PVID	(1<<1)	/* VLAN is PVID, ingress untagged */
#define BRIDGE_VLAN_INFO_UNTAGGED	(1<<2)	/* VLAN egresses untagged */
#define BRIDGE_VLAN_INFO_RANGE_BEGIN	(1<<3) /* VLAN is start of vlan range */
#define BRIDGE_VLAN_INFO_RANGE_END	(1<<4) /* VLAN is end of vlan range */
#define BRIDGE_VLAN_INFO_BRENTRY	(1<<5) /* Global bridge VLAN entry */
#define BRIDGE_VLAN_INFO_ONLY_OPTS	(1<<6) /* Skip create/delete/flags */

struct bridge_vlan_info {
	__u16 flags;
	__u16 vid;
};

enum {
	IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
	IFLA_BRIDGE_VLAN_TUNNEL_ID,
	IFLA_BRIDGE_VLAN_TUNNEL_VID,
	IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
	__IFLA_BRIDGE_VLAN_TUNNEL_MAX,
};

#define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)

struct bridge_vlan_xstats {
	__u64 rx_bytes;
	__u64 rx_packets;
	__u64 tx_bytes;
	__u64 tx_packets;
	__u16 vid;
	__u16 flags;
	__u32 pad2;
};

enum {
	IFLA_BRIDGE_MRP_UNSPEC,
	IFLA_BRIDGE_MRP_INSTANCE,
	IFLA_BRIDGE_MRP_PORT_STATE,
	IFLA_BRIDGE_MRP_PORT_ROLE,
	IFLA_BRIDGE_MRP_RING_STATE,
	IFLA_BRIDGE_MRP_RING_ROLE,
	IFLA_BRIDGE_MRP_START_TEST,
	IFLA_BRIDGE_MRP_INFO,
	IFLA_BRIDGE_MRP_IN_ROLE,
	IFLA_BRIDGE_MRP_IN_STATE,
	IFLA_BRIDGE_MRP_START_IN_TEST,
	__IFLA_BRIDGE_MRP_MAX,
};

#define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
	IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
	IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
	IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
	IFLA_BRIDGE_MRP_INSTANCE_PRIO,
	__IFLA_BRIDGE_MRP_INSTANCE_MAX,
};

#define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
	IFLA_BRIDGE_MRP_PORT_STATE_STATE,
	__IFLA_BRIDGE_MRP_PORT_STATE_MAX,
};

#define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
	IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
	__IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
};

#define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
	IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
	IFLA_BRIDGE_MRP_RING_STATE_STATE,
	__IFLA_BRIDGE_MRP_RING_STATE_MAX,
};

#define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
	IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
	IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
	__IFLA_BRIDGE_MRP_RING_ROLE_MAX,
};

#define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
	IFLA_BRIDGE_MRP_START_TEST_RING_ID,
	IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
	IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
	IFLA_BRIDGE_MRP_START_TEST_PERIOD,
	IFLA_BRIDGE_MRP_START_TEST_MONITOR,
	__IFLA_BRIDGE_MRP_START_TEST_MAX,
};

#define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_INFO_UNSPEC,
	IFLA_BRIDGE_MRP_INFO_RING_ID,
	IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
	IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
	IFLA_BRIDGE_MRP_INFO_PRIO,
	IFLA_BRIDGE_MRP_INFO_RING_STATE,
	IFLA_BRIDGE_MRP_INFO_RING_ROLE,
	IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
	IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
	IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
	IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
	IFLA_BRIDGE_MRP_INFO_IN_STATE,
	IFLA_BRIDGE_MRP_INFO_IN_ROLE,
	IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
	IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
	__IFLA_BRIDGE_MRP_INFO_MAX,
};

#define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
	IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
	IFLA_BRIDGE_MRP_IN_STATE_STATE,
	__IFLA_BRIDGE_MRP_IN_STATE_MAX,
};

#define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
	IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
	IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
	IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
	IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
	__IFLA_BRIDGE_MRP_IN_ROLE_MAX,
};

#define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)

enum {
	IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
	IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
	IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
	IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
	IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
	__IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
};

#define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)

struct br_mrp_instance {
	__u32 ring_id;
	__u32 p_ifindex;
	__u32 s_ifindex;
	__u16 prio;
};

struct br_mrp_ring_state {
	__u32 ring_id;
	__u32 ring_state;
};

struct br_mrp_ring_role {
	__u32 ring_id;
	__u32 ring_role;
};

struct br_mrp_start_test {
	__u32 ring_id;
	__u32 interval;
	__u32 max_miss;
	__u32 period;
	__u32 monitor;
};

struct br_mrp_in_state {
	__u32 in_state;
	__u16 in_id;
};

struct br_mrp_in_role {
	__u32 ring_id;
	__u32 in_role;
	__u32 i_ifindex;
	__u16 in_id;
};

struct br_mrp_start_in_test {
	__u32 interval;
	__u32 max_miss;
	__u32 period;
	__u16 in_id;
};

enum {
	IFLA_BRIDGE_CFM_UNSPEC,
	IFLA_BRIDGE_CFM_MEP_CREATE,
	IFLA_BRIDGE_CFM_MEP_DELETE,
	IFLA_BRIDGE_CFM_MEP_CONFIG,
	IFLA_BRIDGE_CFM_CC_CONFIG,
	IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
	IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
	IFLA_BRIDGE_CFM_CC_RDI,
	IFLA_BRIDGE_CFM_CC_CCM_TX,
	__IFLA_BRIDGE_CFM_MAX,
};

#define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
	IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
	IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
	IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
	IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
	__IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
};

#define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
	IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
	__IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
};

#define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
	IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
	IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
	IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
	IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
	__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
};

#define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
	IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
	IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
	IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
	IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
	__IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
};

#define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
	IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
	IFLA_BRIDGE_CFM_CC_PEER_MEPID,
	__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
};

#define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
	IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
	IFLA_BRIDGE_CFM_CC_RDI_RDI,
	__IFLA_BRIDGE_CFM_CC_RDI_MAX,
};

#define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)

enum {
	IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
	IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
	IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
	IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
	IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
	IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
	IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
	IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
	IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
	__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
};

#define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)

struct bridge_stp_xstats {
	__u64 transition_blk;
	__u64 transition_fwd;
	__u64 rx_bpdu;
	__u64 tx_bpdu;
	__u64 rx_tcn;
	__u64 tx_tcn;
};

/* Bridge vlan RTM header */
struct br_vlan_msg {
	__u8 family;
	__u8 reserved1;
	__u16 reserved2;
	__u32 ifindex;
};

enum {
	BRIDGE_VLANDB_DUMP_UNSPEC,
	BRIDGE_VLANDB_DUMP_FLAGS,
	__BRIDGE_VLANDB_DUMP_MAX,
};
#define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)

/* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
#define BRIDGE_VLANDB_DUMPF_STATS	(1 << 0) /* Include stats in the dump */

/* Bridge vlan RTM attributes
 * [BRIDGE_VLANDB_ENTRY] = {
 *     [BRIDGE_VLANDB_ENTRY_INFO]
 *     ...
 * }
 */
enum {
	BRIDGE_VLANDB_UNSPEC,
	BRIDGE_VLANDB_ENTRY,
	__BRIDGE_VLANDB_MAX,
};
#define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)

enum {
	BRIDGE_VLANDB_ENTRY_UNSPEC,
	BRIDGE_VLANDB_ENTRY_INFO,
	BRIDGE_VLANDB_ENTRY_RANGE,
	BRIDGE_VLANDB_ENTRY_STATE,
	BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
	BRIDGE_VLANDB_ENTRY_STATS,
	__BRIDGE_VLANDB_ENTRY_MAX,
};
#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)

/* [BRIDGE_VLANDB_ENTRY] = {
 *     [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
 *         [BRIDGE_VLANDB_TINFO_ID]
 *         ...
 *     }
 * }
 */
enum {
	BRIDGE_VLANDB_TINFO_UNSPEC,
	BRIDGE_VLANDB_TINFO_ID,
	BRIDGE_VLANDB_TINFO_CMD,
	__BRIDGE_VLANDB_TINFO_MAX,
};
#define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)

/* [BRIDGE_VLANDB_ENTRY] = {
 *     [BRIDGE_VLANDB_ENTRY_STATS] = {
 *         [BRIDGE_VLANDB_STATS_RX_BYTES]
 *         ...
 *     }
 *     ...
 * }
 */
enum {
	BRIDGE_VLANDB_STATS_UNSPEC,
	BRIDGE_VLANDB_STATS_RX_BYTES,
	BRIDGE_VLANDB_STATS_RX_PACKETS,
	BRIDGE_VLANDB_STATS_TX_BYTES,
	BRIDGE_VLANDB_STATS_TX_PACKETS,
	BRIDGE_VLANDB_STATS_PAD,
	__BRIDGE_VLANDB_STATS_MAX,
};
#define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)

/* Bridge multicast database attributes
 * [MDBA_MDB] = {
 *     [MDBA_MDB_ENTRY] = {
 *         [MDBA_MDB_ENTRY_INFO] {
 *		struct br_mdb_entry
 *		[MDBA_MDB_EATTR attributes]
 *         }
 *     }
 * }
 * [MDBA_ROUTER] = {
 *    [MDBA_ROUTER_PORT] = {
 *        u32 ifindex
 *        [MDBA_ROUTER_PATTR attributes]
 *    }
 * }
 */
enum {
	MDBA_UNSPEC,
	MDBA_MDB,
	MDBA_ROUTER,
	__MDBA_MAX,
};
#define MDBA_MAX (__MDBA_MAX - 1)

enum {
	MDBA_MDB_UNSPEC,
	MDBA_MDB_ENTRY,
	__MDBA_MDB_MAX,
};
#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)

enum {
	MDBA_MDB_ENTRY_UNSPEC,
	MDBA_MDB_ENTRY_INFO,
	__MDBA_MDB_ENTRY_MAX,
};
#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)

/* per mdb entry additional attributes */
enum {
	MDBA_MDB_EATTR_UNSPEC,
	MDBA_MDB_EATTR_TIMER,
	MDBA_MDB_EATTR_SRC_LIST,
	MDBA_MDB_EATTR_GROUP_MODE,
	MDBA_MDB_EATTR_SOURCE,
	MDBA_MDB_EATTR_RTPROT,
	__MDBA_MDB_EATTR_MAX
};
#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)

/* per mdb entry source */
enum {
	MDBA_MDB_SRCLIST_UNSPEC,
	MDBA_MDB_SRCLIST_ENTRY,
	__MDBA_MDB_SRCLIST_MAX
};
#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)

/* per mdb entry per source attributes
 * these are embedded in MDBA_MDB_SRCLIST_ENTRY
 */
enum {
	MDBA_MDB_SRCATTR_UNSPEC,
	MDBA_MDB_SRCATTR_ADDRESS,
	MDBA_MDB_SRCATTR_TIMER,
	__MDBA_MDB_SRCATTR_MAX
};
#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)

/* multicast router types */
enum {
	MDB_RTR_TYPE_DISABLED,
	MDB_RTR_TYPE_TEMP_QUERY,
	MDB_RTR_TYPE_PERM,
	MDB_RTR_TYPE_TEMP
};

enum {
	MDBA_ROUTER_UNSPEC,
	MDBA_ROUTER_PORT,
	__MDBA_ROUTER_MAX,
};
#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)

/* router port attributes */
enum {
	MDBA_ROUTER_PATTR_UNSPEC,
	MDBA_ROUTER_PATTR_TIMER,
	MDBA_ROUTER_PATTR_TYPE,
	__MDBA_ROUTER_PATTR_MAX
};
#define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)

struct br_port_msg {
	__u8  family;
	__u32 ifindex;
};

struct br_mdb_entry {
	__u32 ifindex;
#define MDB_TEMPORARY 0
#define MDB_PERMANENT 1
	__u8 state;
#define MDB_FLAGS_OFFLOAD	(1 << 0)
#define MDB_FLAGS_FAST_LEAVE	(1 << 1)
#define MDB_FLAGS_STAR_EXCL	(1 << 2)
#define MDB_FLAGS_BLOCKED	(1 << 3)
	__u8 flags;
	__u16 vid;
	struct {
		union {
			__be32	ip4;
			struct in6_addr ip6;
		} u;
		__be16		proto;
	} addr;
};

enum {
	MDBA_SET_ENTRY_UNSPEC,
	MDBA_SET_ENTRY,
	MDBA_SET_ENTRY_ATTRS,
	__MDBA_SET_ENTRY_MAX,
};
#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)

/* [MDBA_SET_ENTRY_ATTRS] = {
 *    [MDBE_ATTR_xxx]
 *    ...
 * }
 */
enum {
	MDBE_ATTR_UNSPEC,
	MDBE_ATTR_SOURCE,
	__MDBE_ATTR_MAX,
};
#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)

/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
enum {
	BRIDGE_XSTATS_UNSPEC,
	BRIDGE_XSTATS_VLAN,
	BRIDGE_XSTATS_MCAST,
	BRIDGE_XSTATS_PAD,
	BRIDGE_XSTATS_STP,
	__BRIDGE_XSTATS_MAX
};
#define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)

enum {
	BR_MCAST_DIR_RX,
	BR_MCAST_DIR_TX,
	BR_MCAST_DIR_SIZE
};

/* IGMP/MLD statistics */
struct br_mcast_stats {
	__u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
	__u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
	__u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
	__u64 igmp_leaves[BR_MCAST_DIR_SIZE];
	__u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
	__u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
	__u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
	__u64 igmp_parse_errors;

	__u64 mld_v1queries[BR_MCAST_DIR_SIZE];
	__u64 mld_v2queries[BR_MCAST_DIR_SIZE];
	__u64 mld_leaves[BR_MCAST_DIR_SIZE];
	__u64 mld_v1reports[BR_MCAST_DIR_SIZE];
	__u64 mld_v2reports[BR_MCAST_DIR_SIZE];
	__u64 mld_parse_errors;

	__u64 mcast_bytes[BR_MCAST_DIR_SIZE];
	__u64 mcast_packets[BR_MCAST_DIR_SIZE];
};

/* bridge boolean options
 * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
 *
 * IMPORTANT: if adding a new option do not forget to handle
 *            it in br_boolopt_toggle/get and bridge sysfs
 */
enum br_boolopt_id {
	BR_BOOLOPT_NO_LL_LEARN,
	BR_BOOLOPT_MAX
};

/* struct br_boolopt_multi - change multiple bridge boolean options
 *
 * @optval: new option values (bit per option)
 * @optmask: options to change (bit per option)
 */
struct br_boolopt_multi {
	__u32 optval;
	__u32 optmask;
};
#endif /* _UAPI_LINUX_IF_BRIDGE_H */