Commit Graph

239 Commits

Author SHA1 Message Date
Guy Harris a7d98a2cc9 Expand a comment.
Give details on what happens when running Wireshark from a GUI on
UN*Xes, or, at least, on {macOS,Ubuntu+GNOME,Ubuntu+KDE}, although
it's probably similar on other UN*Xes and on other desktop environments.
2021-03-15 18:40:19 -07:00
Guy Harris c33e2f7b51 Add more error-reporting routines that call through a function pointer.
Have routines to report capture-file errors, using libwireshark error
codes and strings, that call through a pointer, so they can pop up
dialogs in GUI apps, print a message to the standard error on
command-line apps, and possibly do something different on server
programs.

Have init_report_message() take a pointer to structure containing those
function pointers, rather than the function pointers themselves, as
arguments.

Make other API changes to make that work.
2021-03-15 12:17:59 -07:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
João Valverde 41a172cc95 if_capabilities: Use a structured error msg from dumpcap
Have dumpcap in child mode return an error message with a primary and
secondary string, instead of using stderr. When writing to the console
log we ignore the second message to prevent flooding the log with
tutorial-like info on permissions.
2021-03-06 12:56:11 +00:00
Guy Harris c80c16759b wiretap: eliminate two WTAP_FILE_TYPE_SUBTYPE_ values.
Eliminate WTAP_FILE_TYPE_SUBTYPE_ERF and
WTAP_FILE_TYPE_SUBTYPE_SYSTEMD_JOURNAL - instead, fetch the values by
name, using wtap_name_to_file_type_subtype().

This requires that wtap_init() be called before epan_init(); that's
currently the case, but put in comments to indicate why it must continue
to be the case.
2021-02-19 23:20:24 +00:00
Gerald Combs abf9e027fc Require Qt 5.6 or later.
Increase the minimum required version of Qt from 5.3 to 5.6. The various
Linux distribution versions that shipped with earlier Qt versions (RHEL
6, Fedora 23, openSUSE 13.2, Debian jessie, Ubuntu 16.04) have either
reached end of support or will do so soon.

The official Qt 5.6 releases for macOS require 10.8, so make that the
minimum macOS version.

Remove a bunch of no-longer-needed version checks.
2021-02-19 13:49:10 -08:00
Guy Harris c0711693ab Enable -Wredundant-decls.
Add it to the default list of checks, and fix some errors it causes.
(Sadly, it doesn't work in CLang.)
2021-02-14 14:43:42 -08:00
Guy Harris 1f15c0899e epan: have a routine to register all tap listeners.
Pull the code to register plugin taps, and the loop to register built-in
taps, into a single register_all_tap_listeners() routine.

This leaves it up to libwireshark, not to the programs using it, to know
how to register them.
2021-01-30 21:15:30 -08:00
Guy Harris 6498bde741 In Wireshark's version info, indicate whether we were built with Minizip.
We can't determine the version number, as there's nothing in the header
to indicate the version with which we were compiled, nor is there an API
to determine the version with which we're running.
2020-12-18 22:16:04 -08:00
Gerald Combs d4b40c0047 Qt: Force layer backing on Big Sur when needed.
Make sure NSView.wantsLayer is true by setting QT_MAC_WANTS_LAYER=1 at
startup if we're running on Big Sur and we were built with a version of
Qt susceptible to QTBUG-87014. Fixes #17075?
2020-12-16 20:28:16 +00:00
Jim Young 9fb22c1ec0 Four trivial comment typo fixes of ‘ad’ to ‘as’ 2020-12-06 19:07:08 +00:00
Guy Harris 639891651f Impose limits on the number of records we read.
Start the limit at 2^32-1, as we use a guint32 to store the frame
number.

With Qt prior to Qt 6, lower the limit to 53 million packets; this
should fix issue #16908.
2020-10-26 16:52:58 -07:00
Guy Harris f7c99f73e2 Revert "Apparently, WS_WIKI_URL() is unworkable not only in C++ but in C."
This reverts commit 5df2925434.

The problem only showed up in tfshark.c, and was caused by tfshark.c
using stuff from ui/urls.h but not *including* ui/urls.h.
2020-10-25 14:42:47 -07:00
Guy Harris 5df2925434 Apparently, WS_WIKI_URL() is unworkable not only in C++ but in C.
If you use it, GCC 9.3.0 seems to think there's a missing parenthesis
somewhere, just as the version of clang++ in my version of Xcode does,
even though other versions of GCC don't.  I'm clearly missing something
obscure about C here; I give up.
2020-10-24 13:53:23 -07:00
Chuck Craft 5b242d62b0 WIN32 logging: connect stdio earlier in main() 2020-10-20 13:49:27 +00:00
Guy Harris e013c5ec7f Clean up URLs.
Add ui/urls.h to define some URLs on various of our websites.  Use the
GitLab URL for the wiki.  Add a macro to generate wiki URLs.

Update wiki URLs in comments etc.

Use the #defined URL for the docs page in
WelcomePage::on_helpLabel_clicked; that removes the last user of
topic_online_url(), so get rid of it and swallow it up into
topic_action_url().
2020-10-02 20:13:42 -07:00
Gerald Combs 7ab6440416 Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for
checkAddTextCalls, which was removed in e2735ecfdd.

Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in
main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp.

Rename "index"es in packet-usb-hid.c.
2020-09-05 07:41:29 +00:00
Guy Harris 608835bf56 Don't call any routines from WinPcap/Npcap packet32.dll.
We aren't using them now; stick to libpcap APIs (including Windows-only
libpcap APIs).

