Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
GBP: use sclass in the DP for policy
[vpp.git]
/
src
/
plugins
/
gbp
/
gbp_contract.c
diff --git
a/src/plugins/gbp/gbp_contract.c
b/src/plugins/gbp/gbp_contract.c
index
f7b8b64
..
805e9b2
100644
(file)
--- a/
src/plugins/gbp/gbp_contract.c
+++ b/
src/plugins/gbp/gbp_contract.c
@@
-377,7
+377,7
@@
gbp_contract_next_hop_resolve (index_t gui, index_t gnhi)
gbd->gb_uu_fwd_sw_if_index,
ips,
&gnh->gnh_mac,
gbd->gb_uu_fwd_sw_if_index,
ips,
&gnh->gnh_mac,
- gnh->gnh_bd, gnh->gnh_rd,
EPG
_INVALID,
+ gnh->gnh_bd, gnh->gnh_rd,
SCLASS
_INVALID,
GBP_ENDPOINT_FLAG_NONE, NULL, NULL,
&gnh->gnh_ge);
GBP_ENDPOINT_FLAG_NONE, NULL, NULL,
&gnh->gnh_ge);
@@
-433,8
+433,8
@@
gbp_contract_mk_lbs (index_t * guis)
}
int
}
int
-gbp_contract_update (
epg_id_t src_epg
,
-
epg_id_t dst_epg
,
+gbp_contract_update (
sclass_t sclass
,
+
sclass_t dclass
,
u32 acl_index, index_t * rules, u16 * allowed_ethertypes)
{
gbp_main_t *gm = &gbp_main;
u32 acl_index, index_t * rules, u16 * allowed_ethertypes)
{
gbp_main_t *gm = &gbp_main;
@@
-444,8
+444,8
@@
gbp_contract_update (epg_id_t src_epg,
uword *p;
gbp_contract_key_t key = {
uword *p;
gbp_contract_key_t key = {
- .gck_src = s
rc_epg
,
- .gck_dst = d
st_epg
,
+ .gck_src = s
class
,
+ .gck_dst = d
class
,
};
if (~0 == gm->gbp_acl_user_id)
};
if (~0 == gm->gbp_acl_user_id)
@@
-483,7
+483,7
@@
gbp_contract_update (epg_id_t src_epg,
gc->gc_acl_index = acl_index;
gc->gc_lc_index =
gm->acl_plugin.get_lookup_context_index (gm->gbp_acl_user_id,
gc->gc_acl_index = acl_index;
gc->gc_lc_index =
gm->acl_plugin.get_lookup_context_index (gm->gbp_acl_user_id,
- s
rc_epg, dst_epg
);
+ s
class, dclass
);
vec_add1 (acl_vec, gc->gc_acl_index);
gm->acl_plugin.set_acl_vec_for_context (gc->gc_lc_index, acl_vec);
vec_add1 (acl_vec, gc->gc_acl_index);
gm->acl_plugin.set_acl_vec_for_context (gc->gc_lc_index, acl_vec);
@@
-493,11
+493,11
@@
gbp_contract_update (epg_id_t src_epg,
}
int
}
int
-gbp_contract_delete (
epg_id_t src_epg, epg_id_t dst_epg
)
+gbp_contract_delete (
sclass_t sclass, sclass_t dclass
)
{
gbp_contract_key_t key = {
{
gbp_contract_key_t key = {
- .gck_src = s
rc_epg
,
- .gck_dst = d
st_epg
,
+ .gck_src = s
class
,
+ .gck_dst = d
class
,
};
gbp_contract_t *gc;
uword *p;
};
gbp_contract_t *gc;
uword *p;
@@
-538,7
+538,7
@@
static clib_error_t *
gbp_contract_cli (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
gbp_contract_cli (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
-
epg_id_t src_epg_id = EPG_INVALID, dst_epg_id = EPG
_INVALID;
+
sclass_t sclass = SCLASS_INVALID, dclass = SCLASS
_INVALID;
u32 acl_index = ~0;
u8 add = 1;
u32 acl_index = ~0;
u8 add = 1;
@@
-548,9
+548,9
@@
gbp_contract_cli (vlib_main_t * vm,
add = 1;
else if (unformat (input, "del"))
add = 0;
add = 1;
else if (unformat (input, "del"))
add = 0;
- else if (unformat (input, "src-epg %d", &s
rc_epg_id
))
+ else if (unformat (input, "src-epg %d", &s
class
))
;
;
- else if (unformat (input, "dst-epg %d", &d
st_epg_id
))
+ else if (unformat (input, "dst-epg %d", &d
class
))
;
else if (unformat (input, "acl-index %d", &acl_index))
;
;
else if (unformat (input, "acl-index %d", &acl_index))
;
@@
-558,18
+558,18
@@
gbp_contract_cli (vlib_main_t * vm,
break;
}
break;
}
- if (
EPG_INVALID == src_epg_id
)
+ if (
SCLASS_INVALID == sclass
)
return clib_error_return (0, "Source EPG-ID must be specified");
return clib_error_return (0, "Source EPG-ID must be specified");
- if (
EPG_INVALID == dst_epg_id
)
+ if (
SCLASS_INVALID == dclass
)
return clib_error_return (0, "Destination EPG-ID must be specified");
if (add)
{
return clib_error_return (0, "Destination EPG-ID must be specified");
if (add)
{
- gbp_contract_update (s
rc_epg_id, dst_epg_id
, acl_index, NULL, NULL);
+ gbp_contract_update (s
class, dclass
, acl_index, NULL, NULL);
}
else
{
}
else
{
- gbp_contract_delete (s
rc_epg_id, dst_epg_id
);
+ gbp_contract_delete (s
class, dclass
);
}
return (NULL);
}
return (NULL);