Commit Graph

273 Commits

Author SHA1 Message Date
Gilbert Ramirez f9838e0b03 Add a python script which has the same functionality as the shell
script 'make-reg-dotc'. It is used only in the Win32 build because the
make-reg-dotc shell script is *so* sloooooooooow on Win32, due to the
multiple processes (grep, grep, sed) launched multiple times for each
source file. By putting all the text-mangling logic into a single Python
script, only one process is launched, and the source files are read
only once. It's *a lot* faster... seconds instead of minutes.

svn path=/trunk/; revision=2873
2001-01-11 07:21:35 +00:00
Guy Harris b7a0290c66 Provide a way by which protocols that run atop HTTP, such as IPP, can
register their port as being for XXX-over-HTTP; the HTTP dissector
registers that port in the "tcp.port" table as an HTTP port, and
registers it in its *own* table with the dissector and protocol provided
to it.

Parse the HTTP MIME headers regardless of whether we're building a
protocol tree or not; we have to do so in order to find the offset of
the payload, to hand to an XXX-over-HTTP dissector.

svn path=/trunk/; revision=2872
2001-01-11 06:30:54 +00:00
Guy Harris 918fb90728 "dissect_http()" doesn't need to be global any more; make it static.
svn path=/trunk/; revision=2870
2001-01-11 05:41:47 +00:00
Guy Harris 47b04baac4 M3UA (MTP3 User Adaptation layer) support, from Michael Tuexen.
svn path=/trunk/; revision=2855
2001-01-10 09:25:13 +00:00
Guy Harris 039bd984c0 Make the stuff to handle SNAP frames (OUI, PID, payload) a routine of
its own; it's used not only by LLC, but by Frame Relay with RFC 2427 and
ATM with RFC 2684.

Support for RFC 2427-encapsulation Frame Relay packets, from Paul
Ionescu.

Get rid of the CISCO_IP PPP protocol type - Cisco HDLC uses, in most
cases, Ethernet packet types, so use ETHERTYPE_IP instead (they're both
0x0800).

svn path=/trunk/; revision=2854
2001-01-10 09:07:35 +00:00
Guy Harris 6cc7a2e804 Frame Relay and Frame-Relay-over-GRE support, from Paul Ionescu.
Fix the GRE dissector to call subdissectors regardless of whether a full
protocol tree dissection is being done or not.

svn path=/trunk/; revision=2842
2001-01-07 22:08:31 +00:00
Guy Harris 499a830af6 DEC LANBridge Spanning Tree Protocol support, from Paul Ionescu.
Put "packet-lapbether.c" into "Makefile.nmake".

svn path=/trunk/; revision=2828
2001-01-05 19:00:37 +00:00
Guy Harris b151ddecbb Have the TR MAC and LLC dissectors register themselves, make them
static, and have other dissectors call them through handles.

