Commit Graph

264 Commits

Author SHA1 Message Date
Dario Lombardo baf2612d9e exported_pdu: add cleanup function.
Change-Id: Iafc9f1c4b2a0210d8098b37eefc095e740182258
Reviewed-on: https://code.wireshark.org/review/19648
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-17 03:26:04 +00:00
Gerald Combs 9f56bdbef3 Set a Libgcrypt log handler on Windows.
Libgcrypt prints all log messages to stderr by default. On Windows the
slow_gatherer routine logs

    NOTE: you should run 'diskperf -y' to enable the disk statistics

if DeviceIoControl(..., IOCTL_DISK_PERFORMANCE, ...) fails. We don't
depend on cryptographically secure random numbers and the message is
needlessly confusing. Add a log handler that ignores less-severe messages.

Change-Id: If40a691ea380364457dfdf126b9bf33ac2672d3a
Reviewed-on: https://code.wireshark.org/review/19155
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-09 13:50:20 +00:00
Benoît Canet 47649d1c7f cql: add lz4 and snappy decompression
We do not use the STARTUP negotiation since a stream
can be captured in its middle but try to decompress
if the flag is present and fallback if it fails.

Change-Id: Iecbf49a45220b04be7808869c9884548eb1e7694
Signed-off-by: Benoît Canet <benoit@scylladb.com>
Reviewed-on: https://code.wireshark.org/review/17952
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-10-17 18:28:45 +00:00
Balint Reczey b1cc056b12 Remove nghttp2 code and use system' nghttp2
Update debian, macos (setup / homebrew) download script
Update testsuite (don't try HPACK when build without nghttp2)

Change-Id: I365e5e17bc4fab4acd81b4c39ea7189a5d1ee112
Reviewed-on: https://code.wireshark.org/review/17347
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 19:26:10 +00:00
Pascal Quantin 80af5edbfe Display Lua release version in about dialog
It allows to have more info on the version used (for ex 5.2.4 instead of 5.2)

Change-Id: I24a5b83f0a7a72fbb131e9ddc3e735ffea689ee6
Reviewed-on: https://code.wireshark.org/review/16977
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-08-09 19:00:12 +00:00
Michael Mann 907d49483d Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning
2. Use proto_tree_add_debug_text
3. Comment some out

Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5
Reviewed-on: https://code.wireshark.org/review/16678
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-26 04:08:50 +00:00
Pascal Quantin a383e692c8 Revert "tap: change glib functions to wmem."
This reverts commit 2e9f3c5d36.

It breaks the registration of codec, dissector and libwiretap plugins.

Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-19 10:47:10 +00:00
Dario Lombardo 2e9f3c5d36 tap: change glib functions to wmem.
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf
Reviewed-on: https://code.wireshark.org/review/15270
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-17 15:38:03 +00:00
Michael Mann 04b82a7dc9 Convert AT_SS7PC to a "dissector address type"
The formatting of the address type is determined by a preference in
packet-mtp3.c, so just make MTP3 register the address type.
Use address_type_get_by_name in other dissectors (and export_pdu)
to use the address type.

Change-Id: Ifb32d7de27aeaa23cee8e803e25ffb3c905547b5
Reviewed-on: https://code.wireshark.org/review/15856
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-13 17:06:38 +00:00
João Valverde 7a1d3f67ac Remove ADNS support
Relevant mailing list message:

  https://www.wireshark.org/lists/wireshark-dev/201503/msg00007.html

Change-Id: I0cff6d4d64fb52a651bcf6b28c183e43653b1cc2
Reviewed-on: https://code.wireshark.org/review/14519
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-21 19:32:00 +00:00
Guy Harris cdf9943717 Don't walk the entire protocol tree to extract the value of one field.
Instead, prime the epan_dissect_t's tree to look for rtp.ssrc, and
extract that value with proto_get_finfo_ptr_array().

Also, have the filter used to check whether the packet is a candidate
for RTP analysis to check for RTPv2 (and add a check for IPv4 or IPv6
back to the Qt version), and get rid of an unnecessary extra level of
indirection for that string.

In the Qt version, if findStreams() set the error string, don't
overwrite it with a "No streams found." indication, and fix error
handling for the "filter didn't compile" case.

Change-Id: I09d0ea37ccd4806d99e3b6394f2a8a376e974705
Reviewed-on: https://code.wireshark.org/review/13045
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-04 21:14:42 +00:00
Guy Harris 47756e6304 Create the capture dissector hash table before registering capture dissectors.
Change-Id: I76efd64b4e6803db909203a66b35e1a50708ca90
Reviewed-on: https://code.wireshark.org/review/12591
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-13 18:03:06 +00:00
Michael Mann 56aa05227f Create a way to register "capture" dissectors.
Capture dissectors could be architected like dissection dissectors, with tables and subtables and possibly using tvbs to pass there data instead of raw byte arrays.  This is a first step towards that by refactoring capture_info_packet() to work off of a "capture dissector table"

Registering the capture dissection functions instead of calling them directly also clears up a bunch of dissector header files who sole purpose was providing the capture dissection function definition.

Change-Id: I10e9b79e061f32d2572f009823601d4f048d37aa
Reviewed-on: https://code.wireshark.org/review/12581
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-13 14:34:13 +00:00
Martin Kaiser 1c5b3c3783 wsgcrypt.h checks internally if we HAVE_LIBGCRYPT
we can #include <wsutils/wsgcrypt.h> without doing the check ourselves

Change-Id: I248431bdb6cfa1bd85b794ec04ce1e4fcd3a7d2d
Reviewed-on: https://code.wireshark.org/review/11483
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-02 11:42:00 +00:00
Alexis La Goutte 2f543b1fd2 EPAN: fix indent (use tab)
Change-Id: I0545cf70decf923a3a042fa8c9dec3e60a861268
Reviewed-on: https://code.wireshark.org/review/11391
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-29 12:27:52 +00:00
Jeff Morriss 9b3bda9232 epan_init(): make 'status' volatile (to avoid might-be-clobbered warnings).
Change-Id: Ic0f1c99a530089f21b08337379a5a0bc7f566b9c
Reviewed-on: https://code.wireshark.org/review/11352
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-10-28 12:43:53 +00:00
Guy Harris c7e42be2e5 Catch REPORT_DISSECTOR_BUG() calls in dissector registration routines.
Have epan_init() return a success/failure Boolean indication.  Catch
exceptions when calling the dissector registration routines and, if we
get one, report the error and return a failure indication.

If epan_init() fails, quit, but first make sure the reported error is
displayed.

Change-Id: I0300cbb1f66a5644f857a205235124909d684c50
Reviewed-on: https://code.wireshark.org/review/11340
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-28 00:44:26 +00:00
Michael Mann e7fd1bfdf7 Reduce epan dependence on dissectors by having print module "cache" the protocol and field ids that it needs.
Change-Id: I4ec48067e9ca2cbe88e1cf2e6c9dc1e382379221
Reviewed-on: https://code.wireshark.org/review/7767
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-20 05:30:52 +00:00
Michael Mann 7ced085550 emem is dead! Long live wmem!
Change-Id: Iddd1200e62bf3200cb1a68408378dd9d47120b77
Reviewed-on: https://code.wireshark.org/review/6939
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-04 06:59:55 +00:00
Michal Labedzki 361ea8215d Add support for multifields in custom column
You can now add column with Custom type with more than one field
by using OR "||" splitter.

Bug: 9695

Change-Id: Ia82a91e7a35b867647d36cb9626e3870f46c0d85
Reviewed-on: https://code.wireshark.org/review/5804
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-12-18 11:03:42 +00:00
Guy Harris 1d92195de8 Have individual programs get libpcap and libz version info.
That way, the code that constructs the runtime version string doesn't
itself have to call libpcap and libz, and could be usable in programs
that don't call them.

While we're at it, add "with" to the run-time version information for
GnuTLS and libgcrypt, to match the compile-time version information, and
add the version information from libwireshark to TShark.

Change-Id: I3726a027d032270b032292da9314c1cec535dcd2
Reviewed-on: https://code.wireshark.org/review/2587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-23 21:56:42 +00:00
Jeff Morriss f113306e0e More Python-bindings removal.
Change-Id: I4d82175781e65c73179f4c8e737a7900cb050bce
Reviewed-on: https://code.wireshark.org/review/2283
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-16 23:14:05 +00:00
Guy Harris 318cf8a678 Add support for dissecting non-packet records.
Add a dissector table indexed by the file type, and, for the
file-type-specific records, have the frame dissector skip the usual
pseudo-header processing, as the pseudo-header has a file-type-specific
record subtype in it, and call the dissector for that file type's
records.

Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9
Reviewed-on: https://code.wireshark.org/review/1782
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-25 00:05:07 +00:00
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Jakub Zawadzki 5f239013e7 wmem: add new simple block allocator, use it in packet-scope.
For packet-scope allocation, there's no need to support realloc(), free()
cause memory will be garbage collected after packet dissection.

(and this allocator is much faster than full block allocator).

Change-Id: I73fdf708c3077f48f55bdcc71f4fa859e4ac2335
Reviewed-on: https://code.wireshark.org/review/1428
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-02 21:07:07 +00:00
Evan Huus 131bba88c5 Remember to destroy the pinfo pool cache
Otherwise a library reinitialization leaks at least one large 8MB chunk.

Change-Id: I5336fef5925eb54e88a72f1a16fc0ddf77ae6c10
Reviewed-on: https://code.wireshark.org/review/945
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-04 07:22:53 +00:00
Anders Broman 0513b29b8b Revert "Allow pcapng interface options to be available to dissectors."
This patch causes Wireshark/tshark to segfault if the file is reread(open a file and press reload).
The test suite also fails on 
2.1.1 Step: Exit status for existing file: "/home/wireshark/builders/trunk/sol10sparc/build/test/captures/dhcp.pcap" must be 0/home/wireshark/builders/trunk/sol10sparc/build/test/suite-clopts.sh: line 149:  6646 Segmentation Fault      (core dumped) $TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1

OSX build bot chokes on
pcapng.c: In function 'pcapng_destroy_option_value':
pcapng.c:377: warning: implicit declaration of function 'g_byte_array_unref'
pcapng.c:379: warning: implicit declaration of function 'g_array_unref'
pcapng.c: In function 'pcapng_collect_block_option':
pcapng.c:419: warning: implicit declaration of function 'g_byte_array_new_take'
pcapng.c:419: warning: initialization makes pointer from integer without a cast

these functions are glib 2.22
This reverts commit 7b13a3b0f6.

Change-Id: Ia82fdb2d08287bc2cd2841e1e941ae68cbc2e009
Reviewed-on: https://code.wireshark.org/review/749
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 12:25:21 +00:00
Christopher Kilgour 7b13a3b0f6 Allow pcapng interface options to be available to dissectors.
Interface options[1], and more generally pcapng options[2], are useful
information that can provide improved dissector output.

Prior to this change, only certain pcapng interface options were interpreted
and made available to dissectors, e.g. the interface name or description.
This change augments the situation by providing epan_get_interface_option( ),
which returns an array of byte arrays if the option code exists
(otherwise NULL).  Each element of the array is a byte buffer containing
the raw data of the option.  An array-of-buffers is used because pcapng
allows for multiple instances of the same option to be present in the file.
All interface options found in a pcapng file are thus made available to the
dissector.

The implementation also provides infrastructure to collect options from
other pcapng blocks such as the section header.  Currently these options
are discarded, but could be retained in the future to support more features.

[1] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionidb
[2] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionopt

Change-Id: I944b6f0f03dde9b8e7d1348b76acde6f9d312f37
Reviewed-on: https://code.wireshark.org/review/331
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 09:54:01 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Hadriel Kaplan bd36fe1bcb Fix bug 6357: Lua all_field_infos() broken within tap/listener
The current API for Lua provides a global function
"all_field_infos()" which returns all the populated field_info nodes
in the current proto_tree.

By default all_field_infos() "works", in the literal sense: it returns
exactly the fields the previous dissectors of the packet have
populated at that instant of time.  But of course dissectors don't
populate all the applicable fields most of the time, because of the
TRY_TO_FAKE_THIS_ITEM optimization where they don't fill in things
that aren't needed at the time by a display, color, or tap's dfilter.

So this commit offers a way to force the dissectors to populate
all the applicable field_infos in the tree, by setting the proto_tree
to be visible.  Obviously that is going to impact performance, since
it basically bypasses the TRY_TO_FAKE_THIS_ITEM optimization; so the
patch only does this if the Lua script author told it to explicitly,
by adding an argument to Listener.new() and register_postdissector().

Change-Id: I11d3559fbe8c14fbadf1b51415a3701dc1200b7b
Reviewed-on: https://code.wireshark.org/review/286
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 21:06:50 +00:00
Michael Mann bf284da2ee TFShark (Terminal Fileshark) v.001. Bug 9607 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9607)
This is a VERY PRELIMINARY version of tfshark.  It's an attempt to jumpstart FileShark and its architecture.  Right now it's mostly just a very stripped down version of tshark with all of the necessary build modifications (including now building filetap library since tfshark depends on it)

