X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/cdda157a88595c0945f7719f83446e3976d53b89..b38f324af9dd953a661b9f35910f8c6d8eb2cc06:/print-tcp.c diff --git a/print-tcp.c b/print-tcp.c index 1473cb38..507c9daa 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -23,6 +23,8 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +/* \summary: TCP printer */ + #ifndef lint #else __RCSID("$NetBSD: print-tcp.c,v 1.8 2007/07/24 11:53:48 drochner Exp $"); @@ -143,6 +145,16 @@ tcp_cksum(netdissect_options *ndo, IPPROTO_TCP); } +static int +tcp6_cksum(netdissect_options *ndo, + register const struct ip6_hdr *ip6, + register const struct tcphdr *tp, + register u_int len) +{ + return nextproto6_cksum(ndo, ip6, (const uint8_t *)tp, len, len, + IPPROTO_TCP); +} + void tcp_print(netdissect_options *ndo, register const u_char *bp, register u_int length, @@ -370,8 +382,7 @@ tcp_print(netdissect_options *ndo, } } else if (IP_V(ip) == 6 && ip6->ip6_plen) { if (ND_TTEST2(tp->th_sport, length)) { - sum = nextproto6_cksum(ip6, (const uint8_t *)tp, - length, length, IPPROTO_TCP); + sum = tcp6_cksum(ndo, ip6, tp, length); tcp_sum = EXTRACT_16BITS(&tp->th_sum); ND_PRINT((ndo, ", cksum 0x%04x", tcp_sum)); @@ -641,6 +652,9 @@ tcp_print(netdissect_options *ndo, case PT_ZMTP1: zmtp1_print(ndo, bp, length); break; + case PT_RESP: + resp_print(ndo, bp, length); + break; } return; } @@ -654,6 +668,8 @@ tcp_print(netdissect_options *ndo, bgp_print(ndo, bp, length); else if (IS_SRC_OR_DST_PORT(PPTP_PORT)) pptp_print(ndo, bp); + else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) + resp_print(ndo, bp, length); #ifdef ENABLE_SMB else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT)) nbt_tcp_print(ndo, bp, length);