46 int flags = va_arg (*args,
int);
48 #define _(f) if (flags & TCP_FLAG_##f) s = format (s, "%s, ", #f); 59 u32 max_header_bytes = va_arg (*args,
u32);
64 if (max_header_bytes <
sizeof (tcp[0]))
65 return format (s,
"TCP header truncated");
71 s =
format (s,
"TCP: %d -> %d", clib_net_to_host_u16 (tcp->src),
72 clib_net_to_host_u16 (tcp->dst));
75 clib_net_to_host_u32 (tcp->seq_number),
76 clib_net_to_host_u32 (tcp->ack_number));
82 clib_net_to_host_u16 (tcp->window),
83 clib_net_to_host_u16 (tcp->checksum));
90 u8 *option_start = (
void *) (tcp + 1);
91 u8 *option_end = (
void *) tcp + header_bytes;
93 for (o = option_start; o < option_end;)
113 if (max_header_bytes != 0 && header_bytes < max_header_bytes)
123 (
void *) tcp + header_bytes,
124 max_header_bytes - header_bytes);
struct _tcp_header tcp_header_t
static tcp_udp_port_info_t * ip_get_tcp_udp_port_info(ip_main_t *im, u32 port)
format_function_t * format_header
static int tcp_header_bytes(tcp_header_t *t)