aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-20"-d" isn't common to all capturing programs, it's dumpcap-specific.Guy Harris1-0/+6
Change-Id: I827615d45051c9d66407516b311d3de448de6d07 Reviewed-on: https://code.wireshark.org/review/2495 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Add some long options for capture short options.Guy Harris1-21/+2
The names match tcpdump trunk's names for the corresponding options. Also have capture_opts.h provide a #define for the part of the short option string that corresponds to the capture short options that all our programs that take capture short options take (those are largely the ones we have in common with tcpdump). Change-Id: Ia209425959c801725850b56a7d63441ee99b5001 Reviewed-on: https://code.wireshark.org/review/2492 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Add --help and --version long options.Guy Harris1-3/+5
Also, make the convention for long-only options be that their case-statement values start at 128, so they avoid colliding with any ASCII code points, including control characters. Make the tables of long options "static const" while we're at it, and get rid of unnecessary casts. Change-Id: I55702a85e9bc078b1cd0f2803ebb68a710405bab Reviewed-on: https://code.wireshark.org/review/2491 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-08Profiling show that g_log() takes a lot of CPU even when logging isn'tAndersBroman1-0/+2
active. Change-Id: I242f8e98a77861c0174e432c7026964babae7299 Reviewed-on: https://code.wireshark.org/review/1565 Reviewed-by: Anders Broman <a.broman58@gmail.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-02-27Fix dumpcap.c: Assigned value is garbage or undefined (clang analyzer)Hadriel Kaplan1-1/+6
Change-Id: I61dbf5e1e206b1c0d2e594bfba38e83e51e8f09c Reviewed-on: https://code.wireshark.org/review/371 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-02-07Replace "svn" with "git" all over the place.Gerald Combs1-5/+5
Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate. Rename "svnversion.h" to "version.h" as Evan suggested. Update some URLs. In make-version.pl, make sure we don't set an improper upstream branch name. Use the number of commits + short hash from `git describe` for package names by default. Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96 Reviewed-on: https://code.wireshark.org/review/139 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-01-17From Toralf FörsterMartin Kaiser1-2/+2
fix format strings for signed integers https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9637 svn path=/trunk/; revision=54835
2014-01-17Fix [-Wmissing-prototypes]Anders Broman1-1/+1
svn path=/trunk/; revision=54834
2013-12-20Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54314
2013-12-17From "bd": Fix " Wireshark stops showing new packets but dumpcap keeps ↵Bill Meier1-2/+2
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-02Specify SI units for the max filesize autostop condition. For now, keep the ↵Chris Maynard1-7/+7
capture buffer size in IEC units, but document it as such. #BACKPORT(1.10, 1.8(?)) svn path=/trunk/; revision=53728
2013-11-29Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.Jakub Zawadzki1-9/+8
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-26Report the interface when an open or an attempt to set the link-layerGuy Harris1-16/+8
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-09include <wsutil/pint.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53196
2013-11-04Print if_droppedAnders Broman1-7/+12
svn path=/trunk/; revision=53080
2013-09-29Rename routines that write pcap-ng files to "pcapng_xxx" rather thanGuy Harris1-44/+44
"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-29We always write to a FILE *, so:Guy Harris1-9/+9
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-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