aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-03-04 16:23:26 +0000
committerNeale Ranns <neale@graphiant.com>2021-03-05 12:23:54 +0000
commitd89de31489cc0fb0c3d606fe9b30a97934942e80 (patch)
tree5e6ff1a85a20add5e6bb65b6ffe48aa01348d10b /src/vnet
parent8fb5add31885fcee1abaf60dd903aa566cc53b0d (diff)
fib: format function for adjacency flags
Type: improvement Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ib01ed3231321f0f38c4b1deb885c4cf718cc0147
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/adj/rewrite.c16
-rw-r--r--src/vnet/adj/rewrite.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/vnet/adj/rewrite.c b/src/vnet/adj/rewrite.c
index fc2df9af109..5b9ec090087 100644
--- a/src/vnet/adj/rewrite.c
+++ b/src/vnet/adj/rewrite.c
@@ -41,6 +41,21 @@
#include <vnet/ip/lookup.h>
u8 *
+format_vnet_rewrite_flags (u8 *s, va_list *ap)
+{
+ vnet_rewrite_flags_t f = va_arg (*ap, int);
+
+ if (f & VNET_REWRITE_HAS_FEATURES)
+ s = format (s, "features ");
+ if (f & VNET_REWRITE_FIXUP_IP4_O_4)
+ s = format (s, "fixup-ip4o4 ");
+ if (f & VNET_REWRITE_FIXUP_FLOW_HASH)
+ s = format (s, "fixup-flow-hash ");
+
+ return (s);
+}
+
+u8 *
format_vnet_rewrite (u8 * s, va_list * args)
{
vnet_rewrite_header_t *rw = va_arg (*args, vnet_rewrite_header_t *);
@@ -61,6 +76,7 @@ format_vnet_rewrite (u8 * s, va_list * args)
}
s = format (s, " mtu:%d next:%d", rw->max_l3_packet_bytes, rw->next_index);
+ s = format (s, " flags:[%U]", format_vnet_rewrite_flags, rw->flags);
/* Format rewrite string. */
if (rw->data_bytes > 0)
diff --git a/src/vnet/adj/rewrite.h b/src/vnet/adj/rewrite.h
index 496bb149bc4..4234986dc37 100644
--- a/src/vnet/adj/rewrite.h
+++ b/src/vnet/adj/rewrite.h
@@ -67,6 +67,8 @@ typedef enum vnet_rewrite_flags_t_
VNET_REWRITE_FIXUP_FLOW_HASH = (1 << 2),
} __attribute__ ((packed)) vnet_rewrite_flags_t;
+extern u8 *format_vnet_rewrite_flags (u8 *s, va_list *ap);
+
typedef struct vnet_rewrite_header_t_
{
/* Interface to mark re-written packets with. */