aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-29Handle the 2GiB boundary case of the max filesize autostop condition ↵Chris Maynard1-3/+7
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-25Check our recently-added signal pipe in statistics mode.Gerald Combs1-0/+4
svn path=/trunk/; revision=51519
2013-08-23Output a warning about kernel BPF JIT compiler beeing activated.Anders Broman1-1/+1
svn path=/trunk/; revision=51488
2013-08-23Output a warning about kernel BPF JIT compiler beeing activated.Anders Broman1-0/+6
svn path=/trunk/; revision=51487
2013-08-22fix compiler warning on Debian wheezy (gcc 4.7.2)Martin Kaiser1-1/+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-22Only enable the Linux kernel BPF JIT compiler if we're on Linux.Guy Harris1-10/+22
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-22Enable Kernel BPF JIT compiler from dumpcap.Anders Broman1-0/+21
svn path=/trunk/; revision=51472
2013-08-14I guess Solaris's getopt_long() "struct option" declaration doesn't haveGuy Harris1-1/+1
enough cowbell^wconst; throw in a comment to squelch warnings. svn path=/trunk/; revision=51351
2013-08-10Fix error when build with clang 3.0Alexis La Goutte1-2/+2
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-07-29Trivial: Wrap text at column 80.Chris Maynard1-1/+2
svn path=/trunk/; revision=51012
2013-07-27if we capture on multiple interfaces, the output file will be pcapn-ngMartin Kaiser1-5/+6
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-27command line option --capture-comment for dumpcapMartin Kaiser1-1/+10
svn path=/trunk/; revision=50945
2013-07-27use capture_comment from the capture_options structureMartin Kaiser1-1/+9
when we write the SHB svn path=/trunk/; revision=50944
2013-07-24use getopt_long() in dumpcapMartin Kaiser1-1/+5
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-16"man inet_pton" only says that it returns a negative value, zero or a ↵Chris Maynard1-1/+1
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-15C++ style comments are not allowed in ISO C90. (Fixes the rest of them now ↵Chris Maynard1-13/+13
that I noticed, "this will be reported only once per input file") svn path=/trunk/; revision=50613
2013-07-15Trivial: C++ style comments are not allowed in ISO C90.Chris Maynard1-1/+1
svn path=/trunk/; revision=50612
2013-06-27get main_window_update out of the way... pass an update_cb to the ↵Luis Ontanon1-11/+18
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-26Move tempfile.{h,c} into wsutil.Jeff Morriss1-1/+1
svn path=/trunk/; revision=50163
2013-06-04From Mike Garratt:Anders Broman1-0/+3
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-05-22Pull the capture-session state information out of capture_opts and putGuy Harris1-1/+2
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-22Rename capture_opts_trim_iface() toGuy Harris1-1/+1
capture_opts_default_iface_if_necessary(), to reflect what it actually does. svn path=/trunk/; revision=49491
2013-05-22On OS X, get the interface type from the System Configuration framework.Guy Harris1-3/+5
svn path=/trunk/; revision=49486
2013-04-25Send the output of the -D and -L options to the standard output ratherGuy Harris1-21/+0
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-03-19From Michal Labedzki:Anders Broman1-18/+14
Fix some compilation errors in dumpcap/plugins https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8304 svn path=/trunk/; revision=48413
2013-03-10Make the memory limit (in bytes or packets) used for storing packetsMichael Tüxen1-20/+39
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-03From beroset:Anders Broman1-13/+23
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48038
2013-02-28Add a #define for the default capture buffer size and use it.Jeff Morriss1-1/+1
svn path=/trunk/; revision=47942
2013-02-28Update the text of dumpcap -h, default buffer size should be 2 MB.Anders Broman1-1/+1
svn path=/trunk/; revision=47935
2013-02-26it's ==> itsBill Meier1-1/+1
svn path=/trunk/; revision=47894
2013-02-20When any of our executables start on Windows create or open a "WiresharkGerald Combs1-2/+1
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-01-22svn path=/trunk/; revision=47210Anders Broman1-22/+22
2013-01-15Add some routines to wsutil to, at least on some platforms, addGuy Harris1-10/+21
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-02Allow pcap/pcapng format to be written to more than just a file (FILE*). ↵Michael Mann1-9/+9
Gives more flexibility if needed. WRITE_DATA macro replaced and applied consistently throughout pcapio.c svn path=/trunk/; revision=46891
2012-12-26Make dumpcap build on WindowsAnders Broman1-4/+7
svn path=/trunk/; revision=46788
2012-12-26Fix a bunch of warnings.Guy Harris1-15/+21
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-23More whitespace cleanups.Guy Harris1-82/+77
svn path=/trunk/; revision=46716
2012-12-23Add support for writing per packet comments when using pcapng.Michael Tüxen1-0/+1
Not actually used with this commit, which just brings in the infrastructure. svn path=/trunk/; revision=46715
2012-12-23Fix indentation.Guy Harris1-58/+54
svn path=/trunk/; revision=46712
2012-12-20fclose() and fflush() are standard C routines, so there's no need forGuy Harris1-6/+6
our own wrappers. (pcapio.c isn't using wrappers around, for example, fwrite().) svn path=/trunk/; revision=46640
2012-12-20Don't use an pcap structures in pcapio.[ch]. Michael Tüxen1-2/+12
Currently, pcapio is only used by dumpcap, which is only compiled if there is pcap support. However, making pcapio independent from libpcap allows it also to be used from text2pcap, which does not rely on libpcap. svn path=/trunk/; revision=46637
2012-12-20Add ws_fclose(), ws_fflush(), and ws_fdopen() to the fileutils.Michael Tüxen1-7/+17
Retire libpcap_fdopen(), libpcap_dump_flush(), and libpcap_dump_close(). svn path=/trunk/; revision=46636
2012-12-19Add support for writing the flags option in the enhancedMichael Tüxen1-1/+1
packet block (pcapng). svn path=/trunk/; revision=46619
2012-12-18- Make dumpcap build with the new bundle.Anders Broman1-0/+4
- Use the correct bundle id for GTK3 svn path=/trunk/; revision=46586
2012-12-12Make the "-g" argument to tshark actually work (by passing it to dumpcap).Jeff Morriss1-1/+1
svn path=/trunk/; revision=46515
2012-12-12Document the "-g" option to dumpcap.Jeff Morriss1-1/+1
Add that option to tshark, too, and document it. The option can't be given to Wireshark because the GUI already has a "-g" (goto packet). svn path=/trunk/; revision=46513
2012-12-10Change variable "devname" to "devicename" in numerous places to avoidStephen Fisher1-8/+8
to avoid -Wshadow warnings about conflicting with BSD's devname() function. svn path=/trunk/; revision=46494
2012-11-25Fix a number of [-Wshadow] warnings;Bill Meier1-151/+153
Also: Do some minor whitespace changes svn path=/trunk/; revision=46182
2012-11-22On UN*X, if an interface has a description, use it as the "friendlyGuy Harris1-2/+3
name". If it doesn't have a description, on OS X, use the System Configuration framework to attempt to get a "friendly name" for interfaces. If a loopback device doesn't have a friendly name, give it "Loopback" as the friendly name. Move the "turn a CFString into a mallocated C string" routine into common code, as it's used in more than one place. svn path=/trunk/; revision=46131
2012-11-21On error, have capture_opts_trim_iface() return the exit status thatGuy Harris1-2/+3
should be used (on success, have it return 0). Exit with that exit status; if the problem is that we couldn't get the interface list or if there are no interfaces in that list, return 2, as that's not a command-line syntax error. svn path=/trunk/; revision=46108