summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-frag6.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-03-31 09:17:26 +0000
committerbms <bms@FreeBSD.org>2004-03-31 09:17:26 +0000
commit281e9d71408deb6e8c5046c746c2e97002b0e7fe (patch)
treeeb08e08f0f875c3b16f8e1aec86091f100906f1c /contrib/tcpdump/print-frag6.c
parentbe6faec6d07fc3a2a54836e76d0309c36192dfad (diff)
downloadFreeBSD-src-281e9d71408deb6e8c5046c746c2e97002b0e7fe.zip
FreeBSD-src-281e9d71408deb6e8c5046c746c2e97002b0e7fe.tar.gz
Import tcpdump 3.8.3, from http://www.tcpdump.org/releases/tcpdump-3.8.3.tar.gz
Diffstat (limited to 'contrib/tcpdump/print-frag6.c')
-rw-r--r--contrib/tcpdump/print-frag6.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/contrib/tcpdump/print-frag6.c b/contrib/tcpdump/print-frag6.c
index 4553505..2356efb 100644
--- a/contrib/tcpdump/print-frag6.c
+++ b/contrib/tcpdump/print-frag6.c
@@ -20,8 +20,8 @@
*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.13 2001/09/17 21:58:02 fenner Exp $";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.16.2.3 2003/11/19 00:35:43 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -30,13 +30,7 @@ static const char rcsid[] =
#ifdef INET6
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-
-#include <netinet/in.h>
+#include <tcpdump-stdinc.h>
#include <stdio.h>
@@ -44,6 +38,7 @@ static const char rcsid[] =
#include "interface.h"
#include "addrtoname.h"
+#include "extract.h"
int
frag6_print(register const u_char *bp, register const u_char *bp2)
@@ -62,21 +57,21 @@ frag6_print(register const u_char *bp, register const u_char *bp2)
if (vflag) {
printf("frag (0x%08x:%d|%ld)",
- (u_int32_t)ntohl(dp->ip6f_ident),
- ntohs(dp->ip6f_offlg & IP6F_OFF_MASK),
- sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) -
+ EXTRACT_32BITS(&dp->ip6f_ident),
+ EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK,
+ sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) -
(long)(bp - bp2) - sizeof(struct ip6_frag));
} else {
printf("frag (%d|%ld)",
- ntohs(dp->ip6f_offlg & IP6F_OFF_MASK),
- sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) -
+ EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK,
+ sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) -
(long)(bp - bp2) - sizeof(struct ip6_frag));
}
#if 1
/* it is meaningless to decode non-first fragment */
- if (ntohs(dp->ip6f_offlg & IP6F_OFF_MASK) != 0)
- return 65535;
+ if ((EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK) != 0)
+ return -1;
else
#endif
{
@@ -85,7 +80,7 @@ frag6_print(register const u_char *bp, register const u_char *bp2)
}
trunc:
fputs("[|frag]", stdout);
- return 65535;
+ return -1;
#undef TCHECK
}
#endif /* INET6 */
OpenPOWER on IntegriCloud