]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From Kazushi Sugyo: update to draft-ietf-mobileip-ipv6-20.
authorguy <guy>
Wed, 5 Feb 2003 02:36:25 +0000 (02:36 +0000)
committerguy <guy>
Wed, 5 Feb 2003 02:36:25 +0000 (02:36 +0000)
print-icmp6.c
print-mobility.c
print-rt6.c

index 45a3bddafd0222acb29c07b2d6058ae3e2edbc5b..0829119e066d5b318a55740aae749c16b58587aa 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.67 2002-12-11 22:29:21 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.68 2003-02-05 02:36:25 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -357,14 +357,12 @@ icmp6_print(const u_char *bp, const u_char *bp2)
                printf("icmp6: ha discovery reply");
                if (vflag) {
                        struct in6_addr *in6;
-                       u_int32_t *res;
                        u_char *cp;
 
                        TCHECK(dp->icmp6_data16[0]);
                        printf("(id=%d", EXTRACT_16BITS(&dp->icmp6_data16[0]));
                        cp = (u_char *)dp + icmp6len;
-                       res = (u_int32_t *)(dp + 1);
-                       in6 = (struct in6_addr *)(res + 2);
+                       in6 = (struct in6_addr *)(dp + 1);
                        for (; (u_char *)in6 < cp; in6++) {
                                TCHECK(*in6);
                                printf(", %s", ip6addr_string(in6));
@@ -383,8 +381,15 @@ icmp6_print(const u_char *bp, const u_char *bp2)
                printf("icmp6: mobile router advertisement");
                if (vflag) {
                        TCHECK(dp->icmp6_data16[0]);
-                       printf("(id=%d)", EXTRACT_16BITS(&dp->icmp6_data16[0]));
-#define MPADVLEN 6
+                       printf("(id=%d", EXTRACT_16BITS(&dp->icmp6_data16[0]));
+                       if (dp->icmp6_data16[1] & 0xc0)
+                               printf(" ");
+                       if (dp->icmp6_data16[1] & 0x80)
+                               printf("M");
+                       if (dp->icmp6_data16[1] & 0x40)
+                               printf("O");
+                       printf(")");
+#define MPADVLEN 8
                        icmp6_opt_print((const u_char *)dp + MPADVLEN,
                                        icmp6len - MPADVLEN);
                }
index de9f153199880f8c1960fe0f61aa7fc11b1b7516..d2123b055a4263b4e72f9de09f7bef5a23620437 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.8 2002-12-11 07:14:05 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.9 2003-02-05 02:36:25 guy Exp $";
 #endif
 
 #ifdef INET6
@@ -79,15 +79,14 @@ struct ip6_mobility {
 #define IP6MOPT_MINLEN         2
 #define IP6MOPT_PAD1          0x0      /* Pad1 */
 #define IP6MOPT_PADN          0x1      /* PadN */
-/*                           0x2       /* reserved */
+#define IP6MOPT_REFRESH              0x2       /* Binding Refresh Advice */
+#define IP6MOPT_REFRESH_MINLEN  4
 #define IP6MOPT_ALTCOA        0x3      /* Alternate Care-of Address */
 #define IP6MOPT_ALTCOA_MINLEN  18
 #define IP6MOPT_NONCEID       0x4      /* Nonce Indices */
 #define IP6MOPT_NONCEID_MINLEN  6
 #define IP6MOPT_AUTH          0x5      /* Binding Authorization Data */
 #define IP6MOPT_AUTH_MINLEN    12
-#define IP6MOPT_REFRESH              0x6       /* Binding Refresh Advice */
-#define IP6MOPT_REFRESH_MINLEN  4
 
 static void
 mobility_opt_print(const u_char *bp, int len)
@@ -118,6 +117,15 @@ mobility_opt_print(const u_char *bp, int len)
                        }
                        printf("(padn)");
                        break;
+               case IP6MOPT_REFRESH:
+                       if (len - i < IP6MOPT_REFRESH_MINLEN) {
+                               printf("(refresh: trunc)");
+                               goto trunc;
+                       }
+                       /* units of 4 secs */
+                       printf("(refresh: %d)",
+                               EXTRACT_16BITS(&bp[i+2]) << 2);
+                       break;
                case IP6MOPT_ALTCOA:
                        if (len - i < IP6MOPT_ALTCOA_MINLEN) {
                                printf("(altcoa: trunc)");
@@ -130,7 +138,7 @@ mobility_opt_print(const u_char *bp, int len)
                                printf("(ni: trunc)");
                                goto trunc;
                        }
-                       printf("(ni: ho=0x%04x ci=0x%04x)",
+                       printf("(ni: ho=0x%04x co=0x%04x)",
                                EXTRACT_16BITS(&bp[i+2]),
                                EXTRACT_16BITS(&bp[i+4]));
                        break;
@@ -141,15 +149,6 @@ mobility_opt_print(const u_char *bp, int len)
                        }
                        printf("(auth)");
                        break;
-               case IP6MOPT_REFRESH:
-                       if (len - i < IP6MOPT_REFRESH_MINLEN) {
-                               printf("(refresh: trunc)");
-                               goto trunc;
-                       }
-                       /* units of 4 secs */
-                       printf("(refresh: %d)",
-                               EXTRACT_16BITS(&bp[i+2]) << 2);
-                       break;
                default:
                        if (len - i < IP6MOPT_MINLEN) {
                                printf("(sopt_type %d: trunc)", bp[i]);
@@ -216,8 +215,8 @@ mobility_print(const u_char *bp, const u_char *bp2)
                hlen = IP6M_MINLEN;
                if (vflag) {
                        TCHECK2(*mh, hlen + 8);
-                       printf(" %soT cookie=%08x:%08x",
-                              type == IP6M_HOME_TEST_INIT ? "H" : "C",
+                       printf(" %s Init Cookie=%08x:%08x",
+                              type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of",
                               EXTRACT_32BITS(&bp[hlen]),
                               EXTRACT_32BITS(&bp[hlen + 4]));
                }
@@ -232,15 +231,15 @@ mobility_print(const u_char *bp, const u_char *bp2)
                hlen = IP6M_MINLEN;
                if (vflag) {
                        TCHECK2(*mh, hlen + 8);
-                       printf(" %soTI cookie=%08x:%08x",
-                              type == IP6M_HOME_TEST ? "H" : "C",
+                       printf(" %s Init Cookie=%08x:%08x",
+                              type == IP6M_HOME_TEST ? "Home" : "Care-of",
                               EXTRACT_32BITS(&bp[hlen]),
                               EXTRACT_32BITS(&bp[hlen + 4]));
                }
                hlen += 8;
                if (vflag) {
                        TCHECK2(*mh, hlen + 8);
-                       printf(" %s KN=%08x:%08x",
+                       printf(" %s Keygen Token=%08x:%08x",
                               type == IP6M_HOME_TEST ? "Home" : "Care-of",
                               EXTRACT_32BITS(&bp[hlen]),
                               EXTRACT_32BITS(&bp[hlen + 4]));
@@ -253,19 +252,17 @@ mobility_print(const u_char *bp, const u_char *bp2)
                printf(" seq#=%d", EXTRACT_16BITS(&mh->ip6m_data16[0]));
                hlen = IP6M_MINLEN;
                TCHECK2(*mh, hlen + 1);
-               if (bp[hlen] & 0xf8)
+               if (bp[hlen] & 0xf0)
                        printf(" ");
                if (bp[hlen] & 0x80)
                        printf("A");
                if (bp[hlen] & 0x40)
                        printf("H");
                if (bp[hlen] & 0x20)
-                       printf("S");
-               if (bp[hlen] & 0x10)
-                       printf("D");
-               if (bp[hlen] & 0x08)
                        printf("L");
-               /* Reserved (3bits) */
+               if (bp[hlen] & 0x10)
+                       printf("K");
+               /* Reserved (4bits) */
                hlen += 1;
                /* Reserved (8bits) */
                hlen += 1;
@@ -278,7 +275,9 @@ mobility_print(const u_char *bp, const u_char *bp2)
                printf("mobility: BA");
                TCHECK(mh->ip6m_data8[0]);
                printf(" status=%d", mh->ip6m_data8[0]);
-               /* Reserved */
+               if (mh->ip6m_data8[1] & 0x80)
+                       printf(" K");
+               /* Reserved (7bits) */
                hlen = IP6M_MINLEN;
                TCHECK2(*mh, hlen + 2);
                printf(" seq#=%d", EXTRACT_16BITS(&bp[hlen]));
index 594f1ea13c0c4cb51154c6021efd32afb4f5f5b1..6b8bae64315482eaee6e4d2e3230002a047d85b4 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.22 2002-12-11 07:14:08 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.23 2003-02-05 02:36:26 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -71,7 +71,7 @@ rt6_print(register const u_char *bp, register const u_char *bp2)
 #define IPV6_RTHDR_TYPE_2 2
 #endif
        case IPV6_RTHDR_TYPE_0:
-       case IPV6_RTHDR_TYPE_2:                 /* Mobile IPv6 ID-17 */
+       case IPV6_RTHDR_TYPE_2:                 /* Mobile IPv6 ID-20 */
                dp0 = (struct ip6_rthdr0 *)dp;
 
                TCHECK(dp0->ip6r0_reserved);