Commit Graph

37 Commits

Author SHA1 Message Date
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
Add a "report a warning message" routine to the "report_err" code in
libwsutil, and rename files and routines appropriately, as they don't
only handle errors any more.

Have a routine read_enabled_and_disabled_protos() that reads all the
files that enable or disable protocols or heuristic dissectors, enables
and disables them based on the contents of those files, and reports
errors itself (as warnings) using the new "report a warning message"
routine.  Fix that error reporting to report separately on the disabled
protocols, enabled protocols, and heuristic dissectors files.

Have a routine to set up the enabled and disabled protocols and
heuristic dissectors from the command-line arguments, so it's done the
same way in all programs.

If we try to enable or disable an unknown heuristic dissector via a
command-line argument, report an error.

Update a bunch of comments.

Update the name of disabled_protos_cleanup(), as it cleans up
information for disabled *and* enabled protocols and for heuristic
dissectors.

Support the command-line flags to enable and disable protocols and
heuristic dissectors in tfshark.

Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df
Reviewed-on: https://code.wireshark.org/review/20966
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08 20:40:08 +00:00
Peter Wu 77ae30ffc5 gtk: fix compilation with GTK+ before 2.18
Removed in v1.99.2rc0-399-g43f09e6, but some includes are still needed.

Basically I looked for the functions defined in the
ui/gtk/old-gtk-compat.h header file that were in files below ui/gtk/.
Then I matched it against the removed part in the above commit and added
the header back at its old place. In two other cases, the header was
only needed for Windows.

If the above commit did not reference the file, I checked which function
was in use and added the header on top, removing redundant conditionals.

Reported and tested by a user of GTK+ 2.12.12 on top of v2.0.5.

Change-Id: I649eec1e5531070f88c99d893c4920306f56d849
Reviewed-on: https://code.wireshark.org/review/17371
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-01 08:27:59 +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
Balint Reczey 1708e2eb04 gtk: Fix null dereference in stats
This fixes the bug reported to Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786704

Change-Id: Iabe19c11067318d78664a17fa00d6a4d1998250c
Reviewed-on: https://code.wireshark.org/review/15948
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-06-15 23:19:56 +00:00
Michael Mann 57ef06e242 *_stdup_printf -> strdup for "single string only" formatting.
Done for performance improvements.

This could probably be done in checkAPIs.pl, but this was just
a quick manual check with grepping.

Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d
Reviewed-on: https://code.wireshark.org/review/15751
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: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-06 06:03:58 +00:00
Michael Mann a8ff1e2778 Create very basic "generic" stat tap API to create a "GUI" independent table.
A few sample tap/dissectors (ANSI/A, ANSI MAP) are also included to test the API.  The "GUI output" is a bit raw and could use some "prettying up", but all the basic hooks are there.

Telephony "stat grouping" needs to be better alphabetized to properly populate menu (on GTK, probably Qt)

Change-Id: I98514171f69c4ab3a304dccb26c71d629703c9ab
Reviewed-on: https://code.wireshark.org/review/9110
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:08:28 +00:00
Gerald Combs 1736a1bcc6 Clean up stats_tree_presentation.
Remove some unused struct members and accompanying callbacks.

