summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/punt.api17
-rw-r--r--src/vnet/ip/punt_api.c12
2 files changed, 22 insertions, 7 deletions
diff --git a/src/vnet/ip/punt.api b/src/vnet/ip/punt.api
index 6cb27311726..72efc7a9557 100644
--- a/src/vnet/ip/punt.api
+++ b/src/vnet/ip/punt.api
@@ -131,18 +131,21 @@ autoreply define punt_socket_deregister {
vl_api_punt_t punt;
};
-/** \brief Dump all of the excpetion punt reasons
+typedef punt_reason
+{
+ u32 id;
+ string name;
+};
+
+/** \brief Dump all or one of the excpetion punt reasons
+* @param - If the string is not set punt dump all reasons
+* else dump only the one specified
*/
define punt_reason_dump
{
u32 client_index;
u32 context;
-};
-
-typedef punt_reason
-{
- u32 id;
- string name;
+ vl_api_punt_reason_t reason;
};
define punt_reason_details
diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c
index b356886a56f..8bb0f7fbc82 100644
--- a/src/vnet/ip/punt_api.c
+++ b/src/vnet/ip/punt_api.c
@@ -321,6 +321,7 @@ typedef struct punt_reason_dump_walk_ctx_t_
{
vl_api_registration_t *reg;
u32 context;
+ u8 *name;
} punt_reason_dump_walk_ctx_t;
static int
@@ -329,6 +330,14 @@ punt_reason_dump_walk_cb (vlib_punt_reason_t id, const u8 * name, void *args)
punt_reason_dump_walk_ctx_t *ctx = args;
vl_api_punt_reason_details_t *mp;
+ if (ctx->name)
+ {
+ /* user requested a specific punt-reason */
+ if (vec_cmp (name, ctx->name))
+ /* not the reasonn we're lookgin for */
+ return 1;
+ }
+
mp = vl_msg_api_alloc (sizeof (*mp) + vec_len (name));
if (!mp)
return (0);
@@ -357,9 +366,12 @@ vl_api_punt_reason_dump_t_handler (vl_api_punt_reason_dump_t * mp)
punt_reason_dump_walk_ctx_t ctx = {
.reg = reg,
.context = mp->context,
+ .name = vl_api_from_api_to_vec (&mp->reason.name),
};
punt_reason_walk (punt_reason_dump_walk_cb, &ctx);
+
+ vec_free (ctx.name);
}
#define vl_msg_name_crc_list