This code has helped me identify what I believe to be all of the necessary layers for a complete fileshark architecture.  And those layers will slowly be added in time (patches always welcome!).

svn path=/trunk/; revision=54646
2014-01-08 04:35:28 +00:00
Jakub Zawadzki 5fa7d37e37 Fix epan building with undefined HAVE_PLUGINS
+ guard prototypes with HAVE_PLUGINS in .h files to get errors before linking.

svn path=/trunk/; revision=53909
2013-12-10 19:13:09 +00:00
Guy Harris 125a17f8e5 Initialize the error-reporting routines before scanning for plugins, as
the code to scan for them uses those routines.

This means epan_init() no longer takes those routines as arguments -
which is just as well, given that the mechanism in question is no longer
part of libwireshark, but is part of libwsutil.

This should fix bug 9508.

svn path=/trunk/; revision=53796
2013-12-05 09:30:22 +00:00
Jakub Zawadzki cedb73c7f7 Dissectors should not use dfilter.h, don't include it.
XXX ncp2222 dissector is using dfilter_compile(), why?

svn path=/trunk/; revision=53766
2013-12-03 21:31:04 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Evan Huus 8a0ef07000 Effectively remove the tree memory pool and port some of its behaviour to the
pinfo memory pool, they have exactly the same scope. Simplification and minor
performance win (one GHashTable we longer have to create/destroy on every
packet).