Change-Id: I64d32ddf886038e8f19bc3f88e86c8d7578db648
Reviewed-on: https://code.wireshark.org/review/8779
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-05 21:39:08 +00:00
Bill Meier bfde04b845 ui/gtk/*.c: Add editor modelines; As needed: Fix indentation
Change-Id: I8cd9d9fe5f12c284f46b8f725766f681faccd753
Reviewed-on: https://code.wireshark.org/review/7138
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-15 19:02:30 +00:00
Martin Mathieson 43f09e67b4 Remove unneeded includes from ui folder
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a
Reviewed-on: https://code.wireshark.org/review/6128
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-01 23:11:10 +00:00
Guy Harris 99b6afbc28 Add a name field to tap_param, for use in error messages.
Change-Id: Ia4317b61ff30e269eba0ee2ea2c46f1668544b1b
Reviewed-on: https://code.wireshark.org/review/5309
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14 20:21:57 +00:00
Guy Harris 4729e13df7 Add an optional flag and a type for UUID parameters for stat taps.
For future use, with common code to parse the -z argument.

Change-Id: Ib2a11bd5c91b5ac48ced2cd2d112b97c301ff72a
Reviewed-on: https://code.wireshark.org/review/5307
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14 19:25:42 +00:00
Guy Harris 1c297771c3 Rename and move ui/stat_menu.h to epan/stat_groups.h.
The groups are, technically, independent of the notion of a menu, and,
if we have mechanisms by which taps that are not only GUI
toolkit-independent but independent of the *existence* of a GUI can be
registered, they might want to register themselves in a group just in
case they're running in a program that has a GUI.

Also, this might fix the Debian package build.

Change-Id: I29435681e79748fd4f2e0c5ac872cd11f831d172
Reviewed-on: https://code.wireshark.org/review/2830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 20:30:42 +00:00
Guy Harris 5e28386540 Move stat_menu.h to libui.
Change-Id: I7bed7f7931845bc41035535cc62e1fe17c71047d
Reviewed-on: https://code.wireshark.org/review/2726
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 21:37:34 +00:00
Chris Maynard e07b7953a8 Save the size and position of the expert info dialog
Set initialize position to center on parent

bug: 3817
Change-Id: Iad48aa762d892908d50f742606160c8305084f48
Reviewed-on: https://code.wireshark.org/review/2459
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Balint Reczey <balint@balintreczey.hu>
2014-06-19 22:21:05 +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
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Anders Broman 8c608ca3d1 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54826
2014-01-16 07:30:22 +00:00
Guy Harris 2e5c54935b In a source file that defines external functions, the header file that
declares the functions must be included, in order to make sure the
declarations match the function signature.  Make it so.

Don't cast away constness when passing something to a routine that takes
a const pointer argument.

svn path=/trunk/; revision=54747
2014-01-14 01:35:13 +00:00
Bill Meier 8ab9c55618 From Ville Skyttä: Spelling Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591


svn path=/trunk/; revision=54387
2013-12-23 15:53:13 +00:00
Alexis La Goutte 006f84a565 From Deon van der Westhuysen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452
Patch: Stats_tree enhancements for sorting, averages and burst rate

Add sort, save-as and new columns to Qt ui, remove old functions

stats_tree.c / stats_tree_priv.h: Make all columns sortable. Remove unneeded functions stats_tree_get_strs_from_node, stats_tree_branch_to_str and stats_tree_is_sortable_column.

stats_tree_stat.c: Set all columns sortable.

stats_tree_dialog.cpp / stats_tree_dialog.h: Add new stats_tree columns. Make columns sortable. Remove copy to csv and copy to yaml buttons. Add copy to clipboard as plain text and save as buttons.

stats_tree_dialog.ui: Remove copy to csv and copy to yaml buttons. Add copy to clipboard as plain text and save as buttons. Only define one column in ui, rest are added dynmically.

From me : fix trailing whitespace

svn path=/trunk/; revision=53848
2013-12-08 11:09:54 +00:00
Guy Harris fb289aedf6 Explicitly convert an int to an enum.
svn path=/trunk/; revision=53729
2013-12-02 19:20:35 +00:00
Guy Harris e313b15f03 Use ws_fopen() so we properly handle UTF-8 file names on Windows.
svn path=/trunk/; revision=53725
2013-12-02 18:58:40 +00:00
Michael Mann 0c9aa51ec5 Patch to include YAML export. Bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Deon van der Westhuysen
From me: use switch statements instead of if-else

svn path=/trunk/; revision=53698
2013-12-01 15:44:22 +00:00
Guy Harris e52bce9f1f Fix indentation.
svn path=/trunk/; revision=53668
2013-11-30 00:53:03 +00:00
Guy Harris c6efc227a5 Strings are usually unwritable; squelch "constness is being assigned
away" warnings.

svn path=/trunk/; revision=53666
2013-11-30 00:10:18 +00:00
Michael Mann 60d6b05e23 Stats_tree enhancements for sorting, averages and burst rate. Bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Deon van der Westhuysen

- Bug fix: object leak in stats_tree after a tap reset (for example apply statistics preferences with a stats_tree window open)
- Bug fix: correct sample code in README.stats_tree
- Add: slash in plug-in name now creates submenu as docs describe (was a bug?)
- Add: menu separator before the stat_tree registered plug-ins
- Add: stats_tree can now calculate averages for nodes; automatically calculated for range nodes. Add section in README.stats_tree describing averages.
- Add: stats_tree can now calculate burst rate of each node (like rate but with a shorter, sliding time window)
- Add: sorting for stats_tree plug-ins. Can sort on node name, count, average, min, max values and burst rate.
- Add: preferences for stats_tree system (default sort column, burst calc params)
- Add: stats_tree window copy to clipboard and export and plain text, csv and XML.
- Added sample of new functionality in $srcdir/plugins/stats_tree/pinfo_stats_tree.c
- Moved all stats_tree sample plug-ins to "IP Statistics" submenu.

svn path=/trunk/; revision=53657
2013-11-29 22:47:59 +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
Bill Meier 35d1b406d7 From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10408

Note: The following parts of the patch had been previously done:
 asn1/snmp/packet-snmp-template.c
 epan/dissectors/packet-snmp.c
 epan/dissectors/packet-x11.c

svn path=/trunk/; revision=48448
2013-03-21 02:58:59 +00:00
Bill Meier ae68f42297 Fix [-Wshadow] warnings.
svn path=/trunk/; revision=46426
2012-12-06 20:59:53 +00:00
Jakub Zawadzki 49ce5e127b protect_thread_critical_region, unprotect_thread_critical_region are no-ops, cleanup code by removing them.
svn path=/trunk/; revision=45201
2012-09-28 21:36:21 +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
Jakub Zawadzki 73b0691fd8 gtk_container_add() -> gtk_box_pack_start() [bug #7377]
svn path=/trunk/; revision=43874
2012-07-20 21:35:45 +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 42310b6eb9 Replace gtk_vbox_new() and gtk_hbox_new() with ws_gtk_box_new().
svn path=/trunk/; revision=42162
2012-04-20 15:28:00 +00:00
Guy Harris d7b2aad043 Move some headers for UI stuff, and the alert_box.c UI-specific file, to
the ui directory.  (Perhaps some other files that would be used by all
flavors of Wireshark, for any GUI toolkit or for someting such as
ncurses, and not for any command-line tool such as TShark, should be
moved there as well.)

Shuffle some #includes to put the "ui/XXX.h" includes together.

svn path=/trunk/; revision=40529
2012-01-16 01:07:52 +00:00
Jörg Mayer be706c6380 Move gtk to ui/gtk.
This looses the last checkin to gtk, will add this manually back.

svn path=/trunk/; revision=40518
2012-01-15 21:59:11 +00:00