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