Commit Graph

248 Commits

Author SHA1 Message Date
Evan Huus b464dcd888 Create init and cleanup functions for wmem as a whole.
Call them from epan_init() and epan_cleanup().
Expose a permanent wmem scope for allocations that should only be freed when
epan is done (which is *not* necessarily when the program finishes).

svn path=/trunk/; revision=45805
2012-10-27 02:42:05 +00:00
Jakub Zawadzki 2fd81fdaf9 Move ep_free_all() *AFTER* packet dissection.
Use glib allocator for data_source.

Thread on wireshark-dev: http://www.wireshark.org/lists/wireshark-dev/201210/msg00116.html

svn path=/trunk/; revision=45673
2012-10-20 20:04:40 +00:00
Jakub Zawadzki 77368c3668 Introduce epan_dissect_run_with_taps() which run dissection with taps.
unexport tap_queue_init, tap_push_tapped_queue

svn path=/trunk/; revision=45670
2012-10-20 19:27:24 +00:00
Jakub Zawadzki 6dc977b7d2 - Allow reseting edt with new function epan_dissect_reset(),
- initialize edt once in few places, and later reset it after dissecting
  (add_packet_to_packet_list),
- revert r45667, probably no longer needed.

svn path=/trunk/; revision=45669
2012-10-20 16:44:55 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Anders Broman d88e1202a5 From Bartosz Brachaczek:
Make the SSL dissector work with GnuTLS compiled with nettle.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6869

#BACKPORT

svn path=/trunk/; revision=45465
2012-10-11 08:28:57 +00:00
Jakub Zawadzki f68020f1e1 Revert changes to ep_ allocator, revert edt ref-counting.
svn path=/trunk/; revision=45451
2012-10-10 19:05:30 +00:00
Evan Huus b6f0d11c6f EDT structures now own their ep_ memory pools. This should finally clean
up the last little bits of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284
- https://www.wireshark.org/lists/wireshark-dev/201208/msg00128.html

and possibly part of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775

This is a fairly invasive change that required some funky work with linked
lists to avoid changing any of the public ep_* APIs, so if something breaks
blame me :)

svn path=/trunk/; revision=45389
2012-10-08 15:23:36 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Pascal Quantin a5c0d49ac2 Remove useless include (GeoIP initialization was removed from epan_init() in r43604)
svn path=/trunk/; revision=44692
2012-08-28 15:14:30 +00:00
Gerald Combs cd3cca7edc Make the corresponding packet_info available to each tree item. This
lets us pass a NULL pinfo to expert_add_info_format() and
expert_add_undecoded_item(), which makes it possible to use those
routines deep in the bowels of many dissectors. As a proof of concept
remove the recent pinfo additions to packet-afp.c. This should also make
it easier to fix bug 3884.

