summaryrefslogtreecommitdiff
path: root/print-icmp.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Remove obsolete commentsFrancois-Xavier Le Bail2015-09-071-1/+1
|
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Functions in libnetdissect must use ndo_error() functionFrancois-Xavier Le Bail2015-09-051-3/+3
|
* Fix print-icmp.c warningGisle Vanem2015-07-101-1/+1
| | | | | | | Fix compilation warning: ``` print-icmp.c(559): warning C4456: declaration of 'vec' hides previous local declaration print-icmp.c(344): note: see declaration of 'vec' ```
* Fix a bunch of de-constifications.Guy Harris2015-04-261-10/+10
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* clean K&R style up in function declarations a bitDenis Ovsienko2015-03-051-1/+2
| | | | The function body should have its opening brace on the next line.
* Only print the incorporated IP packet if there is one.Guy Harris2014-12-191-7/+5
| | | | | | Check for the ICMP types that *do* include an IP packet, rather than checking for a set that doesn't. This does a better job of handling unknown ICMP types.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-40/+40
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-10/+10
| | | | | | | | Have them take a netdissect_options * argument, and get the "no name resolution" flag from it. Move the declaration of dnaddr_string to addrtoname.h, along with the other XXX-to-string routines.
* finalize some previous NDO conversionsDenis Ovsienko2014-03-261-1/+1
| | | | | | Eliminate a number of fputs(), putchar() and fflush() uses. Justify preprocessor directives. Don't typecast ND_PRINT() to void and fix some indentation.
* NDOize EIGRP, ICMP, L2TP, STP and UDP decodersDenis Ovsienko2014-03-151-42/+44
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+0
| | | | | | Remove lots of $Header's and a few $Id's that all belong to the former CVS repository of tcpdump itself. These keywords have been frozen since the migration to git in late 2008.
* ndo-ize print-ascii: hex_print_with_offset()Michael Richardson2014-01-011-2/+8
|
* whitespace changesMichael Richardson2014-01-011-4/+4
|
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-3/+3
| | | | | | 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.
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-7/+14
| | | | | | | | | | | | | The Wireshark routine is based on the BSD in-kernel portable checksum routine (thus BSD-licensed); it takes a vector of pointers and lengths and checksums the concatenation of the buffers in question (just as the BSD in-kernel routine checksums a chain of mbufs). This simplifies the "with a pseudo-header" checksums; hopefully it'll fix up the problems being seen on some big-endian platforms, which might be due to hand-calculating some or all of the checksum and doing so incorrectly. It also gets rid of some code that might be dereferencing unaligned pointers.
* Propagate from the x.9 branch:guy2007-09-131-4/+1
| | | | | | | | | | revision 1.81.2.6 date: 2007-09-13 17:40:18 +0000; author: guy; state: Exp; lines: +1 -6 Completely remove that unused "structure". ---------------------------- revision 1.81.2.5 date: 2007-09-13 17:34:20 +0000; author: gianluca; state: Exp; lines: +3 -1 Commented out a 0-length structure that is not used.
* squelch compiler warningshannes2007-08-091-2/+2
|
* apply some heuristics to detect MPLS ICMP extension headers becausehannes2006-12-121-6/+19
| | | | | | | not all implementations correctly set the length field in the ICMP header as per draft-bonica-internet-icmp-08. if the length field is not set then simply check the checksum.
* rework on the ICMP MPLS extension code:hannes2006-12-121-30/+76
| | | | | | | - preserve the snapend pointer as it may get overwritten by calling the IP printer - protect against infinite loops inside the MPLS extension printer. - detect present of an MPLS extension header by introducing a length field to the ICMP header as per draft-bonica-internet-icmp-08.
* print the id field in the echo/echo-reply messagehannes2005-07-011-5/+6
|
* print the timestamp in the icmp tstamp reply message in human readable formhannes2005-06-221-8/+29
|
* refactored ip_print() so that chained header parser (ESP/AH) canmcr2005-04-061-2/+2
| | | | more easily call the inner parts.
* Add some bounds checking and other sanity checking.guy2004-12-231-2/+10
|
* remove duplicateshannes2004-06-151-6/+6
|
* only call into ICMP_MPLS_EXT dissector for ICMP TIMXCEDD and UNREACH ↵hannes2004-06-151-2/+15
| | | | messages, do some extra header sanity checking
* add support for ICMP MPLS extensions as per draft-bonica-icmp-mpls-02hannes2004-06-141-5/+91
|
* Add bounds checking.guy2004-03-241-1/+2
|
* 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".
* 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.
* don't attempt checksumming in ICMP if the packet is a fragmenthannes2003-05-151-3/+3
|
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and soitojun2002-11-091-5/+5
| | | | forth while i'm here
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+2
|
* From Kevin Steves: handle ICMP_ECHO and ICMP_ECHOREPLY with common code.guy2002-07-301-7/+4
|
* For packets with a bad ICMP checksum, show the bad checksum and what itguy2002-07-211-3/+9
| | | | should have been.
* Include the ICMP lengthfenner2002-07-051-2/+2
|
* whitespace cleanupitojun2002-06-111-12/+12
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-4/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* From Nathaniel Couper-Noles <Nathaniel@isi1.tccisi.com>: print theguy2001-10-271-1/+13
| | | | sequence number in ICMP echo requests and replies.
* Fix description of ICMP_REDIRECT_TOSHOST to say "host" and not "net".fenner2001-07-241-2/+2
|
* backout 1.60itojun2001-07-191-8/+9
|
* no real need to pass char * to printf format string.itojun2001-06-281-17/+16
|
* Remove #if 0 sectionsfenner2001-06-151-7/+1
| | | | | | | | Finish converting over to having the caller print the IP address (except for UDP, TCP and SCTP). This consists mostly of removing places where the IP address is printed, both in the big "case" in ip_print() and in the individual printers. Also fix a couple of spacing bugs.
* styleitojun2001-01-281-6/+6
|
* The infinite diversity of UNIX platforms is an eternal source of joy.guy2000-10-101-1/+2
| | | | | | | | | | | | | On some platforms (e.g., Solaris 2.5.1 and 2.6, at least), you have to include <netdb.h> to get MAXHOSTNAMELEN defined, including <sys/param.h> doesn't do it (on others, <netdb.h> doesn't help, and you have to include <sys/param.h>. Include <netdb.h> in some files, but, for "timed.h", just use 256 rather than MAXHOSTNAMELEN - the Berkeley time daemon protocol spec (in the timed source directory in various BSDs) says the packet includes "A zero-terminated string of up to 256 ASCII characters with the name of the machine sending the message."
* some sprintf fixes, from kris@freebsd.org (patches@tcpdump.org #89)itojun2000-10-051-4/+6
| | | | pedant.