summaryrefslogtreecommitdiffstats
path: root/src/vlib/punt.h
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2021-02-05 15:40:00 +0100
committerNeale Ranns <neale@graphiant.com>2021-03-14 14:37:01 +0000
commit45723b8d305c7c6d034e16fcbf1904fd72dd6bb2 (patch)
treebb010ccd464efcfb90ccfabddded7b63b8223e6a /src/vlib/punt.h
parent4e3f7b2869925b0812a58d04c4bf6371e6773630 (diff)
ip: extend punt CLI for exception packets
Change-Id: I20e48a5ac8068eccb8d998346d35227c4802bb68 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: feature
Diffstat (limited to 'src/vlib/punt.h')
-rw-r--r--src/vlib/punt.h25
1 files changed, 18 insertions, 7 deletions
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);
@@ -42,6 +42,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
*/
typedef int vlib_punt_hdl_t;
@@ -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
*