* 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 $");
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,
}
} 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));
case PT_ZMTP1:
zmtp1_print(ndo, bp, length);
break;
+ case PT_RESP:
+ resp_print(ndo, bp, length);
+ break;
}
return;
}
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);
ND_PRINT((ndo, "+")); /* indicate we truncate */
}
ND_PRINT((ndo, " "));
- while (length-- && sp <= ndo->ndo_snapend) {
+ while (length-- && sp < ndo->ndo_snapend) {
c = *sp++;
safeputchar(ndo, c);
}