X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fvlib%2Fpunt.c;h=7c2daf25ee4271b0843e4fce50fffcaa740d0533;hb=f58571ee6f7b0460392ee6a7f86be2e07e747390;hp=5f83707c11db2c0645cc146164e382cef0a13d1d;hpb=7f6bd24f7217026131f6b8e1e55f92d2955c883b;p=vpp.git diff --git a/src/vlib/punt.c b/src/vlib/punt.c index 5f83707c11d..7c2daf25ee4 100644 --- a/src/vlib/punt.c +++ b/src/vlib/punt.c @@ -366,6 +366,15 @@ vlib_punt_unregister (vlib_punt_hdl_t client, return (0); } +int +vlib_punt_reason_validate (vlib_punt_reason_t reason) +{ + if (reason < punt_reason_last) + return (0); + + return (-1); +} + int vlib_punt_reason_alloc (vlib_punt_hdl_t client, const char *reason_name, vlib_punt_reason_t * reason) @@ -392,6 +401,17 @@ vlib_punt_reason_alloc (vlib_punt_hdl_t client, return (0); } +void +punt_reason_walk (punt_reason_walk_cb_t cb, void *ctx) +{ + punt_reason_data_t *pd; + + vec_foreach (pd, punt_reason_data) + { + cb (pd->pd_reason, pd->pd_name, ctx); + } +} + /* Parse node name -> node index. */ uword unformat_punt_client (unformat_input_t * input, va_list * args)