blob: b644ad010db28f05bdfb06e0f13107322760b6f4 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Christopher Ferris38062f92014-07-09 15:33:25 -070022#include <linux/if_ether.h>
Christopher Ferris82d75042015-01-26 10:57:07 -080023#include <linux/in6.h>
Christopher Ferris38062f92014-07-09 15:33:25 -070024#define SYSFS_BRIDGE_ATTR "bridge"
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define SYSFS_BRIDGE_FDB "brforward"
26#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
Christopher Ferris82d75042015-01-26 10:57:07 -080027#define SYSFS_BRIDGE_PORT_ATTR "brport"
Christopher Ferris38062f92014-07-09 15:33:25 -070028#define SYSFS_BRIDGE_PORT_LINK "bridge"
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define BRCTL_VERSION 1
30#define BRCTL_GET_VERSION 0
Christopher Ferris82d75042015-01-26 10:57:07 -080031#define BRCTL_GET_BRIDGES 1
Christopher Ferris38062f92014-07-09 15:33:25 -070032#define BRCTL_ADD_BRIDGE 2
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define BRCTL_DEL_BRIDGE 3
34#define BRCTL_ADD_IF 4
Christopher Ferris82d75042015-01-26 10:57:07 -080035#define BRCTL_DEL_IF 5
Christopher Ferris38062f92014-07-09 15:33:25 -070036#define BRCTL_GET_BRIDGE_INFO 6
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define BRCTL_GET_PORT_LIST 7
38#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
Christopher Ferris82d75042015-01-26 10:57:07 -080039#define BRCTL_SET_BRIDGE_HELLO_TIME 9
Christopher Ferris38062f92014-07-09 15:33:25 -070040#define BRCTL_SET_BRIDGE_MAX_AGE 10
Ben Cheng655a7c02013-10-16 16:09:24 -070041#define BRCTL_SET_AGEING_TIME 11
42#define BRCTL_SET_GC_INTERVAL 12
Christopher Ferris82d75042015-01-26 10:57:07 -080043#define BRCTL_GET_PORT_INFO 13
Christopher Ferris38062f92014-07-09 15:33:25 -070044#define BRCTL_SET_BRIDGE_STP_STATE 14
Ben Cheng655a7c02013-10-16 16:09:24 -070045#define BRCTL_SET_BRIDGE_PRIORITY 15
46#define BRCTL_SET_PORT_PRIORITY 16
Christopher Ferris82d75042015-01-26 10:57:07 -080047#define BRCTL_SET_PATH_COST 17
Christopher Ferris38062f92014-07-09 15:33:25 -070048#define BRCTL_GET_FDB_ENTRIES 18
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define BR_STATE_DISABLED 0
50#define BR_STATE_LISTENING 1
Christopher Ferris82d75042015-01-26 10:57:07 -080051#define BR_STATE_LEARNING 2
Christopher Ferris38062f92014-07-09 15:33:25 -070052#define BR_STATE_FORWARDING 3
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define BR_STATE_BLOCKING 4
54struct __bridge_info {
Tao Baod7db5942015-01-28 10:07:51 -080055 __u64 designated_root;
56 __u64 bridge_id;
57 __u32 root_path_cost;
58 __u32 max_age;
Tao Baod7db5942015-01-28 10:07:51 -080059 __u32 hello_time;
60 __u32 forward_delay;
61 __u32 bridge_max_age;
62 __u32 bridge_hello_time;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u32 bridge_forward_delay;
64 __u8 topology_change;
65 __u8 topology_change_detected;
66 __u8 root_port;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u8 stp_enabled;
68 __u32 ageing_time;
69 __u32 gc_interval;
70 __u32 hello_timer_value;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 tcn_timer_value;
72 __u32 topology_change_timer_value;
73 __u32 gc_timer_value;
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
Christopher Ferris82d75042015-01-26 10:57:07 -080075struct __port_info {
Tao Baod7db5942015-01-28 10:07:51 -080076 __u64 designated_root;
77 __u64 designated_bridge;
78 __u16 port_id;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u16 designated_port;
80 __u32 path_cost;
81 __u32 designated_cost;
82 __u8 state;
Tao Baod7db5942015-01-28 10:07:51 -080083 __u8 top_change_ack;
84 __u8 config_pending;
85 __u8 unused0;
86 __u32 message_age_timer_value;
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 forward_delay_timer_value;
88 __u32 hold_timer_value;
Ben Cheng655a7c02013-10-16 16:09:24 -070089};
90struct __fdb_entry {
Tao Baod7db5942015-01-28 10:07:51 -080091 __u8 mac_addr[ETH_ALEN];
92 __u8 port_no;
93 __u8 is_local;
94 __u32 ageing_timer_value;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u8 port_hi;
96 __u8 pad0;
97 __u16 unused;
Ben Cheng655a7c02013-10-16 16:09:24 -070098};
Christopher Ferris82d75042015-01-26 10:57:07 -080099#define BRIDGE_FLAGS_MASTER 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700100#define BRIDGE_FLAGS_SELF 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define BRIDGE_MODE_VEB 0
102#define BRIDGE_MODE_VEPA 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103#define BRIDGE_MODE_UNDEF 0xFFFF
Christopher Ferris82d75042015-01-26 10:57:07 -0800104enum {
Tao Baod7db5942015-01-28 10:07:51 -0800105 IFLA_BRIDGE_FLAGS,
106 IFLA_BRIDGE_MODE,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 IFLA_BRIDGE_VLAN_INFO,
Christopher Ferris525ce912017-07-26 13:12:53 -0700108 IFLA_BRIDGE_VLAN_TUNNEL_INFO,
Tao Baod7db5942015-01-28 10:07:51 -0800109 __IFLA_BRIDGE_MAX,
Christopher Ferris38062f92014-07-09 15:33:25 -0700110};
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112#define BRIDGE_VLAN_INFO_MASTER (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800113#define BRIDGE_VLAN_INFO_PVID (1 << 1)
114#define BRIDGE_VLAN_INFO_UNTAGGED (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1 << 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800116#define BRIDGE_VLAN_INFO_RANGE_END (1 << 4)
117#define BRIDGE_VLAN_INFO_BRENTRY (1 << 5)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700118#define BRIDGE_VLAN_INFO_ONLY_OPTS (1 << 6)
Ben Cheng655a7c02013-10-16 16:09:24 -0700119struct bridge_vlan_info {
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u16 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u16 vid;
Christopher Ferris38062f92014-07-09 15:33:25 -0700122};
Christopher Ferris525ce912017-07-26 13:12:53 -0700123enum {
124 IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
125 IFLA_BRIDGE_VLAN_TUNNEL_ID,
126 IFLA_BRIDGE_VLAN_TUNNEL_VID,
127 IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
128 __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
129};
130#define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131struct bridge_vlan_xstats {
132 __u64 rx_bytes;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133 __u64 rx_packets;
134 __u64 tx_bytes;
135 __u64 tx_packets;
136 __u16 vid;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800137 __u16 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138 __u32 pad2;
139};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700140struct bridge_stp_xstats {
141 __u64 transition_blk;
142 __u64 transition_fwd;
143 __u64 rx_bpdu;
144 __u64 tx_bpdu;
145 __u64 rx_tcn;
146 __u64 tx_tcn;
147};
148struct br_vlan_msg {
149 __u8 family;
150 __u8 reserved1;
151 __u16 reserved2;
152 __u32 ifindex;
153};
154enum {
155 BRIDGE_VLANDB_UNSPEC,
156 BRIDGE_VLANDB_ENTRY,
157 __BRIDGE_VLANDB_MAX,
158};
159#define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
160enum {
161 BRIDGE_VLANDB_ENTRY_UNSPEC,
162 BRIDGE_VLANDB_ENTRY_INFO,
163 BRIDGE_VLANDB_ENTRY_RANGE,
164 BRIDGE_VLANDB_ENTRY_STATE,
165 __BRIDGE_VLANDB_ENTRY_MAX,
166};
167#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169 MDBA_UNSPEC,
Tao Baod7db5942015-01-28 10:07:51 -0800170 MDBA_MDB,
171 MDBA_ROUTER,
172 __MDBA_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700173};
Christopher Ferris82d75042015-01-26 10:57:07 -0800174#define MDBA_MAX (__MDBA_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700175enum {
Tao Baod7db5942015-01-28 10:07:51 -0800176 MDBA_MDB_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700177 MDBA_MDB_ENTRY,
Tao Baod7db5942015-01-28 10:07:51 -0800178 __MDBA_MDB_MAX,
Christopher Ferris38062f92014-07-09 15:33:25 -0700179};
Ben Cheng655a7c02013-10-16 16:09:24 -0700180#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700181enum {
Tao Baod7db5942015-01-28 10:07:51 -0800182 MDBA_MDB_ENTRY_UNSPEC,
183 MDBA_MDB_ENTRY_INFO,
184 __MDBA_MDB_ENTRY_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700185};
Christopher Ferris82d75042015-01-26 10:57:07 -0800186#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
Christopher Ferris38062f92014-07-09 15:33:25 -0700187enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188 MDBA_MDB_EATTR_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700189 MDBA_MDB_EATTR_TIMER,
190 __MDBA_MDB_EATTR_MAX
191};
192#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700193enum {
194 MDB_RTR_TYPE_DISABLED,
195 MDB_RTR_TYPE_TEMP_QUERY,
196 MDB_RTR_TYPE_PERM,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700197 MDB_RTR_TYPE_TEMP
198};
199enum {
200 MDBA_ROUTER_UNSPEC,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700201 MDBA_ROUTER_PORT,
Tao Baod7db5942015-01-28 10:07:51 -0800202 __MDBA_ROUTER_MAX,
Christopher Ferris38062f92014-07-09 15:33:25 -0700203};
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700205enum {
206 MDBA_ROUTER_PATTR_UNSPEC,
207 MDBA_ROUTER_PATTR_TIMER,
208 MDBA_ROUTER_PATTR_TYPE,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700209 __MDBA_ROUTER_PATTR_MAX
210};
211#define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700212struct br_port_msg {
Tao Baod7db5942015-01-28 10:07:51 -0800213 __u8 family;
214 __u32 ifindex;
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
216struct br_mdb_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800217 __u32 ifindex;
Christopher Ferris38062f92014-07-09 15:33:25 -0700218#define MDB_TEMPORARY 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define MDB_PERMANENT 1
Tao Baod7db5942015-01-28 10:07:51 -0800220 __u8 state;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700221#define MDB_FLAGS_OFFLOAD (1 << 0)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800222#define MDB_FLAGS_FAST_LEAVE (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700223 __u8 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800224 __u16 vid;
Tao Baod7db5942015-01-28 10:07:51 -0800225 struct {
226 union {
227 __be32 ip4;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800228 struct in6_addr ip6;
Tao Baod7db5942015-01-28 10:07:51 -0800229 } u;
230 __be16 proto;
231 } addr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800232};
Christopher Ferris82d75042015-01-26 10:57:07 -0800233enum {
Tao Baod7db5942015-01-28 10:07:51 -0800234 MDBA_SET_ENTRY_UNSPEC,
235 MDBA_SET_ENTRY,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800236 __MDBA_SET_ENTRY_MAX,
Christopher Ferris82d75042015-01-26 10:57:07 -0800237};
Christopher Ferris38062f92014-07-09 15:33:25 -0700238#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700239enum {
240 BRIDGE_XSTATS_UNSPEC,
241 BRIDGE_XSTATS_VLAN,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800242 BRIDGE_XSTATS_MCAST,
243 BRIDGE_XSTATS_PAD,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700244 BRIDGE_XSTATS_STP,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700245 __BRIDGE_XSTATS_MAX
246};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800247#define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
248enum {
249 BR_MCAST_DIR_RX,
250 BR_MCAST_DIR_TX,
Christopher Ferris49f525c2016-12-12 14:55:36 -0800251 BR_MCAST_DIR_SIZE
252};
253struct br_mcast_stats {
254 __u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800255 __u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
256 __u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
257 __u64 igmp_leaves[BR_MCAST_DIR_SIZE];
258 __u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800259 __u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
260 __u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
261 __u64 igmp_parse_errors;
262 __u64 mld_v1queries[BR_MCAST_DIR_SIZE];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800263 __u64 mld_v2queries[BR_MCAST_DIR_SIZE];
264 __u64 mld_leaves[BR_MCAST_DIR_SIZE];
265 __u64 mld_v1reports[BR_MCAST_DIR_SIZE];
266 __u64 mld_v2reports[BR_MCAST_DIR_SIZE];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800267 __u64 mld_parse_errors;
268 __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
269 __u64 mcast_packets[BR_MCAST_DIR_SIZE];
270};
Christopher Ferrisd842e432019-03-07 10:21:59 -0800271enum br_boolopt_id {
272 BR_BOOLOPT_NO_LL_LEARN,
273 BR_BOOLOPT_MAX
274};
275struct br_boolopt_multi {
276 __u32 optval;
277 __u32 optmask;
278};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800279#endif