Commit Graph

1780 Commits

Author SHA1 Message Date
Guy Harris fc88999155 Use the "-o" flag, rather than using the "-t" flag and redirecting the
standard output, in the rules to get Flex to produce scanner code; that
way, if Flex fails to run for some reason, we don't leave around a
zero-length or otherwise incorrect "XXX-scanner.c" file that might
keep a subsequent make from thinking it has to generate that file.

svn path=/trunk/; revision=1808
2000-04-06 06:19:42 +00:00
Guy Harris 88a4741106 Fix a typo in the rules to make "dfilter-grammar.c" and
"dfilter-grammar.h".

Use the "-o" flag, rather than using the "-t" flag and redirecting the
standard output, in the rules to get Flex to produce scanner code; that
way, if Flex fails to run for some reason, we don't leave around a
zero-length or otherwise incorrect "XXX-scanner.c" file that might
keep a subsequent make from thinking it has to generate that file.

svn path=/trunk/; revision=1807
2000-04-06 06:18:50 +00:00
Guy Harris f9acb5fdb7 After destroying the mem chunk for the packet list, null out the pointer
pointing to it, so that if we call "close_cap_file()" again, we don't
try to destroy an already-destroyed mem chunk.

svn path=/trunk/; revision=1806
2000-04-06 06:04:24 +00:00
Guy Harris a03f3029af Add in an include of "snprintf.h" on platforms where it's necessary.
svn path=/trunk/; revision=1805
2000-04-06 03:59:28 +00:00
Gilbert Ramirez 38e1616c77 Add Attribute Tunnel-Password, from Florian Lohoff.
svn path=/trunk/; revision=1804
2000-04-05 16:01:39 +00:00
Gilbert Ramirez cdbefd7dd7 Spelling fix from Florian Lohoff
svn path=/trunk/; revision=1803
2000-04-05 15:57:04 +00:00
Gilbert Ramirez e15209c496 Update version and plugin directory.
svn path=/trunk/; revision=1801
2000-04-05 11:53:30 +00:00
Gilbert Ramirez 963e4ce472 Plugin API is at version 0.8.5 (reflected in directory name for plugins)
svn path=/trunk/; revision=1800
2000-04-05 11:45:50 +00:00
Gilbert Ramirez 209a8a9a79 Packaging fixes.
svn path=/trunk/; revision=1799
2000-04-05 11:04:46 +00:00
Olivier Abad 1b58783a36 Add a test to check if there is at least one enabled plugin before searching
the plugin list.

svn path=/trunk/; revision=1798
2000-04-04 22:26:36 +00:00
Guy Harris 22ec050ed8 Add "dissector_add()" to the list of routines exported to plugins via
the Big Function Pointer Table.

svn path=/trunk/; revision=1797
2000-04-04 21:46:29 +00:00
Guy Harris 7fba3d94c2 Add some additional notes about
building GTK+/GLib with 64-bit integer support when using HP's C
	compiler;

	libpcap;

from Jost Martin.

svn path=/trunk/; revision=1796
2000-04-04 21:07:33 +00:00
Gilbert Ramirez a35cbd9da9 Move to version 0.8.5
svn path=/trunk/; revision=1795
2000-04-04 19:47:20 +00:00
Gilbert Ramirez 570597952c Add assertions from Ben Fowler <wapdev@leedsnet.com>.
svn path=/trunk/; revision=1794
2000-04-04 17:07:07 +00:00
Gilbert Ramirez 8bbf14cfce Add #include "plugins.h" to get definition of HAVE_PLUGINS
svn path=/trunk/; revision=1793
2000-04-04 16:33:57 +00:00
Guy Harris 9a564888ab Add "clean" rules in subdirectories, and run subdirectory "nmake -f
Makefile.nmake clean" when "nmake -f Makefile.nmake clean" is done in
the top-level directory, so that "nmake -f Makefile.nmake clean" cleans
everything up.

svn path=/trunk/; revision=1792
2000-04-04 08:25:35 +00:00
Guy Harris e59a0d5260 The Win32 port of libpcap requires that programs with which it's built
be built as multi-threaded programs; add "/MT" to the list of compiler
flags.

