summaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp/gbp_endpoint_group.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gbp/gbp_endpoint_group.h')
-rw-r--r--src/plugins/gbp/gbp_endpoint_group.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/gbp/gbp_endpoint_group.h b/src/plugins/gbp/gbp_endpoint_group.h
index 763a80e4d87..123954f63ea 100644
--- a/src/plugins/gbp/gbp_endpoint_group.h
+++ b/src/plugins/gbp/gbp_endpoint_group.h
@@ -31,6 +31,11 @@ typedef struct gpb_endpoint_group_t_
epg_id_t gg_id;
/**
+ * Sclass. Could be unset => ~0
+ */
+ u16 gg_sclass;
+
+ /**
* Bridge-domain ID the EPG is in
*/
index_t gg_gbd;
@@ -71,6 +76,7 @@ typedef struct gbp_endpoint_group_db_t_
} gbp_endpoint_group_db_t;
extern int gbp_endpoint_group_add_and_lock (epg_id_t epg_id,
+ u16 sclass,
u32 bd_id,
u32 rd_id,
u32 uplink_sw_if_index);
@@ -96,6 +102,19 @@ extern u8 *format_gbp_endpoint_group (u8 * s, va_list * args);
*/
extern gbp_endpoint_group_db_t gbp_endpoint_group_db;
extern gbp_endpoint_group_t *gbp_endpoint_group_pool;
+extern uword *gbp_epg_sclass_db;
+
+always_inline gbp_endpoint_group_t *
+gbp_epg_get (epg_id_t epg)
+{
+ uword *p;
+
+ p = hash_get (gbp_endpoint_group_db.gg_hash, epg);
+
+ if (NULL != p)
+ return (pool_elt_at_index (gbp_endpoint_group_pool, p[0]));
+ return (NULL);
+}
always_inline u32
gbp_epg_itf_lookup (epg_id_t epg)
@@ -114,6 +133,20 @@ gbp_epg_itf_lookup (epg_id_t epg)
return (~0);
}
+always_inline epg_id_t
+gbp_epg_sclass_2_id (u16 sclass)
+{
+ uword *p;
+
+ p = hash_get (gbp_epg_sclass_db, sclass);
+
+ if (NULL != p)
+ {
+ return (p[0]);
+ }
+ return (EPG_INVALID);
+}
+
always_inline const dpo_id_t *
gbp_epg_dpo_lookup (epg_id_t epg, fib_protocol_t fproto)
{