Commit Graph

364 Commits

Author SHA1 Message Date
Martin Kaiser c852f994ea From Toralf Förster
fix format strings for signed integers

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

svn path=/trunk/; revision=54835
2014-01-17 20:06:39 +00:00
Anders Broman 90ea235292 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54834
2014-01-17 19:35:57 +00:00
Jakub Zawadzki 064082e68a Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)
svn path=/trunk/; revision=54314
2013-12-20 22:39:32 +00:00
Bill Meier 87e2aa3383 From "bd": Fix " Wireshark stops showing new packets but dumpcap keeps writing them to the temp file"
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9571

From me: Fixed in a slightly different manner than sugested in the patch attached to the bug.



svn path=/trunk/; revision=54181
2013-12-17 15:02:47 +00:00
Chris Maynard 93f15d640c Specify SI units for the max filesize autostop condition. For now, keep the capture buffer size in IEC units, but document it as such.
#BACKPORT(1.10, 1.8(?))

svn path=/trunk/; revision=53728
2013-12-02 19:17:12 +00:00
Jakub Zawadzki d99fdfda63 Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.
XXX, people are not aware that expression of this macros might be evaluated multiple times, like:
 -  BSWAP16(tvb_get_letohs(tvb, off)) : \
 +  GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \

Should be tvb_get_ntohs() called?


svn path=/trunk/; revision=53653
2013-11-29 19:21:20 +00:00
Guy Harris b5e698553e Report the interface when an open or an attempt to set the link-layer
header type fails, as we might be capturing on more than one interface.

Report the failing interface name in single quotes in some places where
we weren't doing so, for stylistic consistency.

svn path=/trunk/; revision=53593
2013-11-26 03:13:16 +00:00
Jakub Zawadzki c9b2ee3768 include <wsutil/pint.h> only when needed.
svn path=/trunk/; revision=53196
2013-11-09 15:44:29 +00:00
Anders Broman 996b07a814 Print if_dropped
svn path=/trunk/; revision=53080
2013-11-04 19:38:20 +00:00
Guy Harris b06876390d Rename routines that write pcap-ng files to "pcapng_xxx" rather than
"libpcap_xxx".

Rename the low-level write routine in pcapio.c to write_to_file(), as
it's used for both pcap and pcap-ng files.

svn path=/trunk/; revision=52275
2013-09-29 20:53:13 +00:00
Guy Harris c42263f28a We always write to a FILE *, so:
make libpcap_write_to_file() static;

	don't pass it as an argument to write routines, just have them
	call it directly;

	make the handle argument a FILE *.

Make the data length argument to libpcap_write_to_file() a size_t, as
that's what, for example, fwrite() takes as a size argument.

svn path=/trunk/; revision=52274
2013-09-29 20:26:25 +00:00
Chris Maynard bc654875f0 Handle the 2GiB boundary case of the max filesize autostop condition properly so that we avoid overflow conditions and so that we ensure we don't capture more than 2GiB. Also, document the max filesize autostop value of 2GIB as well as indicating that it's truly GiB and not GB.
This fixes the problem reported on ask: http://ask.wireshark.org/questions/23891/wireshark-wont-run-with-multiple-capture-files

#BACKPORT(1.10) ... not sure about 1.8?

svn path=/trunk/; revision=51576
2013-08-29 18:15:13 +00:00
Gerald Combs a75499aae0 Check our recently-added signal pipe in statistics mode.
svn path=/trunk/; revision=51519
2013-08-25 22:41:54 +00:00
Anders Broman 71f7093cf3 Output a warning about kernel BPF JIT compiler beeing activated.
svn path=/trunk/; revision=51488
2013-08-23 05:25:30 +00:00
Anders Broman f9aaaebdc8 Output a warning about kernel BPF JIT compiler beeing activated.
svn path=/trunk/; revision=51487
2013-08-23 05:21:25 +00:00
Martin Kaiser 9e7ce8b817 fix compiler warning on Debian wheezy (gcc 4.7.2)
dumpcap.c:193:10: error: ignoring return value of ‘write’, declared with
attribute warn_unused_result [-Werror=unused-result]

for some reason, using (void)write(fd, ...) did not do the trick

