Commit Graph

15 Commits

Author SHA1 Message Date
Guy Harris
832d2c7338 From Fang Wang:
RFC 5482 specifies a new TCP option -- the TCP User Timeout
	Option (UTO) -- that allows one end of a TCP connection to
	advertise its current user timeout value.  The Kind of UTO
	option is 28 and the Length is 4.  The tcpdump currently does
	not recognize UTO option.
2009-08-18 15:02:37 -07:00
guy
a11ed8914e SMB-over-TCP (port 445) support. 2007-12-09 00:30:47 +00:00
hannes
9427d40c14 change the TCP printer to print new-style order:
- seperate fields by comma
  - use [] for flags and options sets
  - print a trailing length field

make use of tok2str() and bitttok2str()
move port definitions into tcp.h
2007-01-29 09:59:42 +00:00
hannes
95f66c8c62 add basic support for keyed authentication TCP option 2005-11-29 09:07:47 +00:00
guy
8234cdad9b From Bruce M. Simpson: add a "-M" flag to specify a shared secret for
TCP-MD5 (RFC 2385) digest verification if we have libcrypto.
2004-03-23 07:15:36 +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
itojun
10afb02ac8 put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and so
forth while i'm here
2002-11-09 17:19:16 +00:00
fenner
5de6f0fd81 Move some stuff that tried to make up for system headers from print-tcp.c
to tcp.h, since don't use the system headers now anyway it was just
 making up for our own tcp.h.
2001-05-09 01:16:57 +00:00
guy
2030f51199 C bitfields are no longer being used to extract bit fields from the IP
and TCP headers, so there's no need to stuff the byte-order stuff into
these header files.
2000-10-03 09:17:40 +00:00
itojun
9d45fb750b fix mistake in bitfield conversion 2000-10-03 03:14:46 +00:00
itojun
fb75d3cd5a always use u_intXX_t for protocol format declaration. char/short/int may not
come with exact size.  while at it, correct signedness of ip/udp header field.
nuke most of the use of bitfield.
TODO: bitfield in namser.h
2000-10-03 02:54:54 +00:00
itojun
cdaba7de64 do not use integer bitfield when we care about the resulting member size.
u_int x:4, y:4; will occupy sizeof(int) on some platforms, while it occupy
1 byte on some platforms.  use macro to decode th_off.
2000-10-03 02:26:53 +00:00
guy
6de29a0314 Declare bitfields as "u_int", not "u_char"; ANSI C doesn't guarantee
that bitfields other than "int" or "unsigned int" are allowed, some
compilers warn about them, and, given that the declaration of a bit
field says how many bits it is wide, declaring them "u_char" doesn't
have any advantage (other than making it a bit clearer, when reading the
header, that the bitfields in question are part of a single byte).
2000-09-29 05:05:47 +00:00
guy
536f512583 Add an "ip.h" header, to declare the IP stuff needed by dissectors, and
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.

Put the declarations of the ICMP stuff directly into "print-icmp.c".

Remove all unnecessary includes of <netinet/ip*.h> files.

Copy the byte-order stuff from "nameser.h" into "tcp.h".
2000-09-23 08:54:24 +00:00
guy
7b50febe28 Add "tcp.h" and "udp.h" headers, to declare the TCP and UDP stuff needed
by dissectors, and have dissectors include them rather than
<netinet/udp.h>, <netinet/udp_var.h>, or <netinet/tcp.h>, if they
actually need that stuff.

Remove all unnecessary includes of <netinet/udp*.h> or <netinet/tcp*.h>
files.
2000-09-23 08:26:30 +00:00