Commit Graph

47 Commits

Author SHA1 Message Date
Guy Harris b1f5853f41 Daniel Ryde's patch to show the IP flags as 4 bits, rather than showing
the full octet containing the flags and the upper 4 bits of the fragment
offset.

svn path=/trunk/; revision=678
1999-09-14 08:18:24 +00:00
Guy Harris fa1930a89c We now use "snprintf()" in "dissect_ip_tcp_options()", so we may need to
include "snprintf.h" to declare it.

svn path=/trunk/; revision=621
1999-08-31 23:21:29 +00:00
Guy Harris 670cf84e9b For unknown options without "syntax" errors, show the length in bytes.
svn path=/trunk/; revision=605
1999-08-28 19:38:37 +00:00
Guy Harris f9068da3e0 Handle unknown options in "dissect_ip_tcp_options()" better; we assume
that the only options that contain *no* length byte are the IP and TCP
EOL and NOP options so that we can treat unknown options as
VARIABLE_LENGTH with a minimum of 2, and at least be able to move on to
the next option by using the length in the option, rather than just
reporting the unknown option and processing no options after it.

svn path=/trunk/; revision=604
1999-08-28 19:17:17 +00:00
Guy Harris 18ecb7c367 PPP options in LCP, IPCP, etc. are like IP and TCP options - one octet
of option code, one octet of length (which includes the two option code
and length bytes), followed by 0 or more octets of option data, with
some options being fixed-length and some being variable-length.  Put
some stuff from the PPP control protocol option parsing code into the
IP-and-TCP option parsing code, and use the latter instead of the
former.

(That code might also be usable for CDP as well, with some stuff added
to it.)

Shuffle the arguments to "dissect_ip_tcp_options()" to resemble those of
various other dissectors (i.e., with the "proto_tree *" at the end).

Add in code to dissect a pile of PPP options documented in various RFCs.

svn path=/trunk/; revision=601
1999-08-28 08:31:28 +00:00
Gilbert Ramirez 75e0f95517 Changed ip.flags from FT_UINT16 to FT_UINT8, and made it highlight only
one byte in the hexdump.

svn path=/trunk/; revision=600
1999-08-28 03:56:03 +00:00
Gilbert Ramirez 6f46f57ff1 Set protocol column to "IP" for fragmented IP packets. It was not being set at
the IP layer, leaving the lower layer's abbreviation in the protocol column.

svn path=/trunk/; revision=599
1999-08-28 02:33:47 +00:00
Gilbert Ramirez da72d12846 Dissect unknown IP protocols with dissect_data().
svn path=/trunk/; revision=585
1999-08-26 17:31:37 +00:00
Gerald Combs 5c57f09423 Richard J�rgensen <ric@tbit.dk> pointed out that ICMP and IGMP checksums
were printed in the wrong byteorder.

svn path=/trunk/; revision=539
1999-08-21 21:06:11 +00:00
Guy Harris ac4f87218d Declare the "packet_info" structure "pi" in "packet.h", rather than in a
bunch of source files.

Replace the "payload" field of a "packet_info" structure with "len" and
"captured_len" fields, which contain the total packet length and total
captured packet length (including all headers) at the current protocol
layer (i.e., if a given layer has a length field, and that length field
says its shorter than the length we got from the capture, reduce the
"pi.len" and "pi.captured_len" values appropriately).  Those fields can
be used in the future if we add checks to make sure a field we're
extracting from a packet doesn't go past the end of the packet, or past
the captured part of the packet.

Get rid of the additional payload argument to some dissection functions;
use "pi.captured_len - offset" instead.

Have the END_OF_FRAME macro use "pi.captured_len" rather than
"fd->cap_len", so that "dissect the rest of the frame" becomes "dissect
the rest of the packet", and doesn't dissect end-of-frame padding such
as padding added to make an Ethernet frame 60 or more octets long.  (We
might want to rename it END_OF_PACKET; if we ever want to label the
end-of-frame padding for the benefit of people curious what that extra
gunk is, we could have a separate END_OF_FRAME macro that uses
"fd->cap_len".)

svn path=/trunk/; revision=506
1999-08-18 00:57:54 +00:00
Gilbert Ramirez d4331d4329 Converted more of the IP fields to filterable fields.
svn path=/trunk/; revision=505
1999-08-17 03:09:39 +00:00
Guy Harris 9e58014e7f Add ICMP to the set of packet types counted in the window shown while a
capture is in progress.

svn path=/trunk/; revision=491
1999-08-14 23:47:20 +00:00
Guy Harris 2563e672c8 Fix the list of descriptions of codes in ICMP Unreachable messages.
svn path=/trunk/; revision=458
1999-08-10 04:57:47 +00:00
Gilbert Ramirez e3e125878f Added John McDermott's patch for handling ICMP Unreachable|Fragmentation
Required packets.

svn path=/trunk/; revision=455
1999-08-09 18:18:38 +00:00
Guy Harris 50dbd34d6d Fix a "proto_tree_add_text()" call that should've been a
"proto_tree_add_item()" call (and fix the length passed to it, which, it
appears, has been wrong for ages).

