aboutsummaryrefslogtreecommitdiff
path: root/ip.h
AgeCommit message (Collapse)Author
2020-10-09Fix some spelling. [skip ci]Denis Ovsienko
2019-03-26Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail
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.
2017-12-10Make nd_uint8_t and nd_int8_t arrays, to catch direct references.Guy Harris
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.
2015-10-07Use the nd_uintN_t types more.Guy Harris
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.
2015-09-08Get rid of "tcpdump" in some libnetdissect codesFrancois-Xavier Le Bail
2015-09-08Remove useless includeFrancois-Xavier Le Bail
2014-07-07make sure to include tcpdump-stdinc.h; it is requiredMichael Richardson
2014-04-23More fixes for uint8_t being shorter than u_int8_t.Guy Harris
Fix a typo while we're at it.
2014-04-23More getting rid of old u_intN_t.Guy Harris
2014-03-26NDOize AODV, IPv4 and SCTP decodersDenis Ovsienko
2014-02-15fix partial checksum errors in DCCP decoder, IPv4 caseFrancois-Xavier Le Bail
2014-01-03remove tcpdump's own CVS keywordsDenis Ovsienko
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.
2011-06-17Add a routine to do the "checksum with pseudo-header" stuff for IPv4.Guy Harris
Clean up some other stuff while we're at it.
2010-08-31Mark various IPv4 and IPv6 headers as unaligned.Guy Harris
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.
2007-09-14From Victor Oppleman: add support for RFC 1393 traceroute.guy
2004-09-27clean up the ip options printer:hannes
- make more use of tok2str() - always display the option length - move option defines into ip.h
2002-12-11The "__attribute__((packed))" tag on structures causes some files not toguy
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.
2002-11-09put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and soitojun
forth while i'm here
2002-07-28Calculate UDP/TCP pseudo-checksum properly in the presence offenner
source-route options.
2000-10-03C bitfields are no longer being used to extract bit fields from the IPguy
and TCP headers, so there's no need to stuff the byte-order stuff into these header files.
2000-10-03fix mistake in bitfield conversionitojun
2000-10-03always use u_intXX_t for protocol format declaration. char/short/int may notitojun
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
2000-09-29Declare bitfields as "u_int", not "u_char"; ANSI C doesn't guaranteeguy
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).
2000-09-29Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy
"n_long", and "n_time", defined in that file, with other types.
2000-09-24Get rid of some "__attribute__ ((packed))"s that I missed.guy
2000-09-23Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy
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".