svn path=/trunk/; revision=44435
2012-08-10 20:33:01 +00:00
Guy Harris 10fa9baef2 From Evan Huus:
Don't initialize GeoIP from epan_init(), as we probably haven't loaded the
preferences for it yet (thanks to it's new use of the UAT framework).

Instead, register a post_update callback with UAT and load it there. As a
bonus, this also means that applying GeoIP preferences no longer requires
restarting Wireshark - everything should Just Work with the new databases right
away.

Fixes bug 7446.

svn path=/trunk/; revision=43604
2012-07-08 01:17:19 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman e6e6d6217b From Tony Trinh:
Update Lua from 5.1 to 5.2

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400

svn path=/trunk/; revision=43482
2012-06-25 20:42:07 +00:00
Anders Broman 7486872523 Refcount edt.s as we may have atleast two "active" edt:s in certain
circumstances see bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284

patch by Evan Huus

svn path=/trunk/; revision=42254
2012-04-26 08:41:47 +00:00
Jakub Zawadzki 189b255ddf Fix dependent_frames memleak.
Reviewed-By: Jeff Morriss (http://www.wireshark.org/lists/wireshark-dev/201204/msg00013.html)

svn path=/trunk/; revision=41902
2012-04-03 09:18:16 +00:00
Jeff Morriss 89cfdc3559 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -
make Save-As/Displayed/All-Packets save not only the displayed packets but
also any other packets needed (e.g., for reassembly) to fully dissect the
displayed packets.

This works only for the "All packets" case; choosing only the Selected packet,
the Marked packets, or a range of packets would require actually storing which
packets depend on which (too much memory) or going through the packet list many
times (too slow).  Also, this behavior is always the case: you can't save the
displayed packets without their dependencies (I don't see why this would be
desirable).

So far this is done for SCTP and things using the reassembly routines (TCP has
been tested).

The Win32 dialog was modified but hasn't been tested yet.

One confusing aspect of the UI is that the Displayed count in the Save-As
dialog does not match the number of displayed packets.  (I tried renaming the
button "Displayed + Dependencies" but it looked too big.)  The tooltip tries
to explain this and the fact that this works only in the All-Packets case;
suggestions for improvement are welcome.


Implementation details:

Dissectors (or the reassembly code) can list frames which were needed to
build the current frame's tree.  If the current frame passes the display
filter then each listed frame is marked as "depended upon" (this takes up the
last free frame_data flag).

When performing a Save-As/Displayed/All-Packets then choose packets which
passed the dfilter _or_ are depended upon.

svn path=/trunk/; revision=41216
2012-02-28 03:19:49 +00:00
Bill Meier 77fe2b7b69 Remove no longer relevant comment about incrementing tvb usage count to prevent freeing tvbs.
svn path=/trunk/; revision=40265
2011-12-21 18:57:42 +00:00
Stig Bjørlykke 3e75b436a0 Added register action for loading Lua plugins.
Removed an unused argument to wslua_init().

svn path=/trunk/; revision=39214
2011-10-02 13:39:35 +00:00
Stig Bjørlykke ad6be9beb8 Whitespace cleanup.
svn path=/trunk/; revision=38893
2011-09-06 09:09:36 +00:00
Stig Bjørlykke 5603cef9f2 Remove support for libpcre, we use GRegex in GLib.
svn path=/trunk/; revision=38683
2011-08-23 09:25:06 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Guy Harris 38bbf40f64 Constify a return value, to squelch a compiler warning.
svn path=/trunk/; revision=37680
2011-06-16 07:27:48 +00:00
Guy Harris b30de7bd0b Include <Python.h> to get the Python version number.
svn path=/trunk/; revision=37651
2011-06-11 17:20:44 +00:00
Jeff Morriss f12ef203b3 Revert 34191 and add some casts instead
svn path=/trunk/; revision=34193
2010-09-23 06:00:22 +00:00
Jeff Morriss 7cdf98c245 Use gsize (size_t) in a couple of places to make the Win64 build happy.
svn path=/trunk/; revision=34191
2010-09-23 01:14:44 +00:00
Sake Blok 7364bef1b3 When using a custom column, make it possible to select which occurrence to show if the field has multiple occurrences.
svn path=/trunk/; revision=34186
2010-09-22 20:56:14 +00:00
Guy Harris 9b7176f7b4 If we have neither libgnutls nor libgcrypt,
epan_get_runtime_version_info() does nothing, and thus doesn't use its
argument.

svn path=/trunk/; revision=33532
2010-07-15 03:22:49 +00:00
Guy Harris cc3540b0fb Move the code to get version information for libraries used by
libwireshark into libwireshark, and call it only in programs linked with
libwireshark.  That way, programs that don't link with libwireshark
don't have to link with libgcrypt or libgnutls solely so that they can
say that they're linked with a particular version of libgcrypt or
libgnutls.

Don't link dumpcap with libgcrypt or libgnutls any more.

svn path=/trunk/; revision=33531
2010-07-15 02:07:16 +00:00
Anders Broman 32abf98aab From David Bond:
Added the IEEE defined ether types for TRILL and Layer 2 ISIS. Also had ISIS
register itself with the ethertype dissector.

References:
http://www.postel.org/pipermail/rbridge/2010-May/003998.html
http://tools.ietf.org/html/draft-ietf-isis-layer2-05
http://tools.ietf.org/html/draft-ietf-trill-rbridge-protocol-16

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4825

svn path=/trunk/; revision=33059
2010-06-02 19:29:14 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

 From me: Fix a number of instances where the function prototype or
  the function definition wasn't changed so there was a mismatch 
  thus causing Windows (but not gcc) compilation errors.

svn path=/trunk/; revision=32365
2010-04-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Balint Reczey e24d953fe1 Disable OID resolution and loading SMI modules by default.
Add an option to enable OID resolution.
Add an option to suppress errors reported by libsmi.

svn path=/trunk/; revision=32096
2010-03-03 17:19:30 +00:00
Bill Meier 9d663d7081 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31720
2010-01-28 18:45:46 +00:00
Gerald Combs 8fc1491a60 Switch to using a bundled version of the openSUSE Build Service packages
for GNUTLS since they provide 32-bit and 64-bit Windows packages. We no
longer have winposixtype.h, so remove its #includes and add a ssize_t
typedef to config.h.win32.

svn path=/trunk/; revision=31341
2009-12-21 21:06:01 +00:00
Jeff Morriss 78318b32ee Add emem_init() which initializes both the ep_ and se_ allocators; have all
callers use that instead of initializing each allocator individually.

svn path=/trunk/; revision=30646
2009-10-20 17:43:05 +00:00
Kovarththanan Rajaratnam de23d92163 Add an option to col_fill_in() to allow us to disable column expression processing. This is rarely needed. It's only needed when the user right clicks on the packet list view to generate a display filter.
svn path=/trunk/; revision=29806
2009-09-08 19:00:54 +00:00
Anders Broman c6d4c80371 From : Didier Gautheron
speed up a little proto_custom_set.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3972

svn path=/trunk/; revision=29789
2009-09-08 10:33:15 +00:00
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Anders Broman 32e7cddf70 From Didier Gautheron:
move custom col set from  proto_tree_set_xxx() to
epan_dissect_fill_in_columns().
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3930

I'v added the new functions to the .h files.

svn path=/trunk/; revision=29551
2009-08-25 21:10:35 +00:00
Kovarththanan Rajaratnam 80a6d3fbcf Introduce epan_dissect_init()/epan_dissect_cleanup(). These are used to initialise/cleanup stack allocated 'edt' structures. This should speed up dissection since we avoid some malloc traffic.
svn path=/trunk/; revision=29404
2009-08-13 19:42:46 +00:00
Kovarththanan Rajaratnam 261a8406bc TRY_TO_FAKE_THIS_ITEM now fakes FT_PROTOCOL per default. If there are any users (e.g. proto_hier_stats.c, others?) that relies on FT_PROTOCOL nodes being created they'll now need to call the newly introduced epan_dissect_fake_protocols() to disable this optimization.
Also make use of TRY_TO_FAKE_THIS_ITEM in proto_tree_add_text_node(), proto_tree_add_none_format() and proto_tree_add_protocol_format().

svn path=/trunk/; revision=29380
2009-08-11 18:08:03 +00:00
Anders Broman cb771536df From Kovarththanan Rajaratnam:
Only fill in frame_data vals when needed.

svn path=/trunk/; revision=29203
2009-07-27 08:33:26 +00:00
Guy Harris ace4af44fc Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c.

Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to
copy_file_binary_mode() (to clarify that it *can* copy text files;
arguably, *all* files are "binary" unless you're on, say, an IBM 1401
:-)).  Have it use the report_err.c routines, so it works in
console-mode programs.

Clean up some comments while we're at it.

svn path=/trunk/; revision=27456
2009-02-15 21:47:57 +00:00
Gerald Combs 7d22c0fb7f Rename geoip.[ch] to geoip_db.[ch] so we don't collide with GeoIP.h. Rename
some functions to match.

Add GeoIP lookups to the IP dissector. Add a preference for GeoIP lookups,
which is disabled by default.

svn path=/trunk/; revision=27063
2008-12-19 23:49:03 +00:00
Gerald Combs 1b7064bb6a Add support for the GeoIP library. Using different database files,
GeoIP can map IP addresses to Countries, Cities, AS numbers, ISPs,
etc. If any library paths are defined AND any database files are found,
corresponding columns are added to the endpoint tables in the GUI.

To do:
  - Add columns to the conversation list
  - Add GeoIP info to "-z conv,..."
  - Create a default UAT file.

svn path=/trunk/; revision=26571
2008-10-27 04:50:57 +00:00
Guy Harris 4d879cd0b8 Rename arguments not to collide with function names, to avoid warnings
from -Wshadow, as noted by John Smith.

svn path=/trunk/; revision=25541
2008-06-23 20:17:08 +00:00
Jeff Morriss 1c67ad6e2e Call se_free_all() in epan_cleanup() so that we will detect per-session (se_)
memory corruption in tshark (and Wireshark when exiting the program instead
of loading a new file?).

Why this wasn't always here I don't know.

This may give us a pile of buildbot fuzz failures but that's a Good Thing.

svn path=/trunk/; revision=25196
2008-04-29 15:29:02 +00:00
Tomas Kukosa 6caaafbb6d Next few improvements to speed up startup about 10%.
- use GTree instead of GList for preference module lists

svn path=/trunk/; revision=23679
2007-11-30 09:22:01 +00:00
Luis Ontanon 00c5e48a17 get users of oid_resolv to use the new oids, rollout packet-snmp.c
svn path=/trunk/; revision=22651
2007-08-25 01:14:24 +00:00
Luis Ontanon 11f06217ce Have editcap and capinfos loading the wiretap plugins.
epan/filesystem.c
   have get_plugin_dir() calling init_plugin_dir() if necessary

epan/epan.c and epan/report_err.c
   move the report_failure family into the new report_err.c file, have epan_init() calling the initializer

epan/plugins.h and epan/proto.c
   do not have init_plugins() calling the proto_reg functions instead do it in init_proto()

gtk/main.c and tshark.c
   init_plugin_dir() has become suprefluous

capinfos.c and editcap.c
   load the wiretap plugins

Makefiles
   do what's needed to build withe the above changes.




svn path=/trunk/; revision=21935
2007-05-25 17:22:32 +00:00
Graeme Lunt cf56e76be9 Updated splash screen for Wireshark that shows the initialisation progress.
The splash screen shows a progress bar and a percentage complete - like the progress dialog.
As dissectors are initialised and handed off the name is shown. However, the names of plugin dissectors are not shown.
The update to the make-dissector-reg shell script has been tested, though I think generally the python version is used.


svn path=/trunk/; revision=21716
2007-05-07 17:55:42 +00:00
Guy Harris 44c0624bd9 Add a WIRESHARK_RUN_FROM_BUILD_DIRECTORY environment variable on UN*X;
if set, and if the program isn't running with additional privileges,
it'll treat the directory in which the program is found as the data
directory.

If, on Windows, the version-number subdirectory of {data
directory}\plugins doesn't exist (which is assumed to mean that the
program is being run from the build directory), or if, on UN*X,
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set, the plugin directory is the
"plugins" subdirectory of the data directory, and all subdirectories of
that directory are scanned for plugins, as the "plugins" subdirectory of
the build directory contains subdirectories for the plugins; this means
that if we're running from the build directory, we'll find the plugins
we built in the build tree.

