Commit Graph

43 Commits

Author SHA1 Message Date
Roland Knall 2cf938cfa8 tap: Adding flags for tap_packet
This allows flags to be passed by the registering listener
to the collection of information
2022-06-10 05:46:15 +00:00
Moshe Kaplan 1c3a9af869 Add files with WS_DLL_PUBLIC to Doxygen
Add @file markers for most files that
contain functions exported with
WS_DLL_PUBLIC so that Doxygen will
generate documentation for them.
2021-11-29 21:27:45 +00:00
João Valverde 8df2a73594 Use the musl in-tree getopt_long() everywhere
Besides the obvious limitation of being unavailable on Windows,
the standard is vague about getopt() and getopt_long() has many
non-portable pitfalls and buggy implementations, that increase
the maintainance cost a lot. Also the GNU libc code currently
in the tree is not suited for embedding and is unmaintainable.

Own maintainership for getopt_long() and use the musl implementation
everywhere. This way we don't need to worry if optreset is available,
or if the $OPERATING_SYSTEM version behaves in subtly different ways.

The API is under the Wireshark namespace to avoid conflicts with
system headers.

Side-note, the Mingw-w64 9.0 getopt_long() implementation is buggy
with opterr and known to crash. In my experience it's a headache to
use the embedded getopt implementation if the system provides one.
2021-09-17 00:43:54 +01:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Michael Mann c10c7737cc Allow floating point values for stats_tree
Bug: 4234
Change-Id: Ibd59809b2dd9890a7851eb57ef7af384e280a74b
Reviewed-on: https://code.wireshark.org/review/31222
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-12-28 14:50:45 +00:00
Gerald Combs 1d030928ef Remove some GTK+-only code.
Change-Id: Ic2498c7acd6a1a522be45094148402ee34a6b4d1
Reviewed-on: https://code.wireshark.org/review/26958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-17 03:44:47 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Dario Lombardo b845e29d97 stats_tree: rename shadow variable
Change-Id: I5b3272cc4df728c70d6b0370b0d8a6d3482a0c6c
Reviewed-on: https://code.wireshark.org/review/16100
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-26 06:00:43 +00:00
Gerald Combs 2d863b9782 Add TapParameterDialog.
Split StatsTreeDialog into StatsTreeDialog and TapParameterDialog (its
base class). This more closely matches the GTK+ UI and paves the way for
more statistics dialogs.

Change-Id: I2630385534e829d99724673ade372fcb33200d07
Reviewed-on: https://code.wireshark.org/review/8842
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-08 19:51:34 +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
Gerald Combs 4556498f33 Qt: Convert more dialogs to WiresharkDialog.
Make the Sequence, IO Graph, Statistics Tree, and VoIP Calls dialogs
subclasses of WiresharkDialog.

Remove "Stats Tree" from Statistics Tree dialog titles. Don't complain
if the user opens more than one instance of the dialog.

Use the applicationName property in WiresharkApplication instead of a
separate variable.

Add a preexisting item to the IO Graph bug list (hovering when the file
is closed clears the graph).

Change-Id: I8411a25305d00b16e0d4a82fa50a9bad5c85b239
Reviewed-on: https://code.wireshark.org/review/6125
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-30 03:34:03 +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
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 5e7b58ab94 Make the declaration of stats_tree_format_node_as_str() match the
definition.

svn path=/trunk/; revision=53727
2013-12-02 19:15:14 +00:00
Guy Harris c123b131ae Make the declaration of stats_tree_format_as_str() match the definition.
svn path=/trunk/; revision=53712
2013-12-02 08:55:38 +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 1d80b1e16c Constify to squelch some warnings.
svn path=/trunk/; revision=53663
2013-11-30 00:02:46 +00:00
Guy Harris 1ca96130b3 A typedef has to actually define a type.
svn path=/trunk/; revision=53659
2013-11-29 23:46:48 +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
Gerald Combs ea28298e96 Add a statistics tree dialog.
Add menu items for each corresponding item in gtk/main_menubar.c that
calls gtk_stats_tree_cb(). Hopefully that's everything. Note that we use
quite a bit less code than the GTK+ flavor and why we might not want to
do that. Change a few things in ui/qt/CMakeLists.txt to more closely
match the GTK+ version. Add plumbing for tap registrations in
CMakeLists.txt and Makefile.am. Add the ability to copy text as CSV or
YAML.

svn path=/trunk/; revision=53464
2013-11-21 01:28:17 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Anders Broman 5d9d9b8221 From Wonil Kim: Enable statistics menu register for the tap plug-in. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7466
svn path=/trunk/; revision=43726
2012-07-15 16:24:35 +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 a009cc0605 Doxygen changes.
svn path=/trunk/; revision=33990
2010-08-29 10:47:38 +00:00
Guy Harris 285cd1fec7 Constify an argument.
svn path=/trunk/; revision=32303
2010-03-26 23:40:48 +00:00
Guy Harris cf91fdf16b Have tap listeners specify whether the "packet" routine requires
a protocol tree;

	the column values.