svn path=/trunk/; revision=53076
2013-11-04 14:12:59 +00:00
Michael Mann 79d58dc670 Add Lua cleanup on shutdown, to help with memory leak detection. Bug 5575 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5575)
From Robert G. Jakabosky

From me: cleanup so that it applies to trunk.

svn path=/trunk/; revision=52798
2013-10-23 16:47:02 +00:00
Jakub Zawadzki 1f110ac43f 2nd try to fix recent test failures.
After recent changes it's possible that epan_dissect_cleanup() can be called if there were
no dissection run on it (epan_dissect_run()) In such case ->tvb will have random value,
just initialize it to NULL in _init() and see if it's working.

Thanks goes to Evan for backtrace.

svn path=/trunk/; revision=52722
2013-10-20 19:05:00 +00:00
Jakub Zawadzki bad81b517f Reintroduce back epan_dissect_reset(), proto_tree_reset()
This time it makes more sense, cause for each dissection we need two wmem allocators.
Reseting wmem allocator is much faster than destroy & create.

svn path=/trunk/; revision=52706
2013-10-20 10:21:25 +00:00
Jakub Zawadzki 107e4a6c80 Move resetting packet_info structure from dissect_packet() to epan_dissect_init()
It'd be actually good idea to seperate packet_info data (packet.c) from epan_dissect_t (epan.c),
but this rule is already violated.