svn path=/trunk/; revision=51476
2013-08-22 18:49:31 +00:00
Guy Harris 347ea71bae Only enable the Linux kernel BPF JIT compiler if we're on Linux.
Unless we're going to do something if that fails, there's no point in
having enable_kernel_bpf_jit_compiler() return a success/failure
indication.

Fix indentation.

svn path=/trunk/; revision=51475
2013-08-22 17:36:30 +00:00
Anders Broman 5928ded2b4 Enable Kernel BPF JIT compiler from dumpcap.
svn path=/trunk/; revision=51472
2013-08-22 17:20:09 +00:00
Guy Harris da7c920853 I guess Solaris's getopt_long() "struct option" declaration doesn't have
enough cowbell^wconst; throw in a comment to squelch warnings.

svn path=/trunk/; revision=51351
2013-08-14 01:21:13 +00:00
Alexis La Goutte a1abe1540b Fix error when build with clang 3.0
dumpcap.c:3981:88: error: implicit conversion loses integer precision: 'const __suseconds_t'
      (aka 'const long') to 'guint32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
                                                             phdr->ts.tv_sec, phdr->ts.tv_usec,
                                                                              ~~~~~~~~~^~~~~~~
dumpcap.c:3989:73: error: implicit conversion loses integer precision: 'const __suseconds_t'
      (aka 'const long') to 'guint32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
                                              phdr->ts.tv_sec, phdr->ts.tv_usec,
                                                               ~~~~~~~~~^~~~~~~

svn path=/trunk/; revision=51250
2013-08-10 21:27:26 +00:00
Chris Maynard 1a0b16d176 Trivial: Wrap text at column 80.
svn path=/trunk/; revision=51012
2013-07-29 15:45:36 +00:00
Martin Kaiser 9e33a6bade if we capture on multiple interfaces, the output file will be pcapn-ng
even if we enforce pcap ouput format via -P
    
in such a case, we *can* write a capture comment to the output file

svn path=/trunk/; revision=50948
2013-07-27 16:48:06 +00:00
Martin Kaiser 82ea635aa6 command line option --capture-comment for dumpcap
svn path=/trunk/; revision=50945
2013-07-27 16:25:08 +00:00
Martin Kaiser a585b45343 use capture_comment from the capture_options structure
when we write the SHB

svn path=/trunk/; revision=50944
2013-07-27 16:16:57 +00:00
Martin Kaiser 14c82477bf use getopt_long() in dumpcap
for now, there's no long options, this is just a first test to see if
things compile everywhere...

svn path=/trunk/; revision=50877
2013-07-24 20:42:39 +00:00
Chris Maynard 91ecc2334f "man inet_pton" only says that it returns a negative value, zero or a postive value, and not specifically -1, 0, or 1, so even though we know that's what wsutil's inet_pton will return, we shouldn't test against those exact values.
svn path=/trunk/; revision=50670
2013-07-16 16:23:31 +00:00
Chris Maynard 42b09314b0 C++ style comments are not allowed in ISO C90. (Fixes the rest of them now that I noticed, "this will be reported only once per input file")
svn path=/trunk/; revision=50613
2013-07-15 15:51:45 +00:00
Chris Maynard e7e260b4fc Trivial: C++ style comments are not allowed in ISO C90.
svn path=/trunk/; revision=50612
2013-07-15 15:48:10 +00:00
Luis Ontanon 0bdc0efc46 get main_window_update out of the way... pass an update_cb to the capture_sync stuff
... as per the XXX comment removed from tshark.c this was a mess to keep the linker
happy... I couldn't!

I did this without even understanding whether calling main_window_update was realy
necessary in most cases. I guess nothing or more specific update cbs would be best.


svn path=/trunk/; revision=50188
2013-06-27 17:10:50 +00:00
Jeff Morriss bbf6a3766e Move tempfile.{h,c} into wsutil.
svn path=/trunk/; revision=50163
2013-06-26 01:14:35 +00:00
Anders Broman 78e334b845 From Mike Garratt:
Friendly Names support causing unnecessary delay when Wireshark starts.

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