When generating the wireshark-filter man page, run tshark with
WIRESHARK_RUN_FROM_BUILD_DIRECTORY set, so it uses the plugins from the
build to generate the list of filters.

svn path=/trunk/; revision=20261
2007-01-02 06:49:40 +00:00
Gilbert Ramirez 5ab5899d5e Add GPL disclaimer, which as been missing since forever.
Thanks to Jaap Keuter for pointing this out.

svn path=/trunk/; revision=20027
2006-11-30 21:32:05 +00:00
Guy Harris a22101f8f0 We also need the memory allocation subsystem initialized in anything
that uses libwireshark.

svn path=/trunk/; revision=19940
2006-11-21 00:30:36 +00:00
Guy Harris b0640ceefc Call guids_init() in epan_init(), so anything that needs libwireshark -
including dftest - will get the GUID table initialized (which anything
that needs libwireshark needs to have happen, so dissectors can register
GUIDs in that table).

svn path=/trunk/; revision=19939
2006-11-21 00:16:44 +00:00
Luis Ontanon a25f3db001 Re-enable lua as the windows version is already there.
svn path=/trunk/; revision=19327
2006-09-26 10:22:20 +00:00
Luis Ontanon b9a1426d47 Complete the workarround of prev rev, temporarilly disabling lua from unix as well.
Luis.