Change-Id: I812eaa31ba1e6e611418853105d3e00c9130a420
Reviewed-on: https://code.wireshark.org/review/37852
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-14 07:30:59 +00:00
Gerald Combs 4dc3114c05 Windows: Set our locale to ".UTF-8".
In each of our executables we were calling "setlocale(LC_ALL, "")" at
startup. This told Windows that output was encoded using the current
system code page. Unless the code page was 65001 (UTF-8), this was a lie.

We write UTF-8 to stdout and stderr, so call "setlocale(LC_ALL, ".UTF-8)"
at startup on Windows. This lets the CRT translate our output correctly
in more cases.

Clarify and expand the OUTPUT section in the tshark man page.

Bug: 16649
Change-Id: If93231fe5b332c292946c7f8e5e813e2f543e799
Reviewed-on: https://code.wireshark.org/review/37560
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-06 16:20:25 +00:00
Gerald Combs d7bbe384f5 Test+Qt: Add an automatic update check.
Add software_update_info() to the software update module, which returns
the name of our update library if we have one. Use it to add automatic
update information to the compiled information in `wireshark --version`.

Add a "release" test suite, which contains a test for automatic updates.

Ping-Bug: 16381
Change-Id: I867a96bdcfde8be541eca2dc0e84b5000276e7dd
Reviewed-on: https://code.wireshark.org/review/36107
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:13:25 +00:00
Gerald Combs 1e4c4f2209 Qt: Make it possible to hide welcome screen warnings.
The "The NPF driver isn't running. You may have trouble" warning dialog
is now redundant, so remove it along with the "privs.warn_if_no_npf"
recent setting.

Add a more general "sys.warn_if_no_capture" recent setting along with a
getter for SimpleDialog's "Don't show this message again." string. Use
them to add a "Don't show this..." link to the main welcome warning
label.

Change-Id: Idffb800761eebf04b75e4be3f6bf7727dd468949
Reviewed-on: https://code.wireshark.org/review/36042
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-02-07 07:36:03 +00:00
Stig Bjørlykke c84bbf4853 Qt: Add error message when create profiles dir fails
Include the error message when creating the profiles directory fails.

Change-Id: I00157282b16e5152632a208357695047bed55539
Reviewed-on: https://code.wireshark.org/review/35759
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-01-12 21:17:44 +00:00
Pascal Quantin 23a6fab52e Qt: remove codecs from about Wireshark dialog
Codecs were moved to plugins in g63af1da7e7, they are no more embedded in a library.

Change-Id: Id5448d2f83b1b4f7b1aac2620390f99da9327167
Reviewed-on: https://code.wireshark.org/review/35701
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-09 07:15:11 +00:00
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Gerald Combs f2036f0fbd Qt: Print qDebug messages by default.
We handle Qt and GLib logging in the same handler, which means that if
we map qDebug messages to G_LOG_LEVEL_DEBUG they won't be printed by
default. This can make debugging the UI more confusing, since sprinkling
in qDebug()s is a common Qt debugging method. If you're focused on
fixing a bug it's easy to forget that you need to use qWarning() or
change the logging level preference instead.

Set the log level for qDebug messages to G_LOG_LEVEL_WARNING so that
they show up.

Change-Id: I4336b001cb667a31bf8b25306cd34e758cc8967e
Reviewed-on: https://code.wireshark.org/review/34937
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-03 17:45:36 +00:00
Guy Harris 5cf3fd03f1 HTTPS In More Places, update some URLs.
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8
Reviewed-on: https://code.wireshark.org/review/34096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27 07:55:36 +00:00
Roland Knall 9ad5dc26dd Qt: Move widgets to sub-directory
General code cleanup

