aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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. */