summaryrefslogtreecommitdiff
path: root/print-ip.c
Commit message (Collapse)AuthorAgeFilesLines
...
* per George Bakos' suggestion:hannes2003-04-241-57/+57
| | | | | | | | | | backout some of the v1.118 changes now we hide frag processing under the vflag option where we print: id, offset. plus the (+,DF,res) flags using bittok2string also decode the rfc3514 "evil" bit to keep the security guys happy;
* Get rid of the added "IP " - IPv6 doesn't do it, and previous versionsguy2003-02-051-3/+1
| | | | of tcpdump didn't do it.
* Fix up long vs. int issues.guy2003-01-031-2/+2
|
* - move IP option processing from the trail up to the headerhannes2002-12-281-8/+11
| | | | - suppress IP id == 0
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-25/+1
| | | | | | things. (if there's unaligned access, they must be converted to EXTRACT_xx)
* support for RSVPhannes2002-10-041-1/+1
|
* hide multiline output using vflag plus enhanced, ES-IS decoderhannes2002-10-031-1/+8
|
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-4/+4
| | | | | | | | | | | | | | | 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".
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Added support for Win32, based on WinPcap.risso2002-08-011-9/+3
|
* Calculate UDP/TCP pseudo-checksum properly in the presence offenner2002-07-281-1/+47
| | | | source-route options.
* Add a "in_cksum_shouldbe()" to compute, given an Internet checksum fieldguy2002-07-211-4/+57
| | | | | | | in a packet header and the computed checksum for the data that the checksum covers, what the checksum field's value should have been. Use that routine in the IP printer.
* Set "off" before using it.guy2002-07-201-3/+3
|
* the last commit contained a bogus commit message;hannes2002-07-141-16/+15
| | | | | | | purpose of 1.105 was to print the ip header values (len, ttl, tos) at the beginning of the line (where it belongs to) and not at the end; it is only displayed using the -v(erbose) options; the BGP output (where i am working now on) gets much more cleaner now;
* split BGP output to multiple lines;hannes2002-07-141-34/+32
| | | | | | | added support for Originator_ID, Cluster List Attributes; reworked BGP Open Message Decoder do decode optional Capabilities; fixed the NEXTHOP decoder of MP_REACH and MP_UNREACH to honor NH length based on AFI,SAFI
* whitespace cleanupitojun2002-06-111-8/+8
|
* Fix a typo.guy2002-05-291-2/+2
|
* when reporting a bad checksum, indicate what it should have been.mcr2002-05-291-3/+4
|
* remove comment which may not be correct; i've experienced unaligned headeritojun2001-11-161-3/+1
| | | | on bpf taps with netbsd 1.5Y.
* From Crist J. Clark <cjclark@alum.mit.edu>: print the IP protocol fieldguy2001-10-271-4/+16
| | | | | | | | for fragments other than the first fragment. Also, for packets whose IP protocols we don't handle ourselves, print the protocol name if "getprotobynumber()" finds it, otherwise print the protocol number.
* Eliminate some unused parameters.fenner2001-09-171-3/+3
| | | | | | | | | | | 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-5/+5
| | | | | | | | 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.
* Remove #if 0 sectionsfenner2001-06-151-45/+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.
* added explicit protocol number to "ipip" - John Hawkinson <jhawk@MIT.EDU>mcr2001-05-291-2/+2
|
* Print new ECN code-point [ECT(0),ECT(1),CE] instead of old ECN bitsfenner2001-05-091-4/+11
|
* SCTP printing from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>fenner2001-05-091-2/+10
| | | | | Modified to print IP/IPv6-level addresses like TCP does, and to not print multi-line detail unless -vv by fenner.
* Add missing space after "truncated-ip: %d bytes missing!"fenner2001-02-201-2/+2
|
* atabifyitojun2001-01-281-10/+10
|
* When printing VRRP packets, show the source and destination IP addressesguy2001-01-021-1/+5
| | | | if "-v" was specified. From OpenBSD.
* do not try to compute tcp/udp checksum for fragmented datagram.itojun2000-11-171-3/+3
| | | | from: jinmei@kame.net
* Move IGMP to its own file.fenner2000-11-021-151/+1
| | | | | | Add IGMPv3 support. Contributed by: Wilbert de Graaf <wilbertdg@hetnet.nl>
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-4/+4
| | | | | | 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-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/+3
| | | | | | | | | | | 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.
* print IP length. From Kevin Steves <stevesk@sweden.hp.com>assar2000-07-291-1/+3
|
* check the ip protocol version on printing raw packets, from Love ↵assar2000-07-111-1/+27
| | | | <lha@stacken.kth.se>
* remove non-STDC codeassar2000-07-011-4/+1
|
* correct handling of truncated IPv4 option.itojun2000-05-101-2/+10
|
* Initial VRRP printer (ip proto 112, RFC 2338).fenner2000-05-011-1/+8
|
* Don't try to print packets with a too-short hlen.fenner2000-01-251-1/+5
| | | | | Pointed out on BUGTRAQ on 16 Jun 1999 (reported as infinite loop on Linux and core dump on all other OS's)
* * print-rt6.c: make IPv6 routing header printing work with new 2292bisitojun1999-12-221-5/+5
| | | | | | | | | | | API. * print-bgp.c: improve options printing. ugly code exists for unaligned option parsing (need some fix). * const poisoning in SMB decoder. * make dump format back to original. someone may want to add an option to do ascii printing, but keep the default behavior as is for scripts used in many places. * -Wall -Werror clean checks.
* Eliminate printf format warnings.fenner1999-12-151-6/+6
| | | | | Don't use len without initializing in ip_printts() (in the case of an invalid type).
* IGMP fixes:fenner1999-11-231-27/+21
| | | | | | | - Identify IGMPv1 and IGMPv2 instead of "report" and "nreport". - Don't use questionably-portable bitfields for packet formats. - Don't try to check the IGMP checksum if the packet was not completely captured.
* Enhanced PIMv1 support.fenner1999-11-221-2/+2
| | | | Cisco Auto-RP support.
* (ip_printts): hard-code IPOPT_TS_PRESPECassar1999-11-211-2/+13
|
* Switch to config.h instead of passing defines in DEFS.fenner1999-11-211-1/+5
|
* print router-alert and ECN. re-write some. From kuznet@ms2.inr.ac.ruassar1999-11-211-32/+111
|
* - enable build outside of the treeitojun1999-10-301-1/+7
| | | | | | | - endian checks (use WORDS_BIGENDIAN) - fallback def for IPPROTO_{AH,ESP} - sa_len issues - do not use bittypes.h, respect AC_LBL_CHECK_TYPES