2 * Linux ethernet bridge
5 * Lennert Buytenhek <buytenh@gnu.org>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
13 #ifndef _UAPI_LINUX_IF_BRIDGE_H
14 #define _UAPI_LINUX_IF_BRIDGE_H
16 #include <linux/types.h>
17 #include <linux/if_ether.h>
19 #define SYSFS_BRIDGE_ATTR "bridge"
20 #define SYSFS_BRIDGE_FDB "brforward"
21 #define SYSFS_BRIDGE_PORT_SUBDIR "brif"
22 #define SYSFS_BRIDGE_PORT_ATTR "brport"
23 #define SYSFS_BRIDGE_PORT_LINK "bridge"
25 #define BRCTL_VERSION 1
27 #define BRCTL_GET_VERSION 0
28 #define BRCTL_GET_BRIDGES 1
29 #define BRCTL_ADD_BRIDGE 2
30 #define BRCTL_DEL_BRIDGE 3
31 #define BRCTL_ADD_IF 4
32 #define BRCTL_DEL_IF 5
33 #define BRCTL_GET_BRIDGE_INFO 6
34 #define BRCTL_GET_PORT_LIST 7
35 #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
36 #define BRCTL_SET_BRIDGE_HELLO_TIME 9
37 #define BRCTL_SET_BRIDGE_MAX_AGE 10
38 #define BRCTL_SET_AGEING_TIME 11
39 #define BRCTL_SET_GC_INTERVAL 12
40 #define BRCTL_GET_PORT_INFO 13
41 #define BRCTL_SET_BRIDGE_STP_STATE 14
42 #define BRCTL_SET_BRIDGE_PRIORITY 15
43 #define BRCTL_SET_PORT_PRIORITY 16
44 #define BRCTL_SET_PATH_COST 17
45 #define BRCTL_GET_FDB_ENTRIES 18
47 #define BR_STATE_DISABLED 0
48 #define BR_STATE_LISTENING 1
49 #define BR_STATE_LEARNING 2
50 #define BR_STATE_FORWARDING 3
51 #define BR_STATE_BLOCKING 4
53 struct __bridge_info
{
54 __u64 designated_root
;
61 __u32 bridge_hello_time
;
62 __u32 bridge_forward_delay
;
64 __u8 topology_change_detected
;
69 __u32 hello_timer_value
;
70 __u32 tcn_timer_value
;
71 __u32 topology_change_timer_value
;
76 __u64 designated_root
;
77 __u64 designated_bridge
;
79 __u16 designated_port
;
81 __u32 designated_cost
;
86 __u32 message_age_timer_value
;
87 __u32 forward_delay_timer_value
;
88 __u32 hold_timer_value
;
92 __u8 mac_addr
[ETH_ALEN
];
95 __u32 ageing_timer_value
;
102 #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */
103 #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */
105 #define BRIDGE_MODE_VEB 0 /* Default loopback mode */
106 #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */
108 /* Bridge management nested attributes
110 * [IFLA_BRIDGE_FLAGS]
112 * [IFLA_BRIDGE_VLAN_INFO]
118 IFLA_BRIDGE_VLAN_INFO
,
121 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
123 #define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */
124 #define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */
125 #define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */
127 struct bridge_vlan_info
{
132 /* Bridge multicast database attributes
134 * [MDBA_MDB_ENTRY] = {
135 * [MDBA_MDB_ENTRY_INFO]
148 #define MDBA_MAX (__MDBA_MAX - 1)
155 #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
158 MDBA_MDB_ENTRY_UNSPEC
,
160 __MDBA_MDB_ENTRY_MAX
,
162 #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
169 #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
176 struct br_mdb_entry
{
178 #define MDB_TEMPORARY 0
179 #define MDB_PERMANENT 1
191 MDBA_SET_ENTRY_UNSPEC
,
193 __MDBA_SET_ENTRY_MAX
,
195 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
197 #endif /* _UAPI_LINUX_IF_BRIDGE_H */