svn path=/trunk/; revision=2816
2001-01-03 10:34:42 +00:00
Richard Sharpe d481cd7b3f Added a LAPBETHER dissector as per Guy's wishes ... :-)
Damn, took more than half an hour :-(

svn path=/trunk/; revision=2796
2000-12-29 01:06:24 +00:00
Guy Harris d13901155d Tvbuffify the CDP, CGMP, ISL, and VTP dissectors.
Add a new subdissector table in the LLC dissector for protocol IDs with
a Cisco OUI, and register the CDP, CGMP, and VTMP dissectors in that
table, rather than calling them via a switch statement.

Register the ISL dissector by name, and have the Ethernet dissector call
it via a handle.

Fix the handling of the checksum field in the CDP dissector.

The strings in CDP are counted, not null-terminated; treat them as such.

Fix the handling of the encapsulated frame CRC, and the encapsulated
frame, in the ISL dissector, at least for Ethernet frames; it may not be
correct for encapsulated Token Ring frames.

svn path=/trunk/; revision=2792
2000-12-28 09:49:09 +00:00
Guy Harris 11b24c6094 Tvbuffify the RIP and OSPF dissectors.
Change them to use facilities in Ethereal that were probably not present
when they were originally written, e.g. routines to fetch 24-bit
integers and to dump a bunch of raw bytes in hex.

Redo them to extract data from the packet as they dissect it, rather
than extracting an entire data structure at once; that way, it may be
able to dissect a structure not all of which is in the packet.

Dissect a bit more of the type-of-service metrics etc. in OSPF packets.

Make "tvb_length_remaining()" return a "gint", not a "guint"; it returns
-1 if the offset is past the end of the tvbuff.

Add a "tvb_reported_length_remaining()" routine, similar to
"tvb_length_remaining()".  Use it instead of just subtracting an offset
from "tvb_reported_length()".

svn path=/trunk/; revision=2787
2000-12-27 12:48:27 +00:00
Guy Harris 60f9476740 Rename "asn1_octet_string_value_decode()" to
"asn1_string_value_decode()", as it can be used for various character
string types as well.

Turn "asn1_octet_string_decode()" into "asn1_string_decode()", which
takes an additional argument giving the tag expected for the string in
question, and make "asn1_octet_string_decode()" a wrapper around it.

Clean up the ASN.1 dissection in the Kerberos dissector, making more use
of the code in "asn1.c", wrapping more operations up in macros, and
doing some more type checking.

Use "REP" rather than "RESP" in names and strings; "REP" is what the
Kerberos spec uses.

Make the routines in the Kerberos dissector not used outside that
dissector static.

Fix some problems with the dissection of strings in the Kerberos
dissector (it was extracting the data from the wrong place in the
packet).

In Kerberos V5, the "kvno" item in the EncryptedData type is optional;
treat it as such.

Treat integers as unsigned in the Kerberos dissector.

svn path=/trunk/; revision=2777
2000-12-24 09:10:12 +00:00
Guy Harris 039805843b Add support for the DLT_LINUX_SLL capture type in the current CVS
version of libpcap; that's used on Linux for captures on the "any"
device (which captures from all interfaces simultaneously) and for
captures on devices whose link-layer type libpcap doesn't (yet) support
natively.

The spanning tree code, when checking for GV{M,R,...}P packets, must
first check whether the link-layer destination address is, in fact, an
Ethernet-style address; on Linux cooked captures, there *is* no
destination address, so it's of type AT_NONE, not AT_ETHER.

svn path=/trunk/; revision=2772
2000-12-23 08:06:16 +00:00
Nathan Neulinger aa1cf7209e added tethereal_static target
svn path=/trunk/; revision=2769
2000-12-22 15:55:36 +00:00
Guy Harris b5b2fbe783 X.25 over TCP support, from Paul Ionescu.
Also, update his e-mail address.

svn path=/trunk/; revision=2765
2000-12-17 07:38:14 +00:00
Guy Harris 677a1c6dc2 Add code to check the checksums of TCP segments and UDP datagrams;
replace the existing checksummer with a modified version of the BSD
checksumming code.  Add a flag to the "packet_info" structure to
indicate that a packet is the first fragment of a fragmented datagram,
so that the checksummers won't try to checksum those.

(It doesn't seem to add a lot of CPU overhead, so we don't introduce a
flag to disable it, yet.  Further checks may be necessary to see whether
the overhead is just swamped by other overheads when scanning through a
capture dissecting all frames, or if it truly is negligible.)

Make the Boolean preference option controlling whether to make the
top-level protocol tree item for TCP display a packet summary static to
the TCP dissector (it doesn't need to be accessible outside the TCP
dissector).

svn path=/trunk/; revision=2751
2000-12-13 02:24:23 +00:00
Guy Harris 7a2cd91595 Register "dissect_nbipx()", and have the IPX dissector look up its
handle and call it through the handle.  Make it static; this renders
"packet-nbipx.h" unnecessary.

Get rid of the "tvb_compat()" call in the IPX dissector - it calls all
dissectors through handles or lookup tables, and thus any
backwards-compatibility stuff is done by the code in libethereal.

svn path=/trunk/; revision=2735
2000-12-03 09:18:20 +00:00
Guy Harris 60b1bed605 GVRP dissector, from Kevin Shi.
svn path=/trunk/; revision=2721
2000-11-30 09:31:52 +00:00
Richard Sharpe 88f954cfa2 Initial coding of the dissector for the Label Distribution Protocol.
It registers the same dissector for the LDP port for both TCP and UDP.

Still a lot of work to do, but we can see the header now.

svn path=/trunk/; revision=2714
2000-11-29 13:15:01 +00:00
Guy Harris d0177bb9b0 WCCP 2.0 support.
svn path=/trunk/; revision=2709
2000-11-29 06:17:34 +00:00
Gilbert Ramirez d673500082 Wrap the dissect_fddi() call (with a 4th argument) with
dissect_fddi_not_bitswapped() and dissect_fddi_bitswapped(), both of which
use the standard 3-argument tvbuffified-dissector argument list.

Add a dissector table called "wtap_encap" which is used to call dissectors
from dissect_frame(). The switch() statement from this top-level dissector
is removed.

The link-layer dissectors register themselves with the "wtap_encap"
dissector table. The dissectors are now static where possible.

svn path=/trunk/; revision=2708
2000-11-29 05:16:15 +00:00
Gilbert Ramirez 038774d586 Enable the building of any combination of ethereal, tethereal, and editcap.
If GTK+ is not detected, then ethereal is not built.

svn path=/trunk/; revision=2695
2000-11-22 04:03:22 +00:00
Guy Harris fcd119d834 Add a "color.h" file that declares a nominally-toolkit-independent
"color_t" structure to store color values (although currently it has all
the same fields that a GdkColor has; its currently advantage is that you
don't have to include any GTK/GDK stuff to declare it).

Add routines in the "gtk" directory to convert between "color_t" and
GdkColor values.

Define, in "prefs.h", all colors as "color_t" values rather than
GdkColor values.  "prefs.h" now no longer needs to include <gtk/gtk.h>,
so don't include it.

svn path=/trunk/; revision=2692
2000-11-21 23:54:10 +00:00
Guy Harris 6ed0c8ac68 Register the OSI transport dissector by name, and make it static.
"packet-clnp.h" no longer exports anything, so remove it.

Have the X.25 dissector call subdissectors through dissector handles
(now that all the dissectors it uses are registered by name).

svn path=/trunk/; revision=2668
2000-11-19 04:14:26 +00:00
Guy Harris d50abaf3f4 Give the "null" link-layer header dissector a dissector table, and put
the BSD AF_ type values it uses into an "aftypes.h" header file for
dissectors that register themselves in that dissector table include.

svn path=/trunk/; revision=2653
2000-11-17 06:02:21 +00:00
Guy Harris ee1b884ee9 Tvbuffify the STP dissector, have it register itself and have the LLC
dissector call it through a handle, and make it static.

Give "dissect_data()" an "offset" argument, so dissectors can use it to
dissect part of the packet without having to cook up a new tvbuff.

Go back to using "dissect_data()" to dissect the data in an IPP request.

svn path=/trunk/; revision=2651
2000-11-16 07:35:43 +00:00
Guy Harris b606de7ea3 Tvbuffify the IPP dissector, and have it register itself rather than
being a global function.

The HTTP dissector should set "pinfo->current_proto" to HTTP even if we
consider the packet to be IPP, so that if we run past the end of a
tvbuff while dissecting HTTP stuff it's reported as a problem with HTTP,
not IPP.

svn path=/trunk/; revision=2648
2000-11-15 08:27:14 +00:00
Guy Harris 77ad89b12d Add a mechanism by which a dissector can be registered by name, another
dissector can get a "handle" for that dissector by name and then call
that dissector through the handle.

This allows dissectors that can't be called through a port table or a
heuristic table to be called from other dissectors without directly
referring to the dissector function - dynamically-loaded modules, under
Windows, cannot directly call functions in the main program, and
non-plugin dissectors are in the main program and thus cannot be called
from plugin dissectors unless either

	1) a pointer to the dissector is put in the Big Transfer Vector

or

	2) some other mechanism for getting a pointer to the dissector
	   is provided.

