Lines Matching refs:ndo

414 handle_ctrl_proto(netdissect_options *ndo,  in handle_ctrl_proto()  argument
426 ND_PRINT((ndo, "%s, ", typestr)); in handle_ctrl_proto()
434 ND_PRINT((ndo, "%s (0x%02x), id %u, length %u", in handle_ctrl_proto()
440 if (!ndo->ndo_vflag) in handle_ctrl_proto()
450 ND_PRINT((ndo, "\n\tencoded length %u (=Option(s) length %u)", len, len - 4)); in handle_ctrl_proto()
452 if (ndo->ndo_vflag > 1) in handle_ctrl_proto()
453 print_unknown_data(ndo, pptr - 2, "\n\t", 6); in handle_ctrl_proto()
461 ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr))); in handle_ctrl_proto()
464 ND_PRINT((ndo, " Vendor: %s (%u)", in handle_ctrl_proto()
503 if ((j = (*pfunc)(ndo, tptr, len)) == 0) in handle_ctrl_proto()
521 ND_PRINT((ndo, "\n\t Rejected %s Protocol (0x%04x)", in handle_ctrl_proto()
526 ND_PRINT((ndo, "\n\t Rejected Packet")); in handle_ctrl_proto()
527 print_unknown_data(ndo, tptr + 2, "\n\t ", len - 2); in handle_ctrl_proto()
536 ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr))); in handle_ctrl_proto()
539 ND_PRINT((ndo, "\n\t -----trailing data-----")); in handle_ctrl_proto()
541 print_unknown_data(ndo, tptr + 4, "\n\t ", len - 8); in handle_ctrl_proto()
548 ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr))); in handle_ctrl_proto()
551 ND_PRINT((ndo, "\n\t Message\n\t ")); in handle_ctrl_proto()
552 if (fn_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend)) in handle_ctrl_proto()
560 ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr))); in handle_ctrl_proto()
562 ND_PRINT((ndo, ", Seconds-Remaining %us", EXTRACT_32BITS(tptr + 4))); in handle_ctrl_proto()
569 if (ndo->ndo_vflag <= 1) in handle_ctrl_proto()
570 print_unknown_data(ndo, pptr - 2, "\n\t ", length + 2); in handle_ctrl_proto()
576 ND_PRINT((ndo, "[|%s]", typestr)); in handle_ctrl_proto()
581 print_lcp_config_options(netdissect_options *ndo, in print_lcp_config_options() argument
595 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_lcp_config_options()
598 ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt)); in print_lcp_config_options()
602 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", lcpconfopts[opt], opt, len)); in print_lcp_config_options()
604 ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt)); in print_lcp_config_options()
611 ND_PRINT((ndo, " (length bogus, should be >= 6)")); in print_lcp_config_options()
615 ND_PRINT((ndo, ": Vendor: %s (%u)", in print_lcp_config_options()
620 ND_PRINT((ndo, ", kind: 0x%02x", p[5])); in print_lcp_config_options()
621 ND_PRINT((ndo, ", Value: 0x")); in print_lcp_config_options()
624 ND_PRINT((ndo, "%02x", p[6 + i])); in print_lcp_config_options()
630 ND_PRINT((ndo, " (length bogus, should be = 4)")); in print_lcp_config_options()
634 ND_PRINT((ndo, ": %u", EXTRACT_16BITS(p + 2))); in print_lcp_config_options()
638 ND_PRINT((ndo, " (length bogus, should be = 6)")); in print_lcp_config_options()
642 ND_PRINT((ndo, ": 0x%08x", EXTRACT_32BITS(p + 2))); in print_lcp_config_options()
646 ND_PRINT((ndo, " (length bogus, should be >= 4)")); in print_lcp_config_options()
650 …ND_PRINT((ndo, ": %s", tok2str(ppptype2str, "Unknown Auth Proto (0x04x)", EXTRACT_16BITS(p + 2)))); in print_lcp_config_options()
655 ND_PRINT((ndo, ", %s", tok2str(authalg_values, "Unknown Auth Alg %u", p[4]))); in print_lcp_config_options()
663 print_unknown_data(ndo, p, "\n\t", len); in print_lcp_config_options()
668 ND_PRINT((ndo, " (length bogus, should be >= 4)")); in print_lcp_config_options()
673 ND_PRINT((ndo, ": LQR")); in print_lcp_config_options()
675 ND_PRINT((ndo, ": unknown")); in print_lcp_config_options()
679 ND_PRINT((ndo, " (length bogus, should be = 6)")); in print_lcp_config_options()
683 ND_PRINT((ndo, ": 0x%08x", EXTRACT_32BITS(p + 2))); in print_lcp_config_options()
691 ND_PRINT((ndo, " (length bogus, should be = 4)")); in print_lcp_config_options()
695 ND_PRINT((ndo, ": 0x%04x", EXTRACT_16BITS(p + 2))); in print_lcp_config_options()
699 ND_PRINT((ndo, " (length bogus, should be >= 3)")); in print_lcp_config_options()
702 ND_PRINT((ndo, ": ")); in print_lcp_config_options()
704 ND_PRINT((ndo, ": Callback Operation %s (%u)", in print_lcp_config_options()
710 ND_PRINT((ndo, " (length bogus, should be = 4)")); in print_lcp_config_options()
714 ND_PRINT((ndo, ": %u", EXTRACT_16BITS(p + 2))); in print_lcp_config_options()
718 ND_PRINT((ndo, " (length bogus, should be >= 3)")); in print_lcp_config_options()
724 ND_PRINT((ndo, ": Null")); in print_lcp_config_options()
727 ND_PRINT((ndo, ": Local")); /* XXX */ in print_lcp_config_options()
731 ND_PRINT((ndo, " (length bogus, should be = 7)")); in print_lcp_config_options()
735 ND_PRINT((ndo, ": IPv4 %s", ipaddr_string(ndo, p + 3))); in print_lcp_config_options()
739 ND_PRINT((ndo, " (length bogus, should be = 9)")); in print_lcp_config_options()
743 ND_PRINT((ndo, ": MAC %s", etheraddr_string(ndo, p + 3))); in print_lcp_config_options()
746 ND_PRINT((ndo, ": Magic-Num-Block")); /* XXX */ in print_lcp_config_options()
749 ND_PRINT((ndo, ": PSNDN")); /* XXX */ in print_lcp_config_options()
752 ND_PRINT((ndo, ": Unknown class %u", p[2])); in print_lcp_config_options()
785 if (ndo->ndo_vflag < 2) in print_lcp_config_options()
786 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); in print_lcp_config_options()
790 if (ndo->ndo_vflag > 1) in print_lcp_config_options()
791 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); /* exclude TLV header */ in print_lcp_config_options()
796 ND_PRINT((ndo, "[|lcp]")); in print_lcp_config_options()
808 handle_mlppp(netdissect_options *ndo, in handle_mlppp() argument
811 if (!ndo->ndo_eflag) in handle_mlppp()
812 ND_PRINT((ndo, "MLPPP, ")); in handle_mlppp()
815 ND_PRINT((ndo, "[|mlppp]")); in handle_mlppp()
819 ND_PRINT((ndo, "[|mlppp]")); in handle_mlppp()
823 ND_PRINT((ndo, "seq 0x%03x, Flags [%s], length %u", in handle_mlppp()
831 handle_chap(netdissect_options *ndo, in handle_chap() argument
841 ND_PRINT((ndo, "[|chap]")); in handle_chap()
845 ND_PRINT((ndo, "[|chap 0x%02x]", *p)); in handle_chap()
851 ND_PRINT((ndo, "CHAP, %s (0x%02x)", in handle_chap()
857 ND_PRINT((ndo, ", id %u", *p)); /* ID */ in handle_chap()
881 ND_PRINT((ndo, ", Value ")); in handle_chap()
884 ND_PRINT((ndo, "%02x", *p++)); in handle_chap()
887 ND_PRINT((ndo, ", Name ")); in handle_chap()
890 safeputchar(ndo, *p++); in handle_chap()
896 ND_PRINT((ndo, ", Msg ")); in handle_chap()
899 safeputchar(ndo, *p++); in handle_chap()
906 ND_PRINT((ndo, "[|chap]")); in handle_chap()
911 handle_pap(netdissect_options *ndo, in handle_pap() argument
921 ND_PRINT((ndo, "[|pap]")); in handle_pap()
925 ND_PRINT((ndo, "[|pap 0x%02x]", *p)); in handle_pap()
931 ND_PRINT((ndo, "PAP, %s (0x%02x)", in handle_pap()
937 ND_PRINT((ndo, ", id %u", *p)); /* ID */ in handle_pap()
945 ND_PRINT((ndo, ", length %u > packet size", len)); in handle_pap()
950 ND_PRINT((ndo, ", length %u < PAP header length", length)); in handle_pap()
966 ND_PRINT((ndo, ", Peer ")); in handle_pap()
969 safeputchar(ndo, *p++); in handle_pap()
979 ND_PRINT((ndo, ", Name ")); in handle_pap()
982 safeputchar(ndo, *p++); in handle_pap()
1001 ND_PRINT((ndo, ", Msg ")); in handle_pap()
1004 safeputchar(ndo, *p++); in handle_pap()
1011 ND_PRINT((ndo, "[|pap]")); in handle_pap()
1016 handle_bap(netdissect_options *ndo _U_, in handle_bap()
1025 print_ipcp_config_options(netdissect_options *ndo, in print_ipcp_config_options() argument
1039 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ipcp_config_options()
1046 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", in print_ipcp_config_options()
1054 ND_PRINT((ndo, " (length bogus, should be = 10)")); in print_ipcp_config_options()
1058 ND_PRINT((ndo, ": src %s, dst %s", in print_ipcp_config_options()
1059 ipaddr_string(ndo, p + 2), in print_ipcp_config_options()
1060 ipaddr_string(ndo, p + 6))); in print_ipcp_config_options()
1064 ND_PRINT((ndo, " (length bogus, should be >= 4)")); in print_ipcp_config_options()
1070 ND_PRINT((ndo, ": %s (0x%02x):", in print_ipcp_config_options()
1080 ND_PRINT((ndo, " (length bogus, should be >= %u)", in print_ipcp_config_options()
1086 ND_PRINT((ndo, "\n\t TCP Space %u, non-TCP Space %u" \ in print_ipcp_config_options()
1099 … ND_PRINT((ndo, "\n\t Suboptions, length %u", ipcomp_subopttotallen)); in print_ipcp_config_options()
1112 ND_PRINT((ndo, "\n\t\t%s Suboption #%u, length %u", in print_ipcp_config_options()
1136 ND_PRINT((ndo, " (length bogus, should be = 6)")); in print_ipcp_config_options()
1140 ND_PRINT((ndo, ": %s", ipaddr_string(ndo, p + 2))); in print_ipcp_config_options()
1147 if (ndo->ndo_vflag < 2) in print_ipcp_config_options()
1148 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); in print_ipcp_config_options()
1151 if (ndo->ndo_vflag > 1) in print_ipcp_config_options()
1152 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); /* exclude TLV header */ in print_ipcp_config_options()
1156 ND_PRINT((ndo, "[|ipcp]")); in print_ipcp_config_options()
1162 print_ip6cp_config_options(netdissect_options *ndo, in print_ip6cp_config_options() argument
1175 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ip6cp_config_options()
1182 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", in print_ip6cp_config_options()
1190 ND_PRINT((ndo, " (length bogus, should be = 10)")); in print_ip6cp_config_options()
1194 ND_PRINT((ndo, ": %04x:%04x:%04x:%04x", in print_ip6cp_config_options()
1205 if (ndo->ndo_vflag < 2) in print_ip6cp_config_options()
1206 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); in print_ip6cp_config_options()
1209 if (ndo->ndo_vflag > 1) in print_ip6cp_config_options()
1210 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); /* exclude TLV header */ in print_ip6cp_config_options()
1215 ND_PRINT((ndo, "[|ip6cp]")); in print_ip6cp_config_options()
1222 print_ccp_config_options(netdissect_options *ndo, in print_ccp_config_options() argument
1235 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ccp_config_options()
1242 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", in print_ccp_config_options()
1250 ND_PRINT((ndo, " (length bogus, should be >= 3)")); in print_ccp_config_options()
1254 ND_PRINT((ndo, ": Version: %u, Dictionary Bits: %u", in print_ccp_config_options()
1259 ND_PRINT((ndo, " (length bogus, should be >= 4)")); in print_ccp_config_options()
1263 ND_PRINT((ndo, ": Features: %u, PxP: %s, History: %u, #CTX-ID: %u", in print_ccp_config_options()
1270 ND_PRINT((ndo, " (length bogus, should be >= 4)")); in print_ccp_config_options()
1274 ND_PRINT((ndo, ": Window: %uK, Method: %s (0x%x), MBZ: %u, CHK: %u", in print_ccp_config_options()
1301 if (ndo->ndo_vflag < 2) in print_ccp_config_options()
1302 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); in print_ccp_config_options()
1305 if (ndo->ndo_vflag > 1) in print_ccp_config_options()
1306 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); /* exclude TLV header */ in print_ccp_config_options()
1311 ND_PRINT((ndo, "[|ccp]")); in print_ccp_config_options()
1317 print_bacp_config_options(netdissect_options *ndo, in print_bacp_config_options() argument
1330 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_bacp_config_options()
1337 ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", in print_bacp_config_options()
1345 ND_PRINT((ndo, " (length bogus, should be = 6)")); in print_bacp_config_options()
1349 ND_PRINT((ndo, ": Magic-Num 0x%08x", EXTRACT_32BITS(p + 2))); in print_bacp_config_options()
1356 if (ndo->ndo_vflag < 2) in print_bacp_config_options()
1357 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); in print_bacp_config_options()
1360 if (ndo->ndo_vflag > 1) in print_bacp_config_options()
1361 print_unknown_data(ndo, &p[2], "\n\t ", len - 2); /* exclude TLV header */ in print_bacp_config_options()
1366 ND_PRINT((ndo, "[|bacp]")); in print_bacp_config_options()
1371 ppp_hdlc(netdissect_options *ndo, in ppp_hdlc() argument
1402 se = ndo->ndo_snapend; in ppp_hdlc()
1403 ndo->ndo_snapend = t; in ppp_hdlc()
1413 ip_print(ndo, b + 1, length - 1); in ppp_hdlc()
1416 ip6_print(ndo, b + 1, length - 1); in ppp_hdlc()
1431 handle_ppp(ndo, proto, b + 4, length - 4); in ppp_hdlc()
1434 handle_ppp(ndo, proto, b + 2, length - 2); in ppp_hdlc()
1439 ndo->ndo_snapend = se; in ppp_hdlc()
1444 ndo->ndo_snapend = se; in ppp_hdlc()
1446 ND_PRINT((ndo, "[|ppp]")); in ppp_hdlc()
1452 handle_ppp(netdissect_options *ndo, in handle_ppp() argument
1456 ppp_hdlc(ndo, p - 1, length); in handle_ppp()
1468 handle_ctrl_proto(ndo, proto, p, length); in handle_ppp()
1471 handle_mlppp(ndo, p, length); in handle_ppp()
1474 handle_chap(ndo, p, length); in handle_ppp()
1477 handle_pap(ndo, p, length); in handle_ppp()
1480 handle_bap(ndo, p, length); in handle_ppp()
1485 ip_print(ndo, p, length); in handle_ppp()
1489 ip6_print(ndo, p, length); in handle_ppp()
1493 ipx_print(ndo, p, length); in handle_ppp()
1496 isoclns_print(ndo, p, length); in handle_ppp()
1500 mpls_print(ndo, p, length); in handle_ppp()
1503 ND_PRINT((ndo, "compressed PPP data")); in handle_ppp()
1506 ND_PRINT((ndo, "%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto))); in handle_ppp()
1507 print_unknown_data(ndo, p, "\n\t", length); in handle_ppp()
1514 ppp_print(netdissect_options *ndo, in ppp_print() argument
1532 if (ndo->ndo_eflag) ND_PRINT((ndo, "In ")); in ppp_print()
1538 if (ndo->ndo_eflag) ND_PRINT((ndo, "Out ")); in ppp_print()
1569 if (ndo->ndo_eflag) in ppp_print()
1570 ND_PRINT((ndo, "%s (0x%04x), length %u: ", in ppp_print()
1575 handle_ppp(ndo, proto, p, length); in ppp_print()
1578 ND_PRINT((ndo, "[|ppp]")); in ppp_print()
1585 ppp_if_print(netdissect_options *ndo, in ppp_if_print() argument
1592 ND_PRINT((ndo, "[|ppp]")); in ppp_if_print()
1633 if (ndo->ndo_eflag) in ppp_if_print()
1634 ND_PRINT((ndo, "%c %4d %02x ", p[0] ? 'O' : 'I', length, p[1])); in ppp_if_print()
1637 ppp_print(ndo, p, length); in ppp_if_print()
1652 ppp_hdlc_if_print(netdissect_options *ndo, in ppp_hdlc_if_print() argument
1661 ND_PRINT((ndo, "[|ppp]")); in ppp_hdlc_if_print()
1669 ND_PRINT((ndo, "[|ppp]")); in ppp_hdlc_if_print()
1673 if (ndo->ndo_eflag) in ppp_hdlc_if_print()
1674 ND_PRINT((ndo, "%02x %02x %d ", p[0], p[1], length)); in ppp_hdlc_if_print()
1683 ND_PRINT((ndo, "%s: ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto))); in ppp_hdlc_if_print()
1685 handle_ppp(ndo, proto, p, length); in ppp_hdlc_if_print()
1690 return (chdlc_if_print(ndo, h, p)); in ppp_hdlc_if_print()
1694 ND_PRINT((ndo, "[|ppp]")); in ppp_hdlc_if_print()
1698 if (ndo->ndo_eflag) in ppp_hdlc_if_print()
1699 ND_PRINT((ndo, "%02x %02x %d ", p[0], p[1], length)); in ppp_hdlc_if_print()
1708 ND_PRINT((ndo, "unknown addr %02x; ctrl %02x", p[0], p[1])); in ppp_hdlc_if_print()
1719 ppp_bsdos_if_print(netdissect_options *ndo _U_, in ppp_bsdos_if_print()
1731 ND_PRINT((ndo, "[|ppp]")); in ppp_bsdos_if_print()
1739 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1740 ND_PRINT((ndo, "%02x %02x ", p[0], p[1])); in ppp_bsdos_if_print()
1745 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1746 ND_PRINT((ndo, "%d ", length)); in ppp_bsdos_if_print()
1751 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1752 ND_PRINT((ndo, "%02x ", ptype)); in ppp_bsdos_if_print()
1758 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1759 ND_PRINT((ndo, "%04x ", ptype)); in ppp_bsdos_if_print()
1765 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1766 ND_PRINT((ndo, "%c ", p[SLC_DIR] ? 'O' : 'I')); in ppp_bsdos_if_print()
1775 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1776 ND_PRINT((ndo, "%02x %02x ", q[0], q[1])); in ppp_bsdos_if_print()
1778 if (ndo->ndo_eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) { in ppp_bsdos_if_print()
1779 ND_PRINT((ndo, "%s ", tok2str(ppptype2str, in ppp_bsdos_if_print()
1783 if (ndo->ndo_eflag) { in ppp_bsdos_if_print()
1784 ND_PRINT((ndo, "LLH=[")); in ppp_bsdos_if_print()
1786 ND_PRINT((ndo, "%02x", q[i])); in ppp_bsdos_if_print()
1787 ND_PRINT((ndo, "] ")); in ppp_bsdos_if_print()
1791 if (ndo->ndo_eflag) in ppp_bsdos_if_print()
1792 ND_PRINT((ndo, "%d ", length)); in ppp_bsdos_if_print()
1798 ptype = vjc_print(ndo, q, ptype); in ppp_bsdos_if_print()
1803 ip_print(ndo, p, length); in ppp_bsdos_if_print()
1806 ip6_print(ndo, p, length); in ppp_bsdos_if_print()
1810 mpls_print(ndo, p, length); in ppp_bsdos_if_print()
1815 ptype = vjc_print(ndo, q, ptype); in ppp_bsdos_if_print()
1820 ip_print(ndo, p, length); in ppp_bsdos_if_print()
1823 ip6_print(ndo, p, length); in ppp_bsdos_if_print()
1827 mpls_print(ndo, p, length); in ppp_bsdos_if_print()
1832 if (ndo->ndo_eflag) { in ppp_bsdos_if_print()
1833 ND_PRINT((ndo, "CH=[")); in ppp_bsdos_if_print()
1835 ND_PRINT((ndo, "%02x", q[i])); in ppp_bsdos_if_print()
1836 ND_PRINT((ndo, "] ")); in ppp_bsdos_if_print()
1853 ip6_print(ndo, p, length); in ppp_bsdos_if_print()
1857 mpls_print(ndo, p, length); in ppp_bsdos_if_print()
1860 ND_PRINT((ndo, "%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype))); in ppp_bsdos_if_print()