svn path=/trunk/; revision=19323
2006-09-26 01:19:29 +00:00
Luis Ontanon afe7787089 Since there's no Lua headers in windows yet, as a temporary workarround just declare wslua_init instead of including wslua.h.
Sorry!


svn path=/trunk/; revision=19322
2006-09-26 01:12:14 +00:00
Luis Ontanon 6462d05044 Move the Lua interface into epan... (not a plugin anymore).
- Rename Tap into Listener
- add a mechanism to pass protocols' tap data to the Listener


svn path=/trunk/; revision=19319
2006-09-25 01:09:00 +00:00
Tomas Kukosa 73ddcc157a GnuTLS/libgcrypt initialization moved to epan.c
svn path=/trunk/; revision=18863
2006-08-10 06:06:21 +00:00
Tomas Kukosa a557a61ae0 new function epan_get_version()
svn path=/trunk/; revision=18450
2006-06-13 08:18:50 +00:00
Gerald Combs b15974d094 libethereal -> libwireshark. idl2eth -> idl2wrs. There are a _lot_ of
changes here.  It compiles OK on OS X, but hasn't been tested anywhere else.

svn path=/trunk/; revision=18260
2006-05-31 00:23:01 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Tomas Kukosa a5bfb48c2f OBJECT IDENTIFIER name resolution moved to oid_resolv.c
svn path=/trunk/; revision=16699
2005-12-06 11:45:55 +00:00
Ulf Lamping 3b66410f77 add doxygen comments to column-utils.h and do a slight code cleanup
svn path=/trunk/; revision=16066
2005-10-02 14:56:27 +00:00
Ulf Lamping 642467ad5c I'm adding the "Expert Info" prototype now, as it seems to be in a state where others might have a look and probably already find it useful :-). Anyway, we can easily disable it at one or two places in the code if it get's in our way of a new release.
Please see: http://wiki.ethereal.com/Development/ExpertInfo for a complete overview of the intended feature and it's current state of implementation.

