X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_endpoint_group.h;h=c5fdff8463d6f7d29f339aadb85221b330cf5584;hb=59f71132e;hp=7116a058aeeb66773f2c54020d93237438cc5cc9;hpb=93cc3ee3b3a9c9224a1446625882205f3282a949;p=vpp.git diff --git a/src/plugins/gbp/gbp_endpoint_group.h b/src/plugins/gbp/gbp_endpoint_group.h index 7116a058aee..c5fdff8463d 100644 --- a/src/plugins/gbp/gbp_endpoint_group.h +++ b/src/plugins/gbp/gbp_endpoint_group.h @@ -17,9 +17,19 @@ #define __GBP_ENDPOINT_GROUP_H__ #include +#include #include +/** + * Endpoint Retnetion Policy + */ +typedef struct gbp_endpoint_retention_t_ +{ + /** Aging timeout for remote endpoints */ + u32 remote_ep_timeout; +} gbp_endpoint_retention_t; + /** * An Endpoint Group representation */ @@ -28,13 +38,17 @@ typedef struct gpb_endpoint_group_t_ /** * ID */ - epg_id_t gg_id; + vnid_t gg_vnid; + + /** + * Sclass. Could be unset => ~0 + */ + u16 gg_sclass; /** * Bridge-domain ID the EPG is in */ index_t gg_gbd; - index_t gg_bd_index; /** * route-domain/IP-table ID the EPG is in @@ -50,6 +64,7 @@ typedef struct gpb_endpoint_group_t_ * the uplink interface dedicated to the EPG */ u32 gg_uplink_sw_if_index; + gbp_itf_hdl_t gg_uplink_itf; /** * The DPO used in the L3 path for forwarding internal subnets @@ -60,6 +75,11 @@ typedef struct gpb_endpoint_group_t_ * Locks/references to this EPG */ u32 gg_locks; + + /** + * EP retention policy + */ + gbp_endpoint_retention_t gg_retention; } gbp_endpoint_group_t; /** @@ -67,23 +87,25 @@ typedef struct gpb_endpoint_group_t_ */ typedef struct gbp_endpoint_group_db_t_ { - uword *gg_hash; + uword *gg_hash_sclass; } gbp_endpoint_group_db_t; -extern int gbp_endpoint_group_add_and_lock (epg_id_t epg_id, +extern int gbp_endpoint_group_add_and_lock (vnid_t vnid, + u16 sclass, u32 bd_id, u32 rd_id, - u32 uplink_sw_if_index); -extern index_t gbp_endpoint_group_find_and_lock (epg_id_t epg_id); -extern index_t gbp_endpoint_group_find (epg_id_t epg_id); -extern int gbp_endpoint_group_delete (epg_id_t epg_id); + u32 uplink_sw_if_index, + const gbp_endpoint_retention_t * + retention); +extern index_t gbp_endpoint_group_find (sclass_t sclass); +extern int gbp_endpoint_group_delete (sclass_t sclass); extern void gbp_endpoint_group_unlock (index_t index); +extern void gbp_endpoint_group_lock (index_t index); extern u32 gbp_endpoint_group_get_bd_id (const gbp_endpoint_group_t *); extern gbp_endpoint_group_t *gbp_endpoint_group_get (index_t i); -extern index_t gbp_endpoint_group_get_fib_index (gbp_endpoint_group_t * gg, - fib_protocol_t fproto); -extern u32 gbp_endpoint_group_get_bvi (gbp_endpoint_group_t * gg); +extern index_t gbp_endpoint_group_get_fib_index (const gbp_endpoint_group_t * + gg, fib_protocol_t fproto); typedef int (*gbp_endpoint_group_cb_t) (gbp_endpoint_group_t * gbpe, void *ctx); @@ -97,13 +119,14 @@ 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 u32 -gbp_epg_itf_lookup (epg_id_t epg) +gbp_epg_itf_lookup_sclass (sclass_t sclass) { uword *p; - p = hash_get (gbp_endpoint_group_db.gg_hash, epg); + p = hash_get (gbp_endpoint_group_db.gg_hash_sclass, sclass); if (NULL != p) { @@ -116,11 +139,11 @@ gbp_epg_itf_lookup (epg_id_t epg) } always_inline const dpo_id_t * -gbp_epg_dpo_lookup (epg_id_t epg, fib_protocol_t fproto) +gbp_epg_dpo_lookup (sclass_t sclass, fib_protocol_t fproto) { uword *p; - p = hash_get (gbp_endpoint_group_db.gg_hash, epg); + p = hash_get (gbp_endpoint_group_db.gg_hash_sclass, sclass); if (NULL != p) {