Change-Id: Ic99fc24b8f8c6142a7ec46f535f8d5b896236390
Reviewed-on: https://code.wireshark.org/review/33769
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-01 06:55:45 +00:00
João Valverde 63af1da7e7 Kill libwscodecs plugin library, just use plugins
Change-Id: I085d04840acb53b0b7681787429a2b4e10547cd5
Reviewed-on: https://code.wireshark.org/review/33068
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 20:59:39 +00:00
João Valverde 57bb2b2a09 Move codec plugins to /plugins
Change-Id: I56d61e2ef737e4326080d75a2302c73a4075e8a1
Reviewed-on: https://code.wireshark.org/review/33067
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 20:27:21 +00:00
João Valverde 186f985793 CMake: Check for and use system SpeexDSP library
Change-Id: I8443379d23a2946dd21c12e5e0bd5464ab73ca25
Reviewed-on: https://code.wireshark.org/review/31857
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-05-02 21:12:01 +00:00
Guy Harris 2ee483a222 Move the Winsock initialization and cleanup to wsutil routines.
Those routines exist on both Windows and UN*X, but they don't do
anything on UN*X (they could if it were ever necessary).

That eliminates some #ifdefs, and also means that the gory details of
initializing Winsock, including the Winsock version being requested,
are buried in one routine.

The initialization routine returns NULL on success and a pointer to a
g_malloc()ated error message on failure; report the error to the user,
along with a "report this to the Wireshark developers" suggestion.

That means including wsutil/socket.h, which obviates the need to include
some headers for socket APIs, as it includes them for you.

Change-Id: I9327bbf25effbb441e4217edc5354a4d5ab07186
Reviewed-on: https://code.wireshark.org/review/33045
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-02 09:29:01 +00:00
Gerald Combs cec5991f40 Windows: Modernize our WSAStartup usage.
Make sure we link each application that calls WSAStartup with ws2_32.lib.
Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996,
so we should be OK.

Ping-Bug: 15711
Change-Id: I431839e930e7c646669af7373789640b5180ec28
Reviewed-on: https://code.wireshark.org/review/33033
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-01 17:51:59 +00:00
Gerald Combs 781fb82045 Qt: Add display information to the About dialog.
Add ColorUtils::themeIsDark and use it to report our dark / light mode
in the "About" dialog. Summarize the HiDPI capability of our displays as
well.

Change-Id: I242af1eb48017d49b90e71099bb753e67a8dd32b
Reviewed-on: https://code.wireshark.org/review/32115
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-21 00:06:39 +00:00
Guy Harris ba589a4e44 Move some command-line-oriented routines from wsutil to ui.
cmdarg_err() is for reporting errors for command-line programs and
command-line errors in GUI programs; it's not something for any of the
Wireshark libraries to use.

The various routines for parsing numerical command-line arguments are
not for general use, they're just for use when parsing arguments.

Change-Id: I100bd4a55ab8ee4497f41d9651b0c5670e6c1e7f
Reviewed-on: https://code.wireshark.org/review/31281
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 02:07:06 +00:00
Guy Harris 43dfd45faa Move more version-info-related stuff to version_info.c.
Have a ws_init_version_info() routine that, given an application name
string:

	constructs the app-name-and-version-information string, and
	saves it;

	adds the initial crash information on platforms that support it,
	and saves it.

Have show_version() use the saved information and take no arguments.

Add a show_help_header() routine to print the header for --help
command-line options, given a description of the application; it prints
the application name and version information, the description, and the
"See {wireshark.org URL}" line.

Use those routines in various places, including providing the
"application name" string in pcapng SHBs.

Change-Id: I0042a8fcc91aa919ad5c381a8b8674a007ce66df
Reviewed-on: https://code.wireshark.org/review/31029
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-13 03:16:13 +00:00
Guy Harris bce13644e9 Bring back arg_list_utf_16to8(), but have it just do UTF-16-to-UTF-8 mapping.
Call it from wmain() in the command-line tools, passing it the input
argument count and vector, and call it from main() in Wireshark, after
getting a UTF-16 argument vector from passing the result of
GetCommandLineW() to CommandLineToArgvW().

