* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.132 2000-07-11 00:49:02 assar Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.133 2000-07-11 01:22:38 assar Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern void icmp_print(const u_char *, u_int, const u_char *);
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 void ipx_print(const u_char *, u_int);
extern void isoclns_print(const u_char *, u_int, u_int, const u_char *,
const u_char *);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.83 2000-07-01 03:39:03 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.84 2000-07-11 01:22:39 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf(")");
}
}
+
+void
+ipN_print(register const u_char *bp, register u_int length)
+{
+ struct ip *ip, hdr;
+
+ ip = (struct ip *)bp;
+ if (length < 4) {
+ (void)printf("truncated-ip %d", length);
+ return;
+ }
+ memcpy (&hdr, (char *)ip, 4);
+ switch (hdr.ip_v) {
+ case 4:
+ ip_print (bp, length);
+ return;
+#ifdef INET6
+ case 6:
+ ip6_print (bp, length);
+ return;
+#endif
+ default:
+ (void)printf("unknown ip %d", hdr.ip_v);
+ return;
+ }
+}
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.26 2000-07-01 03:39:08 assar Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.27 2000-07-11 01:22:39 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
if (eflag)
printf("ip: ");
- ip_print(p, length);
+ ipN_print(p, length);
if (xflag)
default_print(p, caplen);