Lines Matching refs:ndo

58 static int tcp_verify_signature(netdissect_options *ndo,
64 static void print_tcp_fastopen_option(netdissect_options *ndo, register const u_char *cp,
140 tcp_cksum(netdissect_options *ndo,
145 return nextproto4_cksum(ndo, ip, (const uint8_t *)tp, len, len,
150 tcp6_cksum(netdissect_options *ndo,
155 return nextproto6_cksum(ndo, ip6, (const uint8_t *)tp, len, len,
160 tcp_print(netdissect_options *ndo,
184 ND_PRINT((ndo, "%s > %s: [|tcp]",
185 ipaddr_string(ndo, &ip->ip_src),
186 ipaddr_string(ndo, &ip->ip_dst)));
195 ND_PRINT((ndo, "%s.%s > %s.%s: ",
196 ip6addr_string(ndo, &ip6->ip6_src),
197 tcpport_string(ndo, sport),
198 ip6addr_string(ndo, &ip6->ip6_dst),
199 tcpport_string(ndo, dport)));
201 ND_PRINT((ndo, "%s > %s: ",
202 tcpport_string(ndo, sport), tcpport_string(ndo, dport)));
206 ND_PRINT((ndo, "%s.%s > %s.%s: ",
207 ipaddr_string(ndo, &ip->ip_src),
208 tcpport_string(ndo, sport),
209 ipaddr_string(ndo, &ip->ip_dst),
210 tcpport_string(ndo, dport)));
212 ND_PRINT((ndo, "%s > %s: ",
213 tcpport_string(ndo, sport), tcpport_string(ndo, dport)));
222 ND_PRINT((ndo, " tcp %d [bad hdr length %u - too short, < %lu]",
232 if (ndo->ndo_qflag) {
233 ND_PRINT((ndo, "tcp %d", length - hlen));
235 ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]",
242 ND_PRINT((ndo, "Flags [%s]", bittok2str_nosep(tcp_flag_values, "none", flags)));
244 if (!ndo->ndo_Sflag && (flags & TH_ACK)) {
289 (*ndo->ndo_error)(ndo,
340 (*ndo->ndo_error)(ndo,
363 ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]",
368 if (ndo->ndo_vflag && !ndo->ndo_Kflag && !fragmented) {
374 sum = tcp_cksum(ndo, ip, tp, length);
377 ND_PRINT((ndo, ", cksum 0x%04x", tcp_sum));
379 ND_PRINT((ndo, " (incorrect -> 0x%04x)",
382 ND_PRINT((ndo, " (correct)"));
386 sum = tcp6_cksum(ndo, ip6, tp, length);
389 ND_PRINT((ndo, ", cksum 0x%04x", tcp_sum));
391 ND_PRINT((ndo, " (incorrect -> 0x%04x)",
394 ND_PRINT((ndo, " (correct)"));
401 if (ndo->ndo_vflag > 1 || length > 0 || flags & (TH_SYN | TH_FIN | TH_RST)) {
402 ND_PRINT((ndo, ", seq %u", seq));
405 ND_PRINT((ndo, ":%u", seq + length));
410 ND_PRINT((ndo, ", ack %u", ack));
413 ND_PRINT((ndo, ", win %d", win));
416 ND_PRINT((ndo, ", urg %d", urp));
427 ND_PRINT((ndo, ", options ["));
430 ND_PRINT((ndo, "%c", ch));
449 ND_PRINT((ndo, "%s", tok2str(tcp_option_values, "unknown-%u", opt)));
456 ND_PRINT((ndo, " %u", EXTRACT_16BITS(cp)));
462 ND_PRINT((ndo, " %u", *cp));
468 ND_PRINT((ndo, " invalid sack"));
472 ND_PRINT((ndo, " %d ", datalen / 8));
485 ND_PRINT((ndo, "{%u:%u}", s, e));
502 ND_PRINT((ndo, " %u", EXTRACT_32BITS(cp)));
508 ND_PRINT((ndo, " val %u ecr %u",
516 ND_PRINT((ndo, " "));
518 switch (tcp_verify_signature(ndo, ip, tp,
522 ND_PRINT((ndo, "valid"));
526 ND_PRINT((ndo, "invalid"));
530 ND_PRINT((ndo, "can't check - "));
532 ND_PRINT((ndo, "%02x", cp[i]));
537 ND_PRINT((ndo, "%02x", cp[i]));
544 ND_PRINT((ndo, " cap %02x id %u", cp[0], cp[1]));
555 ND_PRINT((ndo, " invalid"));
558 ND_PRINT((ndo, " keyid %u", cp[0]));
560 ND_PRINT((ndo, " rnextkeyid %u", cp[1]));
562 ND_PRINT((ndo, " mac 0x"));
565 ND_PRINT((ndo, "%02x", cp[i]));
584 ND_PRINT((ndo, " 0x%x", utoval));
589 ND_PRINT((ndo, " %u", utoval));
595 if (!mptcp_print(ndo, cp-2, len, flags))
602 ND_PRINT((ndo, " "));
603 print_tcp_fastopen_option(ndo, cp, datalen, FALSE);
613 ND_PRINT((ndo, "-"));
618 print_tcp_fastopen_option(ndo, cp + 2, datalen - 2, TRUE);
623 ND_PRINT((ndo, "%04x", magic));
631 ND_PRINT((ndo, " 0x"));
634 ND_PRINT((ndo, "%02x", cp[i]));
648 ND_PRINT((ndo, "[len %d]", len));
653 ND_PRINT((ndo, "]"));
659 ND_PRINT((ndo, ", length %u", length));
668 if ((flags & TH_RST) && ndo->ndo_vflag) {
669 print_tcp_rst_data(ndo, bp, length);
673 if (ndo->ndo_packettype) {
674 switch (ndo->ndo_packettype) {
676 zmtp1_print(ndo, bp, length);
679 resp_print(ndo, bp, length);
686 telnet_print(ndo, bp, length);
688 ND_PRINT((ndo, ": "));
689 smtp_print(ndo, bp, length);
691 bgp_print(ndo, bp, length);
693 pptp_print(ndo, bp);
695 resp_print(ndo, bp, length);
698 nbt_tcp_print(ndo, bp, length);
700 smb_tcp_print(ndo, bp, length);
703 beep_print(ndo, bp, length);
705 openflow_print(ndo, bp, length);
707 ND_PRINT((ndo, ": "));
708 ftp_print(ndo, bp, length);
710 ND_PRINT((ndo, ": "));
711 http_print(ndo, bp, length);
713 ND_PRINT((ndo, ": "));
714 rtsp_print(ndo, bp, length);
721 ND_PRINT((ndo, " "));
727 ns_print(ndo, bp + 2, length - 2, 0);
729 msdp_print(ndo, bp, length);
731 rpki_rtr_print(ndo, bp, length);
734 ldp_print(ndo, bp, length);
755 ND_PRINT((ndo, ": NFS request xid %u ", EXTRACT_32BITS(&rp->rm_xid)));
756 nfsreq_print_noaddr(ndo, (const u_char *)rp, fraglen, (const u_char *)ip);
760 ND_PRINT((ndo, ": NFS reply xid %u ", EXTRACT_32BITS(&rp->rm_xid)));
761 nfsreply_print_noaddr(ndo, (const u_char *)rp, fraglen, (const u_char *)ip);
769 ND_PRINT((ndo, "[bad opt]"));
771 ND_PRINT((ndo, ">"));
774 ND_PRINT((ndo, "[|tcp]"));
776 ND_PRINT((ndo, ">"));
795 print_tcp_rst_data(netdissect_options *ndo,
800 ND_PRINT((ndo, ND_TTEST2(*sp, length) ? " [RST" : " [!RST"));
803 ND_PRINT((ndo, "+")); /* indicate we truncate */
805 ND_PRINT((ndo, " "));
806 while (length-- && sp < ndo->ndo_snapend) {
808 safeputchar(ndo, c);
810 ND_PRINT((ndo, "]"));
814 print_tcp_fastopen_option(netdissect_options *ndo, register const u_char *cp,
820 ND_PRINT((ndo, "tfo"));
824 ND_PRINT((ndo, " cookiereq"));
828 ND_PRINT((ndo, " invalid"));
830 ND_PRINT((ndo, " cookie "));
832 ND_PRINT((ndo, "%02x", cp[i]));
840 tcp_verify_signature(netdissect_options *ndo,
853 if (data + length > ndo->ndo_snapend) {
854 ND_PRINT((ndo, "snaplen too short, "));
860 if (ndo->ndo_sigsecret == NULL) {
861 ND_PRINT((ndo, "shared secret not supplied with -M, "));
890 ND_PRINT((ndo, "IP version not 4 or 6, "));
910 MD5_Update(&ctx, ndo->ndo_sigsecret, strlen(ndo->ndo_sigsecret));