This mechanism could also support registering old-style dissectors and
calling them from new-style dissectors without the new-style dissector
having to do the argument translation itself (I didn't add support for
registering old-style dissectors because I'd prefer to have people
tvbuffify their code if they have to register a dissector...).

It could also, in the future, perhaps support

	disabling of protocols;

	setting "pinfo->current_proto";

inside "call_dissector()" - and inside "{old_}dissector_try_port()" and
"{old_"dissector_try_heuristic()" - allowing a pile of stuff that
currently has to be done in every dissector be done by common code.
(I have some ideas about how to do this, by

	having "proto_register_protocol()" take an abbreviation - of the
	sort that would be put in, for example, "pinfo->current_proto" -
	as an argument;

	having the calls to register dissectors take an index returned
	by "proto_register_protocol()" as an argument.

The abbreviation could be used elsewhere as well, e.g. in the "Decoding"
tab of the "Edit->Protocols" dialog box, and in a GUI for constructing
protocol filters.  Watch this space.)

Make "dissect_sdp()" the first client of this mechanism; it's now static
to "packet-sdp.c", and all dissectors that call it - including the MGCP
plugin - now call it through a dissector handle fetched by
"find_dissector()".  (Next step - see if Ethereal can now compile on
Windows as a result of this.)

svn path=/trunk/; revision=2647
2000-11-15 07:07:52 +00:00
Guy Harris 7c3fcbac34 IEEE 802.11 support, from Johan Jorgensen of Axis Communications AB.
Add in stuff for a bunch of libpcap formats either in libpcap 0.5.2 or
in the current CVS version; we don't implement all of them in
Ethereal/Wiretap (those are "#if 0"ed out), but we do implement the IEEE
802.11 stuff (which isn't yet in libpcap or tcpdump, but the CVS version
of libpcap *does* reserve 105 as the encapsulation type number for
802.11).

