summaryrefslogtreecommitdiff
path: root/ip.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix some spelling. [skip ci]Denis Ovsienko2020-10-091-1/+1
|
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-2/+2
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Make nd_uint8_t and nd_int8_t arrays, to catch direct references.Guy Harris2017-12-101-2/+2
| | | | | | | | | | This catches direct references, so we can change them to use EXTRACT_U_1 or EXTRACT_S_1. Also, change some structures to use the nd_ types that weren't already using them. Then make the appropriate EXTRACT_{U,S}_1() changes.
* Use the nd_uintN_t types more.Guy Harris2015-10-071-18/+18
| | | | | | | | | | | | | | 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.
* Get rid of "tcpdump" in some libnetdissect codesFrancois-Xavier Le Bail2015-09-081-3/+3
|
* Remove useless includeFrancois-Xavier Le Bail2015-09-081-2/+0
|
* make sure to include tcpdump-stdinc.h; it is requiredMichael Richardson2014-07-071-0/+2
|
* More fixes for uint8_t being shorter than u_int8_t.Guy Harris2014-04-231-8/+8
| | | | Fix a typo while we're at it.
* More getting rid of old u_intN_t.Guy Harris2014-04-231-14/+14
|
* NDOize AODV, IPv4 and SCTP decodersDenis Ovsienko2014-03-261-3/+4
|
* fix partial checksum errors in DCCP decoder, IPv4 caseFrancois-Xavier Le Bail2014-02-151-1/+1
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-1/+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.
* Add a routine to do the "checksum with pseudo-header" stuff for IPv4.Guy Harris2011-06-171-1/+1
| | | | Clean up some other stuff while we're at it.
* Mark various IPv4 and IPv6 headers as unaligned.Guy Harris2010-08-311-2/+2
| | | | | | | | | | | | | This prevents GCC on SPARC from generating code that assumes those structures are aligned naturally, which they are not guaranteed to be. Move some #defines from interface.h to tcpdump-stdinc.h to make them available to code that doesn't include interface.h. Move the declaration of nextproto6_cksum() to ip6.h, so that only files that use it get it declared, and thus so that you don't need to define "struct ip6_hdr" in everything that includes interface.h. Don't include ip6.h in tcpdump-stdinc.h.
* From Victor Oppleman: add support for RFC 1393 traceroute.guy2007-09-141-1/+2
|
* clean up the ip options printer:hannes2004-09-271-1/+2
| | | | | | - make more use of tok2str() - always display the option length - move option defines into ip.h
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+3
| | | | forth while i'm here
* Calculate UDP/TCP pseudo-checksum properly in the presence offenner2002-07-281-1/+4
| | | | source-route options.
* C bitfields are no longer being used to extract bit fields from the IPguy2000-10-031-24/+1
| | | | | and TCP headers, so there's no need to stuff the byte-order stuff into these header files.
* fix mistake in bitfield conversionitojun2000-10-031-4/+4
|
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-27/+17
| | | | | | 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
* Declare bitfields as "u_int", not "u_char"; ANSI C doesn't guaranteeguy2000-09-291-5/+5
| | | | | | | | that bitfields other than "int" or "unsigned int" are allowed, some compilers warn about them, and, given that the declaration of a bit field says how many bits it is wide, declaring them "u_char" doesn't have any advantage (other than making it a bit clearer, when reading the header, that the bitfields in question are part of a single byte).
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-3/+3
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of some "__attribute__ ((packed))"s that I missed.guy2000-09-241-3/+3
|
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-0/+192
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".