summaryrefslogtreecommitdiffstats
path: root/src/plugins/gbp/gbp_subnet.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-02-28 11:11:39 +0000
committerNeale Ranns <nranns@cisco.com>2019-03-06 12:15:10 +0000
commit4ba67723d716660c56326ce498b99a060a9471b1 (patch)
tree10f2fc773e660bad99ee6b7ae7845b1f23102bb8 /src/plugins/gbp/gbp_subnet.c
parent6955595a577e1b7d316b5b69267bf1d1d951a4ab (diff)
GBP: use sclass in the DP for policy
Change-Id: I154e18f22ec7708127b8ade98e80546ab1dcd05b Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_subnet.c')
-rw-r--r--src/plugins/gbp/gbp_subnet.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/gbp/gbp_subnet.c b/src/plugins/gbp/gbp_subnet.c
index 0c8d3aee0a7..5e56c8200b9 100644
--- a/src/plugins/gbp/gbp_subnet.c
+++ b/src/plugins/gbp/gbp_subnet.c
@@ -43,12 +43,12 @@ typedef struct gbp_subnet_t_
{
struct
{
- epg_id_t gs_epg;
+ sclass_t gs_sclass;
u32 gs_sw_if_index;
} gs_stitched_external;
struct
{
- epg_id_t gs_epg;
+ sclass_t gs_sclass;
} gs_l3_out;
};
@@ -155,15 +155,15 @@ gbp_subnet_internal_add (gbp_subnet_t * gs)
}
static int
-gbp_subnet_external_add (gbp_subnet_t * gs, u32 sw_if_index, epg_id_t epg)
+gbp_subnet_external_add (gbp_subnet_t * gs, u32 sw_if_index, sclass_t sclass)
{
dpo_id_t gpd = DPO_INVALID;
- gs->gs_stitched_external.gs_epg = epg;
+ gs->gs_stitched_external.gs_sclass = sclass;
gs->gs_stitched_external.gs_sw_if_index = sw_if_index;
gbp_policy_dpo_add_or_lock (fib_proto_to_dpo (gs->gs_key->gsk_pfx.fp_proto),
- gs->gs_stitched_external.gs_epg,
+ gs->gs_stitched_external.gs_sclass,
gs->gs_stitched_external.gs_sw_if_index, &gpd);
gs->gs_fei = fib_table_entry_special_dpo_update (gs->gs_key->gsk_fib_index,
@@ -179,14 +179,14 @@ gbp_subnet_external_add (gbp_subnet_t * gs, u32 sw_if_index, epg_id_t epg)
}
static int
-gbp_subnet_l3_out_add (gbp_subnet_t * gs, u32 sw_if_index, epg_id_t epg)
+gbp_subnet_l3_out_add (gbp_subnet_t * gs, u32 sw_if_index, sclass_t sclass)
{
dpo_id_t gpd = DPO_INVALID;
- gs->gs_l3_out.gs_epg = epg;
+ gs->gs_l3_out.gs_sclass = sclass;
gbp_policy_dpo_add_or_lock (fib_proto_to_dpo (gs->gs_key->gsk_pfx.fp_proto),
- gs->gs_l3_out.gs_epg, ~0, &gpd);
+ gs->gs_l3_out.gs_sclass, ~0, &gpd);
gs->gs_fei = fib_table_entry_special_dpo_add (gs->gs_key->gsk_fib_index,
&gs->gs_key->gsk_pfx,
@@ -238,7 +238,7 @@ gbp_subnet_del (u32 rd_id, const fib_prefix_t * pfx)
int
gbp_subnet_add (u32 rd_id,
const fib_prefix_t * pfx,
- gbp_subnet_type_t type, u32 sw_if_index, epg_id_t epg)
+ gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass)
{
gbp_route_domain_t *grd;
index_t grdi, gsi;
@@ -273,13 +273,13 @@ gbp_subnet_add (u32 rd_id,
rv = gbp_subnet_internal_add (gs);
break;
case GBP_SUBNET_STITCHED_EXTERNAL:
- rv = gbp_subnet_external_add (gs, sw_if_index, epg);
+ rv = gbp_subnet_external_add (gs, sw_if_index, sclass);
break;
case GBP_SUBNET_TRANSPORT:
rv = gbp_subnet_transport_add (gs);
break;
case GBP_SUBNET_L3_OUT:
- rv = gbp_subnet_l3_out_add (gs, sw_if_index, epg);
+ rv = gbp_subnet_l3_out_add (gs, sw_if_index, sclass);
break;
}
@@ -292,9 +292,9 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx)
gbp_route_domain_t *grd;
gbp_subnet_t *gs;
u32 sw_if_index;
- epg_id_t epg;
+ sclass_t sclass;
- epg = EPG_INVALID;
+ sclass = SCLASS_INVALID;
sw_if_index = ~0;
/* *INDENT-OFF* */
@@ -310,15 +310,15 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx)
break;
case GBP_SUBNET_STITCHED_EXTERNAL:
sw_if_index = gs->gs_stitched_external.gs_sw_if_index;
- epg = gs->gs_stitched_external.gs_epg;
+ sclass = gs->gs_stitched_external.gs_sclass;
break;
case GBP_SUBNET_L3_OUT:
- epg = gs->gs_l3_out.gs_epg;
+ sclass = gs->gs_l3_out.gs_sclass;
break;
}
if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx,
- gs->gs_type, sw_if_index, epg, ctx))
+ gs->gs_type, sw_if_index, sclass, ctx))
break;
}));
/* *INDENT-ON* */
@@ -373,12 +373,12 @@ format_gbp_subnet (u8 * s, va_list * args)
case GBP_SUBNET_TRANSPORT:
break;
case GBP_SUBNET_STITCHED_EXTERNAL:
- s = format (s, " {epg:%d %U}", gs->gs_stitched_external.gs_epg,
+ s = format (s, " {sclass:%d %U}", gs->gs_stitched_external.gs_sclass,
format_vnet_sw_if_index_name,
vnet_get_main (), gs->gs_stitched_external.gs_sw_if_index);
break;
case GBP_SUBNET_L3_OUT:
- s = format (s, " {epg:%d}", gs->gs_l3_out.gs_epg);
+ s = format (s, " {sclass:%d}", gs->gs_l3_out.gs_sclass);
break;
}