X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fpunt.h;h=ce949421dad818b77408481ab728555d6df36d10;hb=45723b8d3;hp=d93b5eac59921e731f381a48dc2cf2ddacee77aa;hpb=8d6d74cdf43d7560eab3cf609cab27e5deb816e0;p=vpp.git diff --git a/src/vlib/punt.h b/src/vlib/punt.h index d93b5eac599..ce949421dad 100644 --- a/src/vlib/punt.h +++ b/src/vlib/punt.h @@ -31,8 +31,8 @@ typedef enum vlib_punt_reason_t_ /** * Walk each punt reason */ -typedef int (*punt_reason_walk_cb_t) (vlib_punt_reason_t id, - const u8 * name, void *ctx); +typedef int (*punt_reason_walk_cb_t) (vlib_punt_reason_t id, const u8 *name, + void *ctx); extern void punt_reason_walk (punt_reason_walk_cb_t cb, void *cxt); @@ -41,6 +41,11 @@ extern void punt_reason_walk (punt_reason_walk_cb_t cb, void *cxt); */ extern u8 *format_vlib_punt_reason (u8 * s, va_list * args); +/** + * @brief Unformat a punt reason + */ +extern uword unformat_punt_reason (unformat_input_t *input, va_list *args); + /** * Typedef for a client handle */ @@ -61,14 +66,18 @@ typedef void (*punt_interested_listener_t) (vlib_enable_or_disable_t i, /** * Allocate a new punt reason - * @param fn - A callback to invoke when an entity becomes [un]interested - * in the punt code. - * @param data - To be passed in the callback function. + * @param fn - A callback to invoke when an entity becomes + * [un]interested in the punt code. + * @param data - To be passed in the callback function. + * @param flags - flags associated with the punt reason + * @param flags_format - formatting function to display those flags (may be + * NULL) */ extern int vlib_punt_reason_alloc (vlib_punt_hdl_t client, const char *reason_name, - punt_interested_listener_t fn, - void *data, vlib_punt_reason_t * reason); + punt_interested_listener_t fn, void *data, + vlib_punt_reason_t *reason, u32 flags, + format_function_t *flags_format); /** * Validate that a punt reason is assigned @@ -87,6 +96,8 @@ extern int vlib_punt_register (vlib_punt_hdl_t client, extern int vlib_punt_unregister (vlib_punt_hdl_t client, vlib_punt_reason_t pr, const char *node); +extern u32 vlib_punt_reason_get_flags (vlib_punt_reason_t pr); + /** * FOR USE IN THE DP ONLY *