diff options
Diffstat (limited to 'src/plugins/gbp/gbp_bridge_domain.h')
-rw-r--r-- | src/plugins/gbp/gbp_bridge_domain.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/plugins/gbp/gbp_bridge_domain.h b/src/plugins/gbp/gbp_bridge_domain.h index 992900b4aa1..4135c2d8232 100644 --- a/src/plugins/gbp/gbp_bridge_domain.h +++ b/src/plugins/gbp/gbp_bridge_domain.h @@ -21,11 +21,20 @@ #include <vnet/fib/fib_types.h> /** + * Bridge Domain Flags + */ +typedef enum gbp_bridge_domain_flags_t_ +{ + GBP_BD_FLAG_NONE = 0, + GBP_BD_FLAG_DO_NOT_LEARN = (1 << 0), +} gbp_bridge_domain_flags_t; + +/** * A bridge Domain Representation. * This is a standard bridge-domain plus all the attributes it must * have to supprt the GBP model. */ -typedef struct gpb_bridge_domain_t_ +typedef struct gbp_bridge_domain_t_ { /** * Bridge-domain ID @@ -34,6 +43,11 @@ typedef struct gpb_bridge_domain_t_ u32 gb_bd_index; /** + * Flags conttrolling behaviour + */ + gbp_bridge_domain_flags_t gb_flags; + + /** * The BD's BVI interface (obligatory) */ u32 gb_bvi_sw_if_index; @@ -57,18 +71,43 @@ typedef struct gpb_bridge_domain_t_ } gbp_bridge_domain_t; extern 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); extern void gbp_bridge_domain_unlock (index_t gbi); extern index_t gbp_bridge_domain_find_and_lock (u32 bd_id); extern int gbp_bridge_domain_delete (u32 bd_id); -extern gbp_bridge_domain_t *gbp_bridge_domain_get (index_t i); typedef int (*gbp_bridge_domain_cb_t) (gbp_bridge_domain_t * gb, void *ctx); extern void gbp_bridge_domain_walk (gbp_bridge_domain_cb_t bgpe, void *ctx); extern u8 *format_gbp_bridge_domain (u8 * s, va_list * args); +/** + * DB of bridge_domains + */ +typedef struct gbp_bridge_domain_db_t +{ + uword *gbd_by_bd_id; + index_t *gbd_by_bd_index; +} gbp_bridge_domain_db_t; + +extern gbp_bridge_domain_db_t gbp_bridge_domain_db; +extern gbp_bridge_domain_t *gbp_bridge_domain_pool; + +always_inline gbp_bridge_domain_t * +gbp_bridge_domain_get (index_t i) +{ + return (pool_elt_at_index (gbp_bridge_domain_pool, i)); +} + +always_inline gbp_bridge_domain_t * +gbp_bridge_domain_get_by_bd_index (u32 bd_index) +{ + return (gbp_bridge_domain_get + (gbp_bridge_domain_db.gbd_by_bd_index[bd_index])); +} + #endif /* |