Add "clean" rules in subdirectories, and run subdirectory "nmake -f
Makefile.nmake clean" when "nmake -f Makefile.nmake clean" is done in
the top-level directory, so that "nmake -f Makefile.nmake clean" cleans
everything up.

svn path=/trunk/; revision=1791
2000-04-04 08:22:13 +00:00
Guy Harris c2b1feea05 Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" into
"dissect_init()" and "dissect_cleanup()", in "packet.c", so that we
don't duplicate those routines in Ethereal and Tethereal (and so on),
and don't have to remember to update N different versions of them if we
have to change the way we do one-time initialization and cleanup.

svn path=/trunk/; revision=1790
2000-04-04 07:03:07 +00:00
Guy Harris 5f0fc518c7 Use the new split between protocol registration and protocol handoff
registration routines to get rid of the special handling of ONC RPC
protocols - dissectors for ONC RPC-based protocols should register their
protocol, fields, and ETT values in a protocol registration routine, and
register themselves with the ONC RPC dissector in their protocol handoff
routine, so that the latter is done after the ONC RPC dissector's
protocol registration routine is called, so that the data structures
needed when dissectors for ONC RPC protocols register themselves with
the ONC RPC dissector have been initialized.

Get rid of "init_dissect_rpc()", which initializes said data structures;
do that in "proto_register_rpc()" instead.

svn path=/trunk/; revision=1789
2000-04-04 06:46:41 +00:00
Guy Harris 1ffa3cfa2b Make "make-reg-dotc" generate a "register_all_protocol_handoffs()"
routine, which calls all routines found in the dissector source files
with names that match " proto_reg_handoff_[a-z_0-9A-Z]*".

Call "register_all_protocol_handoffs()" after calling
"register_all_protocols()" - "register_all_protocols()" needs to be
called first, so that all protocols can register their fields, because
registering a dissector as being called if field "proto.port" is equal
to N requires that "proto.port" be a registered field.

Give DNS a handoff registration routine, and register its dissector to
be called if "udp.port" is UDP_PORT_DNS; remove the registration of DNS
from "packet-udp.c", and make "dissect_dns()" static (as nobody else
need know that it exists).

svn path=/trunk/; revision=1788
2000-04-04 06:17:30 +00:00
Guy Harris e6d47076b8 Make "register.c" depend on "$(srcdir)/make-reg-dotc", so that if the
"make-reg-dotc" script is changed, "register.c" is remade (as the change
may change what it generates).

svn path=/trunk/; revision=1787
2000-04-04 06:10:44 +00:00
Guy Harris 0003202440 Do all the UDP port numbers that we can, and that don't require special
processing (as TFTP does), and don't have comments suggesting that extra
checks are needed, with the port table.

svn path=/trunk/; revision=1786
2000-04-04 05:54:59 +00:00
Guy Harris f540888bd4 Make a routine that takes a dissector table, a port number, and
pd/offset/fd/tree arguments, looks up the port number in the dissector
table, and:

	if it finds it, call the corresponding dissector routine with
	the pd/offset/fd/tree arguments, and return TRUE;

	if it doesn't find it, return FALSE.

Use that in the TCP and UDP dissectors.

Don't add arbitrary UDP ports for which a dissector is found in the
table as ports that should be dissected as TFTP; this should only be
done if we find a packet going from port XXX to the official TFTP port.

Don't register TFTP in UDP's dissector table, as it has to be handled
specially (i.e., we have to add the source port as a TFTP port, although
we really should register the source port *and* IP address); eventually,
we should move that registration to the TFTP dissector itself, at which
point we can register TFTP normally.

svn path=/trunk/; revision=1785
2000-04-04 05:37:36 +00:00
Guy Harris 05fe159e74 Allocate the new mem chunk for the capture in "open_cap_file()", rather
than duplicating the allocation code in "read_cap_file()" and
"start_tail_cap_file()".

svn path=/trunk/; revision=1784
2000-04-04 05:14:48 +00:00
Gilbert Ramirez 6dd3208cfc Rename find_hfinfo_record() to proto_registrar_get_nth() since
all the other public functions in proto.c start with "proto_".

