summaryrefslogtreecommitdiff
path: root/ui/cli/tap-iostat.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-13tap-iostat (cli): fix this statement may fall through ↵Alexis La Goutte1-1/+1
[-Werror=implicit-fallthrough] found by gcc7 Change-Id: Idd8f4e2175d6575beecaccf2ee018457a25fd225 Reviewed-on: https://code.wireshark.org/review/20493 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-22More checks for localtime() and gmtime() returning NULL.Guy Harris1-34/+52
And some comments in the case where we're converting the result of time() - if your machine's idea of time predates January 1, 1970, 00:00:00 UTC, it'll crash on Windows, but that's not a case where a *file* can cause the problem due either to a bad file time stamp or bad time stamps in the file. Change-Id: I837a438e4b875dd8c4f3ec2137df7a16ee4e9498 Reviewed-on: https://code.wireshark.org/review/18369 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-29tap-iostat.c: ensure that interval is set to its maximum value when using 0Pascal Quantin1-5/+5
Otherwise the statistics will be wrong if the capture duration is greater than G_MAXINT32 and it the user specifies an interval of 0 Bug: 12778 Change-Id: I83a0f627ec0bb7c535446c17afa486835091ab8b Reviewed-on: https://code.wireshark.org/review/17367 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-21Check for negative nanoseconds in io,stat tap.Michael Mann1-1/+1
Seconds were already being checked for negative values, but if there is only a fraction of a second, the negative check wasn't being done, which led to bad results. Bug: 9014 Change-Id: I820e0a4b1384330acebf4a632a04f7840db2288b Reviewed-on: https://code.wireshark.org/review/16046 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-06-19Revert "tap: change glib functions to wmem."Pascal Quantin1-3/+3
This reverts commit 2e9f3c5d366eaa7139fc877b5301392166b3f985. 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-17tap: change glib functions to wmem.Dario Lombardo1-3/+3
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-02-12tap-iostat: fix logical ‘or’ of equal expressions [-Werror=logical-op] ↵Alexis La Goutte1-1/+1
found by gcc6 Change-Id: Ic10ba8df57ae69994f7ac0e6ddbdec92af797fc8 Reviewed-on: https://code.wireshark.org/review/13920 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-23More pinfo->fd->abs_ts to pinfo->abs_ts.Guy Harris1-1/+1
Change-Id: I70db0a345cc4c5c57c454371deb4f92f9ac4b9ac Reviewed-on: https://code.wireshark.org/review/13501 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-26Fix checkapi warningsGraham Bloice1-11/+11
Fix some (mostly spurious) checkapi warnings by renaming the offending variables. Change-Id: I7a43ac89f5ed35053a6526fa838fbad67669a49a Reviewed-on: https://code.wireshark.org/review/10655 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2015-06-10tshark: fix computation of iostat table width when specifying an intervalPascal Quantin1-1/+1
Bug: 11262 Change-Id: I57468d1e96ade8926a2911bd035adf85500eba39 Reviewed-on: https://code.wireshark.org/review/8860 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-07Get rid of an unused structure member.Guy Harris1-1/+0
Change-Id: I2941bb7e6dc0fce3e1256af6e5e19d2997de5801 Reviewed-on: https://code.wireshark.org/review/7573 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21Make FT_{U}INT64 behave more like FT_{U}INT32, add support for ↵JC Wren1-8/+35
FT_{U}INT{40,48,56} Change-Id: I57354c309ecf3a0c8f0c7cff485638027f30bb19 Reviewed-on: https://code.wireshark.org/review/5813 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-09(Trivial) Fix printf-related 'Mismatch on sign' warningsBill Meier1-1/+1
Found by MSVC2013 Code Analysis Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79 Reviewed-on: https://code.wireshark.org/review/7045 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-01Remove unneeded includes from ui folderMartin Mathieson1-4/+0
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a Reviewed-on: https://code.wireshark.org/review/6128 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-11-14The registered -z parameter string shouldn't end with a comma.Guy Harris1-1/+1
If it ends with a comma, then, if you don't provide any parameters, you get a "no such -z statistic" message followed by a list of available statistics. If it doesn't end with a comma, then, if you don't provide any parameters *and* a parameter is required, you get a usage message, which is more useful - and, in many of those cases, a parameter *isn't* required. Change-Id: I81275ea41ad4611d8210ca3cb07c09f0abde58f2 Reviewed-on: https://code.wireshark.org/review/5308 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14Rename stat_cmd_args.[ch] to stat_tap_ui.[ch].Guy Harris1-1/+1
The intent is to handle more than just command-line arguments; reflect that. Change-Id: Ia10efda85a9d11c6579d1bec6f789cee30d9e825 Reviewed-on: https://code.wireshark.org/review/5304 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14tap_ui -> stat_tap_ui.Guy Harris1-2/+2
The old routine had stat_ in the name, as the expectation was that they were for statistics taps; that's still the expectation, so have stat_ in the data structure and routine names. Change-Id: Ic98d011012b8641173d41fa0ec4f4e625614370a Reviewed-on: https://code.wireshark.org/review/5303 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-14For tap UIs, register a list of parameters and some menu information.Guy Harris1-1/+11
The intent here is to centralize more UI information so that we can move more tap UI stuff to common code. This is a beginning. Change-Id: Ic35ac0c01bc7b942aab88177db4065847a5e6c30 Reviewed-on: https://code.wireshark.org/review/5301 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-13Add editor modelines and/or adjust whilespace.Bill Meier1-183/+183
Change-Id: I626b7bd8ac6e4b91c57cc9152e7ce038754e7278 Reviewed-on: https://code.wireshark.org/review/4658 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-03(Pedantic): set editor modelines tab-width & etc to 8; Also: fix some ↵Bill Meier1-3/+3
indentation in packet-sip.c Change-Id: I623fc5e4c1247dbe5e15f0f33270f4f0994268ab Reviewed-on: https://code.wireshark.org/review/943 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-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>
2013-12-30Use G_GUINT64_CONSTANT(nn) instead of nnULL in a few places.Bill Meier1-5/+5
svn path=/trunk/; revision=54494
2013-12-20nnn'ULL' ==> G_GUINT64_CONSTANT(nnn)Bill Meier1-26/+29
svn path=/trunk/; revision=54304
2013-12-14Fix some trivial warnings.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=54085
2013-11-14Get rid of Warinings [-Wmissing-prototypes]Anders Broman1-0/+2
svn path=/trunk/; revision=53311
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-1/+2
svn path=/trunk/; revision=53230
2013-11-06Add support for displaying dates as year and day-of-year (1-origin).Guy Harris1-12/+58
In the process, fix various man page descriptions of the -t flag, and add support for UTC absolute times in the iousers and iostat TShark taps. svn path=/trunk/; revision=53114
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=51350
2013-08-09Replace tabs with spaces. Add modelines.Chris Maynard1-21/+34
svn path=/trunk/; revision=51237
2013-08-09Patch for bug 9014. If the relative time is negative, it is set to that of ↵Cal Turney1-11/+21
the previous packet. Since the packet is not discarded, its metadata is included in the stats. svn path=/trunk/; revision=51236
2013-07-21Replace relative timestamp with reference frame number. Saves 16B per frame.Jakub Zawadzki1-3/+3
svn path=/trunk/; revision=50772
2013-07-11Throw in a cast to squelch warnings about a value not fitting in aGuy Harris1-4/+2
time_t. (That also lets us not care how big a time_t is, except that we have a not-fixable Y2.038K problem with 32-bit time_t, about which we merely warn in a comment.) svn path=/trunk/; revision=50502
2013-07-11Get rid of an unused variable.Guy Harris1-3/+4
Don't nest g_strconcat() calls: g_strconcat(a, g_strconcat(b, c, NULL), NULL) is equivalent to g_strconcat(a, b, c, NULL). (And g_strconcat(b, c) is incorrect - you need a NULL at the end of the list.) Checking whether a pointer is "> 0" is useful only in platform-dependent situations or if you're doing a really greasy hack such as stuffing a flag into the uppermost bit of the pointer; the test should just check whether the pointer is null or not. svn path=/trunk/; revision=50500
2013-07-10From Cal Turney:Anders Broman1-62/+113
- tshark -q -z io,stat,1 causes core dump for files larger than ~2MB (with this fix it will still overflow on 32-bits for frame time > 4294s) - In tshark's "io,stat" eliminate the unrequested "Frames and bytes" col, fix formatting, and add "Duration" From me: Added casts to squelch compiler warnings on win7 64bit https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8839 svn path=/trunk/; revision=50488
2013-07-06From Peter Hatina via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8888Evan Huus1-1/+1
We're allocating an array of pointers, not an array of objects, so make the sizeof() reflect that to avoid over-allocating. svn path=/trunk/; revision=50423
2013-05-20The printf format may require 2 arguments passed and if it does, the second ↵Michael Mann1-1/+1
argument could be garbage, so make sure printf has 2 arguments. Fixes bug 8066 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8066) svn path=/trunk/; revision=49451
2013-03-07Use explicit casts.Anders Broman1-1/+1
svn path=/trunk/; revision=48161
2013-03-06Use explicit casts.Anders Broman1-3/+3
svn path=/trunk/; revision=48137
2012-10-24Allow <interval> to be successfully sscanf'd no matter the locale for theChris Maynard1-118/+129
decimal symbol. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2880 (again). #BACKPORT(1.8) svn path=/trunk/; revision=45770
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=45015
2012-09-02Add default branch to try to fix buildbot [-Werror=switch]Anders Broman1-0/+2
svn path=/trunk/; revision=44737
2012-09-02From Cal Turney: Incorrect io-stat table format when unsupported -t operand ↵Anders Broman1-24/+29
is specified and when using AVG of relative_time fields https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7685 svn path=/trunk/; revision=44736
2012-08-31From Cal Turney: Fix Performance regression in tshark -z io,stat ↵Anders Broman1-116/+124
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7674 svn path=/trunk/; revision=44707
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-31From Martin Kaiser via bug 7312:Gerald Combs1-0/+2
there's three coverity defects about division by zero in ui/cli/tap-iostat.c, function iostat_packet() This can be triggered from the command line martin@greta# ./tshark -z io,stat,0.2,AVG\(frame.number\) Capturing on eth0 Floating point exception it->num is 0, wireshark crashes in parent->max_vals[it->colnum] = MAX(parent->max_vals[it->colnum], it->counter/it->num); (and similar for other data types) My proposal for a fix is to not update parent->max_vals[it->colnum] when it->num==0, see the attached patch. svn path=/trunk/; revision=42952
2012-05-23From Florent Drouin:Anders Broman1-7/+79
(Jeff Morriss, Michael Mann ) Add absolute timestamps to -z io,stat https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7207 svn path=/trunk/; revision=42808
2012-05-11Clean up indentation. (HT should not be assumed to work on 4-space tabGuy Harris1-628/+627
stops.) svn path=/trunk/; revision=42580
2012-05-11proto_registrar_get_ftype() returns an FT_ value; make its return typeGuy Harris1-0/+28
"enum ftenum" to reflect that, and fix the "switch doesn't handle XXX" warnings that provokes. svn path=/trunk/; revision=42579
2012-05-05AFAICT '#include sys/types.h' is not needed for these files.Bill Meier1-4/+0
svn path=/trunk/; revision=42446
2012-03-10Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=41461