While I'm working on this, I've also added some more status result codes to the DCE/RPC and DCOM dissectors.

svn path=/trunk/; revision=15754
2005-09-11 16:55:34 +00:00
Ronnie Sahlberg aa051bcca6 get rid of one more gmemchunk
svn path=/trunk/; revision=15332
2005-08-13 06:21:37 +00:00
Ronnie Sahlberg c841beb71b EMEM : a simple and FAST api to allocate memory that will be automatically freed() when the next packet is dissected.
This offesr memory allocation with a packet  scope making memory leaks less likely and memory management faster.


Add initialization calls for both tethereal and ethereal.

Convert the ip_to_str() function to use this and avoid doing the silly rotating buffers thing it previously did.


We also need an equivalent set of functions for allocation with capture file scope (free when next capture is loaded) but i dont know where to put the free_all call.



svn path=/trunk/; revision=14984
2005-07-22 07:46:58 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris d209115ba3 Add a "report_failure()" routine to allow dissectors to report arbitrary
errors to the user.  Use that, rather than "g_warning()", in the
Diameter dissector to report errors reading the dictionary.

Make the format argument to "simple_dialog()" a "const" pointer.

Fix up the read-error message in Tethereal to end with a newline.

If a simple dialog is requested before the main window or the
capture-control window is popped up, queue it up and pop the queued
messages up once the main or capture-control window is displayed.