Change-Id: I0e51703c0a6c92f7892d196e700ab437bd702514
Reviewed-on: https://code.wireshark.org/review/30063
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-08 03:05:45 +00:00
Guy Harris a679ae6f79 Use wsetargv.obj, and wmain() rather than main(), on Windows.
Doing so for command-line programs means that the argument list doesn't
ever get converted to the local code page; converting to the local code
page can mangle file names that *can't* be converted to the local code
page.

Furthermore, code that uses setargv.obj rather than wsetargv.obj has
issues in some versions of Windows 10; see bug 15151.

That means that converting the argument list to UTF-8 is a bit simpler -
we don't need to call GetCommandLineW() or CommandLineToArgvW(), we just
loop over the UTF-16LE argument strings in argv[].

While we're at it, note in Wireshark's main() why we discard argv on
Windows (Qt does the same "convert-to-the-local-code-page" stuff); that
means we *do* need to call GetCommandLineW() and CommandLineToArgvW() in
main() (i.e., we duplicate what Qt's WinMain() does, but converting to
UTF-8 rather than to the local code page).

Change-Id: I35b57c1b658fb3e9b0c685097afe324e9fe98649
Ping-Bug: 15151
Reviewed-on: https://code.wireshark.org/review/30051
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-07 18:57:54 +00:00
Dario Lombardo 7a07832712 prefs: add the option not to load interfaces on startup.
Change-Id: I2ade0647a8c32b76aebd60117b4317cd005aff91
Reviewed-on: https://code.wireshark.org/review/29854
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-26 17:11:47 +00:00
Dario Lombardo 56c1ec5208 Qt: don't load the interfaces list if a capture file is used.
Bug: 15126
Change-Id: I4c190879541db94637ad88ffe99f10479caa4a43
Reviewed-on: https://code.wireshark.org/review/29549
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-26 15:07:58 +00:00
João Valverde ff1e16055f epan: Add argument to epan_init() to disable plugins
Change-Id: I8dc76e6bf8c4d5a3081cbdc1d47b88e857415d29
Reviewed-on: https://code.wireshark.org/review/29498
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-09-09 02:27:34 +00:00
João Valverde 8eddb1650d epan: Remove unnecessary all protocols registration callback
We are exporting a registration function from libwireshark just
to have it passed back as a callback. Seems unnecessary.

Change-Id: I7621005c9be11691d319102326824c5e3520a6f3
Reviewed-on: https://code.wireshark.org/review/29328
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-08-29 23:22:44 +00:00
Gerald Combs c74dba69fc Windows: Fetch our version using RtlGetVersion.
GetVersionEx is deprecated. Use RtlGetVersion instead. Remove
get_windows_major_version since it's no longer needed.

Change-Id: I02f6458608c2328a96a0ac71c6b1f9187babd049
Reviewed-on: https://code.wireshark.org/review/28443
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 20:30:02 +00:00
Gerald Combs f8092f96b3 Qt: Move wireshark-qt.cpp back to ui/qt/main.cpp.
The Qt UI's main module started out as ui/qt/main.cpp but was moved to
the top-level directory in order to appease Autotools. We don't need to
do that any more, so move it back.

Change-Id: Ic5bc0ed5b754e36cc2b9e682f2ca097781233dfd
Reviewed-on: https://code.wireshark.org/review/28090
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-08 03:50:22 +00:00
Guy Harris 8bf7078f79 Move ui/qt/main.cpp to wireshark-qt.cpp, and get rid of the dummy.cpp hack.
Change-Id: Ib4684264363593372b3bf078cf17cae1a1cb10d6
Reviewed-on: https://code.wireshark.org/review/6199
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-01 10:46:00 +00:00
Guy Harris a53b67ceb7 Don't include header files that we don't appear to need.
Some don't appear to be necessary at all, as ui/qt/main.cpp doesn't do
very much (most of the work is done in various class implementations,
including WiresharkApplication), and a few only appear to be necessary
on Windows.

Change-Id: Ic9eae65e77e2425144f7fe4885fc865fcf6ab1ff
Reviewed-on: https://code.wireshark.org/review/6196
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-01 00:10:26 +00:00
Guy Harris 37efc4ae77 We do stuff with signals only on UN*Xes.
Change-Id: I1b1a304143cf4e4a14107d1d55057cef24552a70
Reviewed-on: https://code.wireshark.org/review/6160
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 10:23:51 +00:00
Guy Harris 27be466c9b Do the full string in get_{compiled,runtime}_version_info().
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-31 06:29:11 +00:00
Guy Harris c1f30471ca Move the version_info.c stuff to wsutil/ws_version_info.c.
Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde
Reviewed-on: https://code.wireshark.org/review/6153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 03:41:02 +00:00
Guy Harris c2c9a09880 Use getopt_long() for the first pass through the argument list.
That way:

	1) we don't have to worry about the system getopt() and our
	   getopt_long(), on platforms that have getopt() but not
	   getopt_long() (Solaris prior to Solaris 10, HP-UX, AIX), not
	   working well together;

	2) if necessary, we can handle long options in the first pass.