svn path=/trunk/; revision=2646
2000-11-15 05:42:35 +00:00
Gilbert Ramirez 2cb9d54620 Add MGCP dissector plugin from Ed Warnicke <hagbard@physics.rutgers.edu>.
svn path=/trunk/; revision=2588
2000-11-09 10:04:48 +00:00
Nathan Neulinger 41281d38d5 forget to commit change w/ afs headers
svn path=/trunk/; revision=2576
2000-11-06 14:14:01 +00:00
Guy Harris 2d46c654d4 AIM/OSCAR dissector, from Ralf Holzer.
svn path=/trunk/; revision=2570
2000-11-05 23:45:59 +00:00
Guy Harris f123a86b70 SIP dissector, from Heikki Vatiainen.
svn path=/trunk/; revision=2562
2000-11-04 07:50:47 +00:00
Guy Harris 8c6db228bf WAP support, from Neil Hunter.
svn path=/trunk/; revision=2558
2000-11-04 03:30:41 +00:00
Guy Harris 058a7931fb Cisco IGRP support, from Paul Ionescu.
svn path=/trunk/; revision=2536
2000-10-26 09:14:28 +00:00
Guy Harris 86ceeff7db Wildcard matching is tricky - you have to try wildcarding both the
source *and* destination port and/or both the source *and* destination
address passed to "find_conversation()", because the packet for which
you're trying to find the conversation may be going in the opposite
direction to the packet for which the conversation was originally
created.

Create different hash tables for wildcarded conversations, to reduce the
number of "is this a wildcard?" tests done when doing hash lookups.

This is sufficient to allow the TFTP dissector to use conversations
rather than being special-cased in the UDP dissector, and may also be
sufficient to handle a similar problem with SMTP (request goes from
client IP X port Y to server IP Z's well-known port, reply comes back
from some other port on server Z to client IP X port Y), but further use
may reveal other changes that should be made.

svn path=/trunk/; revision=2525
2000-10-21 09:54:12 +00:00
Guy Harris c4e96b73e2 "tvbtest.c" is now in the "epan" subdirectory, so don't put it in
EXTRA_DIST in the top-level Makefile.am.

svn path=/trunk/; revision=2513
2000-10-19 07:17:38 +00:00
Guy Harris 3f8b7cd0fc Andreas Sikkema's new H.261 and TPKT dissectors, replacement RTCP and
RTP dissectors, and changes to the Q.931 dissector for use with H.323.

svn path=/trunk/; revision=2511
2000-10-19 06:45:11 +00:00
Gilbert Ramirez 3762a64fce Fix for inet*.[ch] move.
svn path=/trunk/; revision=2495
2000-10-14 05:11:11 +00:00
Gilbert Ramirez 26bda31ed9 Move inet_*.[ch] files to epan.
svn path=/trunk/; revision=2494
2000-10-14 04:31:26 +00:00
Gilbert Ramirez aff507ff0a While keeping the directory named 'epan' and the symbols in the library
starting with "epan_", change the name of the library from libepan.a to
libethereal.a, and from libepan.lib to ethereal.lib.

svn path=/trunk/; revision=2492
2000-10-14 03:53:25 +00:00
Gilbert Ramirez e69b5278aa Implement epan_dissect_new() and epan_dissect_free(). These are the
"top-level" dissectors that libepan-users call, instead of dissect_packet().
The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's
memory is not cleared until after the proto_tree is freed. (I might stuff
the proto_tree into the epan_dissect_t, too).

What remains of dissect_packet() in packet.c handles the tvbuff initialiation.
The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c
This means that "packet.c" is no longer a dissector, os it is no longer
passed to make-reg-dotc.

Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped()
and dissect_fddi_nonswapped()), the a dissector handoff routine could
be used instead of the switch statement in dissect_frame(). I'd register
a field like "wtap.encap"

svn path=/trunk/; revision=2478
2000-10-06 10:11:40 +00:00
Gilbert Ramirez 0efe324371 Simple code movement.
svn path=/trunk/; revision=2463
2000-09-28 03:52:12 +00:00
Gilbert Ramirez df710d82c7 Simple code movement to epan.
svn path=/trunk/; revision=2462
2000-09-28 03:28:54 +00:00
Gilbert Ramirez cba2930d6b Move packet.[ch] to epan
svn path=/trunk/; revision=2460
2000-09-27 05:18:06 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00
Gilbert Ramirez 28ac31a634 Move #included C code from an *.h file to an *.inc file.
svn path=/trunk/; revision=2456
2000-09-22 16:37:50 +00:00
Gilbert Ramirez 9941aabd64 Move format_text(), get_token_len(), and fine_line_end(), into strutil.c
This keeps tvbuff.c generic; it doesn't have to pull in packet.h and all
of it's included files.

svn path=/trunk/; revision=2409
2000-09-11 16:16:13 +00:00
Richard Sharpe 8d0ca23802 Initial BXXP dissector ...
Lots more work to be done.

svn path=/trunk/; revision=2384
2000-08-30 12:42:31 +00:00
Gilbert Ramirez 8afa787b0e List pint.h as a source file.
svn path=/trunk/; revision=2383
2000-08-30 02:58:24 +00:00