Lines Matching full:length
410 static void handle_ppp(netdissect_options *, u_int proto, const u_char *p, u_int length);
415 u_int proto, const u_char *pptr, u_int length) in handle_ctrl_proto() argument
428 if (length < 4) /* FIXME weak boundary checking */ in handle_ctrl_proto()
435 ND_PRINT("%s (0x%02x), id %u, length %u", in handle_ctrl_proto()
439 length + 2); in handle_ctrl_proto()
449 ND_PRINT("\n\tencoded length %u (< 4))", len); in handle_ctrl_proto()
453 if (len > length) { in handle_ctrl_proto()
454 ND_PRINT("\n\tencoded length %u (> packet length %u))", len, length); in handle_ctrl_proto()
457 length = len; in handle_ctrl_proto()
459 ND_PRINT("\n\tencoded length %u (=Option(s) length %u)", len, len - 4); in handle_ctrl_proto()
461 if (length == 4) in handle_ctrl_proto()
470 if (length < 11) in handle_ctrl_proto()
483 tlen = len - 4; /* Code(1), Identifier(1) and Length(2) */ in handle_ctrl_proto()
516 ND_PRINT(" [remaining options length %u < %u]", in handle_ctrl_proto()
534 if (length < 6) in handle_ctrl_proto()
548 if (length < 8) in handle_ctrl_proto()
559 if (length < 8) in handle_ctrl_proto()
570 if (length < 12) in handle_ctrl_proto()
581 print_unknown_data(ndo, pptr - 2, "\n\t ", length + 2); in handle_ctrl_proto()
593 const u_char *p, u_int length) in print_lcp_config_options() argument
597 if (length < 2) in print_lcp_config_options()
602 if (length < len) in print_lcp_config_options()
606 ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_lcp_config_options()
613 ND_PRINT("\n\t %s Option (0x%02x), length %u", lcpconfopts[opt], opt, len); in print_lcp_config_options()
622 ND_PRINT(" (length bogus, should be >= 6)"); in print_lcp_config_options()
638 ND_PRINT(" (length bogus, should be = 4)"); in print_lcp_config_options()
645 ND_PRINT(" (length bogus, should be = 6)"); in print_lcp_config_options()
652 ND_PRINT(" (length bogus, should be >= 4)"); in print_lcp_config_options()
674 ND_PRINT(" (length bogus, should be >= 4)"); in print_lcp_config_options()
684 ND_PRINT(" (length bogus, should be = 6)"); in print_lcp_config_options()
695 ND_PRINT(" (length bogus, should be = 4)"); in print_lcp_config_options()
702 ND_PRINT(" (length bogus, should be >= 3)"); in print_lcp_config_options()
711 ND_PRINT(" (length bogus, should be = 4)"); in print_lcp_config_options()
718 ND_PRINT(" (length bogus, should be >= 3)"); in print_lcp_config_options()
730 ND_PRINT(" (length bogus, should be = 7)"); in print_lcp_config_options()
737 ND_PRINT(" (length bogus, should be = 9)"); in print_lcp_config_options()
806 const u_char *p, u_int length) in handle_mlppp() argument
811 if (length < 2) { in handle_mlppp()
820 ND_PRINT("seq 0x%03x, Flags [%s], length %u", in handle_mlppp()
824 length); in handle_mlppp()
830 const u_char *p, u_int length) in handle_chap() argument
838 if (length < 1) { in handle_chap()
841 } else if (length < 4) { in handle_chap()
868 if (length - (p - p0) < 1) in handle_chap()
872 if (length - (p - p0) < val_size) in handle_chap()
901 const u_char *p, u_int length) in handle_pap() argument
909 if (length < 1) { in handle_pap()
912 } else if (length < 4) { in handle_pap()
929 if (len > length) { in handle_pap()
930 ND_PRINT(", length %u > packet size", len); in handle_pap()
933 length = len; in handle_pap()
934 if (length < (size_t)(p - p0)) { in handle_pap()
935 ND_PRINT(", length %u < PAP header length", length); in handle_pap()
944 if (length - (p - p0) < 1) in handle_pap()
946 peerid_len = GET_U_1(p); /* Peer-ID Length */ in handle_pap()
948 if (length - (p - p0) < peerid_len) in handle_pap()
956 if (length - (p - p0) < 1) in handle_pap()
958 passwd_len = GET_U_1(p); /* Password Length */ in handle_pap()
960 if (length - (p - p0) < passwd_len) in handle_pap()
977 if (length - (p - p0) < 1) in handle_pap()
979 msg_len = GET_U_1(p); /* Msg-Length */ in handle_pap()
981 if (length - (p - p0) < msg_len) in handle_pap()
999 const u_char *p _U_, u_int length _U_) in handle_bap()
1008 const u_char *p, u_int length) in print_ipcp_config_options() argument
1013 if (length < 2) in print_ipcp_config_options()
1018 if (length < len) in print_ipcp_config_options()
1021 ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ipcp_config_options()
1028 ND_PRINT("\n\t %s Option (0x%02x), length %u", in print_ipcp_config_options()
1036 ND_PRINT(" (length bogus, should be = 10)"); in print_ipcp_config_options()
1045 ND_PRINT(" (length bogus, should be >= 4)"); in print_ipcp_config_options()
1060 ND_PRINT(" (length bogus, should be >= %u)", in print_ipcp_config_options()
1079 ND_PRINT("\n\t Suboptions, length %u", ipcomp_subopttotallen); in print_ipcp_config_options()
1092 ND_PRINT("\n\t\t%s Suboption #%u, length %u", in print_ipcp_config_options()
1099 ND_PRINT(" [remaining suboptions length %u < %u]", in print_ipcp_config_options()
1121 ND_PRINT(" (length bogus, should be = 6)"); in print_ipcp_config_options()
1147 const u_char *p, u_int length) in print_ip6cp_config_options() argument
1151 if (length < 2) in print_ip6cp_config_options()
1156 if (length < len) in print_ip6cp_config_options()
1159 ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ip6cp_config_options()
1166 ND_PRINT("\n\t %s Option (0x%02x), length %u", in print_ip6cp_config_options()
1174 ND_PRINT(" (length bogus, should be = 10)"); in print_ip6cp_config_options()
1207 const u_char *p, u_int length) in print_ccp_config_options() argument
1211 if (length < 2) in print_ccp_config_options()
1216 if (length < len) in print_ccp_config_options()
1219 ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_ccp_config_options()
1226 ND_PRINT("\n\t %s Option (0x%02x), length %u", in print_ccp_config_options()
1234 ND_PRINT(" (length bogus, should be >= 3)"); in print_ccp_config_options()
1243 ND_PRINT(" (length bogus, should be >= 4)"); in print_ccp_config_options()
1254 ND_PRINT(" (length bogus, should be >= 4)"); in print_ccp_config_options()
1303 const u_char *p, u_int length) in print_bacp_config_options() argument
1307 if (length < 2) in print_bacp_config_options()
1312 if (length < len) in print_bacp_config_options()
1315 ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", in print_bacp_config_options()
1322 ND_PRINT("\n\t %s Option (0x%02x), length %u", in print_bacp_config_options()
1330 ND_PRINT(" (length bogus, should be = 6)"); in print_bacp_config_options()
1356 * The length argument is the on-the-wire length, not the captured
1357 * length; we can only un-escape the captured part.
1361 const u_char *p, u_int length) in ppp_hdlc() argument
1371 if (length == 0) in ppp_hdlc()
1408 length = ND_BYTES_AVAILABLE_AFTER(b); in ppp_hdlc()
1411 if (length < 1) in ppp_hdlc()
1417 ip_print(ndo, b + 1, length - 1); in ppp_hdlc()
1420 ip6_print(ndo, b + 1, length - 1); in ppp_hdlc()
1426 if (length < 2) in ppp_hdlc()
1432 if (length < 4) in ppp_hdlc()
1438 handle_ppp(ndo, proto, b + 4, length - 4); in ppp_hdlc()
1444 handle_ppp(ndo, proto, b + 2, length - 2); in ppp_hdlc()
1461 u_int proto, const u_char *p, u_int length) in handle_ppp() argument
1464 ppp_hdlc(ndo, p - 1, length); in handle_ppp()
1476 handle_ctrl_proto(ndo, proto, p, length); in handle_ppp()
1479 handle_mlppp(ndo, p, length); in handle_ppp()
1482 handle_chap(ndo, p, length); in handle_ppp()
1485 handle_pap(ndo, p, length); in handle_ppp()
1488 handle_bap(ndo, p, length); in handle_ppp()
1493 ip_print(ndo, p, length); in handle_ppp()
1497 ip6_print(ndo, p, length); in handle_ppp()
1501 ipx_print(ndo, p, length); in handle_ppp()
1504 isoclns_print(ndo, p, length); in handle_ppp()
1508 mpls_print(ndo, p, length); in handle_ppp()
1515 print_unknown_data(ndo, p, "\n\t", length); in handle_ppp()
1523 const u_char *p, u_int length) in ppp_print() argument
1526 u_int olen = length; /* _o_riginal length */ in ppp_print()
1534 if (length < 2) in ppp_print()
1542 length -= 2; in ppp_print()
1548 length -= 2; in ppp_print()
1553 length -= 2; in ppp_print()
1561 if (length < 2) in ppp_print()
1566 length--; in ppp_print()
1571 length -= 2; in ppp_print()
1578 ND_PRINT("%s (0x%04x), length %u", in ppp_print()
1588 handle_ppp(ndo, proto, p, length); in ppp_print()
1601 u_int length = h->len; in ppp_if_print() local
1651 length, GET_U_1(p + 1)); in ppp_if_print()
1654 ppp_print(ndo, p, length); in ppp_if_print()
1670 u_int length = h->len; in ppp_hdlc_if_print() local
1693 GET_U_1(p + 1), length); in ppp_hdlc_if_print()
1695 length -= 2; in ppp_hdlc_if_print()
1700 length -= 2; in ppp_hdlc_if_print()
1704 handle_ppp(ndo, proto, p, length); in ppp_hdlc_if_print()
1721 GET_U_1(p + 1), length); in ppp_hdlc_if_print()
1747 u_int length = h->len; in ppp_bsdos_if_print() local
1774 ND_PRINT("%u ", length); in ppp_bsdos_if_print()
1822 ND_PRINT("%u ", length); in ppp_bsdos_if_print()
1833 ip_print(ndo, p, length); in ppp_bsdos_if_print()
1836 ip6_print(ndo, p, length); in ppp_bsdos_if_print()
1840 mpls_print(ndo, p, length); in ppp_bsdos_if_print()
1850 ip_print(ndo, p, length); 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()
1876 length -= hdrlength; in ppp_bsdos_if_print()
1881 ip_print(p, length); in ppp_bsdos_if_print()
1884 ip6_print(ndo, p, length); in ppp_bsdos_if_print()
1888 mpls_print(ndo, p, length); in ppp_bsdos_if_print()