svn path=/trunk/; revision=439
1999-08-05 00:02:55 +00:00
Laurent Deniel 98ebf4ee0a Remove srcip and destip from packet_info since it is not safe to affect
string pointer from the result of ip_to_str (statically allocated string).
Use the ip_src and the new field ip_dst in follow.c to build a correct
string display filter.

svn path=/trunk/; revision=408
1999-07-31 11:21:06 +00:00
Gilbert Ramirez 7bd6c15378 Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.

svn path=/trunk/; revision=402
1999-07-29 05:47:07 +00:00
Gilbert Ramirez 9612b74c16 Added just enough fields to TCP to support "Follow TCP Stream". It works now.
Added the protocol IDs for ipx and IGMP, but not their fields.

svn path=/trunk/; revision=365
1999-07-17 04:19:15 +00:00
Gilbert Ramirez 0d36ec8de2 Modified the proto_register_field_array usage again. Thanks to Guy's
suggestion, this new method using a static array should use less memory
and be faster. It also has a nice side-effect of making the source-code
more readble, IMHO.

Changed the print routines to look for protocol proto_data instead of
looking at the text label as they did before, hoping that the data hex
dump field item starts with "Data (".

Added the -G keyword to ethereal to make it dump a glossary of display
filter keywords to stdout and exit. This data is then formatted with
the doc/dfilter2pod perl program to pod format, which is combined
with doc/ethereal.pod.template to create doc/ethereal.pod, from which
the ethereal manpage is created. This way we can keep the manpage up-to-date
with a list of fields that can be filtered on.

svn path=/trunk/; revision=364
1999-07-15 15:33:52 +00:00
Gilbert Ramirez 53d2a96094 Added Johan's RADIUS dissector, finally. I modified it to fit in with the
new proto_tree routines. I also removed the check for lex and yacc from
wiretap's configure script. The IP dissector now uses
proto_register_field_array().

svn path=/trunk/; revision=348
1999-07-08 04:23:28 +00:00
Gilbert Ramirez 07f42b5b31 Created a new protocol tree implementation and a new display filter
mechanism that is built into ethereal. Wiretap is now used to read all
file formats. Libpcap is used only for capturing.

svn path=/trunk/; revision=342
1999-07-07 22:52:57 +00:00
Gilbert Ramirez 6533d5cae6 Added "0x" to a couple of proto_tree_add_item printf-style labels that
were printing values in hex. The lack of "0x" in fron of the hex numbers
made me think the values were decimal, causing me to waste a bit of time
during debugging.

svn path=/trunk/; revision=323
1999-06-21 16:20:18 +00:00
Gilbert Ramirez aca172004f Added RSVP protocol dissector.
svn path=/trunk/; revision=304
1999-06-11 16:45:02 +00:00
Gilbert Ramirez 34450a8a35 Added PPPoE, PPTP, GRE, and ISAKMP dissectors.
svn path=/trunk/; revision=303
1999-06-11 15:30:55 +00:00
Guy Harris fac51faa8a Dissect ICMP Router Discovery packets (router advertisements and router
solicitations).

svn path=/trunk/; revision=295
1999-05-20 02:41:22 +00:00
Laurent Deniel 06d5d955e8 Minor performance improvement and TCP option decoding fixed (when no tree).
svn path=/trunk/; revision=283
1999-05-12 20:44:59 +00:00
Guy Harris ee80616a8c FTP, POP, and Telnet support from Richard Sharpe.
svn path=/trunk/; revision=237
1999-04-05 21:54:41 +00:00
hannes ccba477d7f Bugfix: The IP Precedence (first three bits in the TOS field) has been cleared
by accident -> It should be displayed correctly with this fix

svn path=/trunk/; revision=234
1999-03-30 20:40:12 +00:00
Gilbert Ramirez 2b86d46d70 Jun-ichiro's IPv6 patch is merged in with ethereal and now uses the new
proto*() functions. The configure script tries to use ipv6 name resolution if
it knows the type of ipv6 stack the user has (this can be avoided with the
--disable-ipv6 switch) Additionally, the configure script now deals with wiretap
better. If the user doesn't want to compile wiretap, the wiretap is never
visited. A few unnecessary #includes were removed from some wiretap files, and
a CPP macro was moved from bpf.c to wtap.h.

svn path=/trunk/; revision=229
1999-03-28 18:32:03 +00:00
Gilbert Ramirez ef3dfe2077 Removed all references to gtk objects from packet*.[ch] files. They now
reference the protocol tree with struct proto_tree and struct proto_item
objects. That way, the packet decoding source code file can be used with
non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged
some of the information in packet.h to more appropriate places (like other
packet-*.[ch] files).

svn path=/trunk/; revision=223
1999-03-23 03:14:46 +00:00
Guy Harris 84361900fa Decode more stuff in an ICMP packet.
svn path=/trunk/; revision=213
1999-03-09 02:52:37 +00:00
Guy Harris dadb230a9e Make the arrays of pointers to strings for ICMP decoding static, as
they're not used outside this file.

