for it to check the protocol number in the IP header.
Have the IPv6 dissector call the SCTP dissector for SCTP packets.
Get rid of the definition of IPPROTO_SCTP in sctpConstants.h, so we
don't have problems if <netinet/in.h> also defines it.
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.29 2003-05-02 08:13:55 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.30 2003-06-03 23:49:22 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
while (cp < snapend) {
cp += advance;
+#ifndef IPPROTO_SCTP
+#define IPPROTO_SCTP 132
+#endif
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));
}
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);
#ifndef lint
static const char rcsid[] =
-"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.11 2002-12-11 07:14:08 guy Exp $ (NETLAB/PEL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.12 2003-06-03 23:49:23 guy Exp $ (NETLAB/PEL)";
#endif
#ifdef HAVE_CONFIG_H
#ifdef INET6
if (ip6) {
- if (ip6->ip6_nxt == IPPROTO_SCTP) {
- (void)printf("%s.%d > %s.%d: sctp",
- ip6addr_string(&ip6->ip6_src),
- sourcePort,
- ip6addr_string(&ip6->ip6_dst),
- destPort);
- } else {
- (void)printf("%d > %d: sctp",
- sourcePort, destPort);
- }
+ (void)printf("%s.%d > %s.%d: sctp",
+ ip6addr_string(&ip6->ip6_src),
+ sourcePort,
+ ip6addr_string(&ip6->ip6_dst),
+ destPort);
} else
#endif /*INET6*/
{
- if (ip->ip_p == IPPROTO_SCTP) {
- (void)printf("%s.%d > %s.%d: sctp",
- ipaddr_string(&ip->ip_src),
- sourcePort,
- ipaddr_string(&ip->ip_dst),
- destPort);
- } else {
- (void)printf("%d > %d: sctp",
- sourcePort, destPort);
- }
+ (void)printf("%s.%d > %s.%d: sctp",
+ ipaddr_string(&ip->ip_src),
+ sourcePort,
+ ipaddr_string(&ip->ip_dst),
+ destPort);
}
fflush(stdout);
-/* @(#) $Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.3 2002-06-11 17:08:59 itojun Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.4 2003-06-03 23:49:23 guy Exp $ (LBL) */
/* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
*
#define SCTP_DEAMON_PORT 9899
-
-#ifndef IPPROTO_SCTP
-#define IPPROTO_SCTP 132 /* the Official IANA number :-) */
-#endif
-
/* Deamon registration message types/responses */
#define DEAMON_REGISTER 0x01
#define DEAMON_REGISTER_ACK 0x02