]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip6.c
Remove the -a flag. It's nonsensical to apply the local netmask to all
[tcpdump] / print-ip6.c
index 846071dada10b42759d041f1673137f82d12c1a1..ee3df72d6a24dfac657af8d53fb26205ad1cbe9b 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.28 2002-12-11 07:14:02 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.31 2003-06-07 11:57:54 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -41,6 +41,7 @@ static const char rcsid[] =
 #include "extract.h"
 
 #include "ip6.h"
+#include "ipproto.h"
 
 /*
  * print an IP6 datagram.
@@ -76,7 +77,8 @@ ip6_print(register const u_char *bp, register u_int length)
                cp += advance;
 
                if (cp == (const u_char *)(ip6 + 1)
-                && nh != IPPROTO_TCP && nh != IPPROTO_UDP) {
+                && nh != IPPROTO_TCP && nh != IPPROTO_UDP
+                && nh != IPPROTO_SCTP) {
                        (void)printf("%s > %s: ", ip6addr_string(&ip6->ip6_src),
                                     ip6addr_string(&ip6->ip6_dst));
                }
@@ -97,9 +99,7 @@ ip6_print(register const u_char *bp, register u_int length)
                        nh = *cp;
                        fragmented = 1;
                        break;
-#ifndef IPPROTO_MOBILITY
-#define IPPROTO_MOBILITY 62
-#endif
+
                case IPPROTO_MOBILITY:
                        /*
                         * XXX - we don't use "advance"; is this
@@ -112,6 +112,10 @@ ip6_print(register const u_char *bp, register u_int length)
                        advance = rt6_print(cp, (const u_char *)ip6);
                        nh = *cp;
                        break;
+               case IPPROTO_SCTP:
+                       sctp_print(cp, (const u_char *)ip6, 
+                               len + sizeof(struct ip6_hdr) - (cp - bp));
+                       goto end;
                case IPPROTO_TCP:
                        tcp_print(cp, len + sizeof(struct ip6_hdr) - (cp - bp),
                                (const u_char *)ip6, fragmented);
@@ -121,7 +125,7 @@ ip6_print(register const u_char *bp, register u_int length)
                                (const u_char *)ip6, fragmented);
                        goto end;
                case IPPROTO_ICMPV6:
-                       icmp6_print(cp, (const u_char *)ip6);
+                       icmp6_print(cp, (const u_char *)ip6, fragmented);
                        goto end;
                case IPPROTO_AH:
                        advance = ah_print(cp);
@@ -137,9 +141,6 @@ ip6_print(register const u_char *bp, register u_int length)
                        len -= padlen;
                        break;
                    }
-#ifndef IPPROTO_IPCOMP
-#define IPPROTO_IPCOMP 108
-#endif
                case IPPROTO_IPCOMP:
                    {
                        int enh;
@@ -150,27 +151,21 @@ ip6_print(register const u_char *bp, register u_int length)
                        break;
                    }
 
-#ifndef IPPROTO_PIM
-#define IPPROTO_PIM    103
-#endif
                case IPPROTO_PIM:
                        pim_print(cp, len);
                        goto end;
-#ifndef IPPROTO_OSPF
-#define IPPROTO_OSPF 89
-#endif
                case IPPROTO_OSPF:
                        ospf6_print(cp, len);
                        goto end;
+
                case IPPROTO_IPV6:
                        ip6_print(cp, len);
                        goto end;
-#ifndef IPPROTO_IPV4
-#define IPPROTO_IPV4   4
-#endif
+
                case IPPROTO_IPV4:
                        ip_print(cp, len);
                        goto end;
+
                case IPPROTO_NONE:
                        (void)printf("no next header");
                        goto end;