Lines Matching +full:ext +full:- +full:32 +full:k

37 #include "netdissect-stdinc.h"
41 #include "netdissect-ctype.h"
58 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
61 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
64 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
66 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
70 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
123 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
129 nd_uint8_t critical; /* bit 7 - critical, rest is RESERVED */
135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
144 nd_uint16_t type; /* defined by DOI-spec, and Attribute Format */
151 /* MAY NOT be used, because of being defined in ipsec-doi. */
195 nd_uint8_t t_id; /* Transform-Id */
207 /* MUST NOT to be used, because of being defined in ipsec-doi. */
224 certificate or certificate-related information contained in the
235 -- Contains a list of the types of certificates requested,
268 nd_uint8_t prot_id; /* Protocol-ID */
276 /* NOTIFY MESSAGES - ERROR TYPES */
308 nd_uint8_t prot_id; /* Protocol-Id */
316 /* 3.3 Security Association Payload -- generic header */
373 nd_uint8_t prot_id; /* Protocol-ID */
415 nd_uint8_t auth_method; /* Protocol-ID */
508 #define IPSECDOI_ATTR_AUTH_KPDK 4 /*RFC-1826(Key/Pad/Data/Key)*/
555 /* Notify Messages - Status Types */
562 const struct isakmp_gen *ext, \
600 const struct isakmp_gen *ext,
615 u_char np, const struct isakmp_gen *ext,
643 NULL, "isakmp", "ipsec-ah", "ipsec-esp", "ipcomp",
646 /* isakmp->np */
648 "none", "sa", "p", "t", "ke", "id", "cert", "cr", "hash", /* 0 - 8 */
649 "sig", "nonce", "n", "d", "vid", /* 9 - 13 */
650 "pay14", "pay15", "pay16", "pay17", "pay18", /* 14- 18 */
651 "pay19", "pay20", "pay21", "pay22", "pay23", /* 19- 23 */
652 "pay24", "pay25", "pay26", "pay27", "pay28", /* 24- 28 */
653 "pay29", "pay30", "pay31", "pay32", /* 29- 32 */
654 "v2sa", "v2ke", "v2IDi", "v2IDr", "v2cert",/* 33- 37 */
655 "v2cr", "v2auth","v2nonce", "v2n", "v2d", /* 38- 42 */
656 "v2vid", "v2TSi", "v2TSr", "v2e", "v2cp", /* 43- 47 */
661 /* isakmp->np */
663 const struct isakmp_gen *ext,
683 NULL, NULL, NULL, NULL, NULL, /* 14- 18 */
684 NULL, NULL, NULL, NULL, NULL, /* 19- 23 */
685 NULL, NULL, NULL, NULL, NULL, /* 24- 28 */
686 NULL, NULL, NULL, NULL, /* 29- 32 */
700 NULL, /* ikev2_e_print,*/ /* 46 - special */
705 /* isakmp->etype */
708 "none", "base", "ident", "auth", "agg", "inf", NULL, NULL, /* 0-7 */
709 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8-15 */
710 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 16-23 */
711 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 24-31 */
712 "oakley-quick", "oakley-newgroup", /* 32-33 */
714 "ikev2_init", "ikev2_auth", "child_sa", "inf2" /* 34-37 */
741 l--;
757 return -1;
779 ip->ip_src, sizeof(nd_ipv4));
781 ip->ip_dst, sizeof(nd_ipv4));
787 ip6->ip6_src, sizeof(nd_ipv6));
789 ip6->ip6_dst, sizeof(nd_ipv6));
812 if (UNALIGNED_MEMCMP(ip->ip_src, &cookiecache[i].iaddr.in4, sizeof(nd_ipv4)) == 0)
815 if (UNALIGNED_MEMCMP(ip->ip_src, &cookiecache[i].raddr.in4, sizeof(nd_ipv4)) == 0)
824 if (UNALIGNED_MEMCMP(ip6->ip6_src, &cookiecache[i].iaddr.in6, sizeof(nd_ipv6)) == 0)
827 if (UNALIGNED_MEMCMP(ip6->ip6_src, &cookiecache[i].raddr.in6, sizeof(nd_ipv6)) == 0)
868 const u_char *end = ep - 20;
870 size_t len = ep - cp;
878 elen = ep - end;
936 ND_PRINT("len=%u value=", totlen - 4);
937 if (!rawprint(ndo, (const uint8_t *)(p + 4), totlen - 4)) {
976 ND_PRINT("len=%u value=", totlen - 4);
977 if (!rawprint(ndo, (const uint8_t *)(p + 4), totlen - 4)) {
991 const struct isakmp_gen *ext,
1003 p = (const struct ikev1_pl_sa *)ext;
1005 doi = GET_BE_U_4(p->doi);
1006 sit = GET_BE_U_4(p->sit);
1027 np = (const u_char *)ext + sizeof(struct ikev1_pl_sa);
1029 ident = GET_BE_U_4(ext + 1);
1034 ext = (const struct isakmp_gen *)np;
1035 ND_TCHECK_SIZE(ext);
1037 cp = ikev1_sub_print(ndo, ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0,
1048 const struct isakmp_gen *ext, u_int item_len _U_,
1058 p = (const struct ikev1_pl_p *)ext;
1061 GET_U_1(p->p_no), PROTOIDSTR(GET_U_1(p->prot_id)),
1062 GET_U_1(p->num_t));
1063 spi_size = GET_U_1(p->spi_size);
1070 ext = (const struct isakmp_gen *)((const u_char *)(p + 1) + spi_size);
1071 ND_TCHECK_SIZE(ext);
1073 cp = ikev1_sub_print(ndo, ISAKMP_NPTYPE_T, ext, ep, phase, doi0,
1074 GET_U_1(p->prot_id), depth);
1092 "sha2-256", "sha2-384", "sha2-512",
1096 NULL, "hmac-md5", "hmac-sha", "hmac-tiger",
1101 NULL, "hmac-md5", "hmac-sha", "dec-mac",
1102 "kpdk-md5", "aes-xcbc"
1106 "no-esn", "esn"
1115 "iana-grp06", "iana-grp07", /* reserved */
1116 "iana-grp08", "iana-grp09",
1117 "iana-grp10", "iana-grp11",
1118 "iana-grp12", "iana-grp13",
1127 NULL, "1des-iv64", "1des", "3des", "rc5", "idea", "cast",
1128 "blowfish", "3idea", "1des-iv32", "rc4", "null", "aes"
1144 "iana-grp06", "iana-grp07", /* reserved */
1145 "iana-grp08", "iana-grp09",
1146 "iana-grp10", "iana-grp11",
1147 "iana-grp12", "iana-grp13",
1155 { "auth", 5, { NULL, "hmac-md5", "hmac-sha1", "1des-mac", "keyed", }, },
1178 "sha2-256", "sha2-384", "sha2-512", }, },
1186 "iana-grp06", "iana-grp07", /* reserved */
1187 "iana-grp08", "iana-grp09",
1188 "iana-grp10", "iana-grp11",
1189 "iana-grp12", "iana-grp13",
1212 const struct isakmp_gen *ext, u_int item_len,
1225 p = (const struct ikev1_pl_t *)ext;
1230 idstr = STR_OR_ID(GET_U_1(p->t_id), ikev1_p_map);
1235 idstr = STR_OR_ID(GET_U_1(p->t_id), ah_p_map);
1240 idstr = STR_OR_ID(GET_U_1(p->t_id), esp_p_map);
1245 idstr = STR_OR_ID(GET_U_1(p->t_id), ipcomp_p_map);
1257 ND_PRINT(" #%u id=%s ", GET_U_1(p->t_no), idstr);
1259 ND_PRINT(" #%u id=%u ", GET_U_1(p->t_no), GET_U_1(p->t_id));
1280 const struct isakmp_gen *ext, u_int item_len,
1286 ND_TCHECK_SIZE(ext);
1290 ND_PRINT(" key len=%u", item_len - 4);
1291 if (2 < ndo->ndo_vflag && item_len > 4) {
1294 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1297 return (const u_char *)ext + item_len;
1305 const struct isakmp_gen *ext, u_int item_len,
1324 p = (const struct ikev1_pl_id *)ext;
1328 len = item_len - sizeof(*p);
1343 STR_OR_ID(GET_U_1(p->d.id_type), idtypestr));
1345 GET_BE_U_4(p->d.doi_data) & 0xffffff);
1357 doi_p = (const struct ipsecdoi_id *)ext;
1359 type = GET_U_1(doi_p->type);
1362 proto_id = GET_U_1(doi_p->proto_id);
1363 if (!ndo->ndo_nflag && proto_id && (p_name = netdb_protoname(proto_id)) != NULL)
1367 ND_PRINT(" port=%u", GET_BE_U_2(doi_p->port));
1417 if (len < 32)
1418 ND_PRINT(" len=%u [bad: < 32]", len);
1447 ND_PRINT(" len=%u %s-%s", len,
1454 if (len < 32)
1455 ND_PRINT(" len=%u [bad: < 32]", len);
1457 ND_PRINT(" len=%u %s-%s", len,
1473 if (2 < ndo->ndo_vflag) {
1479 return (const u_char *)ext + item_len;
1487 const struct isakmp_gen *ext, u_int item_len,
1501 p = (const struct ikev1_pl_cert *)ext;
1506 ND_PRINT(" len=%u", item_len - 4);
1507 ND_PRINT(" type=%s", STR_OR_ID(GET_U_1(p->encode), certstr));
1508 if (2 < ndo->ndo_vflag && 4 < item_len) {
1511 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1514 return (const u_char *)ext + item_len;
1522 const struct isakmp_gen *ext, u_int item_len,
1535 p = (const struct ikev1_pl_cert *)ext;
1540 ND_PRINT(" len=%u", item_len - 4);
1541 ND_PRINT(" type=%s", STR_OR_ID(GET_U_1(p->encode), certstr));
1542 if (2 < ndo->ndo_vflag && 4 < item_len) {
1545 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1548 return (const u_char *)ext + item_len;
1556 const struct isakmp_gen *ext, u_int item_len,
1562 ND_TCHECK_SIZE(ext);
1566 ND_PRINT(" len=%u", item_len - 4);
1567 if (2 < ndo->ndo_vflag && 4 < item_len) {
1570 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1573 return (const u_char *)ext + item_len;
1581 const struct isakmp_gen *ext, u_int item_len,
1587 ND_TCHECK_SIZE(ext);
1591 ND_PRINT(" len=%u", item_len - 4);
1592 if (2 < ndo->ndo_vflag && 4 < item_len) {
1595 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1598 return (const u_char *)ext + item_len;
1606 const struct isakmp_gen *ext,
1614 ND_TCHECK_SIZE(ext);
1618 ND_PRINT(" n len=%u", item_len - 4);
1620 if (ndo->ndo_vflag > 2) {
1622 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1624 } else if (ndo->ndo_vflag > 1) {
1626 if (!ike_show_somedata(ndo, (const u_char *)(ext + 1), ep))
1630 return (const u_char *)ext + item_len;
1638 const struct isakmp_gen *ext, u_int item_len,
1650 NULL, "INVALID-PAYLOAD-TYPE",
1651 "DOI-NOT-SUPPORTED", "SITUATION-NOT-SUPPORTED",
1652 "INVALID-COOKIE", "INVALID-MAJOR-VERSION",
1653 "INVALID-MINOR-VERSION", "INVALID-EXCHANGE-TYPE",
1654 "INVALID-FLAGS", "INVALID-MESSAGE-ID",
1655 "INVALID-PROTOCOL-ID", "INVALID-SPI",
1656 "INVALID-TRANSFORM-ID", "ATTRIBUTES-NOT-SUPPORTED",
1657 "NO-PROPOSAL-CHOSEN", "BAD-PROPOSAL-SYNTAX",
1658 "PAYLOAD-MALFORMED", "INVALID-KEY-INFORMATION",
1659 "INVALID-ID-INFORMATION", "INVALID-CERT-ENCODING",
1660 "INVALID-CERTIFICATE", "CERT-TYPE-UNSUPPORTED",
1661 "INVALID-CERT-AUTHORITY", "INVALID-HASH-INFORMATION",
1662 "AUTHENTICATION-FAILED", "INVALID-SIGNATURE",
1663 "ADDRESS-NOTIFICATION", "NOTIFY-SA-LIFETIME",
1664 "CERTIFICATE-UNAVAILABLE", "UNSUPPORTED-EXCHANGE-TYPE",
1665 "UNEQUAL-PAYLOAD-LENGTHS",
1674 "RESPONDER-LIFETIME", "REPLAY-STATUS",
1675 "INITIAL-CONTACT",
1679 /* 0 - 8191 */
1683 /* 8192 - 16383 */
1685 STR_OR_ID((u_int)((x) - 8192), ipsec_notify_error_str)
1687 /* 16384 - 24575 */
1689 STR_OR_ID((u_int)((x) - 16384), notify_status_str)
1691 /* 24576 - 32767 */
1693 STR_OR_ID((u_int)((x) - 24576), ipsec_notify_status_str)
1697 p = (const struct ikev1_pl_n *)ext;
1699 doi = GET_BE_U_4(p->doi);
1700 proto = GET_U_1(p->prot_id);
1704 type = GET_BE_U_2(p->type);
1713 spi_size = GET_U_1(p->spi_size);
1724 type = GET_BE_U_2(p->type);
1735 spi_size = GET_U_1(p->spi_size);
1770 * XXX - fill in more types here; see, for example,
1771 * draft-ietf-ipsec-notifymsg-04.
1773 if (ndo->ndo_vflag > 3) {
1775 if (!rawprint(ndo, (const uint8_t *)(cp), ep - cp))
1785 return (const u_char *)ext + item_len;
1793 const struct isakmp_gen *ext, u_int item_len _U_,
1807 p = (const struct ikev1_pl_d *)ext;
1809 doi = GET_BE_U_4(p->doi);
1810 proto = GET_U_1(p->prot_id);
1818 spi_size = GET_U_1(p->spi_size);
1820 num_spi = GET_BE_U_2(p->num_spi);
1841 const struct isakmp_gen *ext,
1848 ND_TCHECK_SIZE(ext);
1852 ND_PRINT(" len=%u", item_len - 4);
1853 if (2 < ndo->ndo_vflag && 4 < item_len) {
1856 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1859 return (const u_char *)ext + item_len;
1867 /* IKE v2 - rfc4306 - dissector */
1879 const struct isakmp_gen *ext, u_int item_len)
1881 const struct isakmp_gen *p = (const struct isakmp_gen *)ext;
1883 ND_TCHECK_SIZE(ext);
1884 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(p->critical));
1889 ND_PRINT(" len=%u", item_len - 4);
1890 if (2 < ndo->ndo_vflag && 4 < item_len) {
1893 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
1896 return (const u_char *)ext + item_len;
1904 const struct isakmp_gen *ext, u_int item_len,
1916 p = (const struct ikev2_t *)ext;
1918 ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_T), GET_U_1(p->h.critical));
1920 t_id = GET_BE_U_2(p->t_id);
1925 t_type = GET_U_1(p->t_type);
1982 const struct isakmp_gen *ext, u_int oprop_length,
1994 p = (const struct ikev2_p *)ext;
1997 ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_P), GET_U_1(p->h.critical));
2002 prop_length = oprop_length - 4;
2004 GET_U_1(p->p_no), PROTOIDSTR(GET_U_1(p->prot_id)),
2005 GET_U_1(p->num_t), oprop_length);
2008 spi_size = GET_U_1(p->spi_size);
2016 prop_length -= spi_size;
2023 for (np = ISAKMP_NPTYPE_T; np != 0; np = GET_U_1(ext->np)) {
2025 ext = (const struct isakmp_gen *)cp;
2026 if (prop_length < sizeof(*ext))
2028 ND_TCHECK_SIZE(ext);
2034 * zero-length items or otherwise misdissect the packet.
2036 item_len = GET_BE_U_2(ext->len);
2050 cp = ikev2_t_print(ndo, tcount, ext, item_len, ep);
2060 depth--;
2061 prop_length -= item_len;
2083 const struct isakmp_gen *ext;
2092 ikev2_pay_print(ndo, "sa", GET_U_1(ext1->critical));
2097 osa_length= GET_BE_U_2(ext1->len);
2098 sa_length = osa_length - 4;
2106 for (np = ISAKMP_NPTYPE_P; np != 0; np = GET_U_1(ext->np)) {
2108 ext = (const struct isakmp_gen *)cp;
2109 if (sa_length < sizeof(*ext))
2111 ND_TCHECK_SIZE(ext);
2117 * zero-length items or otherwise misdissect the packet.
2119 item_len = GET_BE_U_2(ext->len);
2133 cp = ikev2_p_print(ndo, np, pcount, ext, item_len,
2144 depth--;
2145 sa_length -= item_len;
2162 const struct isakmp_gen *ext,
2167 const struct ikev2_ke *k;
2169 k = (const struct ikev2_ke *)ext;
2170 ND_TCHECK_SIZE(k);
2171 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(k->h.critical));
2175 return (const u_char *)ext + item_len;
2177 ND_PRINT(" len=%u group=%s", item_len - 8,
2178 STR_OR_ID(GET_BE_U_2(k->ke_group), dh_p_map));
2180 if (2 < ndo->ndo_vflag && 8 < item_len) {
2182 if (!rawprint(ndo, (const uint8_t *)(k + 1), item_len - 8))
2185 return (const u_char *)ext + item_len;
2193 const struct isakmp_gen *ext,
2203 idp = (const struct ikev2_id *)ext;
2205 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(idp->h.critical));
2210 ND_PRINT(" len=%u", item_len - 4);
2211 if (2 < ndo->ndo_vflag && 4 < item_len) {
2214 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
2218 idtype_len =item_len - sizeof(struct ikev2_id);
2221 typedata = (const unsigned char *)(ext)+sizeof(struct ikev2_id);
2223 switch(GET_U_1(idp->type)) {
2269 return (const u_char *)ext + item_len;
2277 const struct isakmp_gen *ext,
2282 return ikev2_gen_print(ndo, tpay, ext, item_len);
2287 const struct isakmp_gen *ext,
2292 return ikev2_gen_print(ndo, tpay, ext, item_len);
2297 const struct isakmp_gen *ext,
2304 "shared-secret", "dsssig" };
2305 const u_char *authdata = (const u_char *)ext + sizeof(struct ikev2_auth);
2307 ND_TCHECK_LEN(ext, sizeof(struct ikev2_auth));
2308 p = (const struct ikev2_auth *)ext;
2309 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(p->h.critical));
2314 ND_PRINT(" len=%u method=%s", item_len-4,
2315 STR_OR_ID(GET_U_1(p->auth_method), v2_auth));
2317 if (ndo->ndo_vflag > 1) {
2319 if (!rawprint(ndo, (const uint8_t *)authdata, item_len - sizeof(struct ikev2_auth)))
2322 } else if (ndo->ndo_vflag) {
2328 return (const u_char *)ext + item_len;
2336 const struct isakmp_gen *ext,
2341 ND_TCHECK_SIZE(ext);
2342 ikev2_pay_print(ndo, "nonce", GET_U_1(ext->critical));
2347 ND_PRINT(" len=%u", item_len - 4);
2348 if (1 < ndo->ndo_vflag && 4 < item_len) {
2350 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
2353 } else if(ndo->ndo_vflag && 4 < item_len) {
2354 if(!ike_show_somedata(ndo, (const u_char *)(ext+1), ep)) goto trunc;
2357 return (const u_char *)ext + item_len;
2366 const struct isakmp_gen *ext,
2378 p = (const struct ikev2_n *)ext;
2380 ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_N), GET_U_1(p->h.critical));
2386 ND_PRINT(" prot_id=%s", PROTOIDSTR(GET_U_1(p->prot_id)));
2388 type = GET_BE_U_2(p->type);
2527 notify_name="private-error";
2531 notify_name="private-status";
2540 spi_size = GET_U_1(p->spi_size);
2550 if (ndo->ndo_vflag > 3 || (showsomedata && ep-cp < 30)) {
2552 if (!rawprint(ndo, (const uint8_t *)(cp), ep - cp))
2562 return (const u_char *)ext + item_len;
2570 const struct isakmp_gen *ext,
2575 return ikev2_gen_print(ndo, tpay, ext, item_len);
2580 const struct isakmp_gen *ext,
2588 ND_TCHECK_SIZE(ext);
2589 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(ext->critical));
2594 ND_PRINT(" len=%u vid=", item_len - 4);
2596 vid = (const u_char *)(ext+1);
2597 len = item_len - 4;
2604 if (2 < ndo->ndo_vflag && 4 < len) {
2607 if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4))
2610 return (const u_char *)ext + item_len;
2618 const struct isakmp_gen *ext,
2623 return ikev2_gen_print(ndo, tpay, ext, item_len);
2633 const struct isakmp_gen *ext,
2658 ND_TCHECK_SIZE(ext);
2659 ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(ext->critical));
2661 dlen = item_len-4;
2664 if (2 < ndo->ndo_vflag && 4 < dlen) {
2666 if (!rawprint(ndo, (const uint8_t *)(ext + 1), dlen))
2670 dat = (const u_char *)(ext+1);
2674 np = GET_U_1(ext->np);
2678 GET_U_1(base->flags) & ISAKMP_FLAG_I,
2679 base->i_ck, base->r_ck,
2682 ext = (const struct isakmp_gen *)ndo->ndo_packetp;
2685 ikev2_sub_print(ndo, base, np, ext,
2686 ndo->ndo_snapend, phase, doi, proto, depth+1);
2709 const struct isakmp_gen *ext,
2714 return ikev2_gen_print(ndo, tpay, ext, item_len);
2719 const struct isakmp_gen *ext,
2724 return ikev2_gen_print(ndo, tpay, ext, item_len);
2729 u_char np, const struct isakmp_gen *ext, const u_char *ep,
2736 cp = (const u_char *)ext;
2737 ND_TCHECK_SIZE(ext);
2743 * zero-length items or otherwise misdissect the packet.
2745 item_len = GET_BE_U_2(ext->len);
2751 * XXX - what if item_len is too short, or too long,
2754 cp = (*npfunc[np])(ndo, np, ext, item_len, ep, phase, doi, proto, depth);
2768 u_char np, const struct isakmp_gen *ext, const u_char *ep,
2775 cp = (const u_char *)ext;
2778 ND_TCHECK_SIZE(ext);
2780 item_len = GET_BE_U_2(ext->len);
2781 ND_TCHECK_LEN(ext, item_len);
2788 cp = ike_sub0_print(ndo, np, ext, ep, phase, doi, proto, depth);
2790 depth--;
2793 /* Zero-length subitem */
2797 np = GET_U_1(ext->np);
2798 ext = (const struct isakmp_gen *)cp;
2827 ep = ndo->ndo_snapend;
2829 phase = (GET_BE_U_4(base->msgid) == 0) ? 1 : 2;
2835 i = cookie_find(&base->i_ck);
2837 if (iszero(ndo, base->r_ck, sizeof(base->r_ck))) {
2841 cookie_record(ndo, &base->i_ck, bp2);
2853 ND_PRINT(" %s", ETYPESTR(GET_U_1(base->etype)));
2854 flags = GET_U_1(base->flags);
2860 if (ndo->ndo_vflag) {
2861 const struct isakmp_gen *ext;
2865 np = GET_U_1(base->np);
2878 ext = (const struct isakmp_gen *)(p + 1);
2879 ikev1_sub_print(ndo, np, ext, ep, phase, 0, 0, 0);
2883 if (ndo->ndo_vflag) {
2884 if (GET_BE_U_4(base->len) != length) {
2886 GET_BE_U_4(base->len), length);
2894 const struct isakmp_gen *ext, const u_char *ep,
2900 cp = (const u_char *)ext;
2901 ND_TCHECK_SIZE(ext);
2907 * zero-length items or otherwise misdissect the packet.
2909 item_len = GET_BE_U_2(ext->len);
2914 cp = ikev2_e_print(ndo, base, np, ext, item_len,
2918 * XXX - what if item_len is too short, or too long,
2921 cp = (*npfunc[np])(ndo, np, ext, item_len,
2937 u_char np, const struct isakmp_gen *ext, const u_char *ep,
2943 cp = (const u_char *)ext;
2945 ND_TCHECK_SIZE(ext);
2947 ND_TCHECK_LEN(ext, GET_BE_U_2(ext->len));
2955 ext, ep, phase, doi, proto, depth);
2957 depth--;
2960 /* Zero-length subitem */
2964 np = GET_U_1(ext->np);
2965 ext = (const struct isakmp_gen *)cp;
2985 ep = ndo->ndo_snapend;
2987 phase = (GET_BE_U_4(base->msgid) == 0) ? 1 : 2;
2993 ND_PRINT(" %s", ETYPESTR(GET_U_1(base->etype)));
2994 flags = GET_U_1(base->flags);
3002 if (ndo->ndo_vflag) {
3003 const struct isakmp_gen *ext;
3007 np = GET_U_1(base->np);
3020 ext = (const struct isakmp_gen *)(p + 1);
3021 ikev2_sub_print(ndo, base, np, ext, ep, phase, 0, 0, 0);
3025 if (ndo->ndo_vflag) {
3026 if (GET_BE_U_4(base->len) != length) {
3028 GET_BE_U_4(base->len), length);
3042 ndo->ndo_protocol = "isakmp";
3045 if (ndo->ndo_sa_list_head == NULL) {
3046 if (ndo->ndo_espsecret)
3052 ep = ndo->ndo_snapend;
3060 major = (GET_U_1(p->vers) & ISAKMP_VERS_MAJOR)
3062 minor = (GET_U_1(p->vers) & ISAKMP_VERS_MINOR)
3065 if (ndo->ndo_vflag) {
3069 if (ndo->ndo_vflag) {
3071 hexprint(ndo, p->msgid, sizeof(p->msgid));
3074 if (1 < ndo->ndo_vflag) {
3076 hexprint(ndo, p->i_ck, sizeof(p->i_ck));
3077 ND_PRINT("->");
3078 hexprint(ndo, p->r_ck, sizeof(p->r_ck));
3098 ndo->ndo_protocol = "isakmp_rfc3948";
3100 ND_PRINT("isakmp-nat-keep-alive");
3112 ND_PRINT("NONESP-encap: ");
3113 isakmp_print(ndo, bp+4, length-4, bp2);
3119 ND_PRINT("UDP-encap: ");