]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rt6.c
ignore pcap files which are generated from .puu files.
[tcpdump] / print-rt6.c
index 8b249788213acea2b7f45d64c2f142165fe105b7..6b8bae64315482eaee6e4d2e3230002a047d85b4 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.18 2001-06-15 22:17:34 fenner Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.23 2003-02-05 02:36:26 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)
@@ -71,14 +66,18 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
        switch (dp->ip6r_type) {
 #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++;
                }