summaryrefslogtreecommitdiff
path: root/print-ip.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the nd_uintN_t types more.Guy Harris2015-10-071-3/+3
| | | | | | | | | | | | | | Define them in netdissect.h. Use them in ip.h, and *don't* mark the structures as UNALIGNED; that should no longer be necessary. Add a new nd_ipv4 type to use as an IPv4 address; it represents the 4 bytes of IPv4 address as an array of unsigned chars, so that its natural alignment is only on a byte boundary. Those changes found some places where we weren't using UNALIGNED_MEMCPY() to extract IPv4 addresses from packets; use it.
* 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
|
* Fix checksumming of PIMv2 Register messages.Guy Harris2015-05-021-4/+1
| | | | | | | The checksum only covers the header, not the encapsulated packet, so only checksum that. However, if that checksum fails, try checksumming the entire packet, as, according to RFC 4601, packets with the entire packet checksummed should also be accepted, for interoperability.
* Fix a bunch of de-constifications.Guy Harris2015-04-261-3/+3
|
* 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.
* Dissect the IPv4 header if the version is wrong, but fix the messages.Guy Harris2014-12-191-3/+3
|
* Don't dissect a header with a version field != 4.Guy Harris2014-12-181-1/+2
| | | | Also, clean up the message printed when it's 6.
* Check whether the version field is available before looking at it.Guy Harris2014-12-181-4/+7
| | | | | While we're at it, use ND_TCHECK(), rather than a hand-rolled check, to check whether we have the full fixed-length portion of the IPv4 header.
* Leave it up to ip6_print() to handle non-IPv6-capable systems.Guy Harris2014-10-011-4/+0
| | | | | | | | | | | | Always define and declare ip6_print(), always compile print-ip6.c, and always call it if we recognize a payload as IPv6. If INET6 isn't defined, ip6_print() will just print the length and note that printing isn't supported. That way, we don't do weird dissection of IPv6 packets on systems without IPv6 support, due to, for example, ethertype_print() returning 0 ("not dissected") for IPv6 packets on those systems (IPv6-over-Frame Relay was dissected weirdly due to this).
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-13/+13
| | | | | | | | | 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-11/+11
| | | | | | | | 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.
* NDOize LLDP, PPP and RSVP decodersDenis Ovsienko2014-04-021-1/+1
|
* NDOize DECnet, OSPF and TCP decodersDenis Ovsienko2014-04-021-2/+2
|
* NDOize AODV, IPv4 and SCTP decodersDenis Ovsienko2014-03-261-97/+101
|
* NDOize BOOTP, DHCPv6, DNS, PIM and sFlow decodersDenis Ovsienko2014-03-251-1/+1
| | | | Also add/remove tabs in a few involved functions to justify indentation.
* NDOize VRRP decoderDenis Ovsienko2014-03-231-1/+1
|
* NDOize 7 more small decodersDenis Ovsienko2014-03-211-1/+1
| | | | | This change converts DVMRP, DLT_ENC, EGP, GeoNet, NetFlow, SLIP and TFTP decoders.
* NDOize 7 bigger decodersDenis Ovsienko2014-03-191-2/+2
| | | | | This change converts IGMP, IPv6 mobility options, LDP, Lightweight Access Point, PGM, PPTP and RIP decoders.
* NDOize EIGRP, ICMP, L2TP, STP and UDP decodersDenis Ovsienko2014-03-151-3/+3
|
* NDOize DCCP, Linux socket and RPKI-Router decodersDenis Ovsienko2014-03-141-1/+1
|
* NDOize more small decodersDenis Ovsienko2014-03-121-3/+3
| | | | | This change converts decoders for: DLT_RAW, IPv6 routing header, USB, Symantec firewall and cHDLC.
* NDOize ARCNET, BFD and GRE decodersDenis Ovsienko2014-03-111-1/+1
|
* NDOize IP mobile, MSDP and NULL decodersDenis Ovsienko2014-03-061-1/+1
|
* Add support for VRRPv3 (IPv4 only).Angus Cameron2014-03-061-1/+2
|
* NDOize HSRP, IGRP and UDLD decodersDenis Ovsienko2014-03-041-1/+1
|
* NDOize CIP, IPComp and IPFC decodersDenis Ovsienko2014-02-281-1/+1
| | | | Also remove some unneeded includes while at it.
* NDOize AH, BEEP and DTP decodersDenis Ovsienko2014-02-271-1/+1
| | | | Also remove some unnecessary passages.
* CARP: NDOizeDenis Ovsienko2014-02-251-1/+1
|
* fix partial checksum errors in DCCP decoder, IPv4 caseFrancois-Xavier Le Bail2014-02-151-2/+2
|
* No need for casting back and forth.Guy Harris2014-01-181-3/+2
| | | | | | | | That might also convince the compiler that it can "helpfully" optimize the copy into something that assumes 4-byte alignment, which we don't want it to do on platforms where the optimized code will trap if the IP header *isn't* aligned on a 4-byte boundary, given that there's no guarantee that it *is* aligned on a 4-byte boundary.
* Only do the unaligned_mem{cpy,cmp} hack if necessary.Guy Harris2014-01-171-4/+4
| | | | If the processor does unaligned accesses, it's not necessary.
* More possibly-unaligned memcpy()s and assignments - use unaligned_memcpy().Guy Harris2014-01-171-4/+4
|
* 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.
* make consistent use of the "tstr" idiomDenis Ovsienko2013-12-261-2/+4
| | | | | | | | For each decoder that has more than one instance of truncation signaling and prints the same string in each instance make sure that the string is declared as "static const char tstr[]" right after the initial includes block. Where necessary, replace fputs(s, stdout) with equivalent printf("%s", s).
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-2/+2
| | | | | | 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.
* do not convert protocol to names if -n flagMichael Richardson2012-04-071-1/+1
|
* whitespace changes in print-ip.cMichael Richardson2012-03-291-11/+11
|
* Back out DLT_PFSYNC support.Guy Harris2012-02-291-8/+0
| | | | | | Unfortunately, the DLT_PFSYNC support depends on header files included from the pfctl command's source tree, and trying to arrange to find that would be too much trouble.
* Add DLT_PFSYNC support.Guy Harris2012-02-291-0/+8
| | | | | | From FreeBSD PR bin/124825: tcpdump(8) does not support pfsync(4) data, which in turn was ported over from OpenBSD. We already have CARP support, so we did not port that part over.
* permit -n flag to affect print-ip for protocol numbersMichael Richardson2012-01-231-1/+1
|
* Add a CARP dissector and a command-line option to dissect proto 112 as CARP.George Neville-Neil2011-11-231-1/+13
| | | | | | | CARP and VRRP both use IP protocol number 112, so there needs to be a -T flag to specify that protocol 112 be dissected as CARP rather than VRRP. Also update the man page.
* Add a routine to do the "checksum with pseudo-header" stuff for IPv4.Guy Harris2011-06-171-1/+34
| | | | Clean up some other stuff while we're at it.
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-89/+8
| | | | | | | | | | | | | 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-3/+3
|
* reworked print-ether to use netdissectMichael Richardson2010-10-071-4/+4
|
* modularize ip6 nextlayer checksum generation andHannes Gredler2009-10-121-1/+2
| | | | change tcp6 and pim6 to use it.
* Make the -K flag suppress IP and UDP checksum checking as well.Guy Harris2009-03-051-1/+1
|
* From Victor Oppleman: add support for RFC 1393 traceroute.guy2007-09-141-1/+2
|