return format(s, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]);
}
-u8 *format_pnat_5tuple(u8 *s, va_list *args) { return 0; }
+u8 *format_pnat_match_tuple(u8 *s, va_list *args) { return 0; }
+u8 *format_pnat_rewrite_tuple(u8 *s, va_list *args) { return 0; }
vl_counter_t pnat_error_counters[10];
clib_net_to_host_u16(tcp->checksum));
return s;
}
+/* Format UDP header. */
+u8 *format_udp_header(u8 *s, va_list *args) {
+ udp_header_t *udp = va_arg(*args, udp_header_t *);
+ u32 max_header_bytes = va_arg(*args, u32);
+ u32 indent;
+
+ /* Nothing to do. */
+ if (max_header_bytes < sizeof(udp[0]))
+ return format(s, "UDP header truncated");
+
+ indent = format_get_indent(s);
+ indent += 2;
+
+ s = format(s, "UDP: %d -> %d", clib_net_to_host_u16(udp->src_port),
+ clib_net_to_host_u16(udp->dst_port));
+
+ s = format(s, "\n%Ulength %d, checksum 0x%04x", format_white_space, indent,
+ clib_net_to_host_u16(udp->length),
+ clib_net_to_host_u16(udp->checksum));
+
+ return s;
+}
/* Format an IP4 header. */
u8 *format_ip4_header(u8 *s, va_list *args) {