aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2016-03-01dumpcap: Add support for 802.11ac monitor modesMikael Kanstrup1-7/+18
Add dumpcap support for configuring 80MHz, 80+80MHz, 160MHz monitor modes via nl80211. Change-Id: I2ae8955670c2a9b5051e2223d45ce522459f2c5f Reviewed-on: https://code.wireshark.org/review/13964 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-19Add inet_pton/inet_ntop interface to libwsutilJoão Valverde1-7/+4
Change-Id: Ifc344ed33f2f7ca09a6912a5adb49dc35f07c81f Reviewed-on: https://code.wireshark.org/review/13881 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-07Expand a comment.Guy Harris1-1/+6
Change-Id: Id928258326a1bd4512d88fe0f74b0a34262da56a Reviewed-on: https://code.wireshark.org/review/13104 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-07Move more capture device handling to the caputils library.Guy Harris1-601/+8
Move the code to open capture devices and get properties of capture devices there, joining the code to get a list of capture devices. This lets us do a better job of handling pcap_create() in WinPcap, including handling both WinPcap with pcap_create() and WinPcap without pcap_create() at run time, just in case somebody tries using WinPcap 3.x with a Wireshark built with WinPcap 4.x. It also could make it easier to use libpcap/WinPcap directly in Wireshark and TShark, if we have versions of libpcap/WinPcap that run small helper utilities to do privileged functions, allowing programs using them never to need elevated privileges themselves. That might make it easier to fix some issues with running TShark when not saving to a file (we could avoid the file entirely) and with delays when stopping a capture in Wireshark (Wireshark could stop writing to the file as soon as you click the stop button, rather than letting dumpcap do so when the signal gets to it). It might also make it easier to handle future versions of libpcap/WinPcap that support using pcap_create()/pcap_activate() for remote captures, and other future extensions to libpcap/WinPcap. Rename some XXX_linktype routines to XXX_datalink to indicate that they work with DLT_ values rather than LINKTYPE_ values; future versions of libpcap might use LINKTYPE_ values in newer APIs. Check for pcap_create() on all platforms in CMake. Change-Id: Ia12e1692c96ec945c07a135d246958771a29c817 Reviewed-on: https://code.wireshark.org/review/13062 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-12Remove -Wwrite-strings compiler flagJoão Valverde1-4/+2
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-08Use ws_{read,write,fdopen,close}.Guy Harris1-2/+2
Be more consistent about using the ws_ routines, as we suggest in README.developer. In C++ on UN*X, define ws_close as ::close rather than close, so that it works even in classes with methods or members named "close". Change-Id: Ide2652229e6b6b4624cbddae0e909a4ea1efa591 Reviewed-on: https://code.wireshark.org/review/11637 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-12/+0
Have wsutil/file_util.h include them on UN*X, just as it includes io.h on Windows, so we can have a rule of "if you do file operations, include <wsutil/file_util.h> and use the routines in it". Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't necessary (whether because of the addition of them to wsutil/file_util.h or because they weren't needed in the first place). Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f Reviewed-on: https://code.wireshark.org/review/11619 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-0/+1
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-02The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris1-4/+4
It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that. Replace all-caps "WIN32" referring to Windows in comments and other text with "Windows" or "Win32". (The two are pretty much equivalent, these days; nobody much cares about Win16, not that we ever ran on it, and 64-bit Windows is just a 64-bitified Win32.) Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70 Reviewed-on: https://code.wireshark.org/review/10367 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-22Fix retrieval of data link type supported by remote interfaces with ↵Pascal Quantin1-13/+20
authentication Make use of -A parameter when querying data link types supported by a given interface with dumpcap. Ensure to pass the authentication parameters configured for a remote interface when calling capture_get_if_capabilities() Bug: 11366 Change-Id: I4efea615084a82108e4a12a64e8c46817f30a5c6 Reviewed-on: https://code.wireshark.org/review/9690 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24dumpcap: fix files capture autostop conditionPascal Quantin1-2/+2
CND_CLASS_CAPTURESIZE condition type needs the tested parameter to be a guint64 Bug: 11305 Change-Id: I096d995e1e08ff3a81b2a95710185d272d849c86 Reviewed-on: https://code.wireshark.org/review/9104 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-28Set a capture buffer size only when we have a valid handle.Gerald Combs1-5/+3
Fixes the current Windows unit test crash. Clean up a warning message. Change-Id: I696e70c7656352d9576c1ad29703298cc7109621 Reviewed-on: https://code.wireshark.org/review/8674 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-28Windows: don't attempt to set the capture buffer size on remote (rpcap) devices.Jeff Morriss1-17/+19
Also move the code for setting the buffer size on Windows near the code for setting it when we have pcap_create(): into open_capture_device(). Bug: 9067 Change-Id: Ica45f74b98094958d8bb0a38de23248aaa251d4b Reviewed-on: https://code.wireshark.org/review/8551 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-05-28is_linux_bonding_device() is only used if we HAVE_PCAP_CREATE so only define itJeff Morriss1-2/+2
if we HAVE_PCAP_CREATE. Change-Id: Ic4eb6e69bde7d244b68a9fd97f66682eda6bdf91 Reviewed-on: https://code.wireshark.org/review/8667 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-04-13dumpcap: fix opening of pipes on Windows broken since gbed29afPascal Quantin1-1/+17
Previous code was assuming that all local pipes were of extcap type. Let's explicitly check for extcap prefix now. Bug: 10803 Change-Id: If955e77a9ee2af11b553740269964c40273d5177 Reviewed-on: https://code.wireshark.org/review/8013 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-04dumpcap: fix no previous prototype for ‘is_linux_bonding_device’ ↵Alexis La Goutte1-1/+1
[-Wmissing-prototypes] Change-Id: If0c07232f92fab03f5312a932b925156d53bda4e Reviewed-on: https://code.wireshark.org/review/7909 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-01dumpcap: fix Resource leak (CID: 129558)Alexis La Goutte1-0/+1
Change-Id: Ia5d91889ad636412f9ed8104818bfbbd311bf99b Reviewed-on: https://code.wireshark.org/review/7879 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-30Work around a Linux bonding driver bug (and the lack of a libpcap workaround).Guy Harris1-1/+84
The bonding driver does not properly handle unknown ioctls; it returns ENODEV rather than ENOTSUP, EOPNOTSUPP, ENOTTY, or a "not supported" error of that type. This causes problems detailed in bug 11058. On Linux, check for bonding devices before checking for monitor-mode support. While we're at it, get rid of a commented-out include of CheckCSourceCompiles (it's presumably already been implicitly included by other functions that use it). Bug: 11058 Change-Id: I13035de0650634c51a52f262829b2b6fb86b39e9 Reviewed-on: https://code.wireshark.org/review/7856 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25Have a #define for whether the capture buffer size can be set.Guy Harris1-3/+3
It can be set if either 1) this is Windows (where we're assumed to be using WinPcap, which includes calls to set the buffer size) or 2) we have pcap_create() (in which case we also have pcap_set_buffer_size(), at least in a normal libpcap release). Use that rather than testing "defined(_WIN32) || defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's being tested. Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12 Reviewed-on: https://code.wireshark.org/review/7816 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-17Don't say "Capturing on..." if we're not capturing on.Guy Harris1-38/+39
Only print the "Capturing on..." message if we're actually capturing, not if we're printing link-layer types. Change-Id: Icc554776a6a2826276893acb38f7d700effd5f78 Reviewed-on: https://code.wireshark.org/review/7726 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-17Allow multiple -D/-L/-d/-S flags, only allow one -k flag.Guy Harris1-12/+25
Multiple instances of a single flag from -D/-L/-d/-S should behave like a single instance of that flag; -D plus -L, for example, is not supported, but -D plus another -D should be. -k, however, takes an argument, and we only support one. Change-Id: I8baced346fbffd75f8d768497213f67bb9a0555f Reviewed-on: https://code.wireshark.org/review/7723 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-16Update an error message to reflect all the run-dumpcap-and-quit arguments.Guy Harris1-1/+5
Change-Id: I3c270279b4ea044919de5497d373c283ea87c5bf Reviewed-on: https://code.wireshark.org/review/7709 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-10Change a lot of http:// URLs to https://.Gerald Combs1-18/+10
Most of our sites are now HTTPS-only. Update URLs accordingly. Update other URLs while we're at it. Remove or comment out dead links. Change-Id: I7c4f323e6585d22760bb90bf28fc0faa6b893a33 Reviewed-on: https://code.wireshark.org/review/7621 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-20Suppress a bunch of cast-qual warnings.Gerald Combs1-0/+5
Squelch warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] similar to g630f54f. Change strtod to g_ascii_strtod to squelch a checkAPIs error. Change-Id: Ib2d26ef89f08827a5adc07e35eaf876cd7b8d14e Reviewed-on: https://code.wireshark.org/review/7269 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-09(Trivial) Fix printf-related 'Mismatch on sign' warningsBill Meier1-2/+2
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-03Dumpcap: avoid collecting stats on nf* interfaces.Dario Lombardo1-0/+12
On Linux nf* interfaces don't collect stats properly and don't allows multiple connections. Change-Id: I69d8f343017d77bda313de7d2c501fab542f2e9b Bug: 10886 Reviewed-on: https://code.wireshark.org/review/6796 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-03Use g_strdup_printf(), rather than a fixed-length buffer, for the app name.Guy Harris1-6/+8
Change-Id: Ie6034e229f37278fce44b2fddad9250dfb5bc6c8 Reviewed-on: https://code.wireshark.org/review/6286 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Do the full string in get_{compiled,runtime}_version_info().Guy Harris1-6/+4
Have them start the string with "Compiled" or "Running on", and return the string when done. Change-Id: Ic4d290c963621fa0385dc5aab766fd4ad31d3810 Reviewed-on: https://code.wireshark.org/review/6155 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31Move the version_info.c stuff to wsutil/ws_version_info.c.Guy Harris1-1/+0
Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde Reviewed-on: https://code.wireshark.org/review/6153 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-28Removed duplicated #include linesDario Lombardo1-1/+0
Change-Id: I9cafa3cd5c74121168777d8c656e7e94e89efd3c Reviewed-on: https://code.wireshark.org/review/6065 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-25Check for getopt_long(), not getopt().Guy Harris1-1/+1
We support three types of platforms: 1) UN*Xes that have both getopt() and getopt_long(); 2) UN*Xes that have getopt() but not getopt_long(); 3) Windows, which has neither. Checking for getopt_long() lets us distinguish between 1) and 2) and build getopt_long() for them. Change-Id: Iaf0f142f9bebaa2eed2128d544ec9786711def45 Reviewed-on: https://code.wireshark.org/review/6045 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-24Move twelve show_version() functions from the varoius programs andStephen Fisher1-15/+1
Wireshark UI files into a single one in wsutil. Change-Id: I0a64f0cc8106bd681bd185289c36272c4c43baad Reviewed-on: https://code.wireshark.org/review/6026 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-11-05Oops, we also need to worry about pcap_get_tstamp_precision().Guy Harris1-1/+1
Change-Id: I60a1f671ba313c59ca1999ab703ee11370608758 Reviewed-on: https://code.wireshark.org/review/5123 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-05Cope with newer Xcode not having the 10.6 SDK.Guy Harris1-12/+3
The latest Xcode, as of today, has only 10.9 and 10.10 SDKs, which means that, if we build Wireshark and request a deployment minimum release of 10.6, we'll be building against an SDK in which libpcap has routines that aren't available in 10.6 and that doesn't use weak linking for them, so the resulting binary won't actually work on 10.6. Use the run-time loader to find those routines (currently, only pcap_set_tstamp_precision()) and call them only if we find them. On other UN*Xes, we still assume that we'll be running only on the release against which we were built and newer releases. Change-Id: Iab20d86fe3be4b299cfb6e25c1f95dc6e1581661 Reviewed-on: https://code.wireshark.org/review/5120 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-18Get rid of unnecessary includes of ctype.h.Guy Harris1-1/+0
Change-Id: Ibf9385715b85186f5c7289165acea7233b3fabde Reviewed-on: https://code.wireshark.org/review/4804 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-29Pass the global capture options to open_capture_device().Guy Harris1-3/+8
If we support setting the time stamp precision, we need it to determine whether we're writing a pcap-ng file so we know whether to request nanosecond precision or not. Change-Id: I7df19c1afbe1ba90c40c49aef79f6f88ce5df29b Reviewed-on: https://code.wireshark.org/review/4359 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28Add support for getting nanosecond time stamp resolution when capturing.Guy Harris1-0/+31
If we have pcap_set_tstamp_precision(), use it to request nanosecond time stamp resolution *if* we're writing a pcap-ng file; any code that reads those files and can't handle nanosecond time stamp resolution is broken and needs to be fixed. If we're writing a pcap file, don't ask for nanosecond resolution time stamps, as that requires a different magic number for pcap files, and not all code that reads pcap files can handle that. (Unlike pcap-ng, where the ability to have non-microsecond time stamp resolution was present from Day One, it's a relatively recent addition to pcap.) We could add a command-line option/GUI option for that, like the option recent versions of tcpdump have, if it matters. Change-Id: I8fa464eb929feecb9a70be70712502c9f0cc5270 Reviewed-on: https://code.wireshark.org/review/4355 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-25Update the simple dialog code.Gerald Combs1-7/+7
Rename simple_dialog_qt.{cpp,h} to simple_dialog.{cpp,h}. Make it a subclass of QMessageBox. Queue messages at startup similar to GTK+. Move the GTK+-specific simple_dialog declarations to gtk/simple_dialog.h. Don't yell at the user so much. Replace exclamation points with periods. Change-Id: I1cc771106222d5e06f1f52d67ac29d6dc367cce4 Reviewed-on: https://code.wireshark.org/review/4288 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-08-24Modify includes of config.h so that out-of-tree builds, i.e. CMakeGraham Bloice1-1/+1
don't pick up the in-tree copy. Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71 Reviewed-on: https://code.wireshark.org/review/3798 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-21Extcap Capture InterfaceRoland Knall1-11/+18
Extcap is a plugin interface, which allows for the usage of external capture interfaces via pipes using a predefined configuration language which results in a graphical gui. This implementation seeks for a generic implementation, which results in a seamless integration with the current system, and does add all external interfaces as simple interfaces. Windows Note: Due to limitations with GTK and Windows, a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe is needed, which is part of any GTK windows installation. The default installation directory from the build is an extcap subdirectory underneath the run directory. The folder used by extcap may be viewed in the folders tab of the about dialog. The default installation directory for extcap plugins with a pre-build or installer version of wireshark is the extcap subdirectory underneath the main wireshark directory. For more information see: http://youtu.be/Nn84T506SwU bug #9009 Also take a look in doc/extcap_example.py for a Python-example and in extcap.pod for the arguments grammer. Todo: - Integrate with Qt - currently no GUI is generated, but the interfaces are still usable Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net> Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net> Signed-off-by: Roland Knall <rknall@gmail.com> Reviewed-on: https://code.wireshark.org/review/359 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-05- Fix the whitespace fixJoerg Mayer1-1/+1
- Also, trying to commit this "properly" gave this message: Error: Found prohibited APIs in dumpcap.c: strncpy,htons,strerror,open How does this happen? Why does gerrit accept this stuff in case a user does not have the (current) hooks installed? Change-Id: I692d053dcd9221aee31ed2780170c0671b856264 Reviewed-on: https://code.wireshark.org/review/3454 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-08-05Fix whitespace/indentation to match editor modelines.Bill Meier1-11/+11
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-22Clean up indentation (get rid of tabs).Guy Harris1-1/+1
Change-Id: I14917737db30c80af2d40e40efd79ceb6aea79f8 Reviewed-on: https://code.wireshark.org/review/3170 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-22Get rid of NO_INTERFACES_FOUND - it's not an error.Guy Harris1-18/+8
It just means "pcap didn't give me any interfaces, and didn't report an error". Hopefully, in the future, there will be pcap APIs that distinguish between the (admittedly unlikely, these days) case of "there really *are* no interfaces on which *anybody* can capture" and "you don't have sufficient permission to capture", and we can report the latter as an error. (Given that pcap supports more than just "regular interfaces", though, there are cases where you don't have permission to capture on those but you have permission to capture raw USB traffic, for example, so perhaps what's really needed is per-interface indications of permissions.) Change-Id: I7b8abb0829e8502f5259c95e8af31655f79d36a1 Reviewed-on: https://code.wireshark.org/review/3169 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04Move utility routines for capturing into a libcaputils static library.Guy Harris1-38/+10
Some of those routines are used only in dumpcap; others are used in TShark and Wireshark as well. Change-Id: I9d92483f2fcff57a7d8b6bf6bdf2870505d19fb7 Reviewed-on: https://code.wireshark.org/review/2841 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03Clean up printf() argument list.Guy Harris1-2/+4
Splitting %s from \n makes it clearer that the %s's in question take arguments that already include a newline, and that the subsequent \n adds a blank line. Change-Id: I5bac8ca80b42f7de980ad29480042cae3166ff7e Reviewed-on: https://code.wireshark.org/review/2797 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03Make --help and --version information a bit more uniform.Guy Harris1-9/+57
Have --version print the version number, the copyright information, the "compiled with" information, the "running on/with" information, and the compiler information. Have --help print the version number, a one-line summary of what the program does, a reference to http://www.wireshark.org for more information, a Usage: line, and a list of command-line options. This means programs doing that don't need to include version.h; that's left up to get_ws_vcs_version_info() to do. Change-Id: Idac641bc10e4dfd04c9914d379b3a3e0cc5ca8cb Reviewed-on: https://code.wireshark.org/review/2794 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03Regularize the help output of programs.Guy Harris1-15/+7
Only print to the standard output, and only give the version information, if a "print help" command-line option is specified. Otherwise, leave out the version information, and print to the standard error. Leave out the copyright information; it's extra cruft, and http://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html doesn't say anything about it (and bash, at least, doesn't print it). Change-Id: Ic5029ccf96e096453f3bd38383cc2dd355542e8a Reviewed-on: https://code.wireshark.org/review/2789 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03Regularize the first line of version output.Guy Harris1-5/+5
For Wireshark, say "Wireshark", not "wireshark". For other programs, put "(Wireshark)" after the program name, as per http://www.gnu.org/prep/standards/html_node/_002d_002dversion.html ("If the program is a subsidiary part of a larger package, mention the package name in parentheses, like this"). Change-Id: I68558f64cfa6ee4423e42f3d6b120633ef1b2716 Reviewed-on: https://code.wireshark.org/review/2788 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30Move capture_session.h to capchild; what it declares is defined there.Guy Harris1-1/+1
Change-Id: I8b1407839390b7ac0b45bf6f583c1a509073f002 Reviewed-on: https://code.wireshark.org/review/2709 Reviewed-by: Guy Harris <guy@alum.mit.edu>