summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_input.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-07-26 11:57:04 +0300
committerJohn Lo <loj@cisco.com>2017-07-31 13:10:02 +0000
commit942402b02096af1c966f10e3e2a3d235787b962e (patch)
tree224baaa9c25a111f3374ada094e5e31609409f99 /src/vnet/l2/l2_input.c
parent91d341c260c21b231543b29553d28d48b6148120 (diff)
CLI:add l2 input/outut to "sh int features"
Change-Id: If608bbc7f4c8b0d5c3a237098a20279e407c82d3 Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_input.c')
-rw-r--r--src/vnet/l2/l2_input.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index 26c832adfb1..faed7c7fd76 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -60,6 +60,29 @@ l2input_get_feat_names (void)
return l2input_feat_names;
}
+u8 *
+format_l2_input_features (u8 * s, va_list * args)
+{
+ static char *display_names[] = {
+#define _(sym,name) #sym,
+ foreach_l2input_feat
+#undef _
+ };
+ u32 feature_bitmap = va_arg (*args, u32);
+
+ if (feature_bitmap == 0)
+ {
+ s = format (s, " none configured");
+ return s;
+ }
+
+ feature_bitmap &= ~L2INPUT_FEAT_DROP; /* Not a feature */
+ int i;
+ for (i = L2INPUT_N_FEAT; i >= 0; i--)
+ if (feature_bitmap & (1 << i))
+ s = format (s, "%10s (%s)\n", display_names[i], l2input_feat_names[i]);
+ return s;
+}
typedef struct
{