Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
mactime: add a "top" command to watch device stats
[vpp.git]
/
src
/
vnet
/
ip
/
punt_api.c
diff --git
a/src/vnet/ip/punt_api.c
b/src/vnet/ip/punt_api.c
index
946a001
..
8bb0f7f
100644
(file)
--- a/
src/vnet/ip/punt_api.c
+++ b/
src/vnet/ip/punt_api.c
@@
-21,7
+21,6
@@
#include <vlibmemory/api.h>
#include <vnet/ip/punt.h>
#include <vnet/ip/ip_types_api.h>
#include <vlibmemory/api.h>
#include <vnet/ip/punt.h>
#include <vnet/ip/ip_types_api.h>
-#include <vlibapi/api_types_inlines.h>
#include <vnet/vnet_msg_enum.h>
#include <vnet/vnet_msg_enum.h>
@@
-322,6
+321,7
@@
typedef struct punt_reason_dump_walk_ctx_t_
{
vl_api_registration_t *reg;
u32 context;
{
vl_api_registration_t *reg;
u32 context;
+ u8 *name;
} punt_reason_dump_walk_ctx_t;
static int
} punt_reason_dump_walk_ctx_t;
static int
@@
-330,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;
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);
mp = vl_msg_api_alloc (sizeof (*mp) + vec_len (name));
if (!mp)
return (0);
@@
-358,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,
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);
};
punt_reason_walk (punt_reason_dump_walk_cb, &ctx);
+
+ vec_free (ctx.name);
}
#define vl_msg_name_crc_list
}
#define vl_msg_name_crc_list