Strict seperation could allow for example allow multiple dissection on the same epan_dissect_t
(I think it was idea behind it), but it's not working.

svn path=/trunk/; revision=52705
2013-10-20 10:11:16 +00:00
Anders Broman e958d8c081 From beroset@mindspring.com:
remove unnecessary and unused oid_resolv_cleanup()

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

svn path=/trunk/; revision=52697
2013-10-19 20:25:55 +00:00
Evan Huus d8f00e22e1 As suggested in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9033
Make epan_free a no-op if the pointer is NULL. This fixes 99% of the cases
causing problems for wmem_leave_file_scope() - remove that XXX comment and add
back the assertion.

Remove the cleanup_dissection call from epan_cleanup, it doesn't make sense
there. init_dissection is only called from epan_new, so cleanup_dissection
should only be called from epan_free.

Add one missing epan_free call to tshark revealed by the above changes.

svn path=/trunk/; revision=51342
2013-08-13 22:41:34 +00:00
Evan Huus a2b2885daf Create the dissector hash table in only one place, and specify that its values
should be freed when it is destroyed. This requires splitting packet_init in
two: the hash table which must be created before protocol registration, and the
caching of common protocol handles, which must happen after registration.

svn path=/trunk/; revision=51329
2013-08-13 03:11:28 +00:00
Jeff Morriss 2c81a97d55 Ensure we have both _initialize() and a corresponding _cleanup() routines for
the various name resolvers; put those two routines next to each other.

