* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.243 2005-03-08 08:52:38 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.244 2005-04-06 21:33:27 mcr Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern void icmp_print(const u_char *, u_int, const u_char *, int);
extern void igmp_print(const u_char *, u_int);
extern void igrp_print(const u_char *, u_int, const u_char *);
-extern void ip_print(const u_char *, u_int);
extern void ipN_print(const u_char *, u_int);
extern u_int ipfc_if_print(const struct pcap_pkthdr *, const u_char *);
extern void ipx_print(const u_char *, u_int);
extern void udp_print(const u_char *, u_int, const u_char *, int);
extern void wb_print(const void *, u_int);
extern int ah_print(register const u_char *);
-extern void isakmp_print(const u_char *, u_int, const u_char *);
extern int ipcomp_print(register const u_char *, int *);
extern void rx_print(register const u_char *, int, int, int, u_char *);
extern void netbeui_print(u_short, const u_char *, int);
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.14 2004-12-30 03:36:51 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.15 2005-04-06 21:33:27 mcr Exp $ (LBL)
*/
#ifndef netdissect_h
register const u_char *bp, int len, register const u_char *bp2,
int *nhdr, int *padlen);
extern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
+extern void isakmp_print(netdissect_options *,const u_char *,
+ u_int, const u_char *);
+extern void isakmp_rfc3948_print(netdissect_options *,const u_char *,
+ u_int, const u_char *);
+extern void ip_print(netdissect_options *,const u_char *, u_int);
#if 0
extern void ascii_print_with_offset(netdissect_options *, const char *,
register const u_char *, u_int);
extern void igrp_print(netdissect_options *,const u_char *, u_int,
const u_char *);
-extern void ip_print(netdissect_options *,const u_char *, u_int);
extern void ipN_print(netdissect_options *,const u_char *, u_int);
extern void ipx_print(netdissect_options *,const u_char *, u_int);
extern void isoclns_print(netdissect_options *,const u_char *,
extern int ah_print(netdissect_options *,register const u_char *,
register const u_char *);
extern void esp_print_decodesecret(netdissect_options *ndo);
-extern void isakmp_print(netdissect_options *,const u_char *,
- u_int, const u_char *);
extern int ipcomp_print(netdissect_options *,register const u_char *,
register const u_char *, int *);
extern void rx_print(netdissect_options *,register const u_char *,
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.49 2004-11-04 07:49:14 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.50 2005-04-06 21:33:27 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
break;
default:
/* NULL is dummy */
- isakmp_print(cp, item_len - sizeof(*p) - n.spi_size,
- NULL);
+ isakmp_print(gndo, cp,
+ item_len - sizeof(*p) - n.spi_size,
+ NULL);
}
printf(")");
}
}
void
-isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
+isakmp_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2)
{
const struct isakmp *p;
struct isakmp base;
int major, minor;
p = (const struct isakmp *)bp;
- ep = snapend;
+ ep = ndo->ndo_snapend;
if ((struct isakmp *)ep < p + 1) {
printf("[|isakmp]");
}
}
}
+
+void
+isakmp_rfc3948_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2)
+{
+ const u_char *ep;
+ ep = ndo->ndo_snapend;
+
+ if(length == 1 && bp[0]==0xff) {
+ ND_PRINT((ndo, "isakmp-nat-keep-alive"));
+ return;
+ }
+
+ ND_TCHECK2(bp, 4);
+
+ /*
+ * see if this is an IKE packet
+ */
+ if(bp[0]==0 && bp[1]==0 && bp[2]==0 && bp[3]==0) {
+ isakmp_print(ndo, bp+4, length-4, bp2);
+ return;
+ }
+
+ /* must be an ESP packet */
+ {
+ int nh, enh, padlen;
+ int advance;
+
+ advance = esp_print(ndo, bp, length, bp2, &enh, &padlen);
+ if(advance <= 0)
+ return;
+
+ bp += advance;
+ length -= advance + padlen;
+ nh = enh & 0xff;
+
+ /* now need to jump into ip_print(). */
+ return;
+ }
+
+trunc:
+ printf("[|isakmp]");
+ return;
+}
+
+
+
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.136 2004-12-27 01:13:44 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.137 2005-04-06 21:33:28 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#else
0);
#endif
- else if (ISPORT(ISAKMP_PORT))
- isakmp_print((const u_char *)(up + 1), length, bp2);
+ else if (ISPORT(ISAKMP_PORT) || ISPORT(ISAKMP_PORT_NATT))
+ isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
#if 1 /*???*/
- else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2))
- isakmp_print((const u_char *)(up + 1), length, bp2);
+ else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2))
+ isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
#endif
else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT))
snmp_print((const u_char *)(up + 1), length);
} else
(void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up)));
}
+
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
+
-/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.7 2004-07-27 17:04:21 hannes Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.8 2005-04-06 21:33:28 mcr Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
#define KERBEROS_SEC_PORT 750 /*XXX*/
#define L2TP_PORT 1701 /*XXX*/
#define SIP_PORT 5060
+#define ISAKMP_PORT_NATT 4500 /* rfc3948 */
#define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/
#define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/
#define RX_PORT_LOW 7000 /*XXX*/