Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  *  Linux ethernet bridge
0004  *
0005  *  Authors:
0006  *  Lennert Buytenhek       <buytenh@gnu.org>
0007  *
0008  *  This program is free software; you can redistribute it and/or
0009  *  modify it under the terms of the GNU General Public License
0010  *  as published by the Free Software Foundation; either version
0011  *  2 of the License, or (at your option) any later version.
0012  */
0013 
0014 #ifndef _UAPI_LINUX_IF_BRIDGE_H
0015 #define _UAPI_LINUX_IF_BRIDGE_H
0016 
0017 #include <linux/types.h>
0018 #include <linux/if_ether.h>
0019 #include <linux/in6.h>
0020 
0021 #define SYSFS_BRIDGE_ATTR   "bridge"
0022 #define SYSFS_BRIDGE_FDB    "brforward"
0023 #define SYSFS_BRIDGE_PORT_SUBDIR "brif"
0024 #define SYSFS_BRIDGE_PORT_ATTR  "brport"
0025 #define SYSFS_BRIDGE_PORT_LINK  "bridge"
0026 
0027 #define BRCTL_VERSION 1
0028 
0029 #define BRCTL_GET_VERSION 0
0030 #define BRCTL_GET_BRIDGES 1
0031 #define BRCTL_ADD_BRIDGE 2
0032 #define BRCTL_DEL_BRIDGE 3
0033 #define BRCTL_ADD_IF 4
0034 #define BRCTL_DEL_IF 5
0035 #define BRCTL_GET_BRIDGE_INFO 6
0036 #define BRCTL_GET_PORT_LIST 7
0037 #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
0038 #define BRCTL_SET_BRIDGE_HELLO_TIME 9
0039 #define BRCTL_SET_BRIDGE_MAX_AGE 10
0040 #define BRCTL_SET_AGEING_TIME 11
0041 #define BRCTL_SET_GC_INTERVAL 12
0042 #define BRCTL_GET_PORT_INFO 13
0043 #define BRCTL_SET_BRIDGE_STP_STATE 14
0044 #define BRCTL_SET_BRIDGE_PRIORITY 15
0045 #define BRCTL_SET_PORT_PRIORITY 16
0046 #define BRCTL_SET_PATH_COST 17
0047 #define BRCTL_GET_FDB_ENTRIES 18
0048 
0049 #define BR_STATE_DISABLED 0
0050 #define BR_STATE_LISTENING 1
0051 #define BR_STATE_LEARNING 2
0052 #define BR_STATE_FORWARDING 3
0053 #define BR_STATE_BLOCKING 4
0054 
0055 struct __bridge_info {
0056     __u64 designated_root;
0057     __u64 bridge_id;
0058     __u32 root_path_cost;
0059     __u32 max_age;
0060     __u32 hello_time;
0061     __u32 forward_delay;
0062     __u32 bridge_max_age;
0063     __u32 bridge_hello_time;
0064     __u32 bridge_forward_delay;
0065     __u8 topology_change;
0066     __u8 topology_change_detected;
0067     __u8 root_port;
0068     __u8 stp_enabled;
0069     __u32 ageing_time;
0070     __u32 gc_interval;
0071     __u32 hello_timer_value;
0072     __u32 tcn_timer_value;
0073     __u32 topology_change_timer_value;
0074     __u32 gc_timer_value;
0075 };
0076 
0077 struct __port_info {
0078     __u64 designated_root;
0079     __u64 designated_bridge;
0080     __u16 port_id;
0081     __u16 designated_port;
0082     __u32 path_cost;
0083     __u32 designated_cost;
0084     __u8 state;
0085     __u8 top_change_ack;
0086     __u8 config_pending;
0087     __u8 unused0;
0088     __u32 message_age_timer_value;
0089     __u32 forward_delay_timer_value;
0090     __u32 hold_timer_value;
0091 };
0092 
0093 struct __fdb_entry {
0094     __u8 mac_addr[ETH_ALEN];
0095     __u8 port_no;
0096     __u8 is_local;
0097     __u32 ageing_timer_value;
0098     __u8 port_hi;
0099     __u8 pad0;
0100     __u16 unused;
0101 };
0102 
0103 /* Bridge Flags */
0104 #define BRIDGE_FLAGS_MASTER 1   /* Bridge command to/from master */
0105 #define BRIDGE_FLAGS_SELF   2   /* Bridge command to/from lowerdev */
0106 
0107 #define BRIDGE_MODE_VEB     0   /* Default loopback mode */
0108 #define BRIDGE_MODE_VEPA    1   /* 802.1Qbg defined VEPA mode */
0109 #define BRIDGE_MODE_UNDEF   0xFFFF  /* mode undefined */
0110 
0111 /* Bridge management nested attributes
0112  * [IFLA_AF_SPEC] = {
0113  *     [IFLA_BRIDGE_FLAGS]
0114  *     [IFLA_BRIDGE_MODE]
0115  *     [IFLA_BRIDGE_VLAN_INFO]
0116  * }
0117  */
0118 enum {
0119     IFLA_BRIDGE_FLAGS,
0120     IFLA_BRIDGE_MODE,
0121     IFLA_BRIDGE_VLAN_INFO,
0122     IFLA_BRIDGE_VLAN_TUNNEL_INFO,
0123     IFLA_BRIDGE_MRP,
0124     IFLA_BRIDGE_CFM,
0125     IFLA_BRIDGE_MST,
0126     __IFLA_BRIDGE_MAX,
0127 };
0128 #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
0129 
0130 #define BRIDGE_VLAN_INFO_MASTER (1<<0)  /* Operate on Bridge device as well */
0131 #define BRIDGE_VLAN_INFO_PVID   (1<<1)  /* VLAN is PVID, ingress untagged */
0132 #define BRIDGE_VLAN_INFO_UNTAGGED   (1<<2)  /* VLAN egresses untagged */
0133 #define BRIDGE_VLAN_INFO_RANGE_BEGIN    (1<<3) /* VLAN is start of vlan range */
0134 #define BRIDGE_VLAN_INFO_RANGE_END  (1<<4) /* VLAN is end of vlan range */
0135 #define BRIDGE_VLAN_INFO_BRENTRY    (1<<5) /* Global bridge VLAN entry */
0136 #define BRIDGE_VLAN_INFO_ONLY_OPTS  (1<<6) /* Skip create/delete/flags */
0137 
0138 struct bridge_vlan_info {
0139     __u16 flags;
0140     __u16 vid;
0141 };
0142 
0143 enum {
0144     IFLA_BRIDGE_VLAN_TUNNEL_UNSPEC,
0145     IFLA_BRIDGE_VLAN_TUNNEL_ID,
0146     IFLA_BRIDGE_VLAN_TUNNEL_VID,
0147     IFLA_BRIDGE_VLAN_TUNNEL_FLAGS,
0148     __IFLA_BRIDGE_VLAN_TUNNEL_MAX,
0149 };
0150 
0151 #define IFLA_BRIDGE_VLAN_TUNNEL_MAX (__IFLA_BRIDGE_VLAN_TUNNEL_MAX - 1)
0152 
0153 struct bridge_vlan_xstats {
0154     __u64 rx_bytes;
0155     __u64 rx_packets;
0156     __u64 tx_bytes;
0157     __u64 tx_packets;
0158     __u16 vid;
0159     __u16 flags;
0160     __u32 pad2;
0161 };
0162 
0163 enum {
0164     IFLA_BRIDGE_MRP_UNSPEC,
0165     IFLA_BRIDGE_MRP_INSTANCE,
0166     IFLA_BRIDGE_MRP_PORT_STATE,
0167     IFLA_BRIDGE_MRP_PORT_ROLE,
0168     IFLA_BRIDGE_MRP_RING_STATE,
0169     IFLA_BRIDGE_MRP_RING_ROLE,
0170     IFLA_BRIDGE_MRP_START_TEST,
0171     IFLA_BRIDGE_MRP_INFO,
0172     IFLA_BRIDGE_MRP_IN_ROLE,
0173     IFLA_BRIDGE_MRP_IN_STATE,
0174     IFLA_BRIDGE_MRP_START_IN_TEST,
0175     __IFLA_BRIDGE_MRP_MAX,
0176 };
0177 
0178 #define IFLA_BRIDGE_MRP_MAX (__IFLA_BRIDGE_MRP_MAX - 1)
0179 
0180 enum {
0181     IFLA_BRIDGE_MRP_INSTANCE_UNSPEC,
0182     IFLA_BRIDGE_MRP_INSTANCE_RING_ID,
0183     IFLA_BRIDGE_MRP_INSTANCE_P_IFINDEX,
0184     IFLA_BRIDGE_MRP_INSTANCE_S_IFINDEX,
0185     IFLA_BRIDGE_MRP_INSTANCE_PRIO,
0186     __IFLA_BRIDGE_MRP_INSTANCE_MAX,
0187 };
0188 
0189 #define IFLA_BRIDGE_MRP_INSTANCE_MAX (__IFLA_BRIDGE_MRP_INSTANCE_MAX - 1)
0190 
0191 enum {
0192     IFLA_BRIDGE_MRP_PORT_STATE_UNSPEC,
0193     IFLA_BRIDGE_MRP_PORT_STATE_STATE,
0194     __IFLA_BRIDGE_MRP_PORT_STATE_MAX,
0195 };
0196 
0197 #define IFLA_BRIDGE_MRP_PORT_STATE_MAX (__IFLA_BRIDGE_MRP_PORT_STATE_MAX - 1)
0198 
0199 enum {
0200     IFLA_BRIDGE_MRP_PORT_ROLE_UNSPEC,
0201     IFLA_BRIDGE_MRP_PORT_ROLE_ROLE,
0202     __IFLA_BRIDGE_MRP_PORT_ROLE_MAX,
0203 };
0204 
0205 #define IFLA_BRIDGE_MRP_PORT_ROLE_MAX (__IFLA_BRIDGE_MRP_PORT_ROLE_MAX - 1)
0206 
0207 enum {
0208     IFLA_BRIDGE_MRP_RING_STATE_UNSPEC,
0209     IFLA_BRIDGE_MRP_RING_STATE_RING_ID,
0210     IFLA_BRIDGE_MRP_RING_STATE_STATE,
0211     __IFLA_BRIDGE_MRP_RING_STATE_MAX,
0212 };
0213 
0214 #define IFLA_BRIDGE_MRP_RING_STATE_MAX (__IFLA_BRIDGE_MRP_RING_STATE_MAX - 1)
0215 
0216 enum {
0217     IFLA_BRIDGE_MRP_RING_ROLE_UNSPEC,
0218     IFLA_BRIDGE_MRP_RING_ROLE_RING_ID,
0219     IFLA_BRIDGE_MRP_RING_ROLE_ROLE,
0220     __IFLA_BRIDGE_MRP_RING_ROLE_MAX,
0221 };
0222 
0223 #define IFLA_BRIDGE_MRP_RING_ROLE_MAX (__IFLA_BRIDGE_MRP_RING_ROLE_MAX - 1)
0224 
0225 enum {
0226     IFLA_BRIDGE_MRP_START_TEST_UNSPEC,
0227     IFLA_BRIDGE_MRP_START_TEST_RING_ID,
0228     IFLA_BRIDGE_MRP_START_TEST_INTERVAL,
0229     IFLA_BRIDGE_MRP_START_TEST_MAX_MISS,
0230     IFLA_BRIDGE_MRP_START_TEST_PERIOD,
0231     IFLA_BRIDGE_MRP_START_TEST_MONITOR,
0232     __IFLA_BRIDGE_MRP_START_TEST_MAX,
0233 };
0234 
0235 #define IFLA_BRIDGE_MRP_START_TEST_MAX (__IFLA_BRIDGE_MRP_START_TEST_MAX - 1)
0236 
0237 enum {
0238     IFLA_BRIDGE_MRP_INFO_UNSPEC,
0239     IFLA_BRIDGE_MRP_INFO_RING_ID,
0240     IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
0241     IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
0242     IFLA_BRIDGE_MRP_INFO_PRIO,
0243     IFLA_BRIDGE_MRP_INFO_RING_STATE,
0244     IFLA_BRIDGE_MRP_INFO_RING_ROLE,
0245     IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
0246     IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
0247     IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
0248     IFLA_BRIDGE_MRP_INFO_I_IFINDEX,
0249     IFLA_BRIDGE_MRP_INFO_IN_STATE,
0250     IFLA_BRIDGE_MRP_INFO_IN_ROLE,
0251     IFLA_BRIDGE_MRP_INFO_IN_TEST_INTERVAL,
0252     IFLA_BRIDGE_MRP_INFO_IN_TEST_MAX_MISS,
0253     __IFLA_BRIDGE_MRP_INFO_MAX,
0254 };
0255 
0256 #define IFLA_BRIDGE_MRP_INFO_MAX (__IFLA_BRIDGE_MRP_INFO_MAX - 1)
0257 
0258 enum {
0259     IFLA_BRIDGE_MRP_IN_STATE_UNSPEC,
0260     IFLA_BRIDGE_MRP_IN_STATE_IN_ID,
0261     IFLA_BRIDGE_MRP_IN_STATE_STATE,
0262     __IFLA_BRIDGE_MRP_IN_STATE_MAX,
0263 };
0264 
0265 #define IFLA_BRIDGE_MRP_IN_STATE_MAX (__IFLA_BRIDGE_MRP_IN_STATE_MAX - 1)
0266 
0267 enum {
0268     IFLA_BRIDGE_MRP_IN_ROLE_UNSPEC,
0269     IFLA_BRIDGE_MRP_IN_ROLE_RING_ID,
0270     IFLA_BRIDGE_MRP_IN_ROLE_IN_ID,
0271     IFLA_BRIDGE_MRP_IN_ROLE_ROLE,
0272     IFLA_BRIDGE_MRP_IN_ROLE_I_IFINDEX,
0273     __IFLA_BRIDGE_MRP_IN_ROLE_MAX,
0274 };
0275 
0276 #define IFLA_BRIDGE_MRP_IN_ROLE_MAX (__IFLA_BRIDGE_MRP_IN_ROLE_MAX - 1)
0277 
0278 enum {
0279     IFLA_BRIDGE_MRP_START_IN_TEST_UNSPEC,
0280     IFLA_BRIDGE_MRP_START_IN_TEST_IN_ID,
0281     IFLA_BRIDGE_MRP_START_IN_TEST_INTERVAL,
0282     IFLA_BRIDGE_MRP_START_IN_TEST_MAX_MISS,
0283     IFLA_BRIDGE_MRP_START_IN_TEST_PERIOD,
0284     __IFLA_BRIDGE_MRP_START_IN_TEST_MAX,
0285 };
0286 
0287 #define IFLA_BRIDGE_MRP_START_IN_TEST_MAX (__IFLA_BRIDGE_MRP_START_IN_TEST_MAX - 1)
0288 
0289 struct br_mrp_instance {
0290     __u32 ring_id;
0291     __u32 p_ifindex;
0292     __u32 s_ifindex;
0293     __u16 prio;
0294 };
0295 
0296 struct br_mrp_ring_state {
0297     __u32 ring_id;
0298     __u32 ring_state;
0299 };
0300 
0301 struct br_mrp_ring_role {
0302     __u32 ring_id;
0303     __u32 ring_role;
0304 };
0305 
0306 struct br_mrp_start_test {
0307     __u32 ring_id;
0308     __u32 interval;
0309     __u32 max_miss;
0310     __u32 period;
0311     __u32 monitor;
0312 };
0313 
0314 struct br_mrp_in_state {
0315     __u32 in_state;
0316     __u16 in_id;
0317 };
0318 
0319 struct br_mrp_in_role {
0320     __u32 ring_id;
0321     __u32 in_role;
0322     __u32 i_ifindex;
0323     __u16 in_id;
0324 };
0325 
0326 struct br_mrp_start_in_test {
0327     __u32 interval;
0328     __u32 max_miss;
0329     __u32 period;
0330     __u16 in_id;
0331 };
0332 
0333 enum {
0334     IFLA_BRIDGE_CFM_UNSPEC,
0335     IFLA_BRIDGE_CFM_MEP_CREATE,
0336     IFLA_BRIDGE_CFM_MEP_DELETE,
0337     IFLA_BRIDGE_CFM_MEP_CONFIG,
0338     IFLA_BRIDGE_CFM_CC_CONFIG,
0339     IFLA_BRIDGE_CFM_CC_PEER_MEP_ADD,
0340     IFLA_BRIDGE_CFM_CC_PEER_MEP_REMOVE,
0341     IFLA_BRIDGE_CFM_CC_RDI,
0342     IFLA_BRIDGE_CFM_CC_CCM_TX,
0343     IFLA_BRIDGE_CFM_MEP_CREATE_INFO,
0344     IFLA_BRIDGE_CFM_MEP_CONFIG_INFO,
0345     IFLA_BRIDGE_CFM_CC_CONFIG_INFO,
0346     IFLA_BRIDGE_CFM_CC_RDI_INFO,
0347     IFLA_BRIDGE_CFM_CC_CCM_TX_INFO,
0348     IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO,
0349     IFLA_BRIDGE_CFM_MEP_STATUS_INFO,
0350     IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO,
0351     __IFLA_BRIDGE_CFM_MAX,
0352 };
0353 
0354 #define IFLA_BRIDGE_CFM_MAX (__IFLA_BRIDGE_CFM_MAX - 1)
0355 
0356 enum {
0357     IFLA_BRIDGE_CFM_MEP_CREATE_UNSPEC,
0358     IFLA_BRIDGE_CFM_MEP_CREATE_INSTANCE,
0359     IFLA_BRIDGE_CFM_MEP_CREATE_DOMAIN,
0360     IFLA_BRIDGE_CFM_MEP_CREATE_DIRECTION,
0361     IFLA_BRIDGE_CFM_MEP_CREATE_IFINDEX,
0362     __IFLA_BRIDGE_CFM_MEP_CREATE_MAX,
0363 };
0364 
0365 #define IFLA_BRIDGE_CFM_MEP_CREATE_MAX (__IFLA_BRIDGE_CFM_MEP_CREATE_MAX - 1)
0366 
0367 enum {
0368     IFLA_BRIDGE_CFM_MEP_DELETE_UNSPEC,
0369     IFLA_BRIDGE_CFM_MEP_DELETE_INSTANCE,
0370     __IFLA_BRIDGE_CFM_MEP_DELETE_MAX,
0371 };
0372 
0373 #define IFLA_BRIDGE_CFM_MEP_DELETE_MAX (__IFLA_BRIDGE_CFM_MEP_DELETE_MAX - 1)
0374 
0375 enum {
0376     IFLA_BRIDGE_CFM_MEP_CONFIG_UNSPEC,
0377     IFLA_BRIDGE_CFM_MEP_CONFIG_INSTANCE,
0378     IFLA_BRIDGE_CFM_MEP_CONFIG_UNICAST_MAC,
0379     IFLA_BRIDGE_CFM_MEP_CONFIG_MDLEVEL,
0380     IFLA_BRIDGE_CFM_MEP_CONFIG_MEPID,
0381     __IFLA_BRIDGE_CFM_MEP_CONFIG_MAX,
0382 };
0383 
0384 #define IFLA_BRIDGE_CFM_MEP_CONFIG_MAX (__IFLA_BRIDGE_CFM_MEP_CONFIG_MAX - 1)
0385 
0386 enum {
0387     IFLA_BRIDGE_CFM_CC_CONFIG_UNSPEC,
0388     IFLA_BRIDGE_CFM_CC_CONFIG_INSTANCE,
0389     IFLA_BRIDGE_CFM_CC_CONFIG_ENABLE,
0390     IFLA_BRIDGE_CFM_CC_CONFIG_EXP_INTERVAL,
0391     IFLA_BRIDGE_CFM_CC_CONFIG_EXP_MAID,
0392     __IFLA_BRIDGE_CFM_CC_CONFIG_MAX,
0393 };
0394 
0395 #define IFLA_BRIDGE_CFM_CC_CONFIG_MAX (__IFLA_BRIDGE_CFM_CC_CONFIG_MAX - 1)
0396 
0397 enum {
0398     IFLA_BRIDGE_CFM_CC_PEER_MEP_UNSPEC,
0399     IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
0400     IFLA_BRIDGE_CFM_CC_PEER_MEPID,
0401     __IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX,
0402 };
0403 
0404 #define IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX (__IFLA_BRIDGE_CFM_CC_PEER_MEP_MAX - 1)
0405 
0406 enum {
0407     IFLA_BRIDGE_CFM_CC_RDI_UNSPEC,
0408     IFLA_BRIDGE_CFM_CC_RDI_INSTANCE,
0409     IFLA_BRIDGE_CFM_CC_RDI_RDI,
0410     __IFLA_BRIDGE_CFM_CC_RDI_MAX,
0411 };
0412 
0413 #define IFLA_BRIDGE_CFM_CC_RDI_MAX (__IFLA_BRIDGE_CFM_CC_RDI_MAX - 1)
0414 
0415 enum {
0416     IFLA_BRIDGE_CFM_CC_CCM_TX_UNSPEC,
0417     IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE,
0418     IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC,
0419     IFLA_BRIDGE_CFM_CC_CCM_TX_SEQ_NO_UPDATE,
0420     IFLA_BRIDGE_CFM_CC_CCM_TX_PERIOD,
0421     IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV,
0422     IFLA_BRIDGE_CFM_CC_CCM_TX_IF_TLV_VALUE,
0423     IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV,
0424     IFLA_BRIDGE_CFM_CC_CCM_TX_PORT_TLV_VALUE,
0425     __IFLA_BRIDGE_CFM_CC_CCM_TX_MAX,
0426 };
0427 
0428 #define IFLA_BRIDGE_CFM_CC_CCM_TX_MAX (__IFLA_BRIDGE_CFM_CC_CCM_TX_MAX - 1)
0429 
0430 enum {
0431     IFLA_BRIDGE_CFM_MEP_STATUS_UNSPEC,
0432     IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
0433     IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
0434     IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
0435     IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
0436     __IFLA_BRIDGE_CFM_MEP_STATUS_MAX,
0437 };
0438 
0439 #define IFLA_BRIDGE_CFM_MEP_STATUS_MAX (__IFLA_BRIDGE_CFM_MEP_STATUS_MAX - 1)
0440 
0441 enum {
0442     IFLA_BRIDGE_CFM_CC_PEER_STATUS_UNSPEC,
0443     IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
0444     IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
0445     IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
0446     IFLA_BRIDGE_CFM_CC_PEER_STATUS_RDI,
0447     IFLA_BRIDGE_CFM_CC_PEER_STATUS_PORT_TLV_VALUE,
0448     IFLA_BRIDGE_CFM_CC_PEER_STATUS_IF_TLV_VALUE,
0449     IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEEN,
0450     IFLA_BRIDGE_CFM_CC_PEER_STATUS_TLV_SEEN,
0451     IFLA_BRIDGE_CFM_CC_PEER_STATUS_SEQ_UNEXP_SEEN,
0452     __IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX,
0453 };
0454 
0455 #define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
0456 
0457 enum {
0458     IFLA_BRIDGE_MST_UNSPEC,
0459     IFLA_BRIDGE_MST_ENTRY,
0460     __IFLA_BRIDGE_MST_MAX,
0461 };
0462 #define IFLA_BRIDGE_MST_MAX (__IFLA_BRIDGE_MST_MAX - 1)
0463 
0464 enum {
0465     IFLA_BRIDGE_MST_ENTRY_UNSPEC,
0466     IFLA_BRIDGE_MST_ENTRY_MSTI,
0467     IFLA_BRIDGE_MST_ENTRY_STATE,
0468     __IFLA_BRIDGE_MST_ENTRY_MAX,
0469 };
0470 #define IFLA_BRIDGE_MST_ENTRY_MAX (__IFLA_BRIDGE_MST_ENTRY_MAX - 1)
0471 
0472 struct bridge_stp_xstats {
0473     __u64 transition_blk;
0474     __u64 transition_fwd;
0475     __u64 rx_bpdu;
0476     __u64 tx_bpdu;
0477     __u64 rx_tcn;
0478     __u64 tx_tcn;
0479 };
0480 
0481 /* Bridge vlan RTM header */
0482 struct br_vlan_msg {
0483     __u8 family;
0484     __u8 reserved1;
0485     __u16 reserved2;
0486     __u32 ifindex;
0487 };
0488 
0489 enum {
0490     BRIDGE_VLANDB_DUMP_UNSPEC,
0491     BRIDGE_VLANDB_DUMP_FLAGS,
0492     __BRIDGE_VLANDB_DUMP_MAX,
0493 };
0494 #define BRIDGE_VLANDB_DUMP_MAX (__BRIDGE_VLANDB_DUMP_MAX - 1)
0495 
0496 /* flags used in BRIDGE_VLANDB_DUMP_FLAGS attribute to affect dumps */
0497 #define BRIDGE_VLANDB_DUMPF_STATS   (1 << 0) /* Include stats in the dump */
0498 #define BRIDGE_VLANDB_DUMPF_GLOBAL  (1 << 1) /* Dump global vlan options only */
0499 
0500 /* Bridge vlan RTM attributes
0501  * [BRIDGE_VLANDB_ENTRY] = {
0502  *     [BRIDGE_VLANDB_ENTRY_INFO]
0503  *     ...
0504  * }
0505  * [BRIDGE_VLANDB_GLOBAL_OPTIONS] = {
0506  *     [BRIDGE_VLANDB_GOPTS_ID]
0507  *     ...
0508  * }
0509  */
0510 enum {
0511     BRIDGE_VLANDB_UNSPEC,
0512     BRIDGE_VLANDB_ENTRY,
0513     BRIDGE_VLANDB_GLOBAL_OPTIONS,
0514     __BRIDGE_VLANDB_MAX,
0515 };
0516 #define BRIDGE_VLANDB_MAX (__BRIDGE_VLANDB_MAX - 1)
0517 
0518 enum {
0519     BRIDGE_VLANDB_ENTRY_UNSPEC,
0520     BRIDGE_VLANDB_ENTRY_INFO,
0521     BRIDGE_VLANDB_ENTRY_RANGE,
0522     BRIDGE_VLANDB_ENTRY_STATE,
0523     BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
0524     BRIDGE_VLANDB_ENTRY_STATS,
0525     BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
0526     __BRIDGE_VLANDB_ENTRY_MAX,
0527 };
0528 #define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
0529 
0530 /* [BRIDGE_VLANDB_ENTRY] = {
0531  *     [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] = {
0532  *         [BRIDGE_VLANDB_TINFO_ID]
0533  *         ...
0534  *     }
0535  * }
0536  */
0537 enum {
0538     BRIDGE_VLANDB_TINFO_UNSPEC,
0539     BRIDGE_VLANDB_TINFO_ID,
0540     BRIDGE_VLANDB_TINFO_CMD,
0541     __BRIDGE_VLANDB_TINFO_MAX,
0542 };
0543 #define BRIDGE_VLANDB_TINFO_MAX (__BRIDGE_VLANDB_TINFO_MAX - 1)
0544 
0545 /* [BRIDGE_VLANDB_ENTRY] = {
0546  *     [BRIDGE_VLANDB_ENTRY_STATS] = {
0547  *         [BRIDGE_VLANDB_STATS_RX_BYTES]
0548  *         ...
0549  *     }
0550  *     ...
0551  * }
0552  */
0553 enum {
0554     BRIDGE_VLANDB_STATS_UNSPEC,
0555     BRIDGE_VLANDB_STATS_RX_BYTES,
0556     BRIDGE_VLANDB_STATS_RX_PACKETS,
0557     BRIDGE_VLANDB_STATS_TX_BYTES,
0558     BRIDGE_VLANDB_STATS_TX_PACKETS,
0559     BRIDGE_VLANDB_STATS_PAD,
0560     __BRIDGE_VLANDB_STATS_MAX,
0561 };
0562 #define BRIDGE_VLANDB_STATS_MAX (__BRIDGE_VLANDB_STATS_MAX - 1)
0563 
0564 enum {
0565     BRIDGE_VLANDB_GOPTS_UNSPEC,
0566     BRIDGE_VLANDB_GOPTS_ID,
0567     BRIDGE_VLANDB_GOPTS_RANGE,
0568     BRIDGE_VLANDB_GOPTS_MCAST_SNOOPING,
0569     BRIDGE_VLANDB_GOPTS_MCAST_IGMP_VERSION,
0570     BRIDGE_VLANDB_GOPTS_MCAST_MLD_VERSION,
0571     BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_CNT,
0572     BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_CNT,
0573     BRIDGE_VLANDB_GOPTS_MCAST_LAST_MEMBER_INTVL,
0574     BRIDGE_VLANDB_GOPTS_PAD,
0575     BRIDGE_VLANDB_GOPTS_MCAST_MEMBERSHIP_INTVL,
0576     BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_INTVL,
0577     BRIDGE_VLANDB_GOPTS_MCAST_QUERY_INTVL,
0578     BRIDGE_VLANDB_GOPTS_MCAST_QUERY_RESPONSE_INTVL,
0579     BRIDGE_VLANDB_GOPTS_MCAST_STARTUP_QUERY_INTVL,
0580     BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,
0581     BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,
0582     BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,
0583     BRIDGE_VLANDB_GOPTS_MSTI,
0584     __BRIDGE_VLANDB_GOPTS_MAX
0585 };
0586 #define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
0587 
0588 /* Bridge multicast database attributes
0589  * [MDBA_MDB] = {
0590  *     [MDBA_MDB_ENTRY] = {
0591  *         [MDBA_MDB_ENTRY_INFO] {
0592  *      struct br_mdb_entry
0593  *      [MDBA_MDB_EATTR attributes]
0594  *         }
0595  *     }
0596  * }
0597  * [MDBA_ROUTER] = {
0598  *    [MDBA_ROUTER_PORT] = {
0599  *        u32 ifindex
0600  *        [MDBA_ROUTER_PATTR attributes]
0601  *    }
0602  * }
0603  */
0604 enum {
0605     MDBA_UNSPEC,
0606     MDBA_MDB,
0607     MDBA_ROUTER,
0608     __MDBA_MAX,
0609 };
0610 #define MDBA_MAX (__MDBA_MAX - 1)
0611 
0612 enum {
0613     MDBA_MDB_UNSPEC,
0614     MDBA_MDB_ENTRY,
0615     __MDBA_MDB_MAX,
0616 };
0617 #define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
0618 
0619 enum {
0620     MDBA_MDB_ENTRY_UNSPEC,
0621     MDBA_MDB_ENTRY_INFO,
0622     __MDBA_MDB_ENTRY_MAX,
0623 };
0624 #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
0625 
0626 /* per mdb entry additional attributes */
0627 enum {
0628     MDBA_MDB_EATTR_UNSPEC,
0629     MDBA_MDB_EATTR_TIMER,
0630     MDBA_MDB_EATTR_SRC_LIST,
0631     MDBA_MDB_EATTR_GROUP_MODE,
0632     MDBA_MDB_EATTR_SOURCE,
0633     MDBA_MDB_EATTR_RTPROT,
0634     __MDBA_MDB_EATTR_MAX
0635 };
0636 #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
0637 
0638 /* per mdb entry source */
0639 enum {
0640     MDBA_MDB_SRCLIST_UNSPEC,
0641     MDBA_MDB_SRCLIST_ENTRY,
0642     __MDBA_MDB_SRCLIST_MAX
0643 };
0644 #define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
0645 
0646 /* per mdb entry per source attributes
0647  * these are embedded in MDBA_MDB_SRCLIST_ENTRY
0648  */
0649 enum {
0650     MDBA_MDB_SRCATTR_UNSPEC,
0651     MDBA_MDB_SRCATTR_ADDRESS,
0652     MDBA_MDB_SRCATTR_TIMER,
0653     __MDBA_MDB_SRCATTR_MAX
0654 };
0655 #define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
0656 
0657 /* multicast router types */
0658 enum {
0659     MDB_RTR_TYPE_DISABLED,
0660     MDB_RTR_TYPE_TEMP_QUERY,
0661     MDB_RTR_TYPE_PERM,
0662     MDB_RTR_TYPE_TEMP
0663 };
0664 
0665 enum {
0666     MDBA_ROUTER_UNSPEC,
0667     MDBA_ROUTER_PORT,
0668     __MDBA_ROUTER_MAX,
0669 };
0670 #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
0671 
0672 /* router port attributes */
0673 enum {
0674     MDBA_ROUTER_PATTR_UNSPEC,
0675     MDBA_ROUTER_PATTR_TIMER,
0676     MDBA_ROUTER_PATTR_TYPE,
0677     MDBA_ROUTER_PATTR_INET_TIMER,
0678     MDBA_ROUTER_PATTR_INET6_TIMER,
0679     MDBA_ROUTER_PATTR_VID,
0680     __MDBA_ROUTER_PATTR_MAX
0681 };
0682 #define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
0683 
0684 struct br_port_msg {
0685     __u8  family;
0686     __u32 ifindex;
0687 };
0688 
0689 struct br_mdb_entry {
0690     __u32 ifindex;
0691 #define MDB_TEMPORARY 0
0692 #define MDB_PERMANENT 1
0693     __u8 state;
0694 #define MDB_FLAGS_OFFLOAD   (1 << 0)
0695 #define MDB_FLAGS_FAST_LEAVE    (1 << 1)
0696 #define MDB_FLAGS_STAR_EXCL (1 << 2)
0697 #define MDB_FLAGS_BLOCKED   (1 << 3)
0698     __u8 flags;
0699     __u16 vid;
0700     struct {
0701         union {
0702             __be32  ip4;
0703             struct in6_addr ip6;
0704             unsigned char mac_addr[ETH_ALEN];
0705         } u;
0706         __be16      proto;
0707     } addr;
0708 };
0709 
0710 enum {
0711     MDBA_SET_ENTRY_UNSPEC,
0712     MDBA_SET_ENTRY,
0713     MDBA_SET_ENTRY_ATTRS,
0714     __MDBA_SET_ENTRY_MAX,
0715 };
0716 #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
0717 
0718 /* [MDBA_SET_ENTRY_ATTRS] = {
0719  *    [MDBE_ATTR_xxx]
0720  *    ...
0721  * }
0722  */
0723 enum {
0724     MDBE_ATTR_UNSPEC,
0725     MDBE_ATTR_SOURCE,
0726     __MDBE_ATTR_MAX,
0727 };
0728 #define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
0729 
0730 /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
0731 enum {
0732     BRIDGE_XSTATS_UNSPEC,
0733     BRIDGE_XSTATS_VLAN,
0734     BRIDGE_XSTATS_MCAST,
0735     BRIDGE_XSTATS_PAD,
0736     BRIDGE_XSTATS_STP,
0737     __BRIDGE_XSTATS_MAX
0738 };
0739 #define BRIDGE_XSTATS_MAX (__BRIDGE_XSTATS_MAX - 1)
0740 
0741 enum {
0742     BR_MCAST_DIR_RX,
0743     BR_MCAST_DIR_TX,
0744     BR_MCAST_DIR_SIZE
0745 };
0746 
0747 /* IGMP/MLD statistics */
0748 struct br_mcast_stats {
0749     __u64 igmp_v1queries[BR_MCAST_DIR_SIZE];
0750     __u64 igmp_v2queries[BR_MCAST_DIR_SIZE];
0751     __u64 igmp_v3queries[BR_MCAST_DIR_SIZE];
0752     __u64 igmp_leaves[BR_MCAST_DIR_SIZE];
0753     __u64 igmp_v1reports[BR_MCAST_DIR_SIZE];
0754     __u64 igmp_v2reports[BR_MCAST_DIR_SIZE];
0755     __u64 igmp_v3reports[BR_MCAST_DIR_SIZE];
0756     __u64 igmp_parse_errors;
0757 
0758     __u64 mld_v1queries[BR_MCAST_DIR_SIZE];
0759     __u64 mld_v2queries[BR_MCAST_DIR_SIZE];
0760     __u64 mld_leaves[BR_MCAST_DIR_SIZE];
0761     __u64 mld_v1reports[BR_MCAST_DIR_SIZE];
0762     __u64 mld_v2reports[BR_MCAST_DIR_SIZE];
0763     __u64 mld_parse_errors;
0764 
0765     __u64 mcast_bytes[BR_MCAST_DIR_SIZE];
0766     __u64 mcast_packets[BR_MCAST_DIR_SIZE];
0767 };
0768 
0769 /* bridge boolean options
0770  * BR_BOOLOPT_NO_LL_LEARN - disable learning from link-local packets
0771  * BR_BOOLOPT_MCAST_VLAN_SNOOPING - control vlan multicast snooping
0772  *
0773  * IMPORTANT: if adding a new option do not forget to handle
0774  *            it in br_boolopt_toggle/get and bridge sysfs
0775  */
0776 enum br_boolopt_id {
0777     BR_BOOLOPT_NO_LL_LEARN,
0778     BR_BOOLOPT_MCAST_VLAN_SNOOPING,
0779     BR_BOOLOPT_MST_ENABLE,
0780     BR_BOOLOPT_MAX
0781 };
0782 
0783 /* struct br_boolopt_multi - change multiple bridge boolean options
0784  *
0785  * @optval: new option values (bit per option)
0786  * @optmask: options to change (bit per option)
0787  */
0788 struct br_boolopt_multi {
0789     __u32 optval;
0790     __u32 optmask;
0791 };
0792 
0793 enum {
0794     BRIDGE_QUERIER_UNSPEC,
0795     BRIDGE_QUERIER_IP_ADDRESS,
0796     BRIDGE_QUERIER_IP_PORT,
0797     BRIDGE_QUERIER_IP_OTHER_TIMER,
0798     BRIDGE_QUERIER_PAD,
0799     BRIDGE_QUERIER_IPV6_ADDRESS,
0800     BRIDGE_QUERIER_IPV6_PORT,
0801     BRIDGE_QUERIER_IPV6_OTHER_TIMER,
0802     __BRIDGE_QUERIER_MAX
0803 };
0804 #define BRIDGE_QUERIER_MAX (__BRIDGE_QUERIER_MAX - 1)
0805 #endif /* _UAPI_LINUX_IF_BRIDGE_H */