]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Updates from Kazushi Sugyo <[email protected]> for
authorguy <guy>
Thu, 28 Mar 2002 10:02:34 +0000 (10:02 +0000)
committerguy <guy>
Thu, 28 Mar 2002 10:02:34 +0000 (10:02 +0000)
draft-ietf-mobileip-ipv6-15.

icmp6.h
print-icmp6.c
print-ip6opts.c

diff --git a/icmp6.h b/icmp6.h
index 5873e90e344dcffae43e4c52d8d5b77c7b54c010..4877e9aeb530f619d26e392b422b94407161bedd 100644 (file)
--- a/icmp6.h
+++ b/icmp6.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.11 2001-06-01 23:01:04 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.12 2002-03-28 10:02:34 guy Exp $ (LBL) */
 /*     $NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp $        */
 /*     $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $  */
 
@@ -122,7 +122,13 @@ struct icmp6_hdr {
 #define MLD6_MTRACE_RESP               141     /* mtrace response(to sender) */
 #define MLD6_MTRACE                    142     /* mtrace messages */
 
-#define ICMP6_MAXTYPE                  142
+/* Folloing numbers are defined in the mobile-ip draft. */
+#define ICMP6_HADISCOV_REQUEST         150     /* XXX To be authorized */
+#define ICMP6_HADISCOV_REPLY           151     /* XXX To be authorized */
+#define ICMP6_MOBILEPREFIX_SOLICIT     152     /* XXX To be authorized */
+#define ICMP6_MOBILEPREFIX_ADVERT      153     /* XXX To be authorized */
+
+#define ICMP6_MAXTYPE                  153
 
 #define ICMP6_DST_UNREACH_NOROUTE      0       /* no route to destination */
 #define ICMP6_DST_UNREACH_ADMIN                1       /* administratively prohibited */
index d9a37beea10730f230b50015464b2b1230173435..95cc60092bb7430146403af9eda3c4f79e770253 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.57 2001-12-09 05:22:27 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.58 2002-03-28 10:02:34 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -356,6 +356,29 @@ icmp6_print(const u_char *bp, const u_char *bp2)
        case ICMP6_NI_REPLY:
                icmp6_nodeinfo_print(icmp6len, bp, ep);
                break;
+       case ICMP6_HADISCOV_REQUEST:
+       case ICMP6_HADISCOV_REPLY:
+       {
+               struct in6_addr *in6;
+               u_int32_t *res;
+               u_char *cp;
+               int cnt, i;
+               printf("icmp6: ha discovery %s: ",
+                      dp->icmp6_type == ICMP6_HADISCOV_REQUEST ?
+                      "request" : "reply");
+               TCHECK(dp->icmp6_data16[0]);
+               printf("id=%d", ntohs(dp->icmp6_data16[0]));
+               cp = (u_char *)dp + icmp6len;
+               res = (u_int32_t *)(dp + 1);
+               in6 = (struct in6_addr *)(res + 2);
+               for (; (u_char *)in6 < cp; in6++) {
+                       TCHECK(*in6);
+                       printf(", %s", ip6addr_string(in6));
+               }
+               break;
+       }
+       case ICMP6_MOBILEPREFIX_SOLICIT:
+       case ICMP6_MOBILEPREFIX_ADVERT:
        default:
                printf("icmp6: type-#%d", dp->icmp6_type);
                break;
index ac0ac905e1284bbe417a9c9fe7c8472a8af9adbf..0712406854dd548b08753d9f13cde43796ddc082 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-ip6opts.c,v 1.9 2001-05-09 02:47:26 itojun Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-ip6opts.c,v 1.10 2002-03-28 10:02:35 guy Exp $";
 #endif
 
 #ifdef INET6
@@ -64,10 +64,12 @@ static const char rcsid[] =
 #define IP6OPT_BU_MINLEN       10
 #define IP6OPT_BA_MINLEN       13
 #define IP6OPT_BR_MINLEN        2
-#define IP6SOPT_ALTCOA        0x4
-#define IP6SOPT_ALTCOA_MINLEN  18
 #define IP6SOPT_UI            0x2
 #define IP6SOPT_UI_MINLEN       4
+#define IP6SOPT_ALTCOA        0x3
+#define IP6SOPT_ALTCOA_MINLEN  18
+#define IP6SOPT_AUTH          0x4
+#define IP6SOPT_AUTH_MINLEN     6
 
 static void ip6_sopt_print(const u_char *, int);
 
@@ -100,6 +102,13 @@ ip6_sopt_print(const u_char *bp, int len)
            }
             printf(", padn");
            break;
