summaryrefslogtreecommitdiff
path: root/print-ip.c
diff options
context:
space:
mode:
authorfenner <fenner>2001-05-09 00:34:34 +0000
committerfenner <fenner>2001-05-09 00:34:34 +0000
commit52332d013210e0391ed55353c1811d6fe5f079ef (patch)
treecb9b5629d0d4d4092e6ca899f3f40ee57d3f5695 /print-ip.c
parent5e30e81f5317384df5c167d67c3ba20929d1fe31 (diff)
downloadtcpdump-52332d013210e0391ed55353c1811d6fe5f079ef.tar.gz
SCTP printing from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
Modified to print IP/IPv6-level addresses like TCP does, and to not print multi-line detail unless -vv by fenner.
Diffstat (limited to 'print-ip.c')
-rw-r--r--print-ip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/print-ip.c b/print-ip.c
index 04de692e..2e15513b 100644
--- a/print-ip.c
+++ b/print-ip.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.94 2001-02-20 18:55:47 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.95 2001-05-09 00:34:34 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -315,7 +315,11 @@ ip_print(register const u_char *bp, register u_int length)
cp = (const u_char *)ip + hlen;
nh = ip->ip_p;
- if (nh != IPPROTO_TCP && nh != IPPROTO_UDP) {
+#ifndef IPPROTO_SCTP
+#define IPPROTO_SCTP 132
+#endif
+ if (nh != IPPROTO_TCP && nh != IPPROTO_UDP &&
+ nh != IPPROTO_SCTP) {
(void)printf("%s > %s: ", ipaddr_string(&ip->ip_src),
ipaddr_string(&ip->ip_dst));
}
@@ -362,6 +366,10 @@ again:
goto again;
}
+ case IPPROTO_SCTP:
+ sctp_print(cp, (const u_char *)ip, len);
+ break;
+
case IPPROTO_TCP:
tcp_print(cp, len, (const u_char *)ip, (off &~ 0x6000));
break;