Switch to using getopt_long() for the *second* pass for the GTK+ version
of Wireshark.

Use the documented mechanism for resetting the argument parser for the
glibc version of getopt_long(); use the mostly-undocumented-but-at-least-
they-documented-optreset mechanism for the *BSD version.

(We should look into doing only one pass, saving away arguments that
can't fully be processed in the first pass for further processing after
initializing libwireshark.)

Change-Id: Ide5069f1c7c66a5d04acc712551eb201080ce02f
Reviewed-on: https://code.wireshark.org/review/6063
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-26 22:39:46 +00:00
Guy Harris 20503c7047 Check for getopt_long(), not getopt().
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-25 01:11:10 +00:00
Stephen Fisher 2d8ec49ffa Move twelve show_version() functions from the varoius programs and
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-12-24 16:51:45 +00:00
Gerald Combs 9ba9cd83a4 Qt: Add a CaptureFile class.
Wrap the capture_file struct in a QObject which translates cf_cb_* and
capture_cb_* events into signals. Move the global cfile to
capture_file.cpp.

Don't use a void pointer for the capture file struct.

Change-Id: Ic5d5efb4bb1db64aa0247245890e5669b1da723a
Reviewed-on: https://code.wireshark.org/review/5885
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-20 17:39:29 +00:00
Gerald Combs 44e14b7805 Qt: Defer startup messages.
Wait until we've completely started up to show accumulated warnings and
errors.

Replace three periods with an ellipsis.

Change-Id: Ic3b268836e4e4429786c5eba4862cbc0458a19b5
Reviewed-on: https://code.wireshark.org/review/5762
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-14 17:53:22 +00:00
Alexis La Goutte a30f3d5ebc Qt: Add long option for -R (--read-filter) and -Y (--display-filter)
Change-Id: Id535c04493f6c6df88006d922ee43cff9f4b70a1
Reviewed-on: https://code.wireshark.org/review/5507
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-11-27 16:24:12 +00:00
Martin Kaiser 449bc19ba9 Qt: support the -R option to set a read filter on the command line
rename display_filter to read_filter in some places to make it clear
what it's used for

modify MainWindow::openCaptureFile() so that a read filter can be set
when the file name is passed in cf_path, not only when it's chosen from
a file selection dialogue

don't display the read filter string in the filter toolbar

Change-Id: Ie8dc94cbd1ff7e61ce1e2a55518a28297daa5d51
Reviewed-on: https://code.wireshark.org/review/5446
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-11-26 16:01:52 +00:00
Martin Kaiser 363b87a4be Qt: support the -Y option to set an initial display filter
Change-Id: I7627265b876c6994b163df1c5b037f4dae2f6d42
Reviewed-on: https://code.wireshark.org/review/5445
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-25 02:52:16 +00:00
Guy Harris 225c86f7a2 Do the "-z help" processing separately, and do it for Wireshark as well.
Yes, Wireshark does a bunch of GUI stuff, and then takes the window down
before printing the help, but the same is true for some command-line
error messages as well.

Change-Id: Id501468416c83308e4c0a9e7a66116d8d33a9d84
Reviewed-on: https://code.wireshark.org/review/5317
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-15 00:27:48 +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
Michal Labedzki 5025bc258c Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all
  translations working
- dynamic list of supported languages
- runtime change of GUI language (no need to restart application)
- add flags icons support
- search for *.qm languages in buildin resources, then
  data dir called "languages" (main directory in sources or
  /usr/share/wireshark/languages), then user directory
  (UNIX: ~/.wireshark/languages); "languages" directory should contains
  files wireshark_xx.qm where xx is language code (en, en_GB, etc.),
  and optional xx.svg for flag icon
- try to fix some untranslated manually-created UI items
  (need manual reset text of those components)

Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229
Reviewed-on: https://code.wireshark.org/review/5041
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-04 08:21:55 +00:00
Gerald Combs 9ddbc8de77 Qt: Fill in time display menu items. Other fixes and updates.
Reselect the current packet when we redraw the packet list.

Don't crash if we try to mark when no frame is selected. Try to
invalidate cached packet list strings when needed. Rename
PacketList::updateAll to redrawVisiblePackets so that its purpose is
more clear. When changing the font size, call redrawVisiblePackets
instead of rebuilding the entire list of visible rows.