+        case IP6SOPT_UI:
+             if (len - i < IP6SOPT_UI_MINLEN) {
+               printf(", ui: trunc");
+               goto trunc;
+           }
+            printf(", ui: 0x%04x ", ntohs(*(u_int16_t *)&bp[i + 2]));
+           break;
         case IP6SOPT_ALTCOA:
              if (len - i < IP6SOPT_ALTCOA_MINLEN) {
                printf(", altcoa: trunc");
@@ -107,12 +116,13 @@ ip6_sopt_print(const u_char *bp, int len)
            }
             printf(", alt-CoA: %s", ip6addr_string(&bp[i+2]));
            break;
-        case IP6SOPT_UI:
-             if (len - i < IP6SOPT_UI_MINLEN) {
-               printf(", ui: trunc");
+        case IP6SOPT_AUTH:
+             if (len - i < IP6SOPT_AUTH_MINLEN) {
+               printf(", auth: trunc");
                goto trunc;
            }
-            printf("(ui: 0x%04x) ", ntohs(*(u_int16_t *)&bp[i + 2]));
+            printf(", auth spi: 0x%08x",
+                  (u_int32_t)ntohl(*(u_int32_t *)&bp[i + 2]));
            break;
        default:
            if (len - i < IP6OPT_MINLEN) {
@@ -211,16 +221,14 @@ ip6_opt_print(const u_char *bp, int len)
            if (bp[i + 2] & 0x40)
                    printf("H");
            if (bp[i + 2] & 0x20)
-                   printf("R");
+                   printf("S");
            if (bp[i + 2] & 0x10)
                    printf("D");
-           if (bp[i + 2] & 0x0f)
+           if ((bp[i + 2] & 0x0f) || bp[i + 3] || bp[i + 4])
                    printf("res");
-           printf(", prefixlen: %u", bp[i + 3]);
-           printf(", sequence: %u",
-               (u_int16_t)ntohs(*(u_int16_t *)&bp[i + 4]));
+           printf(", sequence: %u", bp[i + 5]);
            printf(", lifetime: %u",
-               (u_int32_t)ntohs(*(u_int32_t *)&bp[i + 8]));
+               (u_int32_t)ntohl(*(u_int32_t *)&bp[i + 6]));
 
            if (bp[i + 1] > IP6OPT_BU_MINLEN - 2) {
                ip6_sopt_print(&bp[i + IP6OPT_BU_MINLEN],
@@ -239,12 +247,13 @@ ip6_opt_print(const u_char *bp, int len)
            }
            printf("(ba: ");
            printf("status: %u", bp[i + 2]);
-           printf(", sequence: %u",
-               (u_int16_t)ntohs(*(u_int16_t *)&bp[i + 3]));
+           if (bp[i + 3])
+                   printf("res");
+           printf(", sequence: %u", bp[i + 4]);
            printf(", lifetime: %u",
-               (u_int32_t)ntohs(*(u_int32_t *)&bp[i + 7]));
+               (u_int32_t)ntohl(*(u_int32_t *)&bp[i + 5]));
            printf(", refresh: %u",
-               (u_int32_t)ntohs(*(u_int32_t *)&bp[i + 11]));
+               (u_int32_t)ntohl(*(u_int32_t *)&bp[i + 9]));
 
            if (bp[i + 1] > IP6OPT_BA_MINLEN - 2) {
                ip6_sopt_print(&bp[i + IP6OPT_BA_MINLEN],