summaryrefslogtreecommitdiff
path: root/print-tcp.c
Commit message (Collapse)AuthorAgeFilesLines
* From Noritoshi Demizu: memcmp() returns a value = 0 if the two memoryguy2005-10-161-2/+2
| | | | | | regions are =, < 0 if the first memory region is < the second, or > 0 if the first memory region is > the second, so to check whether two memory regions are equal, check whether memcmp()'s return value is == 0.
* Squelch a signed vs. unsigned warning.guy2005-04-211-2/+2
|
* From Noritoshi Demizu <demizu@users.sourceforge.net>: don't print "sack"guy2005-04-181-5/+3
| | | | twice.
* tweaked copyright.mcr2005-04-061-1/+3
|
* Have our own headers to declare the format of ONC (Sun) RPC messages onguy2004-12-271-5/+5
| | | | | | | | | | | | | | the wire; the definitions in many systems use u_long, which is 64 bits long on many platforms - that's OK for in-memory structures, but it doesn't match what's on the wire. Use headers based on the Sun ones, but use u_int32_t for fields, and otherwise make the structures match what's on the wire, and change some names to avoid collision with <rpc/rpc.h>, which print-sunrpc.c includes to declare "getrpcbynumber()" and the structure it returns. Record whether "getrpcbynumber()" is found, and use it only if it's found, rather than basing the decisison on whether we're building for Win32 or not.
* In "tcp_verify_signature()", don't assume we can do IPv6, andguy2004-09-151-7/+30
| | | | | | distinguish between "signature invalid" and "we can't check the signature". Have its caller show the raw signature if we can't check it.
* "sizeof()" could be "unsigned long" or "unsigned int"; cast it toguy2004-07-151-3/+3
| | | | | "unsigned long" and print it with "%lu", so it works in either case, regardless of whether "long" is the same size as "int" or not.
* Check for a TCP header length that's too short, report more informationguy2004-07-081-5/+17
| | | | if it's too long, and check for NFS only if the header length is OK.
* From Steiner Haug: handle LDP-over-TCP, and do more complete LDPguy2004-05-271-3/+4
| | | | decoding.
* TCP MD5 signature for IPv6. XXX not really tested yetitojun2004-04-261-13/+27
|
* display cosmetics: be more verbose on IP6 TCP checksum errors, align IP4,IP6 ↵hannes2004-04-241-9/+13
| | | | checksum printing
* get rid of warning in print-tcp.c about const violations.mcr2004-04-051-7/+11
| | | | | | the signature checker was writing over a structure that should not have been modified - change the code to make a copy instead.
* From Bruce M. Simpson: add a "-M" flag to specify a shared secret forguy2004-03-231-1/+75
| | | | TCP-MD5 (RFC 2385) digest verification if we have libcrypto.
* Cut off "snapend" at the length of the IPv4 or IPv6 payload, so we don'tguy2003-11-191-11/+8
| | | | | | | | | | | | | | | | | run past the end of that payload. Check that the IPv4 total length isn't less than the header length. Use "%u", not "%d", to print unsigned values. Properly update "len" in the header-processing loop for IPv6. Doing so means we can trust the length passed to the TCP and UDP dissectors when constructing the IPv6 pseudo-header; do so (but fix the length we pass to the UDP-over-IPv6 checksum routine). That length is unsigned; make the corresponding arguments to the TCP and UDP checksum routines unsigned.
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | 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.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | 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".
* In mDNS, report IN-class records with the "cache flush" bit set as such,guy2003-11-051-2/+2
| | | | rather than as "Class 32769".
* unsigned/signed mixupitojun2003-10-281-2/+2
|
* Add a new "ipproto.h" header file, with definitions of IP protocol typeguy2003-06-071-1/+2
| | | | | | | values. Use that rather than private definitions in various files. Add "gmpls.h" to the list of files in FILES, and add it and "ipfc.h" to the list of files in INSTALL.
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-40/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-2/+2
| | | | | | | | | | | | | | | unused-parameter problems reported by GCC. Add an _U_ tag to label parameters as unused if the function is called through a pointer (so that you can't change its signature by removing parameters) or if there are unused parameters only because the function isn't complete. Add some additional bounds checks the necessity for which was revealed while cleaning up unused-parameter problems. Make some routines static. "lcp_print()", defined in "print-lcp.c", isn't called anywhere - "print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* more consistent use of the length: indicator;hannes2002-08-201-2/+2
|
* tell the world that its LDP, rather than port 646;hannes2002-08-201-1/+4
|
* dissect traffic on port 5353 as multicast DNS. vlubet@apple.comitojun2002-08-161-2/+3
|
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+2
|
* Calculate UDP/TCP pseudo-checksum properly in the presence offenner2002-07-281-2/+5
| | | | source-route options.
* For packets with a bad TCP checksum, show the value from the header, andguy2002-07-211-5/+7
| | | | | the value it should have had, as we do for packets with a bad IP checksum, rather than showing the non-zero computed checksum.
* The BXXP protocol was replaced by the BEEP protocol; replace the BXXPguy2001-12-101-4/+4
| | | | dissector with a BEEP dissector.
* clarify some signedness mixupitojun2001-11-161-2/+2
|
* remove a blank lineitojun2001-11-051-2/+1
|
* comment about DNS-over-TCP decoding. the packet could be unaligned (DNSitojun2001-10-191-2/+5
| | | | | formatted payload does not start at the top of the packet), and in that case, the decoded result could be garage
* Add --enable-smb to make it easier to re-enable the SMB printer.fenner2001-10-081-2/+2
|
* disable smb printing until we have boundary checks in *smb*.c (there's almostitojun2001-10-041-1/+3
| | | | no boundary check).
* Add MSDP printer.fenner2001-09-171-1/+4
|
* Use the passed in length instead of the IP header's length in thefenner2001-08-201-22/+5
| | | | | pseudo-header checksum, to allow for IPSEC or other encapsulations. Use in_cksum() instead of private versions.
* indentitojun2001-06-251-2/+2
|
* Move some stuff that tried to make up for system headers from print-tcp.cfenner2001-05-091-40/+1
| | | | | to tcp.h, since don't use the system headers now anyway it was just making up for our own tcp.h.
* PPTP support, from Motonori Shindo <mshindo@mshindo.net>.guy2001-03-091-1/+6
|
* decode DNS over TCPitojun2001-02-031-12/+19
|
* remove extra spaceitojun2001-01-281-2/+1
|
* use safeputchar() instead of cook up on its own.itojun2001-01-281-5/+2
|
* When adding the last byte of an odd number of bytes to a TCP or UDPguy2000-12-231-3/+3
| | | | | | | | | | checksum, fetch it by casting the pointer to "const u_int8_t *" rather than "const char *" - casting it to "const char *" causes it to be sign-extended, perhaps causing 16 1 bits to be added in at the top and, at least on big-endian platforms (where "htons()" does nothing, meaning it won't trim off the extra 16 bits) with signed "char"s (e.g., SPARC), causing the checksum to be computed incorrectly and causing it to incorrectly be reported as bad.
* do not try to compute tcp/udp checksum for fragmented datagram.itojun2000-11-171-4/+4
| | | | from: jinmei@kame.net
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-5/+4
| | | | | | | | ip6.h is almost normal RFC2292 header. icmp6.h has couple of extensions (not covered by RFC2292), like MLD, ICMPv6 nodeinfo, and router renumber. XXX how to synchronize with future kame changes?
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-4/+4
| | | | | | 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
* do not use integer bitfield when we care about the resulting member size.itojun2000-10-031-4/+4
| | | | | 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.
* BXXP support, from Richard Sharpe <sharpe@ns.aus.com>.guy2000-09-301-1/+4
|
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-3/+3
| | | | | | | | | | | 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".