FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
gbp_bridge_domain.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __GBP_BRIDGE_DOMAIN_H__
17 #define __GBP_BRIDGE_DOMAIN_H__
18 
19 #include <plugins/gbp/gbp_types.h>
20 #include <plugins/gbp/gbp_itf.h>
21 
22 #include <vnet/fib/fib_types.h>
23 #include <vnet/l2/l2_bd.h>
24 
25 /**
26  * Bridge Domain Flags
27  */
29 {
36 
37 /**
38  * A bridge Domain Representation.
39  * This is a standard bridge-domain plus all the attributes it must
40  * have to supprt the GBP model.
41  */
42 typedef struct gbp_bridge_domain_t_
43 {
44  /**
45  * Bridge-domain ID
46  */
49 
50  /**
51  * Index of the Route-domain this BD is associated with. This is used as the
52  * 'scope' of the packets for contract matching.
53  */
55 
56  /**
57  * Flags conttrolling behaviour
58  */
60 
61  /**
62  * The BD's BVI interface (obligatory)
63  */
65 
66  /**
67  * The BD's MAC spine-proxy interface (optional)
68  */
70 
71  /**
72  * The BD's interface to sned Broadcast and multicast packets
73  */
75 
76  /**
77  * The index of the BD's VNI interface on which packets from
78  * unkown endpoints arrive
79  */
81 
82  /**
83  * locks/references to the BD so it does not get deleted (from the API)
84  * whilst it is still being used
85  */
88 
89 extern void gbp_bridge_domain_itf_add (index_t gbdi,
92 extern void gbp_bridge_domain_itf_del (index_t gbdi,
95 
97  u32 rd_id,
102 
103 extern void gbp_bridge_domain_unlock (index_t gbi);
105 extern int gbp_bridge_domain_delete (u32 bd_id);
108 
109 typedef int (*gbp_bridge_domain_cb_t) (gbp_bridge_domain_t * gb, void *ctx);
110 extern void gbp_bridge_domain_walk (gbp_bridge_domain_cb_t bgpe, void *ctx);
111 
112 extern u8 *format_gbp_bridge_domain (u8 * s, va_list * args);
113 extern u8 *format_gbp_bridge_domain_flags (u8 * s, va_list * args);
114 
115 /**
116  * DB of bridge_domains
117  */
119 {
123 
126 
129 {
131 }
132 
135 {
136  return (gbp_bridge_domain_get
138 }
139 
141 
144 {
145  return (gbp_scope_by_bd_index[bd_index]);
146 }
147 
148 #endif
149 
150 /*
151  * fd.io coding-style-patch-verification: ON
152  *
153  * Local Variables:
154  * eval: (c-set-style "gnu")
155  * End:
156  */
GBP_BD_FLAG_DO_NOT_LEARN
@ GBP_BD_FLAG_DO_NOT_LEARN
Definition: gbp_bridge_domain.h:31
gbp_bridge_domain_flags_t_
gbp_bridge_domain_flags_t_
Bridge Domain Flags.
Definition: gbp_bridge_domain.h:28
gbp_bridge_domain_t_::gb_bd_index
u32 gb_bd_index
Definition: gbp_bridge_domain.h:48
gbp_bridge_domain_cb_t
int(* gbp_bridge_domain_cb_t)(gbp_bridge_domain_t *gb, void *ctx)
Definition: gbp_bridge_domain.h:109
gbp_bridge_domain_t_::gb_rdi
u32 gb_rdi
Index of the Route-domain this BD is associated with.
Definition: gbp_bridge_domain.h:54
gbp_types.h
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
gbp_itf_hdl_t_
Definition: gbp_itf.h:45
gbp_bridge_domain_t_::gb_vni
u32 gb_vni
The index of the BD's VNI interface on which packets from unkown endpoints arrive.
Definition: gbp_bridge_domain.h:80
gbp_bridge_domain_find_and_lock
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
Definition: gbp_bridge_domain.c:91
gbp_bridge_domain_add_and_lock
int gbp_bridge_domain_add_and_lock(u32 bd_id, u32 rd_id, gbp_bridge_domain_flags_t flags, u32 bvi_sw_if_index, u32 uu_fwd_sw_if_index, u32 bm_flood_sw_if_index)
Definition: gbp_bridge_domain.c:180
gbp_bridge_domain_delete
int gbp_bridge_domain_delete(u32 bd_id)
Definition: gbp_bridge_domain.c:343
gbp_bridge_domain_walk
void gbp_bridge_domain_walk(gbp_bridge_domain_cb_t bgpe, void *ctx)
Definition: gbp_bridge_domain.c:362
gbp_bridge_domain_get
static gbp_bridge_domain_t * gbp_bridge_domain_get(index_t i)
Definition: gbp_bridge_domain.h:128
gbp_bridge_domain_get_scope
static gbp_scope_t gbp_bridge_domain_get_scope(u32 bd_index)
Definition: gbp_bridge_domain.h:143
gbp_bridge_domain_t_::gb_bd_id
u32 gb_bd_id
Bridge-domain ID.
Definition: gbp_bridge_domain.h:47
gbp_bridge_domain_t_::gb_bvi_sw_if_index
u32 gb_bvi_sw_if_index
The BD's BVI interface (obligatory)
Definition: gbp_bridge_domain.h:64
bvi_sw_if_index
vl_api_interface_index_t bvi_sw_if_index
Definition: gbp.api:37
gbp_scope_by_bd_index
gbp_scope_t * gbp_scope_by_bd_index
Map of BD index to contract scope.
Definition: gbp_bridge_domain.c:42
bm_flood_sw_if_index
vl_api_interface_index_t bm_flood_sw_if_index
Definition: gbp.api:39
gbp_bridge_domain_t_::gb_locks
u32 gb_locks
locks/references to the BD so it does not get deleted (from the API) whilst it is still being used
Definition: gbp_bridge_domain.h:86
gbp_bridge_domain_index
index_t gbp_bridge_domain_index(const gbp_bridge_domain_t *)
Definition: gbp_bridge_domain.c:53
bd_id
u32 bd_id
Definition: gbp.api:188
GBP_BD_FLAG_UCAST_ARP
@ GBP_BD_FLAG_UCAST_ARP
Definition: gbp_bridge_domain.h:34
gbp_bridge_domain_get_bd_id
u32 gbp_bridge_domain_get_bd_id(index_t gbdi)
Definition: gbp_bridge_domain.c:68
fib_types.h
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
gbp_bridge_domain_unlock
void gbp_bridge_domain_unlock(index_t gbi)
Definition: gbp_bridge_domain.c:312
uword
u64 uword
Definition: types.h:112
gbp_bridge_domain_db_t
struct gbp_bridge_domain_db_t gbp_bridge_domain_db_t
DB of bridge_domains.
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
gbp_bridge_domain_db
gbp_bridge_domain_db_t gbp_bridge_domain_db
DB of bridge_domains.
Definition: gbp_bridge_domain.c:37
format_gbp_bridge_domain_flags
u8 * format_gbp_bridge_domain_flags(u8 *s, va_list *args)
Definition: gbp_bridge_domain.c:124
gbp_itf.h
gbp_bridge_domain_db_t
DB of bridge_domains.
Definition: gbp_bridge_domain.h:118
gbp_bridge_domain_itf_del
void gbp_bridge_domain_itf_del(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
Definition: gbp_bridge_domain.c:300
gbp_bridge_domain_t_::gb_bm_flood_itf
gbp_itf_hdl_t gb_bm_flood_itf
The BD's interface to sned Broadcast and multicast packets.
Definition: gbp_bridge_domain.h:74
rd_id
u32 rd_id
Definition: gbp.api:35
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
u32
unsigned int u32
Definition: types.h:88
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
GBP_BD_FLAG_MCAST_DROP
@ GBP_BD_FLAG_MCAST_DROP
Definition: gbp_bridge_domain.h:33
gbp_bridge_domain_pool
gbp_bridge_domain_t * gbp_bridge_domain_pool
Pool of GBP bridge_domains.
Definition: gbp_bridge_domain.c:32
GBP_BD_FLAG_UU_FWD_DROP
@ GBP_BD_FLAG_UU_FWD_DROP
Definition: gbp_bridge_domain.h:32
gbp_bridge_domain_t_
A bridge Domain Representation.
Definition: gbp_bridge_domain.h:42
gbp_bridge_domain_db_t::gbd_by_bd_id
uword * gbd_by_bd_id
Definition: gbp_bridge_domain.h:120
format_gbp_bridge_domain
u8 * format_gbp_bridge_domain(u8 *s, va_list *args)
Definition: gbp_bridge_domain.c:168
gbp_bridge_domain_t_::gb_uu_fwd_sw_if_index
u32 gb_uu_fwd_sw_if_index
The BD's MAC spine-proxy interface (optional)
Definition: gbp_bridge_domain.h:69
gbp_bridge_domain_itf_add
void gbp_bridge_domain_itf_add(index_t gbdi, u32 sw_if_index, l2_bd_port_type_t type)
Definition: gbp_bridge_domain.c:282
u8
unsigned char u8
Definition: types.h:56
GBP_BD_FLAG_NONE
@ GBP_BD_FLAG_NONE
Definition: gbp_bridge_domain.h:30
gbp_bridge_domain_flags_t
enum gbp_bridge_domain_flags_t_ gbp_bridge_domain_flags_t
Bridge Domain Flags.
l2_bd_port_type_t
enum l2_bd_port_type_t_ l2_bd_port_type_t
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
uu_fwd_sw_if_index
vl_api_interface_index_t uu_fwd_sw_if_index
Definition: gbp.api:38
l2_bd.h
gbp_bridge_domain_t_::gb_flags
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
Definition: gbp_bridge_domain.h:59
gbp_scope_t
u16 gbp_scope_t
Definition: gbp_types.h:24
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
gbp_bridge_domain_t
struct gbp_bridge_domain_t_ gbp_bridge_domain_t
A bridge Domain Representation.
gbp_bridge_domain_db_t::gbd_by_bd_index
index_t * gbd_by_bd_index
Definition: gbp_bridge_domain.h:121
gbp_bridge_domain_get_by_bd_index
static gbp_bridge_domain_t * gbp_bridge_domain_get_by_bd_index(u32 bd_index)
Definition: gbp_bridge_domain.h:134
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105