summaryrefslogtreecommitdiff
path: root/print-ip6.c
Commit message (Collapse)AuthorAgeFilesLines
* Use nextproto6_cksum() for XXX-over-IPv6 checksums.Guy Harris2011-06-171-3/+3
| | | | Get rid of duplicated checksums with IPv6 pseudo-headers.
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-14/+20
| | | | | | | | | | | | | 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.
* Convert the IPv6 printer to use netdissect.Guy Harris2010-11-071-27/+27
|
* Include "netdissect.h" in print-ip6.c, and move icmp6_print'sGuy Harris2009-11-261-0/+1
| | | | | declaration out from inside #if 0/#endif, to get it declared in print-ip6.c.
* netdisect converted icmp6_print()Michael Richardson2009-11-141-1/+1
|
* modularize ip6 nextlayer checksum generation andHannes Gredler2009-10-121-1/+27
| | | | change tcp6 and pim6 to use it.
* in tcpdump a length field has the semantics of a 'total length field'hannes2007-09-211-2/+2
| | | | | | i.e. including the header - the IP6 payload length field differs from that ... highlight the difference by printing 'payload length' rather than 'length'
* From pfhunt on SourceForge:guy2007-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a packet contains an IPv6 options header followed by an unknown IPv6 protocol payload, tcpdump displays the proto ID for the known option header, not for the unknown payload. For example, this is the output for an IPv6 packet containing a destination options header, followed by a payload of (unknown) protocol 138: # tcpdump -s 128 -i eth1 tcpdump: WARNING: addresses not searched tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes 11:44:40.862572 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-60 16 The ip-proto-60 refers to the destination option header (DSTOPT), rather than displaying the unknown option 138, which I think would be more informative. The attached patch fixes this problem. With the patch applied, the output for the packet is: # tcpdump -s 128 -i eth1 tcpdump: WARNING: addresses not searched tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes 11:48:26.160462 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-138 16
* From Ian McDonald and Arnaldo Carvalho de Melo: DCCP support.guy2005-09-201-2/+5
|
* add GRE and RSVP to the supported IPv6 protoshannes2005-07-031-1/+10
|
* from Andy Heffernan <ahh@juniper.net>:hannes2005-05-201-1/+5
| | | | add PGM upport as per rfc3208
* refactored ip_print() so that chained header parser (ESP/AH) canmcr2005-04-061-2/+2
| | | | more easily call the inner parts.
* -display cosmetics: make the output more conistent:hannes2004-09-291-2/+2
| | | | | | | | - consistent use of length field (not payload-len) - no message type number given in PIM/OSPF printers as those changes affect only verbose mode and/or routing protocols we hope not to break existing scripts;
* Use %u to print unsigned quantities.guy2004-08-271-3/+3
| | | | | | | | | Check, and use, the supplied packet length in the PPPoE dissector. (It reflects the actual packet length; snapend reflects the captured packet length.) As we're now doing bounds checks with TCHECK, the loop over the tagged fields doesn't have to check against snapend.
* print the packet length for ESP packetshannes2004-07-161-2/+2
|
* supress printing of the L3 protoname if eflag is sethannes2004-05-011-2/+3
|
* print header related information earlier - in order to not break multi-line ↵hannes2004-04-261-40/+39
| | | | outputs
* print-esp has been "NDO"-ized.mcr2004-04-051-2/+2
| | | | | replace error() and warning() with ndo-ized version. moved snaplen/snapend to ndo structure.
* 135 appears to be the current IP protocol number for mobility headers;guy2003-11-241-3/+10
| | | | | | support it, as well as 62 (which presumably was one that was used before, even though it was already assigned to some protocol named CFTP).
* Use "len", not "payload_len", as we step through the packet; useguy2003-11-191-19/+15
| | | | "payload_len" to report the raw value from the header.
* Keep the remaining payload length in a separate variable from the totalguy2003-11-191-12/+18
| | | | payload length, so we can report the latter at the end of dissection.
* "icmp6_rrenum_print()" doesn't use its "icmp6len" argument (and, as thatguy2003-11-191-8/+5
| | | | | | | | | | | | | | | | | just reflects the payload length, the snapshot length has been trimmed to correspond to it, so it doesn't need to check it merely to avoid running past the end of the IPv6 payload); get rid of it. Pass "icmp6_print()" the IPv6 payload length (i.e., the length of the ICMPv6 packet), rather than having it compre the length itself. Make the length argument to "icmp6_cksum()" unsigned, to match the value passed to it. Fix the lengths passed to "sctp_print()", "tcp_print()", and "udp_print()" (we update "len" in the header-processing loop to correspond to the remaining payload, so we just pass it to those routines).
* Have various routines for printing non-final headers for IPv4/IPv6guy2003-11-191-6/+2
| | | | | | | return -1 if they run out of data. Have the IPv4 and IPv6 dissectors check for non-positive return values from those routines and quit if they see one.
* Cut off "snapend" at the length of the IPv4 or IPv6 payload, so we don'tguy2003-11-191-5/+14
| | | | | | | | | | | | | | | | | 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".
* styleitojun2003-10-281-4/+4
|
* Add a new "ipproto.h" header file, with definitions of IP protocol typeguy2003-06-071-19/+6
| | | | | | | 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 SCTP dissector is only called for SCTP packets, so there's no reasonguy2003-06-031-2/+10
| | | | | | | | | 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.
* verify/warn icmpv6 checksum. from jinmei@kameitojun2003-05-021-2/+2
|
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* remove buffer move in LBL_ALIGN case, which does more bad things than good ↵itojun2002-10-181-20/+1
| | | | | | things. (if there's unaligned access, they must be converted to EXTRACT_xx)
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-3/+3
| | | | | | | | | | | | | | | 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".
* Make "mobility_opt_print()" static, as it's not used outsideguy2002-08-021-1/+5
| | | | | | | | "print-mobility.c". Make sure "mobility_print()" returns a valid value even if there's no data available in the mobility header - but note that the value isn't used. (Is there ever a need to use the value?)
* Added support for Win32, based on WinPcap.risso2002-08-011-8/+2
|
* From Kazushi Sugyo <sugyo@pb.jp.nec.com>:guy2002-06-271-1/+8
| | | | | | | | | Here is a patch for draft-ietf-mobileip-ipv6-17. - print-mobility.c: Mobility header(MIPv6 defines a new IPv6 protocol) printing - added Routing header type 2 - ICMPv6 Home Agent Address Discovery and Mobile Prefix Sol., Adv. message update
* whitespace cleanupitojun2002-06-111-3/+3
|
* remove comment which may not be correct; i've experienced unaligned headeritojun2001-11-161-3/+1
| | | | on bpf taps with netbsd 1.5Y.
* adjust bp when packet is moved by LBL_ALIGNitojun2001-11-151-1/+2
|
* die if malloc fails in #ifdef LBL_ALIGN.itojun2001-11-151-2/+5
| | | | | XXX LBL_ALIGN path is not really torture-tested, and at this moment it can affect field printing badly (like TCP).
* Eliminate some unused parameters.fenner2001-09-171-8/+8
| | | | | | | | | | | Use const more. Use EXTRACT_* macros more. Use TCHECK* more. Use tok2str() to replace some home-grown workalikes. smb: - Get rid of private types, use tcpdump-defined types - Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict with IRIX library function.
* Don't try decrypting a fragmented ESP packet; the IP proto number andfenner2001-08-201-3/+4
| | | | | | | | padding info are in the last fragment but the header is in the first fragment. Pass padding length back to IP to allow trimming the padding. Update in_cksum() prototype to allow using it for checksums including the pseudo-header.
* do not try to compute tcp/udp checksum for fragmented datagram.itojun2000-11-171-3/+5
| | | | from: jinmei@kame.net
* repair IPv6 ESP decoderitojun2000-11-091-14/+14
|
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-2/+2
| | | | | | | | 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?
* include string.h for memcpy/memset.itojun2000-10-031-2/+3
| | | | | on some architecutrees, sizeof(void *) > sizeof(int). don't try to cast pointer to int to check alignment issues.
* 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/+1
| | | | | | | | | | | 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/+1
| | | | | | | | | 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.
* (ip6_print): fix flipped arguments to memcpy. From Rafal Maszkowskiassar2000-07-291-3/+3
| | | | <rzm@icm.edu.pl>