Add generic addr_resolv_init() and addr_resolv_cleanup() routines which call
all of those internal routines.

Call the generic init/cleanup routine from epan_init() and epan_cleanup().

Create the hash tables for each name resolver in those initialization routines
in order to avoid having to repeatedly check if the table is already created
or not (and to avoid glib warnings if we neglected to perform that check):

http://www.wireshark.org/lists/wireshark-dev/201308/msg00012.html


Don't clean up   hostnames in init_dissection():    it's done already in cleanup_dissection().
Don't initialize hostnames in cleanup_dissection(): it's done already in init_dissection().

svn path=/trunk/; revision=51191
2013-08-07 16:46:08 +00:00
Jakub Zawadzki 08eb36b5af Remove fdata->opt_comment, add pkt_comment to pinfo
Original (read from file) comments can be accessed by pkthdr->opt_comment
Keep user comments in seperated BST, add new method for epan session to get it.

svn path=/trunk/; revision=51090
2013-08-01 20:59:38 +00:00
Anders Broman 0105d538d2 Use glibs hastables rather than home grown variants for manuf an wka(well known addresses).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9000

svn path=/trunk/; revision=51084
2013-08-01 20:11:13 +00:00
Jakub Zawadzki 7ec1a78fe8 Abuse epan_t more: add callback to get interface name.
svn path=/trunk/; revision=50794
2013-07-22 19:38:38 +00:00
Jakub Zawadzki 5df324921d Fix: epan.c:155: warning: assignment discards qualifiers from pointer target type
svn path=/trunk/; revision=50767
2013-07-21 21:04:25 +00:00
Jakub Zawadzki 5d52e16734 Add helper function to epan_session which can be used to get absolute timestamp of given frame.
Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number.

This patch reduce size of frame_data by 8B (amd64)
This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13)

svn path=/trunk/; revision=50765
2013-07-21 20:48:30 +00:00
Jakub Zawadzki 265dbadb68 try to fix: epan.c:141: error: invalid application of 'sizeof' to incomplete type 'epan_t'
svn path=/trunk/; revision=50763
2013-07-21 19:08:11 +00:00
Jakub Zawadzki 28e9dcc4a9 Some work on multi file dissection
- make init_dissection/cleanup_dissection private for libwireshark
- implement epan_new(), epan_free()
- pass epan_t to epan_dissect*

svn path=/trunk/; revision=50761
2013-07-21 18:38:03 +00:00
Jeff Morriss 54bb2e7a5c Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark).
svn path=/trunk/; revision=50598
2013-07-15 02:48:26 +00:00
Jakub Zawadzki ce81449ed9 packet dissection now takes pointer to tvb instead of guint8 data
implement frame_tvbuff, right now almost a copy of 'real' tvb.