Change-Id: I6e7a15067e7063d0efc26082170e1795ae3c0779
Reviewed-on: https://code.wireshark.org/review/4901
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-21 23:32:21 +00:00
Guy Harris 87545f39da Remove unnecessary includes of <ctype.h>.
Change-Id: I8eacec5fa8d57b10d40a3627197461dae89c6cb2
Reviewed-on: https://code.wireshark.org/review/4768
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 06:57:41 +00:00
Dario Lombardo 7f74471229 Added italian translation to qt.
Change-Id: If58ed29e78a9994fc488a4d01cf665f7e8d82830
Reviewed-on: https://code.wireshark.org/review/4707
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-16 18:55:33 +00:00
Gerald Combs 58cde5c74a Add tests for the Qt UI.
Make sure the Qt UI quits if WIRESHARK_QUIT_AFTER_CAPTURE is set. Make
sure Bourne shell scripts (*.sh) have UNIX/POSIX line endings. Reduce
some time values so that the tests run faster.

Change-Id: I81df7c6f72d7d807d1856863cbea1bb6326ca711
Reviewed-on: https://code.wireshark.org/review/4407
Tested-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-01 22:30:33 +00:00
Gerald Combs 00509025e8 Qt: Finish implementing -g
Should fix the current dist failure.

Change-Id: Ib1b8d92f6267040c9eef2e4c27ca78c6dd0631be
Reviewed-on: https://code.wireshark.org/review/4384
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-30 20:04:44 +00:00
Gerald Combs 9fdc85d6c0 Qt: Try to fix libpcap-less builds.
Change-Id: I64f4d6490388858306180445b58863d57217986a
Reviewed-on: https://code.wireshark.org/review/4383
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-30 19:16:07 +00:00
Gerald Combs ced39b6de8 Qt: Start capture from the command line.
Fill in the capture-related mise en place so that -k and -i work. Get
rid of global_capture_session in ui/qt and make it a member of
MainWindow.

Copy over privilege checking from GTK+.

Move the global capture session struct to MainWindow.

Change-Id: Iab5ec683860a40255a7e1d82e3872ced24fd55cb
Reviewed-on: https://code.wireshark.org/review/4382
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-30 18:44:59 +00:00
Guy Harris 54b733ce9a Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution.  Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.

Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display".  Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.

Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28 18:38:18 +00:00
Gerald Combs 2d7c1135ed Move the console log handling code to ui/console.[ch].
Change-Id: I8e554a8e17399d78b0ef29dfb68109a219cd9f1b
Reviewed-on: https://code.wireshark.org/review/4294
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-26 14:15:45 +00:00
Gerald Combs ea6fa049c9 Update the simple dialog code.
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-09-25 22:02:43 +00:00
Jeff Morriss 2cd9784f10 Fix sizing of qtshark based on the saved (recent) geometry.
Do this by emitting the StaticRecentFilesRead signal after reading the static
portion of the recent file.

Unfortunately this results in the main window appearing in one size and
then resizing to the saved size but I haven't figured out how to fix that yet.
At the very least this prevents qtshark's default geometry from being saved to
my recent file and affecting wireshark-gtk's geometry.

Change-Id: I47b66078a9d00cb321badc744f1337ff39ca42a7
Reviewed-on: https://code.wireshark.org/review/4177
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-20 18:19:07 +00:00
Pascal Quantin 7b20afc73f Qt: add support for some more command line options
Change-Id: I63b2c51ba857dc5282897c32594102aad2ef9e2f
Reviewed-on: https://code.wireshark.org/review/4127
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-09-18 20:55:47 +00:00
Martin Kaiser 63d7f7fc4c adjust the path to the translation files
they were renamed from qtshark_... to wireshark_...

Change-Id: I97b245a9028b4ed99812204114ba8f59357d49e8
Reviewed-on: https://code.wireshark.org/review/3995
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-09-05 06:35:53 +00:00
Gerald Combs 30f3d52441 Qt: Refactor ConversationDialog for endpoints.
Create a TrafficTableDialog (for lack of a better name) parent class
from the general parts of ConversationDialog. Use it to create
EndpointsDialog.

Move the contents of conversation_tree_widget.{cpp,h} to
conversation_dialog.{cpp,h} to match endpoint_dialog and
traffic_table_dialog.

Fill in GeoIP columns dynamically instead of using a hard-coded limit.

Use "endp_" and "ENDP_" prefixes for a lot of endpoint variables and
defines.