svn path=/trunk/; revision=1783
2000-04-04 02:34:40 +00:00
Gilbert Ramirez b61aeda52d Set cf->plist_chunk in the other place where needed. Guy's experiencing
some network problems today, so I checked this in for him.

svn path=/trunk/; revision=1782
2000-04-03 22:28:51 +00:00
Guy Harris 3ee409084c Move the creation of, and registration of protocols known to UDP in, the
hash table attached to "udp.port" out of "init_dissect_udp()" into
"proto_register_udp()", so that it's done the way TCP does it, and then
get rid of "init_dissect_udp()".

svn path=/trunk/; revision=1781
2000-04-03 09:41:31 +00:00
Guy Harris 7678c401dd Fix a compile error introduced by the previous checkin, which also moved
the check for plugins after the check for ONC RPC protocols, so that we
do the checks in the same order for TCP and UDP (ONC RPC first, as we
expect the RPC heuristics not to get false hits, and ONC RPC protocols
could well use ports that are nominally assigned to other protocols).

svn path=/trunk/; revision=1780
2000-04-03 09:37:39 +00:00
Guy Harris c7d11f582d Jeff Foster's patch to support attaching a hash table to a protocol
field, to allow dissectors to register their dissection routine in a
particular field's hash table with a particular "port" value, and to
make the TCP and UDP dissectors support that for their "port" field and
to look up ports in that hash table.

This replaces the hash table that the UDP dissector was using.

There's still more work needed to make this useful - right now, the hash
tables are attached to the protocol field in the register routines for
the TCP and UDP protocols, which means that the register routines for
protocols that run atop TCP and UDP can't use this unless their register
routines happen to be called after those for TCP and/or UDP, and several
other protocols need to attach hash tables to fields, and there's no
single global field for Ethernet types so we can't even attach a hash
table to such a field to allow protocols to register themselves with a
particular Ethertype - but it's a start.

svn path=/trunk/; revision=1779
2000-04-03 09:24:12 +00:00
Guy Harris 560819cad2 Another update from Doug Nazar.
svn path=/trunk/; revision=1778
2000-04-03 09:00:31 +00:00
Guy Harris 9653203d24 Note that it didn't seem to save a significant amount of time or space
to use a G_ALLOC_ONLY memory chunk rather than a G_ALLOC_AND_FREE memory
chunk.

svn path=/trunk/; revision=1777
2000-04-03 08:57:17 +00:00
Guy Harris f3c287d201 Use a GMemChunk for allocating and freeing "frame_data" structures; it
reduces the memory required for one big capture file I have by about 10
megabytes, and speeds up the reading in of that file, presumably because
it amortizes the memory-allocator space and CPU time overhead over
a set of several "frame_data" structures.

svn path=/trunk/; revision=1776
2000-04-03 08:42:45 +00:00
Guy Harris 9e47031a4a Improvements from Doug Nazar.
One of those improvements adds an "exit now" after we've filled in the
protocol and info columns if we're not building a protocol tree,
obviating the need for the "parse only the first request in the sequence
if we're not building a protocol tree" code I stuck in, so remove the
latter code.

svn path=/trunk/; revision=1775
2000-04-03 07:48:55 +00:00
Guy Harris c6e50f9bc9 Split "filter_dialog_cb()" into "filter_dialog_cb()", which pops up a
"global" dialog box when "Edit:Filters" is selected, so that the list of
filters can be edited, and "filter_browse_cb()", which pops up a dialog
box associated with a "Filter:" button and a text entry widget attached
to that button, so that a filter can be selected or saved (although it
also supports the same editing that the "global" dialog box does).

Have "filter_dialog_cb()" connect the window in which the "Filter:"
button lives and the filter dialog box, so that:

	if the window in which the "Filter:" button lives goes away, so
	does the filter dialog box (as it no longer has a text widget
	into which it can stuff the selected filter);

	if the "Filter:" button is clicked when there's already a filter
	dialog box open, we just reactivate that existing dialog box
	rather than popping up a new one.