Compute their sizes with the standard "number of elements in an array" C
idiom, rather than hardcoding them as numbers.

Add the "information request" and "information reply" ICMP packet types.

svn path=/trunk/; revision=212
1999-03-09 01:45:06 +00:00
Guy Harris 75305346b5 When doing a capture, decode enough of the incoming packets to correctly
update the packet counts and percentages in the dialog box popped up
during a capture, even for non-Ethernet captures.

svn path=/trunk/; revision=184
1999-02-09 00:35:38 +00:00
Gilbert Ramirez facb503960 I removed the bit-fields that depended upon gcc's ability to use any type
of variable as a bit field container. ANSI specs only allow unsigned ints
to host bit fields; IBM's C compiler is very ANSI-strict.

svn path=/trunk/; revision=183
1999-02-08 20:02:35 +00:00
Gerald Combs cb1f8e34c5 * Added Joerg Mayer's Vines patch
* Added Joerg to the AUTHORS file
* Added Guy's bitfield decode patch
* Fixed time output

svn path=/trunk/; revision=142
1998-12-29 04:05:38 +00:00
Gerald Combs 6ca358948b * Added column formatting functionality.
* Added check_col(), add_col_str() and add_col_fmt() to replace references
  to ft->win_info.
* Added column prefs handling code.

svn path=/trunk/; revision=97
1998-11-17 04:29:13 +00:00
Gilbert Ramirez fcb4c78a6a A lengthy patch to add the wiretap library. Wiretap is not used by default
because it is still in its infancy, but it can be compiled in optionally.
The library exists in its own subdirectory ethereal/wiretap. This patch also
edits all the packet-*.c files to remove the #include <pcap.h> line which is
unnecessary in these files. In the ethereal code, file.c is the most heavily
modified with #ifdef WITH_WIRETAP lines for the optional library.

svn path=/trunk/; revision=82
1998-11-12 00:06:47 +00:00
Guy Harris 6f241463be Add the "Maximize security" type of service for IP, from RFC
1455.

	Make the arguments to "val_to_str()" and "match_strval()" that
	point to things those routines don't modify pointers to "const",
	and make the "value_string" tables passed into those routines in
	"packet-ip.c" "const".

svn path=/trunk/; revision=72
1998-10-28 01:16:49 +00:00
Guy Harris 0bb16cb989 Add a "val_to_str()" routine that calls "match_strval()" and, if
it returns NULL, formats the value with the format passed in as
	an argument, and returns a pointer to that static buffer.

	Change several "match_strval()" calls to use "val_to_str()".

	In "dissect_ospf()", use "match_strval()" to look up the packet
	type, and use "Unknown" if it doesn't find a match.

svn path=/trunk/; revision=66
1998-10-20 05:31:03 +00:00
Gerald Combs 349f96bb49 * Copied in the correct GNU license (I'm such a goober)
* Hacks to the filter interface (Gerald)
* About box (Laurent)
* AppleTalk support (Simon)
* Mods to the match_strval routine (Gerald)

svn path=/trunk/; revision=61
1998-10-16 01:18:35 +00:00
Guy Harris 7f2da15d6b Add a routine to dissect IP or TCP options (and, from a look at RFC
1883, it should, perhaps with some additions, be able to handle IPv6
options as well).

Make the IPv4 and TCP dissectors use it.

Fix a typo in the IP dissector ("Unknon" for "Unknown").

Show the IP and TCP header lengths as byte counts rather than
4-byte-word counts.

Show the protocol field value of an IP header as a name if it's a
protocol we know about.

List the acknowledgment and urgent pointer values in a TCP header only
if the corresponding flag is set.

Make the ETT_ values members of an enum, so that the compiler
automatically assigns them sequential integer values (at least if said
compiler conforms to the ANSI C standard).

svn path=/trunk/; revision=45
1998-10-13 05:40:04 +00:00
Gerald Combs 73e19611fd * Fixes for bugs introduced in last night's commit.
svn path=/trunk/; revision=37
1998-10-10 18:23:43 +00:00
Gerald Combs 1b26a7cdb7 * OSPF alignment fixes (Gerald)
* FDDI support (Laurent, Guy)

svn path=/trunk/; revision=36
1998-10-10 03:32:20 +00:00
Gerald Combs 2e7e493198 Merged in a _huge_ patch from Guy Harris. It adds a time stap column,
generalizes the column printing code, adds a "frame" tree item to
   the tree view, and fixes a bunch of miscellaneous coding bugs.

svn path=/trunk/; revision=31
1998-09-27 22:12:47 +00:00
Gerald Combs 5110b21fd8 * Added Mike Hall's TCP reconstruction code.
svn path=/trunk/; revision=10
1998-09-17 03:12:28 +00:00
Gerald Combs 576024f903 Added ID tags to the beginning of each source file.
svn path=/trunk/; revision=7
1998-09-16 03:22:19 +00:00
Gerald Combs 86534f46e1 Initial revision
svn path=/trunk/; revision=2
1998-09-16 02:39:15 +00:00