Try to make geoip_db_lookup_ipv4 and geoip_db_lookup_ipv6 more robust.

Clean up some includes. Fix a shadowed variable.

Change-Id: I23054816ac7f8c6edb3b1f01c8536db37ba4122d
Reviewed-on: https://code.wireshark.org/review/3462
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-05 01:06:53 +00:00
Michael Mann 018b84de84 Refactor "common" hostlist/endpoint table functionality.
This is very similar in architecture to the changes made to the Conversation table functionality.  Since all conversations have endpoints/hostlists, the "registered" list is shared for both.

Change-Id: Ie8c6910a68a1b3f27c5b18c4494f49b9404a7b31
Reviewed-on: https://code.wireshark.org/review/3214
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-18 04:24:39 +00:00
Guy Harris 435e7c6106 Move the AirPcap stuff into caputils.
Change-Id: I64b45dad36a3ec491aeb9de3439b4fe19b46f9d8
Reviewed-on: https://code.wireshark.org/review/3308
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-01 00:30:03 +00:00
Michael Mann 31ecdf5b06 Refactor "common" Conversation table functionality.
Refactor (non-GUI) conversation table functionality from gtk/Qt to epan.  Also refactor "common GUI" conversation table functionality.

The idea is to not have to modify the GUI when a dissector adds a new "conversation type"

Change-Id: I11f08d0d7edd631218663ba4b902c4a4c849acda
Reviewed-on: https://code.wireshark.org/review/3113
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-26 20:59:42 +00:00
Guy Harris f6ce0cdacd Get rid of NO_INTERFACES_FOUND - it's not an error.
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-22 23:53:49 +00:00
Joerg Mayer 16daf0c783 Add a warning that not all command line options are implemented
Change-Id: If1b12fed6d04623a4265131a2ff666d4a937d382
Reviewed-on: https://code.wireshark.org/review/3151
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-07-21 18:33:54 +00:00
Martin Kaiser b1532b21be start support for the Japanese language in the Qt version
just the framework and some simple translations

Change-Id: I7653a9c6ab26b391bfe2942d088d233996030576
Reviewed-on: https://code.wireshark.org/review/3134
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-20 18:02:33 +00:00
Gerald Combs d1d88f575d Add plumbing for stat commands ("-z ...").
Trigger dialog creation by passing a method name to
QMetaObject::invokeMethod. I'm not entirely sure this is sane but it
seems to work OK. Move getopt processing further down in the main initialization sequence
to more closely match GTK+ and allow for stat command registration.