Also keep a pointer to the "global" filter dialog box, so that we also
arrange that there's only one of them (by reactivating the existing on
if "Edit:Filters" is selected when there's already a "global" filter
dialog box open).

Keep around pointers to the dialog boxes that contain the "Filter:"
buttons, so that we can arrange that there be only one of them (that was
a side-effect of an earlier attempt at fixing the problems described
above, but it's still useful for keeping multiple competing dialog boxes
from being open - there's more of that to be done).

Make the pointer to the "Open Capture File" dialog box widget static to
"file_dlg.c" - nobody outside of "file_dlg.c cares about it.

svn path=/trunk/; revision=1774
2000-04-01 12:03:42 +00:00
Guy Harris 5549f62efd There's no need to catch the "delete_event" signal on "Follow TCP
Stream" windows - the window should always be deleted in that situation,
so there's no need for a signal handler that might return TRUE (meaning
"don't delete the window"), and the "destroy" handler gets called when
the window actually gets destroyed, so there's no need to do any cleanup
in the "delete_event" handler.

Catch the "delete_event" signal on the main window in a routine with the
right signature, and that returns FALSE so that the window actually gets
deleted.

Call "close_cap_file()" in the callback for the "File:Quit" menu item
(which is also called by the "delete_event" handler for the main
window), rather than calling it after "gtk_main()" returns -
"close_cap_file()" manipulates stuff in the main window, and if we do so
after "gtk_main()" returns, it appears that the main window may have
disappeared (if we are exiting because the user deleted the main
window), in which case we can get crashes or other errors when
"close_cap_file()" tries to manipulate stuff in the main window.

There's no need to catch the "destroy" signal on the main window - we do
some of the cleanup in the handler for "delete_event" (we have to, for
reasons described above), and we do the rest of it after the main
routine returns.

svn path=/trunk/; revision=1773
2000-04-01 11:30:53 +00:00
Guy Harris 4173af0077 Exit from Ethereal by making the main loop exit, so that any quit
routines we register get called.

Register the "follow TCP stream" windows with "gtk_quit_add_destroy()",
so that, when Ethereal exits, they all get destroyed; this means that
their destroy callbacks get called, which means that they get to delete
their temporary files, so that, if you exit Ethereal without manually
closing the "follow TCP stream" windows, the temporary files don't get
left around.

Exit from Ethereal's "main()" function by calling "gtk_exit()", rather
than "exit()", so that we do whatever cleanup GTK+ requires.  (We used
to call "gtk_exit()" in the callback for the "File:Quit" menu item and
the "delete" callback for the main window, but we now just call
"gtk_main_quit()" so that we exit from the main loop.)

svn path=/trunk/; revision=1772
2000-04-01 10:23:01 +00:00
Guy Harris 239109b3e9 No work need be done when a summary dialog box is destroyed, or when the
window manager tries to delete it, so no callback is needed for the
"destroy" or "delete_event" signals (grabs are, at least in GTK+ 1.2.7,
removed when a widget is destroyed, and there's no need for the destroy
callback to destroy the widget itself; the delete event handler *could*,
for example, pop up a dialog box saying "Do you really want to close
this?", and allow the user to back out of the operation, but there's
no unsaved work that would be lost by closing the window, so there's no
point in having a delete event handler that does that).

svn path=/trunk/; revision=1771
2000-04-01 09:16:49 +00:00
Olivier Abad 2673685067 Add a counter : "enabled_plugins_number", to record how many plugins are
enabled. The counter is incremented in enable_plugin() and decremented
in disable_plugin().
In add_packet_to_packet_list(), we check this counter (instead of
plugin_list) to see if there is at least one enabled plugin. If this is
the case, we must build the protocol tree.

svn path=/trunk/; revision=1770
2000-03-31 21:42:24 +00:00
Guy Harris 87e3becab5 Rick Jones of HP says that the "-Ae" flag to the HP ANSI C compiler
gives you everything that "-Aa" does, plus the extensions that you get
only with "-Ae", and that there's no need to specify "-Aa" if you've
specified "-Ae".  Therefore, we get rid of "-Aa".

