Commit Graph

13 Commits

Author SHA1 Message Date
guy
14e71ce55a From Mark Ellzey Thomas <mark@ackers.net>: check the length of a data
chunk before printing it.
2003-08-06 05:02:12 +00:00
guy
c4aa80257a The SCTP dissector is only called for SCTP packets, so there's no reason
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.
2003-06-03 23:49:22 +00:00
guy
fcc82f451d The "__attribute__((packed))" tag on structures causes some files not to
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.

Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.

Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets.  We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.

We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand.  (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case.  On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)

Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
2002-12-11 07:13:49 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
itojun
111ff8a61d whitespace cleanup 2002-06-11 17:08:37 +00:00
guy
a7aa2961a4 Constify.
Make "payloadPtr" a "u_char *" rather than a "char *", to eliminate some
signed vs. unsigned complaints from some compilers.
2002-04-25 04:45:59 +00:00
guy
153e205db7 The payload of an SCTP DATA chunk is *not* necessarily ASCII text, so it
shouldn't be printed by directly sending it to the standard output;
print it with "default_print()" if neither the "-x" nor the "-q" flag
were set.
2001-12-12 07:16:40 +00:00
guy
b6971d45d8 Don't switch between using standard I/O and raw writes; just use
"fwrite()" instead of "write()".
2001-12-11 09:41:54 +00:00
guy
a9f1b2876e "print-sctp.c" doesn't have to include <net/if.h>, and, if it doesn't do
so, it doesn't need to provide incomplete definitions of "struct mbuf"
or "struct rtentry", either.  If it *does* include <net/if.h>, it
appears to fail to compile on at least some versions of AIX; remove the
include and the incomplete definitions.
2001-08-01 03:31:55 +00:00
itojun
0d427b24a7 size_t may not fit into int 2001-06-27 02:48:45 +00:00
itojun
06201e8b52 ntohl() is typed to return unsigned long on old 4.[34]BSD-based OS
(i guess this i freebsd only among *BSD these day), and u_int32_t on some os.
do not rely upon OS decl and cast away to u_int32_t, and use %lu.
2001-05-09 02:42:50 +00:00
fenner
f78e1e25bd Quiet down gcc -Wall 2001-05-09 01:25:44 +00:00
fenner
52332d0132 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.
2001-05-09 00:34:34 +00:00