aboutsummaryrefslogtreecommitdiffstats
path: root/epan/stats_tree.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-11stats_tree: fix this statement may fall through ↵Alexis La Goutte1-1/+1
[-Werror=implicit-fallthrough] found by gcc7 Change-Id: Idd5ab938b95d515cdf8b2a8568456f44b3dd85ac Reviewed-on: https://code.wireshark.org/review/20496 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-20stats_tree: fix no previous prototype for ‘stats_tree_cfg_free’ ↵Alexis La Goutte1-1/+1
[-Wmissing-prototypes] Change-Id: Iddf63fabec9a2abb5b3d75fb5289f769e0175b55 Reviewed-on: https://code.wireshark.org/review/20197 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-07stats_tree: add cleanup function.Dario Lombardo1-1/+16
Change-Id: Iefd264bdd79af172c245c3a30119999cca9d56c0 Reviewed-on: https://code.wireshark.org/review/19976 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-02-08Cleanup indentationJoão Valverde1-163/+183
Change-Id: I59e9a4806d047e8cc26e9927e76243ce58a57e6d Reviewed-on: https://code.wireshark.org/review/13811 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-20Fix constnessJoão Valverde1-1/+1
Change-Id: I23a01f86d6934f3d6c048015c47ae690742173c8 Reviewed-on: https://code.wireshark.org/review/13437 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2015-12-28Don't cast away constness unnecessarily.Guy Harris1-2/+2
Compare functions for various collection data types don't need to modify what they're comparing, so keep everything const. Change-Id: I1c2cff6954b1a8c5ade74943934324d0bd8f523c Reviewed-on: https://code.wireshark.org/review/12884 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-01stats_tree: re-indent else for avoid warning found by PVS Studio (V705)Alexis La Goutte1-7/+9
It is possible that 'else' block was forgotten or commented out, thus altering the program's operation logics Change-Id: Ie246592282bd0791021159f90b4b8aeb92cff86f Reviewed-on: https://code.wireshark.org/review/12333 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-22Add support for IPv6 stats tree statisticsJoão Valverde1-1/+14
Also add support for alphabetizing stat tree items as the addition of IPv6 stats tree makes it more obvious its needed. Change-Id: I8b319ceac805ce7e3a1fd59f92c1c6fe2a54d3de Reviewed-on: https://code.wireshark.org/review/10062 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-20Tap parameter and stats dialog fixups.Gerald Combs1-0/+2
If we run into an error when trying to register a tap listener, return instead of tapping packets. This should fix some (but likely not all) double frees found by Stig. For now close each statistics dialog if we find an error. Note that we might want to keep them open instead. Add checks and cleanups to some of the stats table free routines. Call fillTree once in TapParameterDialog's constructor instead of each time it's shown. Make fillTree a slot which lets us use a delay timer so that the dialog is visible when we retap packets. Change-Id: Id49f2f2a99bc8e5b1d32990024986b3c8b1abe24 Reviewed-on: https://code.wireshark.org/review/10153 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-03Add ServiceResponseTimeDialog.Gerald Combs1-1/+2
Add ServiceResponseTimeDialog as a subclass of TapParameterDialog, similar to StatsTreeDialog. Add initial plumbing for statistics menu items and command line invocation. Don't append "..." to menu item names. Don't add menu icons. In each case this avoids repetitive UI clutter. Change-Id: I463b95c93090160bb81d2e80b16aad389dc0bd6c Reviewed-on: https://code.wireshark.org/review/8864 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-05Clean up stats_tree_presentation.Gerald Combs1-35/+0
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>
2014-12-30stats_tree: Make sure some structs are fully initialized.Gerald Combs1-36/+4
Get rid of a strcpy. Change-Id: I49460969fdf627fdb89030115ad5a658e300a5d4 Reviewed-on: https://code.wireshark.org/review/6130 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22stats_tree: g_sprintf()-->g_snprintf(); cleanup #includes.Bill Meier1-6/+5
Change-Id: I862fed818cd1f14584b082f87b1d4d305cf78687 Reviewed-on: https://code.wireshark.org/review/5970 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06Convert "4 space tabs" to spaces; Adjust editor modelines.Bill Meier1-1002/+1002
Change-Id: I8d61d959c79e6aa9875c58680c54a331d18079cc Reviewed-on: https://code.wireshark.org/review/4504 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-01Fix some scan-build warnings.Gerald Combs1-1/+1
Fix a modeline while we're at it. Change-Id: Ief6d5edbe33456170059cfab4f436f0844de32a1 Reviewed-on: https://code.wireshark.org/review/440 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-25Remove trailing whitespaceBill Meier1-1/+1
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-01-05Fix indent (Use tabs) and add modelinesAlexis La Goutte1-45/+55
svn path=/trunk/; revision=54610
2013-12-09Fix warningsJakub Zawadzki1-1/+1
svn path=/trunk/; revision=53885
2013-12-08From Deon van der Westhuysen via ↵Alexis La Goutte1-91/+7
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-07Use strutil xml_escape() functionJakub Zawadzki1-27/+4
svn path=/trunk/; revision=53832
2013-12-02Get rid of a stray semicolon, as it upsets Sun^WOracle Studio's CGuy Harris1-3/+2
compiler. Clean up escape_xml_chars() a bit, so that there's no extra unreached "return s;", and so that it's clearer that it runs until it hits a NUL. (XXX - are there GLib routines that will do this?) svn path=/trunk/; revision=53716
2013-12-01Patch to include YAML export. Bug 9452 ↵Michael Mann1-16/+47
(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-11-30Better fix for uninitialized variable warning. Part of bug 9452 ↵Michael Mann1-2/+7
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452) From Peter Wu. From me: Leave the "result" variable initialized because I'm not sure code analyzers will consider g_assert_not_reached() enough prevention from using uninitialized "result" svn path=/trunk/; revision=53679
2013-11-30Try to please GCC 4.3.2Pascal Quantin1-2/+2
svn path=/trunk/; revision=53675
2013-11-30Casts required from void * in C++.Guy Harris1-1/+1
svn path=/trunk/; revision=53664
2013-11-30Constify to squelch some warnings.Guy Harris1-8/+14
svn path=/trunk/; revision=53663
2013-11-29Squelch some "use parentheses" warnings.Guy Harris1-11/+11
Use tab indentation uniformly. svn path=/trunk/; revision=53662
2013-11-29Rename variable to avoid collisions with standard function names.Guy Harris1-23/+23
Use the st_format_type type. svn path=/trunk/; revision=53661
2013-11-29Stats_tree enhancements for sorting, averages and burst rate. Bug 9452 ↵Michael Mann1-15/+639
(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-21Add a statistics tree dialog.Gerald Combs1-2/+2
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-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=53230
2013-10-18Don't allow invalid ranges to be specified for the stats tree. Bug 9130 ↵Michael Mann1-20/+19
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9130) Not sure which memory allocation should be used here (using wmem caused crash), but this revision can at least be easily backported to 1.10 where the bug was reported. Also allow a single number to be used in the stats range since it's considered a valid "range" by the UAT. svn path=/trunk/; revision=52679
2013-08-14Get rid of -Wshadow warning - I guess we're including something thatGuy Harris1-5/+5
gets <getopt.h>, so we get the optarg global. svn path=/trunk/; revision=51348
2013-07-21Replace relative timestamp with reference frame number. Saves 16B per frame.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=50772
2013-03-16From beroset:Anders Broman1-19/+19
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48337
2013-02-26it's ==> its & its ==> it's as needed.Bill Meier1-1/+1
svn path=/trunk/; revision=47896
2012-12-26Fix a bunch of warnings.Guy Harris1-2/+2
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-07-15From Wonil Kim: Enable statistics menu register for the tap plug-in. Fixes ↵Anders Broman1-1/+23
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7466 svn path=/trunk/; revision=43726
2012-07-07From Michael Mann:Guy Harris1-0/+17
Add a preference for the packet length statistics. Fixes bug 3239. svn path=/trunk/; revision=43597
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-02-18Fix some dead code and zero division issues found by Clang scan-build.Gerald Combs1-102/+102
In convert_string_case() use g_utf8_strup() instead of converting each character by hand. Hopefully this won't cause any unexpected changes in behavior. svn path=/trunk/; revision=36006
2010-03-26Constify an argument.Guy Harris1-1/+1
svn path=/trunk/; revision=32303
2009-06-05Have tap listeners specify whether the "packet" routine requiresGuy Harris1-2/+7
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-04-08More size_t fixes. Use a string buffer in range.c.Gerald Combs1-1/+1
svn path=/trunk/; revision=27999
2009-03-13From Jakub Zawadzki (bug 3331):Stig Bjørlykke1-4/+2
g_free() is NULL safe, so we don't need check against it. svn path=/trunk/; revision=27718
2009-02-10Remove an ugly hack:Ulf Lamping1-2/+14
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
2008-07-12More (mostly stats tree) unsigned->signed char cleanupJeff Morriss1-1/+1
svn path=/trunk/; revision=25717
2008-07-11Change the stats tree API to use signed chars instead of guint8s for all itsJeff Morriss1-108/+144
strings; this should fix a number of signed/unsigned char warnings. Reindent a bunch, too. svn path=/trunk/; revision=25716