This includes stats-tree listeners.

Have the routines to build the packet list, and to retap packets, honor
those requirements.  This means that cf_retap_packets() no longer needs
an argument to specify whether to construct the column values or not, so
get rid of that argument.

This also means that there's no need for a tap to have a fake filter
to ensure that the protocol tree will be built, so don't set up a fake
"frame" filter.

While we're at it, clean up some cases where "no filter" was represented
as a null string rather than a null pointer.

Have a routine to return an indication of the number of tap listeners
with filters; use that rather than the global num_tap_filters.

Clean up some indentation and some gboolean vs. gint items.

svn path=/trunk/; revision=28645
2009-06-05 22:42:47 +00:00
Ulf Lamping f904f42f9d Remove an ugly hack:
There was an ugly hack while creating the menu, that tried to detect the stat_group a stats_tree belongs to by looking at the name string. That makes it unnecessarily hard to understand how the menu is really created.

Fix: Add a new function stats_tree_register_with_group() that takes the stat_group as a parameter. Use this function where a stats_tree doesn't fit into the default "unsorted" group.

svn path=/trunk/; revision=27407
2009-02-10 03:54:55 +00:00
Jeff Morriss c50b4aec09 More (mostly stats tree) unsigned->signed char cleanup
svn path=/trunk/; revision=25717
2008-07-12 01:48:24 +00:00
Jeff Morriss 71c1e4faf0 Change the stats tree API to use signed chars instead of guint8s for all its
strings; this should fix a number of signed/unsigned char warnings.
Reindent a bunch, too.

svn path=/trunk/; revision=25716
2008-07-11 21:13:39 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Luis Ontanon c39b333072 Fix bug 710 and avoid having it crash when more than one instance are open at once.
I think that whoever wrote the whole stats_tree thing should rewrite it ASAP, because it sucks!

I did ?!?!??

ooops!


svn path=/trunk/; revision=17627
2006-03-15 01:41:39 +00:00
Luis Ontanon 35bd5bd854 Instead of checking if this is a new packet at every call to avoid recounting the packets at every rerun remove the tap listener of this stats tree.
fixes bug 474

svn path=/trunk/; revision=15960
2005-09-22 17:01:06 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Luis Ontanon 22084517ad Fix the names that were not consistent after the rename.
svn path=/trunk/; revision=13852
2005-03-21 17:51:07 +00:00
Luis Ontanon 3af24ce10a Add a cleanup call-back to the stats_tree.
svn path=/trunk/; revision=13851
2005-03-21 15:40:33 +00:00
Luis Ontanon 04dcf4e154 Rename all stats_tree extern functions to start with stats_tree_
svn path=/trunk/; revision=13840
2005-03-21 00:55:04 +00:00
Luis Ontanon 9e9a658369 There was a design flaw that caused a crash on windows and
left uninitialized successive copies of the stats tree.

Split the stats_tree data in two different structs one for data that's
always needed and it's not going to change at every run and another
for each run of the tap.



svn path=/trunk/; revision=13816
2005-03-20 00:19:15 +00:00
Luis Ontanon 93c46dde91 Several fixes to the stats_tree
- Avoid creating a copy of every branch at reinitialization
       this used to cause some GTK warnings and a leakage of tree nodes

- propperly check the optarg to avoid getting junk in the filter text
       this caused a crash


svn path=/trunk/; revision=13534
2005-02-27 16:55:24 +00:00
Luis Ontanon ca67abe524 some more work for
- beautify the text output
- make gtk1 textbox implementation usable (I hope)


svn path=/trunk/; revision=13506
2005-02-25 03:56:12 +00:00
Luis Ontanon 00435bf390 Update to the stats_tree tapping API
- change the tap init_string to %s,tree instead of %s,stat
- change the registration key (it used to be tapname, that disallowed to register more than one tap per protocol)
- add a "pivot" node for convenience


svn path=/trunk/; revision=13502
2005-02-24 22:02:31 +00:00
Luis Ontanon 9b02a501cd Fixes few things during reinitialization with gtk2 (it doesn't crash anymore),
there are still problems at reinit (gtk2 node->pr warns about an iterator not been OK)

set up propperties of the given files

svn path=/trunk/; revision=13448
2005-02-20 17:43:38 +00:00
Luis Ontanon 43124c8744 Initial checkin of the stats-tree tap API
Makefiles have not been modified yet, there's still work to do.

svn path=/trunk/; revision=13414
2005-02-16 14:16:40 +00:00