svn path=/trunk/; revision=10616
2004-04-16 23:17:13 +00:00
Guy Harris 121f06fab7 Make "epan_init()" take, as additional arguments, pointers to routines
that dissectors should call to report file open and read errors, and
have "report_open_failure()" and "report_read_failure()" call through
those pointers, rather than being defined and exported by the
application using libethereal - instead, the application would define
those functions and pass pointers to them to 'epan_init()".

Move "report_err.h" to the epan directory, as the functions it declares
are now part of the libethereal API.

svn path=/trunk/; revision=10470
2004-03-23 21:19:58 +00:00
Gerald Combs 1d9b54fc07 Add support for asynchronous DNS updates using the GNU ADNS library.
Support can be enabled at configure time by using "--with-adns=DIR".
If support is enabled, async queries happen whenever host name resolution
is enabled.  Do we need a separate preference for async queries?

Currently, only IPv4 reverse queries are supported.  I can add IPv4 forward
lookup support, but I don't have any way to test IPv6 queries.

svn path=/trunk/; revision=7640
2003-05-04 18:50:56 +00:00
Guy Harris 28c1a65e85 Add in a notion of "circuits", which are for virtual circuit-oriented
protocols (where there's a virtual circuit ID of some sort in packets)
what conversations are for protocols ultimately running atop
connectionless network layers.  Have circuit type and ID values in the
"packet_info" structure.

Have the Frame Relay dissector set the circuit type and ID values, and
have the Wellfleet compression protocol set up circuit information and
store compression information with the circuit.

svn path=/trunk/; revision=6469
2002-10-22 08:22:07 +00:00
Guy Harris ac69a72fda "dfilter_prime_proto_tree()" doesn't modify the "dfilter_t" to which
it's handed a pointer, which means that "epan_dissect_prime_dfilter()"
doesn't do so either; make that argument a "const dfilter_t *" in both
cases.

svn path=/trunk/; revision=6239
2002-09-09 21:04:15 +00:00
Ronnie Sahlberg 93a649db6f Tap api. tap is a simple api that can be used for arbitrary extensions.
One example extension is rpcstat.

Try -Z rpc,rtt,100003,3 as argument to tethereal when reading a capture
containing NFSv3 packets.

tap-rpcstat.[ch] is intended to demonstrate the api and can be used to
base other extensions on.

svn path=/trunk/; revision=6175
2002-09-04 09:40:29 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Gilbert Ramirez 41cc7f0707 Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make
some of the COL_INFO texts more useful, handle a Unicode issue, and
modify some of the cases that use "request conditions".
But the NCP dissector as it stands is very usable now.

Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted
to think about the various possible macros and review an email conversation
I had with Guy on the subject.

svn path=/trunk/; revision=5432
2002-05-09 23:50:34 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris a94eccb20c Fix up white space.
svn path=/trunk/; revision=4478
2002-01-04 08:57:09 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Guy Harris 794f0c04f4 Add an extra argument to "epan_dissect_new()" that indicates whether the
display representation should be put into protocol tree items if a
protocol tree is to be constructed; have it set "proto_tree_is_visible"
from that argument.

svn path=/trunk/; revision=4408
2001-12-16 22:16:14 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Gilbert Ramirez 6542c18172 Remove proto_tree from capture_file and PacketWinData, since they
already contain a pointer to an epan_dissect_t, which contains
the proto_tree.

Routines calling epan_dissect_new() do not create their own
proto_tree via proto_tree_create_root(); instead, they pass a boolean
to epan_dissect_new() telling it whether it should create the root
proto_tree.

svn path=/trunk/; revision=4343
2001-12-06 04:25:09 +00:00
Gilbert Ramirez 8743a4a8a7 Remove the global packet_info called "pi". Dissectors now only
access their own "pinfo". A packet_info is stored in epan_dissect_t,
which is created for the dissection of a single packet.

GUI functions which need to access the packet_info of the currently
selected packet used to use "pi"; now they use cfile.edt->pi. cfile's
"edt" member is the epan_dissect_t of the currently-selected packet.

The functionality of blank_packetinfo() was moved into
dissect_packet(), as that's the only place that called blank_packetinfo(),
after a spurious call to blank_packetinfo() was removed from
packet_list_select_cb().

svn path=/trunk/; revision=4246
2001-11-21 23:16:26 +00:00
Ed Warnicke f5cf9c8dca Added two new arguments to epan_init() and proto_init() to
allow the passing of register_all_protocols() and
register_all_protocol_handoffs() through epan_init() to proto_init().
This allows the removal of the compile time dependence of proto.c
on register.h.  Modified dftest.c, tethereal.c, and gtk/main.c to
use the new style epan_init() and depend on register.h.

svn path=/trunk/; revision=3237
2001-04-02 00:38:36 +00:00
Ed Warnicke 10cd0c5f70 Changed packet_init() to look up the frame dissector and cache its
dissector_handle in a static variable in packet.c.  Changed dissect_packet
to call dissector from using the call_dissector() function and the cached
dissector_handle for frame_dissector.  Changed the order of function
calls in epan_init() to allow for this change ( it sucks to look up
a dissector when none are registered ).

svn path=/trunk/; revision=3234
2001-04-01 22:01:34 +00:00
Ed Warnicke 20eee44b70 Moved the frame_data structures and functions from packet.{h,c} to
frame_data{h,c}.  Added a frame_data_init to be called by epan_init.

svn path=/trunk/; revision=3223
2001-04-01 04:11:51 +00:00
Jeff Foster 395b68ea19 Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name,
GUI and printing code changed to support these changes
and display the multiple hex views.

svn path=/trunk/; revision=3165
2001-03-23 14:44:04 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Guy Harris e7ea7a34e9 Clean up the dissector registration up a bit - arrange that all plugins
be loaded and their initialization routines called in right after we
call the initialization routines for built-in dissectors, but don't call
their handoff registration routines yet, and then call the handoff
registration routines right after calling the handoff registration
routines for built-in dissectors.

Do all that in "proto_init()", rather than "epan_init()".

That way, we call all dissector registration routines together, and then
call all dissector handoff registration routines together; all the
registration routines are called before any handoff registration
routines, as is required, and, as "proto_init()" is called by
"epan_init()" before "dfilter_init()" is called, all filterable fields
have been registered before "dfilter_init()" is called, and no plugins
have to call "dfilter_init()" themselves to get their fields registered.

Remove pointers to "dfilter_init()" and "dfilter_cleanup()" from the
plugin address table, as plugins shouldn't be calling them any more, and
remove calls to them from plugins.

svn path=/trunk/; revision=2940
2001-01-26 06:14:53 +00:00
Guy Harris cba377df3c Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()".  Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.

That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files.  Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).

Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.

Remove from the top-level configure script checks for things used only
in libethereal.

svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +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
Olivier Abad 22031f399d - HAVE_PLUGINS is defined in plugins.h so it must be included here.
- get rid of the "epan" argument for init_plugins()

svn path=/trunk/; revision=2471
2000-09-30 10:19:01 +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