• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_IF_BRIDGE_H
20 #define _UAPI_LINUX_IF_BRIDGE_H
21 #include <linux/types.h>
22 #include <linux/if_ether.h>
23 #include <linux/in6.h>
24 #define SYSFS_BRIDGE_ATTR "bridge"
25 #define SYSFS_BRIDGE_FDB "brforward"
26 #define SYSFS_BRIDGE_PORT_SUBDIR "brif"
27 #define SYSFS_BRIDGE_PORT_ATTR "brport"
28 #define SYSFS_BRIDGE_PORT_LINK "bridge"
29 #define BRCTL_VERSION 1
30 #define BRCTL_GET_VERSION 0
31 #define BRCTL_GET_BRIDGES 1
32 #define BRCTL_ADD_BRIDGE 2
33 #define BRCTL_DEL_BRIDGE 3
34 #define BRCTL_ADD_IF 4
35 #define BRCTL_DEL_IF 5
36 #define BRCTL_GET_BRIDGE_INFO 6
37 #define BRCTL_GET_PORT_LIST 7
38 #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
39 #define BRCTL_SET_BRIDGE_HELLO_TIME 9
40 #define BRCTL_SET_BRIDGE_MAX_AGE 10
41 #define BRCTL_SET_AGEING_TIME 11
42 #define BRCTL_SET_GC_INTERVAL 12
43 #define BRCTL_GET_PORT_INFO 13
44 #define BRCTL_SET_BRIDGE_STP_STATE 14
45 #define BRCTL_SET_BRIDGE_PRIORITY 15
46 #define BRCTL_SET_PORT_PRIORITY 16
47 #define BRCTL_SET_PATH_COST 17
48 #define BRCTL_GET_FDB_ENTRIES 18
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 struct __bridge_info {
55   __u64 designated_root;
56   __u64 bridge_id;
57   __u32 root_path_cost;
58   __u32 max_age;
59   __u32 hello_time;
60   __u32 forward_delay;
61   __u32 bridge_max_age;
62   __u32 bridge_hello_time;
63   __u32 bridge_forward_delay;
64   __u8 topology_change;
65   __u8 topology_change_detected;
66   __u8 root_port;
67   __u8 stp_enabled;
68   __u32 ageing_time;
69   __u32 gc_interval;
70   __u32 hello_timer_value;
71   __u32 tcn_timer_value;
72   __u32 topology_change_timer_value;
73   __u32 gc_timer_value;
74 };
75 struct __port_info {
76   __u64 designated_root;
77   __u64 designated_bridge;
78   __u16 port_id;
79   __u16 designated_port;
80   __u32 path_cost;
81   __u32 designated_cost;
82   __u8 state;
83   __u8 top_change_ack;
84   __u8 config_pending;
85   __u8 unused0;
86   __u32 message_age_timer_value;
87   __u32 forward_delay_timer_value;
88   __u32 hold_timer_value;
89 };
90 struct __fdb_entry {
91   __u8 mac_addr[ETH_ALEN];
92   __u8 port_no;
93   __u8 is_local;
94   __u32 ageing_timer_value;
95   __u8 port_hi;
96   __u8 pad0;
97   __u16 unused;
98 };
99 #define BRIDGE_FLAGS_MASTER 1
100 #define BRIDGE_FLAGS_SELF 2
101 #define BRIDGE_MODE_VEB 0
102 #define BRIDGE_MODE_VEPA 1
103 #define BRIDGE_MODE_UNDEF 0xFFFF
104 enum {
105   IFLA_BRIDGE_FLAGS,
106   IFLA_BRIDGE_MODE,
107   IFLA_BRIDGE_VLAN_INFO,
108   IFLA_BRIDGE_VLAN_TUNNEL_INFO,
109   __IFLA_BRIDGE_MAX,
110 };
111 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
112 #define BRIDGE_VLAN_INFO_MASTER (1 << 0)
113 #define BRIDGE_VLAN_INFO_PVID (1 << 1)
114 #define BRIDGE_VLAN_INFO_UNTAGGED (1 << 2)
115 #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1 << 3)
116 #define BRIDGE_VLAN_INFO_RANGE_END (1 << 4)
117 #define BRIDGE_VLAN_INFO_BRENTRY (1 << 5)
118 struct bridge_vlan_info {
119   __u16 flags;
120   __u16 vid;
121 };
122 enum {
123   IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
124   IFLA_BRIDGE_VLAN_TUNNEL_ID,
125   IFLA_BRIDGE_VLAN_TUNNEL_VID,
126   IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
127   __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
128 };
129 #define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
130 struct bridge_vlan_xstats {
131   __u64 rx_bytes;
132   __u64 rx_packets;
133   __u64 tx_bytes;
134   __u64 tx_packets;
135   __u16 vid;
136   __u16 flags;
137   __u32 pad2;
138 };
139 enum {
140   MDBA_UNSPEC,
141   MDBA_MDB,
142   MDBA_ROUTER,
143   __MDBA_MAX,
144 };
145 #define MDBA_MAX (__MDBA_MAX - 1)
146 enum {
147   MDBA_MDB_UNSPEC,
148   MDBA_MDB_ENTRY,
149   __MDBA_MDB_MAX,
150 };
151 #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
152 enum {
153   MDBA_MDB_ENTRY_UNSPEC,
154   MDBA_MDB_ENTRY_INFO,
155   __MDBA_MDB_ENTRY_MAX,
156 };
157 #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
158 enum {
159   MDBA_MDB_EATTR_UNSPEC,
160   MDBA_MDB_EATTR_TIMER,
161   __MDBA_MDB_EATTR_MAX
162 };
163 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
164 enum {
165   MDB_RTR_TYPE_DISABLED,
166   MDB_RTR_TYPE_TEMP_QUERY,
167   MDB_RTR_TYPE_PERM,
168   MDB_RTR_TYPE_TEMP
169 };
170 enum {
171   MDBA_ROUTER_UNSPEC,
172   MDBA_ROUTER_PORT,
173   __MDBA_ROUTER_MAX,
174 };
175 #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
176 enum {
177   MDBA_ROUTER_PATTR_UNSPEC,
178   MDBA_ROUTER_PATTR_TIMER,
179   MDBA_ROUTER_PATTR_TYPE,
180   __MDBA_ROUTER_PATTR_MAX
181 };
182 #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
183 struct br_port_msg {
184   __u8 family;
185   __u32 ifindex;
186 };
187 struct br_mdb_entry {
188   __u32 ifindex;
189 #define MDB_TEMPORARY 0
190 #define MDB_PERMANENT 1
191   __u8 state;
192 #define MDB_FLAGS_OFFLOAD (1 << 0)
193   __u8 flags;
194   __u16 vid;
195   struct {
196     union {
197       __be32 ip4;
198       struct in6_addr ip6;
199     } u;
200     __be16 proto;
201   } addr;
202 };
203 enum {
204   MDBA_SET_ENTRY_UNSPEC,
205   MDBA_SET_ENTRY,
206   __MDBA_SET_ENTRY_MAX,
207 };
208 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
209 enum {
210   BRIDGE_XSTATS_UNSPEC,
211   BRIDGE_XSTATS_VLAN,
212   BRIDGE_XSTATS_MCAST,
213   BRIDGE_XSTATS_PAD,
214   __BRIDGE_XSTATS_MAX
215 };
216 #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
217 enum {
218   BR_MCAST_DIR_RX,
219   BR_MCAST_DIR_TX,
220   BR_MCAST_DIR_SIZE
221 };
222 struct br_mcast_stats {
223   __u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
224   __u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
225   __u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
226   __u64 igmp_leaves[BR_MCAST_DIR_SIZE];
227   __u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
228   __u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
229   __u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
230   __u64 igmp_parse_errors;
231   __u64 mld_v1queries[BR_MCAST_DIR_SIZE];
232   __u64 mld_v2queries[BR_MCAST_DIR_SIZE];
233   __u64 mld_leaves[BR_MCAST_DIR_SIZE];
234   __u64 mld_v1reports[BR_MCAST_DIR_SIZE];
235   __u64 mld_v2reports[BR_MCAST_DIR_SIZE];
236   __u64 mld_parse_errors;
237   __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
238   __u64 mcast_packets[BR_MCAST_DIR_SIZE];
239 };
240 enum br_boolopt_id {
241   BR_BOOLOPT_NO_LL_LEARN,
242   BR_BOOLOPT_MAX
243 };
244 struct br_boolopt_multi {
245   __u32 optval;
246   __u32 optmask;
247 };
248 #endif
249