svn path=/trunk/; revision=49752
2013-06-04 04:36:19 +00:00
Guy Harris 8596d17d7f Pull the capture-session state information out of capture_opts and put
it into a separate capture_session structure.  capture_opts should
contain only user-specified option information (and stuff directly
derived from it, such as the "capturing from a pipe" flag).

svn path=/trunk/; revision=49493
2013-05-22 07:44:28 +00:00
Guy Harris 1ca63098ac Rename capture_opts_trim_iface() to
capture_opts_default_iface_if_necessary(), to reflect what it actually
does.

svn path=/trunk/; revision=49491
2013-05-22 04:49:31 +00:00
Guy Harris c1d34d4be6 On OS X, get the interface type from the System Configuration framework.
svn path=/trunk/; revision=49486
2013-05-22 01:19:18 +00:00
Guy Harris 39779a7bee Send the output of the -D and -L options to the standard output rather
than the standard error.

In Wireshark on Windows, create a console before doing so and destroy it
before exiting.  Don't do that in TShark or dumpcap, as those are
console-mode programs on Windows.

This should fix bug 8609 and still allow "wireshark -D" and "wireshark
-L" to work when the standard output isn't redirected.

svn path=/trunk/; revision=49025
2013-04-25 05:47:11 +00:00
Anders Broman 26ddabf0d7 From Michal Labedzki:
Fix some compilation errors in dumpcap/plugins


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

svn path=/trunk/; revision=48413
2013-03-19 05:09:37 +00:00
Michael Tüxen da07699dd3 Make the memory limit (in bytes or packets) used for storing packets
configurable via command line options and print specific drop numbers
at the end. This allows to tune the buffering when using multiple
threads.
This also fixes a logic arrow in enforcing the limits.
The patch for the enhanced counters is from Anders Broman.


svn path=/trunk/; revision=48223
2013-03-10 11:57:40 +00:00
Anders Broman 85973068cc From beroset:
remove C++ incompatibilities

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

svn path=/trunk/; revision=48038
2013-03-03 17:14:19 +00:00
Jeff Morriss d0992bf8cd Add a #define for the default capture buffer size and use it.
svn path=/trunk/; revision=47942
2013-02-28 15:27:56 +00:00
Anders Broman 1a4fb17e13 Update the text of dumpcap -h, default buffer size should be 2 MB.
svn path=/trunk/; revision=47935
2013-02-28 06:37:41 +00:00
Bill Meier 4d9850f689 it's ==> its
svn path=/trunk/; revision=47894
2013-02-26 01:43:39 +00:00
Gerald Combs bd4cffae58 When any of our executables start on Windows create or open a "Wireshark
is running" mutex. Have the NSIS installer check for this mutex and ask
the user to close Wireshark if it's found. While not perfect this makes
the WinSparkle update process much less annoying.

svn path=/trunk/; revision=47758
2013-02-20 01:19:42 +00:00
Anders Broman e90f414a72 svn path=/trunk/; revision=47210 2013-01-22 08:28:46 +00:00
Guy Harris 05825b02cd Add some routines to wsutil to, at least on some platforms, add
information to crash dumps and the like.  (Currently, we only handle OS
X's CrashReporter, but we should do this on other platforms where this
information can be added and would be helpful.)

White space tweaks.

svn path=/trunk/; revision=47104
2013-01-15 21:54:41 +00:00
Michael Mann 18580d6703 Allow pcap/pcapng format to be written to more than just a file (FILE*). Gives more flexibility if needed.
WRITE_DATA macro replaced and applied consistently throughout pcapio.c

svn path=/trunk/; revision=46891
2013-01-02 04:01:22 +00:00
Anders Broman 8106e33188 Make dumpcap build on Windows
svn path=/trunk/; revision=46788
2012-12-26 15:02:32 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
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-12-26 05:57:06 +00:00
Guy Harris e0ed1bddab More whitespace cleanups.
svn path=/trunk/; revision=46716
2012-12-23 09:54:05 +00:00
Michael Tüxen 644f8485da Add support for writing per packet comments when using pcapng.
Not actually used with this commit, which just brings in the
infrastructure.


svn path=/trunk/; revision=46715
2012-12-23 09:25:42 +00:00
Guy Harris bb846842f8 Fix indentation.
svn path=/trunk/; revision=46712
2012-12-23 06:52:50 +00:00