summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-rt6.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-03-31 09:17:26 +0000
committerbms <bms@FreeBSD.org>2004-03-31 09:17:26 +0000
commit281e9d71408deb6e8c5046c746c2e97002b0e7fe (patch)
treeeb08e08f0f875c3b16f8e1aec86091f100906f1c /contrib/tcpdump/print-rt6.c
parentbe6faec6d07fc3a2a54836e76d0309c36192dfad (diff)
downloadFreeBSD-src-281e9d71408deb6e8c5046c746c2e97002b0e7fe.zip
FreeBSD-src-281e9d71408deb6e8c5046c746c2e97002b0e7fe.tar.gz
Import tcpdump 3.8.3, from http://www.tcpdump.org/releases/tcpdump-3.8.3.tar.gz
Diffstat (limited to 'contrib/tcpdump/print-rt6.c')
-rw-r--r--contrib/tcpdump/print-rt6.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/tcpdump/print-rt6.c b/contrib/tcpdump/print-rt6.c
index dc5f0f3..6adc009 100644
--- a/contrib/tcpdump/print-rt6.c
+++ b/contrib/tcpdump/print-rt6.c
@@ -20,8 +20,8 @@
*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.18 2001/06/15 22:17:34 fenner Exp $";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.23.2.3 2003/11/19 00:35:45 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -30,13 +30,7 @@ static const char rcsid[] =
#ifdef INET6
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-
-#include <netinet/in.h>
+#include <tcpdump-stdinc.h>
#include <stdio.h>
@@ -44,6 +38,7 @@ static const char rcsid[] =
#include "interface.h"
#include "addrtoname.h"
+#include "extract.h"
int
rt6_print(register const u_char *bp, register const u_char *bp2)
@@ -72,13 +67,17 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
#ifndef IPV6_RTHDR_TYPE_0
#define IPV6_RTHDR_TYPE_0 0
#endif
+#ifndef IPV6_RTHDR_TYPE_2
+#define IPV6_RTHDR_TYPE_2 2
+#endif
case IPV6_RTHDR_TYPE_0:
+ case IPV6_RTHDR_TYPE_2: /* Mobile IPv6 ID-20 */
dp0 = (struct ip6_rthdr0 *)dp;
TCHECK(dp0->ip6r0_reserved);
if (dp0->ip6r0_reserved || vflag) {
printf(", rsv=0x%0x",
- (u_int32_t)ntohl(dp0->ip6r0_reserved));
+ EXTRACT_32BITS(&dp0->ip6r0_reserved));
}
if (len % 2 == 1)
@@ -88,7 +87,7 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
for (i = 0; i < len; i++) {
if ((u_char *)(addr + 1) > ep)
goto trunc;
-
+
printf(", [%d]%s", i, ip6addr_string(addr));
addr++;
}
@@ -103,6 +102,6 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
trunc:
fputs("[|srcrt]", stdout);
- return 65535; /* XXX */
+ return -1;
}
#endif /* INET6 */
OpenPOWER on IntegriCloud