X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgbp%2Fgbp_policy.c;h=21e4bdba0649640c6ba3d82916541f1c53a90c85;hb=1d6d9f021c5a169dedca55b46451ab54728e3ee8;hp=fbdf3946d1d846ae18463a635a6c92ed82eadee6;hpb=f90bcee0944064fbe99571b772eef4baba32152e;p=vpp.git diff --git a/src/plugins/gbp/gbp_policy.c b/src/plugins/gbp/gbp_policy.c index fbdf3946d1d..21e4bdba064 100644 --- a/src/plugins/gbp/gbp_policy.c +++ b/src/plugins/gbp/gbp_policy.c @@ -14,31 +14,54 @@ */ #include -#include +#include +#include gbp_policy_main_t gbp_policy_main; +/* packet trace format function */ +u8 * +format_gbp_policy_trace (u8 * s, va_list * args) +{ + CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); + CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); + gbp_policy_trace_t *t = va_arg (*args, gbp_policy_trace_t *); + + s = + format (s, "scope:%d sclass:%d, dclass:%d, allowed:%d flags:%U", t->scope, + t->sclass, t->dclass, t->allowed, format_vxlan_gbp_header_gpflags, + t->flags); + + return s; +} + static clib_error_t * gbp_policy_init (vlib_main_t * vm) { gbp_policy_main_t *gpm = &gbp_policy_main; clib_error_t *error = 0; - vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "gbp-policy-port"); - /* Initialize the feature next-node indexes */ + vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "gbp-policy-port"); feat_bitmap_init_next_nodes (vm, node->index, L2OUTPUT_N_FEAT, l2output_get_feat_names (), - gpm->l2_output_feat_next[1]); + gpm->l2_output_feat_next[GBP_POLICY_PORT]); node = vlib_get_node_by_name (vm, (u8 *) "gbp-policy-mac"); feat_bitmap_init_next_nodes (vm, node->index, L2OUTPUT_N_FEAT, l2output_get_feat_names (), - gpm->l2_output_feat_next[0]); + gpm->l2_output_feat_next[GBP_POLICY_MAC]); + + node = vlib_get_node_by_name (vm, (u8 *) "gbp-policy-lpm"); + feat_bitmap_init_next_nodes (vm, + node->index, + L2OUTPUT_N_FEAT, + l2output_get_feat_names (), + gpm->l2_output_feat_next[GBP_POLICY_LPM]); return error; }