svn path=/trunk/; revision=1769
2000-03-31 20:45:29 +00:00
Guy Harris 413b0b3f19 Put in the beginnings of checks for ASN.1 dissection errors.
The "present" choice in the type Filter is, in LDAP V2,
AttributeType, and, in LDAP V3, it's AttributeDescription.  Both of
those are just LDAPString, which is, in turn, OCTET STRING, so it should
be required to have the primitive representation (unless and until we
add support for the constructed representation of octet strings - but
RFC 1777, the LDAP V2 spec, says

   (2)  Bitstrings and octet strings and all character string types
        will be encoded in the primitive form only.

and RFC 2251, the LDAP V3 spec, says

   (2) OCTET STRING values will be encoded in the primitive form only.

so we shouldn't ever see it with the constructed representation), and be
parsed with "asn1_octet_string_value_decode()", as, by that point, we've
already dissected the ASN.1 id and length.

Put the bind authorization type into the protocol tree before switching
on the type, so that it goes in even if it's not something we yet
dissect, and actually pass it as an argument to "proto_tree_add_item()"
(alas, "proto_tree_add_item()" is a varargs function, so this error
couldn't have been detected by the compiler).

When not constructing a protocol tree, quit "dissect_ldap()" after
dissecting the first operation - we don't need to dissect the others.

svn path=/trunk/; revision=1768
2000-03-31 10:22:24 +00:00
Gilbert Ramirez c74451becd Jochen Friedrich <jochen@nwe.de>
protocol type 0x0c in AIX iptrace is used for the IBM SP switch
devices. Encoding is RAW IP...

svn path=/trunk/; revision=1767
2000-03-30 21:41:11 +00:00
Guy Harris a02c9146d5 "add_rr_to_tree()" is exported from "packet-dns.c" for use by the NBNS
protocol, which is DNS-derived; hopefully, Microsoft won't shovel any
more stuff into NBNS (I suspect that they ultimately want to make DNS
replace it completely), so it won't pick up stuff such as OPT RRs.

As such, we don't need to export "add_opt_rr_to_tree()", so make it
static to "packet-dns.c".

svn path=/trunk/; revision=1766
2000-03-30 01:52:40 +00:00
Jun-ichiro itojun Hagino 72ebab08bf add dissector for OPT pseudo-RR, in RFC2671 section 4.
svn path=/trunk/; revision=1765
2000-03-30 01:33:10 +00:00
Guy Harris 7dbe2ffaf2 Get rid of the "Find Frame" and "Go To Frame" items under "Display"; we
put them under "Edit" a while ago.

svn path=/trunk/; revision=1764
2000-03-29 22:39:19 +00:00
Guy Harris a91805901f Use the "-o" flag, rather than using the "-t" flag and redirecting the
standard output, in the rules to get Flex to produce scanner code; that
way, if Flex fails to run for some reason, we don't leave around a
zero-length or otherwise incorrect "XXX-scanner.c" file that might
keep a subsequent make from thinking it has to generate that file.

svn path=/trunk/; revision=1763
2000-03-29 19:55:51 +00:00
Gilbert Ramirez ca71c851dd Add ID for Lucent, and sort lines.
svn path=/trunk/; revision=1762
2000-03-29 16:55:08 +00:00
Guy Harris 3a29d6e090 Fix from Michael Johnston to check the correct bit when testing the
broadcast flag in DHCP packets.

svn path=/trunk/; revision=1761
2000-03-29 09:29:16 +00:00
Guy Harris 72a70000db Updates from Doug Nazar.
svn path=/trunk/; revision=1760
2000-03-29 09:25:21 +00:00
Jun-ichiro itojun Hagino 01d2363d0e update RFC1966 (BGP route reflection) support.
From: Greg Hankins <gregh@twoguys.org>

svn path=/trunk/; revision=1759
2000-03-29 06:27:54 +00:00
Gilbert Ramirez c317b042a8 Add getopt.c (from GNU libc) for use on Win32.
Ethereal/win32 now supports command-line options.
Tethereal now compiles on win32, except for the fact that I haven't
put the Makefile.nmake changes in for that yet.

svn path=/trunk/; revision=1758
2000-03-28 20:20:11 +00:00