Change-Id: I5cd5375fa71dbadac69d528b2ba3bb13598dc3f6
Reviewed-on: https://code.wireshark.org/review/2964
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-11 20:52:10 +00:00
Guy Harris 17995db2ff Fix the no-libpcap build.
Change-Id: I2443ab22d423508641ac199262238e5fbafc95df
Reviewed-on: https://code.wireshark.org/review/2843
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-04 08:01:41 +00:00
Guy Harris 9e6487f247 Move utility routines for capturing into a libcaputils static library.
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-04 07:25:26 +00:00
Guy Harris 66b02c75ed Include <sys/capaibility.h> to get _LINUX_CAPABILITY_VERSION defined.
It's no longer used in version_info.c, but is used in the main source
files of TShark and Wireshark (it's already included in dumpcap).

Change-Id: I2169a2bbed678baf26fc8711d7c13d95cce3ee2a
Reviewed-on: https://code.wireshark.org/review/2819
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 15:22:45 +00:00
Guy Harris 1692c520ef Include "capture-pcap-util.h" even if we don't have libpcap.
The routines to get libpcap version information just say "no pcap here"
if we don't have it, so they're called regardless of whether we were
compiled with it.

Change-Id: I4e58cce83f7c0e36aa6ef9b40ec7075732402f3b
Reviewed-on: https://code.wireshark.org/review/2800
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 09:16:39 +00:00
Guy Harris b4ce352539 Make --help and --version information a bit more uniform.
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-03 08:46:01 +00:00
Guy Harris 6b3391c60a Regularize the help output of programs.
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-03 02:29:54 +00:00
Guy Harris 66c342ed59 Regularize the first line of version output.
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-07-03 02:03:35 +00:00
Guy Harris 9485392687 Add a comment that appears in other programs.
Change-Id: Ife885779d339fbb706c9d6cfd931833afba25277
Reviewed-on: https://code.wireshark.org/review/2742
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 10:06:11 +00:00
Guy Harris 62fa030a03 Do startup things in an order more like that of gtkshark.
Get credential information and drop privileges *very* early on.  Get the
pathname of the executable right after that, then initialize the 802.11
decryption, then, on Windows, load WinPcap and, if available, AirPcap.
*Then* we can get the version information and set the crash information.

We should drop privileges as early as possible.

We have to load WinPcap and AirPcap before getting the run-time
information, as the run-time information includes the *pcap versions.

Change-Id: Ib40e5a848cc7f42fcb424faa15a91868eaa0b9a4
Reviewed-on: https://code.wireshark.org/review/2733
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 22:51:55 +00:00
Guy Harris ad1391aa4e Move capture.[ch] to libui.
Change-Id: I86e7e781cc9e14abab0374a18b95438529b046f0
Reviewed-on: https://code.wireshark.org/review/2711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 05:38:57 +00:00
Guy Harris df5833723c Move capture_ui_utils.[ch] to libui.
Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a
Reviewed-on: https://code.wireshark.org/review/2708
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 01:36:56 +00:00
Guy Harris fe42762f23 Move some more stuff into wsutil.
Move the routines to parse numerical command-line arguments there.

Make cmdarg_err() and cmdarg_err_cont() routines in wsutil that just
call routines specified by a call to cmdarg_err_init(), and have
programs supply the appropriate routines to it.

Change-Id: Ic24fc758c0e647f4ff49eb91673529bcb9587b01
Reviewed-on: https://code.wireshark.org/review/2704
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-29 23:03:24 +00:00
Guy Harris adf6b1a8df For capchild headers, include <capchild/XXX.h>.
Change-Id: I780c69ee637dcd9846756a2e2d6a35baf02d826d
Reviewed-on: https://code.wireshark.org/review/2594
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24 00:28:08 +00:00
Guy Harris 9cdbb25760 Don't report the run-time version of pcap if we weren't built with pcap.
Change-Id: Ib879290b72938cc999e00b6e044f917161ba5801
Reviewed-on: https://code.wireshark.org/review/2589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-23 22:49:40 +00:00
Guy Harris 1d92195de8 Have individual programs get libpcap and libz version info.
That way, the code that constructs the runtime version string doesn't
itself have to call libpcap and libz, and could be usable in programs
that don't call them.

While we're at it, add "with" to the run-time version information for
GnuTLS and libgcrypt, to match the compile-time version information, and
add the version information from libwireshark to TShark.

Change-Id: I3726a027d032270b032292da9314c1cec535dcd2
Reviewed-on: https://code.wireshark.org/review/2587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-23 21:56:42 +00:00
Michal Labedzki 59e860cf2f [WIP] qt: Add support for Polish language
Change-Id: Ib63937e741b737f171a9b383a9cbabb55dfdd8ef
Reviewed-on: https://code.wireshark.org/review/2553
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-23 19:10:21 +00:00
Guy Harris c46329c27b Add a routine to return a version string including VCS information.
Add a routine get_ws_vcs_version_info() that, for builds from a tree
checked out from Wireshark's version control system, returns a string
that includes both the Wireshark version number and an indication of
what particular VCS version was checked out, and just returns
Wireshark's version number for other builds.

Use that routine rather than manually gluing VERSION and the Git version
number together.

("vcs", not "git", just in case we do something bizarre or mercurial
some day. :-))

Change-Id: Ie5c6dc83b9d3f56655eaef30fec3ec9916b6320d
Reviewed-on: https://code.wireshark.org/review/2529
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22 01:06:25 +00:00
Guy Harris 43443af0ac Move get_copyright_info() to wsutil.
Change-Id: I75c1c747cd2b4a9845c659636582d54b2caecf1a
Reviewed-on: https://code.wireshark.org/review/2510
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 17:33:05 +00:00
Guy Harris 235d3a2a3a Fix build without pcap.
The files that use LONGOPT_CAPTURE_COMMON and OPTSTRING_CAPTURE_COMMON
include capture_opts.h unconditionally, so there's no need to define
them if we don't have pcap.  In addition, we want the capture options
"available" even if we don't have pcap, so we can tell the user "you're
using a version of *shark without pcap, but you gave a capture option".

Change-Id: I0bd3893b73d3d903610d0bc6cacb60bfb37096f4
Reviewed-on: https://code.wireshark.org/review/2503
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 23:26:46 +00:00
Guy Harris b3885a9387 Fix builds without pcap.
Change-Id: I6c67f9ea9d115a8396af0904ef9a73d2c528dcaa
Reviewed-on: https://code.wireshark.org/review/2498
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:51:34 +00:00