Commit Graph

48 Commits

Author SHA1 Message Date
Bill Meier e88a11f5c9 (Trivial) Fix printf-related 'Mismatch on sign' warnings
Found by MSVC2013 Code Analysis

Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79
Reviewed-on: https://code.wireshark.org/review/7045
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-09 18:57:14 +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 04ab731933 The registered -z parameter string shouldn't end with a comma.
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-14 20:06:02 +00:00
Guy Harris 4d3c4c4f12 Rename stat_cmd_args.[ch] to stat_tap_ui.[ch].
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-14 18:52:06 +00:00
Guy Harris a21436eaed tap_ui -> stat_tap_ui.
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-14 18:42:50 +00:00
Guy Harris 7390516f61 For tap UIs, register a list of parameters and some menu information.
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-11-14 18:31:34 +00:00
Bill Meier 6a9479ecf9 Add editor modelines and/or adjust whilespace.
Change-Id: I626b7bd8ac6e4b91c57cc9152e7ce038754e7278
Reviewed-on: https://code.wireshark.org/review/4658
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-13 19:09:07 +00:00
Bill Meier c0b0a11e4e (Pedantic): set editor modelines tab-width & etc to 8; Also: fix some 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-04-03 15:31:56 +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 8724d5de0f Use G_GUINT64_CONSTANT(nn) instead of nnULL in a few places.
svn path=/trunk/; revision=54494
2013-12-30 02:24:11 +00:00
Bill Meier ccdb11e177 nnn'ULL' ==> G_GUINT64_CONSTANT(nnn)
svn path=/trunk/; revision=54304
2013-12-20 15:34:05 +00:00
Jakub Zawadzki 5c79cbf152 Fix some trivial warnings.
svn path=/trunk/; revision=54085
2013-12-14 10:29:26 +00:00
Anders Broman a7e417bf24 Get rid of Warinings [-Wmissing-prototypes]
svn path=/trunk/; revision=53311
2013-11-14 06:21:02 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Guy Harris 2a088c1d53 Add support for displaying dates as year and day-of-year (1-origin).
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-11-06 20:39:09 +00:00
Guy Harris ab3aeb63e4 Get rid of -Wshadow warning - I guess we're including something that
gets <getopt.h>, so we get the optarg global.

svn path=/trunk/; revision=51350
2013-08-14 01:18:58 +00:00
Chris Maynard 9aa40bfcee Replace tabs with spaces. Add modelines.
svn path=/trunk/; revision=51237
2013-08-09 15:08:48 +00:00
Cal Turney 249285a022 Patch for bug 9014. If the relative time is negative, it is set to that of the previous packet. Since the packet is not discarded, its metadata is included in the stats.
svn path=/trunk/; revision=51236
2013-08-09 14:53:35 +00:00
Jakub Zawadzki c702e92121 Replace relative timestamp with reference frame number. Saves 16B per frame.
svn path=/trunk/; revision=50772
2013-07-21 23:07:33 +00:00
Guy Harris 359fb84023 Throw in a cast to squelch warnings about a value not fitting in a
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-11 09:51:30 +00:00
Guy Harris 88a1a0249b Get rid of an unused variable.
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-11 09:40:44 +00:00
Anders Broman bdd8e5bb57 From Cal Turney:
- 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-10 18:41:24 +00:00
Evan Huus 337ad423c1 From Peter Hatina via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8888
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-07-06 21:55:10 +00:00
Michael Mann 312daa4f6c The printf format may require 2 arguments passed and if it does, the second 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-05-20 18:50:50 +00:00
Anders Broman 5d698bfd88 Use explicit casts.
svn path=/trunk/; revision=48161
2013-03-07 07:05:45 +00:00
Anders Broman 7990a0e4d0 Use explicit casts.
svn path=/trunk/; revision=48137
2013-03-06 17:35:11 +00:00
Chris Maynard bc8e520439 Allow <interval> to be successfully sscanf'd no matter the locale for the
decimal symbol.  Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2880 (again).

#BACKPORT(1.8)

