Commit Graph

26 Commits

Author SHA1 Message Date
Denis Ovsienko
7de355927b justify declarations of struct tok arrays
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
2013-09-24 20:54:03 +04:00
Denis Ovsienko
f1261458ff SCTP: remove an unused variable (compiler warning) 2013-09-07 15:26:29 +04:00
jamal
d3e9af76c3 RESEND: [PATCH 1/1] ForCES fix SCTP TML port
The old ports for SCTP TML ports were replaced at RFC editor
publication time. Caught by folks preparing for an Interop
tommorow.
While we could add a backward compat support it seems meaningless
if those ports will never ever be used in production.
I will send new test/pcaps at a later point and remove the existing
ones once this patch goes in.

cheers,
jamal

commit 40ecad0e866e7567716e6e57158c5274c0786a21
Author: Jamal Hadi Salim <hadi@mojatatu.com>
Date:   Thu Feb 3 22:00:23 2011 -0500

    Conform to new IANA assignment of ForCES SCTP TML

    Signed-off-by: Jamal Hadi Salim <hadi@mojatatu.com>
2011-03-31 09:41:04 +02:00
Guy Harris
19b5602a0c Use EXTRACT_16BITS to extract big-endian 16-bit quantities from the packet.
There's no guarantee that those quantities will be properly aligned, nor
is there any guarantee that fetching an improperly-aligned quantity will
work as desired.
2010-01-26 18:35:53 -08:00
Michael Richardson
d0e01819c0 IETF FORCES protocol printer, from Jamal Hadi Salim <hadi at cyberus.ca. 2010-01-10 14:49:46 -05:00
guy
735692ad42 From Chris Larson: don't cut off the last byte of the chunk payload. 2007-09-13 18:03:49 +00:00
guy
d953299b94 Add a flag to suppress the "default_print()" call made in various
link-layer print routines if no other print routine claimed the packet.
Test whether that flag is set rather than testing whether neither of -x
or -q were specified, and have -x, -q, *and* -X set that flag, so that
-X suppresses it just as -x does.  That way you don't get those pckets
dumped twice if -X was specified.
2005-07-07 01:22:15 +00:00
guy
d022b3377f Fix the bounds check for the chunk. 2005-05-06 10:53:01 +00:00
guy
1324704138 Add more bounds checks, and check for bogus chunk lengths (too short). 2005-05-05 23:08:43 +00:00
guy
6b5bfdd688 Don't use "u_long", as its length is not guaranteed to be 4 bytes. In
fact, don't even use "u_int32_t", as we're just pointing into a packet,
which is made up of bytes - use "u_char", and bump the pointer by 4 for
each item.
2005-04-13 08:30:41 +00:00
guy
262a263f75 Print all of the SCTP information, except for the payload, if "-vv"
isn't specified.
2004-12-15 08:43:23 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".

Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
use "_U_" in the definitions of "rcsid[]", to eliminate
	complaints about those variables being unused;

	move the definitions after the include of "interface.h", or add
	an include of "interface.h", so that "_U_" is defined.

Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
2003-11-15 00:39:12 +00:00
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