summaryrefslogtreecommitdiff
path: root/print-icmp.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Use "u_int8_t", "u_int16_t", and "u_int32_t" rather than "u_char",guy2000-10-031-21/+21
| | | | "u_short", and "u_int".
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-3/+3
| | | | | | 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
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-10/+9
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of unneeded includes of <net/if.h>.guy2000-09-281-2/+1
|
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-12/+119
| | | | | | | | | | | 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".
* Add "tcp.h" and "udp.h" headers, to declare the TCP and UDP stuff neededguy2000-09-231-4/+3
| | | | | | | | | 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.
* Add definitions of Ethernet types fromguy2000-09-231-2/+1
| | | | | | | | | | | | | | | | "linux-includes/netinet/if_ether.h" to "ethertype.h". Move other stuff used by dissectors from <netinet/if_ether.h> to "ether.h", along the lines of "fddi.h" and "token.h". Move ARP declarations from BSD include files to "print-arp.c". Remove from dissectors includes of <netinet/if_ether.h>, and add includes of "ethertype.h" and/or "ether.h" as necessary. Get rid of configuration options that test declarations now made in "ether.h" or "print-arp.c", as those declarations are now under our control, not the OS's control.
* remove non-STDC codeassar2000-07-011-3/+1
|
* add printing of timestamp request and reply. From Frank Volfassar2000-06-101-2/+19
| | | | <volf@oasis.IAEhv.nl>
* (icmp_print): step through all advertised routers for a routerassar2000-05-151-1/+2
| | | | advertisement. From <aandres@mfom.es>
* random cleanups. add some parens for clarity.itojun2000-04-281-17/+18
|
* s/sprintf/snprintf/.itojun2000-01-171-24/+29
| | | | | there seem to be couple of unsafe use of strcat and strcpy - we should bring in strl{cat,cpy}.
* Use TTEST2 instead of home-grown truncation check.fenner1999-11-221-2/+9
| | | | If -vv, print the original IP packet included in ICMP errors.
* Switch to config.h instead of passing defines in DEFS.fenner1999-11-211-1/+5
|
* (icmp_print): check checksum if vflag. From kuznet@ms2.inr.ac.ruassar1999-11-211-2/+8
|
* Bring in KAME IPv6 tcpdump. replaces esp/ah/isakmp decoder.itojun1999-10-301-3/+5
| | | | | | | Hope I did not break anything. Portability on IPv4-only node needs checking, I'll do this very soon. (sorry for rather jumbo commit) XXx what is _FAVOR_BSD?
* patches to help build on Linux 2.2linux22mcr1999-10-171-4/+3
|