#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
#include "extract.h"
#include "ip6.h"
+#include "ipproto.h"
/*
* print an IP6 datagram.
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));
}
nh = *cp;
fragmented = 1;
break;
-#ifndef IPPROTO_MOBILITY
-#define IPPROTO_MOBILITY 62
-#endif
+
case IPPROTO_MOBILITY:
/*
* XXX - we don't use "advance"; is this
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);
(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);
len -= padlen;
break;
}
-#ifndef IPPROTO_IPCOMP
-#define IPPROTO_IPCOMP 108
-#endif
case IPPROTO_IPCOMP:
{
int enh;
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;