svn path=/trunk/; revision=45770
2012-10-24 17:46:16 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Anders Broman 5e11cf0596 Add default branch to try to fix buildbot [-Werror=switch]
svn path=/trunk/; revision=44737
2012-09-02 09:47:49 +00:00
Anders Broman 33a27d1601 From Cal Turney: Incorrect io-stat table format when unsupported -t operand 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-09-02 08:36:38 +00:00
Anders Broman 9d6e58a52b From Cal Turney: Fix Performance regression in tshark -z io,stat https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7674
svn path=/trunk/; revision=44707
2012-08-31 07:30:01 +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
Gerald Combs 698ad5bd95 From Martin Kaiser via bug 7312:
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-31 21:40:55 +00:00
Anders Broman 27596da916 From Florent Drouin:
(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-23 06:55:31 +00:00
Guy Harris 47fadf1d2a Clean up indentation. (HT should not be assumed to work on 4-space tab
stops.)

svn path=/trunk/; revision=42580
2012-05-11 17:35:56 +00:00
Guy Harris f1b11f62f8 proto_registrar_get_ftype() returns an FT_ value; make its return type
"enum ftenum" to reflect that, and fix the "switch doesn't handle XXX"
warnings that provokes.

svn path=/trunk/; revision=42579
2012-05-11 17:29:56 +00:00
Bill Meier 1783543e92 AFAICT '#include sys/types.h' is not needed for these files.
svn path=/trunk/; revision=42446
2012-05-05 21:29:13 +00:00
Alexis La Goutte ba19f72aab Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41461
2012-03-10 17:45:17 +00:00
Anders Broman 1b7e7ea109 Try to make the buildbot happy
svn path=/trunk/; revision=41370
2012-03-06 09:24:49 +00:00
Anders Broman 3b06ee6ca0 From Cal Turney: Try to fix the remaining warnings. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6883
svn path=/trunk/; revision=41367
2012-03-06 08:45:54 +00:00
Anders Broman de47b36104 From Cal Turney:
Bugs in the tshark '-z io,stat' output:
1: The LOAD stat in the last row of the output is inaccurate because rpc.time
is divided by the full interval rather than limiting it to the capture
duration.
2: An The empty comma field (for outputting total frames and bytes) is ignored
when it is the first field in the command.
3: Intervals at the end of capture that contain no data are not displayed. Such
intervals are as important to see as those (zero data intervals) that occur
earlier in the capture. 
4: Floating point numbers are not properly aligned under their column headers.

Enhancements to '-z io,stat' output:
1. Column widths are determined by the maximum magnitude of their values rather
than set to a fixed width of 15 chars which allows for more stats to be
displayed per row without wrapping. 
2. To improve readability, filters wrap at 102 chars or the table width,
whichever is greater, and wrap on the nearest space. An option can be added to
alter the 102-char limit. 
3. Column numbers begin at 1 instead of 0.     
4. The columns and entire output are enclosed in a border for improved
presentability in reports. The table can be imported into a spreadsheet by
specifying the vertical bar as the data delimiter.

"Fixed" compiling on Ubuntu

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

svn path=/trunk/; revision=41355
2012-03-05 12:06:26 +00:00
Jeff Morriss 094e8f8947 Revert 41240, 41239, 41234, 41233, and (finally) 41231. Every time I fix a warning, 3 more pop up. Some of the uninitialized-variable ones look genuine and figuring them out would take a while.
svn path=/trunk/; revision=41241
2012-02-29 15:28:20 +00:00
Anders Broman ee38355eed Remove the offending %s for now.
svn path=/trunk/; revision=41240
2012-02-29 15:22:33 +00:00
Jeff Morriss 4a6e191973 Don't use itoa(). It still doesn't compile due to a format warning on line 760; like Martin, I'm not sure what is supposed to be there.
svn path=/trunk/; revision=41239
2012-02-29 15:04:06 +00:00
Martin Mathieson e7bd26af04 Fix another couple of warnings, but not sure what to do about the rest:
tap-iostat.c: In function ‘iostat_draw’:
tap-iostat.c:542:5: error: implicit declaration of function ‘itoa’
tap-iostat.c:756:9: error: too few arguments for format
tap-iostat.c:756:9: error: too few arguments for format

itoa() could be converted into a g_snprintf(), but the buffer used is only
one character long.  Is that right?

For the printf() format one, I'm not sure what was intended.


svn path=/trunk/; revision=41234
2012-02-29 10:25:44 +00:00
Martin Mathieson 86f0a7b80c Fix several compiler warnings (a few more remain though).
svn path=/trunk/; revision=41233
2012-02-29 10:19:32 +00:00
Anders Broman 9bdde5216f From Cal Turney:io,stat LOAD error, comma field ignored, zero data intervals not displayed, enhanced output https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6883
svn path=/trunk/; revision=41231
2012-02-29 05:49:18 +00:00
Jörg Mayer 35508464b2 Start moving files to ui/ and ui/cli/
svn path=/trunk/; revision=41047
2012-02-17 12:30:27 +00:00