X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_contract.c;h=e12b33145ce7d7b7021bbfd980f14062cb770e18;hb=bdfe5955f59a735fd8d70e9026f8c1867a4c8cc6;hp=a24edb362f5da3d7aca23db3e24383c4a4c2f9d3;hpb=7bf7ea3ce39c1d70c0409dcbecd5c4aaf26fae13;p=vpp.git diff --git a/src/plugins/gbp/gbp_contract.c b/src/plugins/gbp/gbp_contract.c index a24edb362f5..e12b33145ce 100644 --- a/src/plugins/gbp/gbp_contract.c +++ b/src/plugins/gbp/gbp_contract.c @@ -19,10 +19,17 @@ #include #include #include +#include #include #include +char *gbp_contract_error_strings[] = { +#define _(sym,string) string, + foreach_gbp_contract_error +#undef _ +}; + /** * Single contract DB instance */ @@ -66,6 +73,12 @@ gbp_rule_alloc (gbp_rule_action_t action, return (gu - gbp_rule_pool); } +void +gbp_rule_free (index_t gui) +{ + pool_put_index (gbp_rule_pool, gui); +} + index_t gbp_next_hop_alloc (const ip46_address_t * ip, index_t grd, const mac_address_t * mac, index_t gbd) @@ -132,6 +145,8 @@ gbp_contract_rules_free (index_t * rules) adj_unlock (gnh->gnh_ai[fproto]); } } + + gbp_rule_free (*gui); } vec_free (rules); } @@ -152,7 +167,7 @@ format_gbp_next_hop (u8 * s, va_list * args) return (s); } -static u8 * +u8 * format_gbp_rule_action (u8 * s, va_list * args) { gbp_rule_action_t action = va_arg (*args, gbp_rule_action_t); @@ -268,7 +283,10 @@ gbp_contract_mk_adj (gbp_next_hop_t * gnh, fib_protocol_t fproto) gnh->gnh_ai[fproto] = adj_nbr_add_or_lock_w_rewrite (fproto, fib_proto_to_link (fproto), - &gnh->gnh_ip, ge->ge_fwd.gef_itf, rewrite); + &gnh->gnh_ip, + gbp_itf_get_sw_if_index (ge-> + ge_fwd.gef_itf), + rewrite); adj_unlock (old_ai); }