svn path=/trunk/; revision=50497
2013-07-11 05:47:02 +00:00
Michael Mann 0d1a4b2920 Add expert info configuration framework. Bug 2412 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2412).
Expert info "fields" can now be registered/addressed by name.  Right now, the basic framework allows expert info fields to become "display filters".  However more could be done, like user preferences overriding default severity level, speeding up expert info dialog load time by not needing to redissect a file, etc.

Long term goal is to have all expert_info filterable and have the functionality of expert_add_info_format() include the "registered index".  expert_add_info_format_text() is the workaround until all current calls to expert_add_info_format() have been updated with either expert_add_info() or expert_add_info_format_text().  Then the remaining expert_add_info_format_text() will be renamed to expert_add_info_format().

svn path=/trunk/; revision=49559
2013-05-24 17:59:36 +00:00
Guy Harris 70bb111bab Turn "packet_is_ssl()" into a general "does the packet whose dissection
is in this epan_dissect_t contain the field whose name is passed as an
argument" routine in libwireshark, and use it where we used
packet_is_ssl().  (We should check to see if anything *else* could use
it.)

svn path=/trunk/; revision=49530
2013-05-22 23:02:19 +00:00
Anders Broman 8677c1f42f Don't load the hosts file in epan_init, it's loaded when opening a file
in cf_open().

svn path=/trunk/; revision=48526
2013-03-24 14:39:19 +00:00
Michael Mann 0f3f207967 Bugfix Lua pinfo.cols.protocol not holding value in postdissector
From Hadriel Kaplan, bug 6020 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6020)

svn path=/trunk/; revision=47877
2013-02-25 17:32:25 +00:00
Martin Kaiser 38a73a32f3 include the wsutil/wsgcrypt.h instead of including gcrypt.h directly
svn path=/trunk/; revision=47802
2013-02-21 18:23:29 +00:00
Evan Huus 5cf858ec52 Dispatch all allocator creations through a single function using an enum to
determine the desired type. This has two advantages over the old way:
 - just one environment variable for valgrind to override in order to guarantee
   that ALL allocators use memory it can track, and just one place to check that
   variable
 - allocator owners no longer have to include headers specific to their
   allocator, allowing them to change allocators without adjusting all their
   #includes

svn path=/trunk/; revision=46604
2012-12-19 00:43:36 +00:00
Evan Huus 561525cbb5 Rename allocator_glib to allocator_simple, since the block allocator also
uses glib and 'simple' describes the intention far better.

svn path=/trunk/; revision=46603
2012-12-18 23:36:45 +00:00
Evan Huus 8b69e3ee22 Use 'new' instead of 'create' a consistent manner.
svn path=/trunk/; revision=46601
2012-12-18 23:25:11 +00:00
Evan Huus 93a15fa28a Actually destroy the pool in epan_dissect_cleanup. There are many cases
where the edt is on the stack, in which case epan_dissect_free never gets
called and we were leaking the pool (although not any of the memory in it).

svn path=/trunk/; revision=46333
2012-12-02 18:16:21 +00:00
Evan Huus b9c6f71fe4 Create a wmem pool in pinfo and use it for some address allocations.
A (better?) fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8030

See also thread starting at:
http://www.wireshark.org/lists/wireshark-dev/201212/msg00001.html

svn path=/trunk/; revision=46331
2012-12-02 17:01:04 +00:00
Jakub Zawadzki bdcdec560c Manually revert r45669
svn path=/trunk/; revision=45884
2012-11-03 20:51:19 +00:00
Evan Huus 2737b7b7d3 Add wmem scopes for packet and file lifetimes. The file lifetime scope isn't
yet initialized because I can't figure out where the enter() and leave() calls
should go - the obvious place in packet.c causes a lot of assertion errors.

svn path=/trunk/; revision=45879
2012-11-03 15:49:15 +00:00
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