FD.io VPP  v19.04.1-1-ge4a0f9f
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 
21 #include <vnet/fib/fib_types.h>
22 
23 /**
24  * Bridge Domain Flags
25  */
27 {
34 
35 /**
36  * A bridge Domain Representation.
37  * This is a standard bridge-domain plus all the attributes it must
38  * have to supprt the GBP model.
39  */
40 typedef struct gbp_bridge_domain_t_
41 {
42  /**
43  * Bridge-domain ID
44  */
47 
48  /**
49  * Flags conttrolling behaviour
50  */
52 
53  /**
54  * The BD's BVI interface (obligatory)
55  */
57 
58  /**
59  * The BD's MAC spine-proxy interface (optional)
60  */
62 
63  /**
64  * The BD's interface to sned Broadcast and multicast packets
65  */
67 
68  /**
69  * The index of the BD's VNI interface on which packets from
70  * unkown endpoints arrive
71  */
73 
74  /**
75  * locks/references to the BD so it does not get deleted (from the API)
76  * whilst it is still being used
77  */
80 
86 
87 extern void gbp_bridge_domain_unlock (index_t gbi);
92 
93 typedef int (*gbp_bridge_domain_cb_t) (gbp_bridge_domain_t * gb, void *ctx);
94 extern void gbp_bridge_domain_walk (gbp_bridge_domain_cb_t bgpe, void *ctx);
95 
96 extern u8 *format_gbp_bridge_domain (u8 * s, va_list * args);
97 extern u8 *format_gbp_bridge_domain_flags (u8 * s, va_list * args);
98 
99 /**
100  * DB of bridge_domains
101  */
103 {
107 
110 
113 {
114  return (pool_elt_at_index (gbp_bridge_domain_pool, i));
115 }
116 
119 {
120  return (gbp_bridge_domain_get
121  (gbp_bridge_domain_db.gbd_by_bd_index[bd_index]));
122 }
123 
124 #endif
125 
126 /*
127  * fd.io coding-style-patch-verification: ON
128  *
129  * Local Variables:
130  * eval: (c-set-style "gnu")
131  * End:
132  */
u32 gb_uu_fwd_sw_if_index
The BD&#39;s MAC spine-proxy interface (optional)
static gbp_bridge_domain_t * gbp_bridge_domain_get_by_bd_index(u32 bd_index)
u32 flags
Definition: vhost_user.h:115
struct gbp_bridge_domain_db_t gbp_bridge_domain_db_t
DB of bridge_domains.
u32 gb_vni
The index of the BD&#39;s VNI interface on which packets from unkown endpoints arrive.
A bridge Domain Representation.
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:41
gbp_bridge_domain_flags_t_
Bridge Domain Flags.
int i
u8 * format_gbp_bridge_domain_flags(u8 *s, va_list *args)
u32 uu_fwd_sw_if_index
Definition: gbp.api:36
static gbp_bridge_domain_t * gbp_bridge_domain_get(index_t i)
unsigned char u8
Definition: types.h:56
enum gbp_bridge_domain_flags_t_ gbp_bridge_domain_flags_t
Bridge Domain Flags.
#define always_inline
Definition: clib.h:98
gbp_bridge_domain_t * gbp_bridge_domain_pool
Pool of GBP bridge_domains.
unsigned int u32
Definition: types.h:88
int gbp_bridge_domain_add_and_lock(u32 bd_id, gbp_bridge_domain_flags_t flags, u32 bvi_sw_if_index, u32 uu_fwd_sw_if_index, u32 bm_flood_sw_if_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:514
u32 bvi_sw_if_index
Definition: gbp.api:35
long ctx[MAX_CONNS]
Definition: main.c:144
u32 bd_id
Definition: gbp.api:269
DB of bridge_domains.
u32 gb_bd_id
Bridge-domain ID.
gbp_bridge_domain_flags_t gb_flags
Flags conttrolling behaviour.
u32 gb_locks
locks/references to the BD so it does not get deleted (from the API) whilst it is still being used ...
u32 gb_bm_flood_sw_if_index
The BD&#39;s interface to sned Broadcast and multicast packets.
int(* gbp_bridge_domain_cb_t)(gbp_bridge_domain_t *gb, void *ctx)
gbp_bridge_domain_db_t gbp_bridge_domain_db
DB of bridge_domains.
int gbp_bridge_domain_delete(u32 bd_id)
struct gbp_bridge_domain_t_ gbp_bridge_domain_t
A bridge Domain Representation.
u32 gb_bvi_sw_if_index
The BD&#39;s BVI interface (obligatory)
u32 bm_flood_sw_if_index
Definition: gbp.api:37
u8 * format_gbp_bridge_domain(u8 *s, va_list *args)
void gbp_bridge_domain_unlock(index_t gbi)
index_t gbp_bridge_domain_index(const gbp_bridge_domain_t *)
u32 gbp_bridge_domain_get_bd_id(index_t gbdi)
u64 uword
Definition: types.h:112
index_t gbp_bridge_domain_find_and_lock(u32 bd_id)
void gbp_bridge_domain_walk(gbp_bridge_domain_cb_t bgpe, void *ctx)