Commit Graph

53708 Commits

Author SHA1 Message Date
Guy Harris a4304de1cc Add long-option support.
That way, --help and --version, as well as -h and -v, work.

Change-Id: I095e0dcef9f6181d6fbe6337f9f33e80bc44f11a
Reviewed-on: https://code.wireshark.org/review/2790
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 02:33:52 +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 0e4e825309 Add license information to the copyright information.
See

	http://www.gnu.org/prep/standards/html_node/_002d_002dversion.html

Change-Id: I19c1cf560a1bb7ed7d7312bea727550977d66120
Reviewed-on: https://code.wireshark.org/review/2787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 01:33:51 +00:00
Irene Ruengeler f3c5f14bc4 Manage Interfaces
- Add dialog to manage interfaces
- Add and delete pipes
- Hide local interfaces

Change-Id: I08323c306c2ea736f99e57c28e2fe3170a0c2216
Reviewed-on: https://code.wireshark.org/review/2613
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-02 20:56:37 +00:00
Guy Harris 2c9d2bea32 Fail if any of the install-exec-hook commands fails.
Hopefully, this will mean that somebody doing a set-UID/set-GID/setcap
installation as themselves rather than as root will not "succeed" but
leave dumpcap installed without enhanced privileges, so the underlying
problem in bugs such as bug 10247 will be more obvious.

Change-Id: I34393bc2c9ea4dc59854a08524edb4f65e79730b
Reviewed-on: https://code.wireshark.org/review/2781
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-02 20:27:28 +00:00
Michael Mann 980893a15a NDPS dissector is the poster child for proto_tree_add_subtree[_format].
NDPS dissector is also the poster child for not being considered "that naughty" by checkAPIs because most of its proto_tree_add_text calls don't have printf-style arguments (which is what checkAPIs really keys off of)

Fixed both cases and removed about 370 proto_tree_add_text calls from the dissector.

Change-Id: I721678c39d4a0544e5e7212e622c0c2eebfd04f7
Reviewed-on: https://code.wireshark.org/review/2775
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-02 17:35:52 +00:00
Evan Huus a3bac6d0ce kafka: fully dissect offset request/response messages
Change-Id: I641a3dbece6f822144f6740dde6801b1be202db5
Reviewed-on: https://code.wireshark.org/review/2777
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-02 17:29:55 +00:00
Joerg Mayer 0041f36093 Make the flag testing logic for linker flags work like the compiler flag testing.
Change-Id: I2478417cbcd395247215f149978c5f0c874c9b3a
Reviewed-on: https://code.wireshark.org/review/2779
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-07-02 15:57:09 +00:00
Balint Reczey 65e3f5c25e Allow overriding C/C++ flags from CMake command line
Append user's flags to our flags instead of prepending them to make
user flags higher priority.

Change-Id: I3ead33ee5fa06a2395d9197a027306ef99a704a2
Reviewed-on: https://code.wireshark.org/review/2722
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-07-02 13:53:26 +00:00
Evan Huus 956c440786 RSVP checksum is not required if integrity object is present
Bug: 10219
Change-Id: I2da62ee184327b2bc42a264e1782db927460f5cf
Reviewed-on: https://code.wireshark.org/review/2773
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-02 06:31:58 +00:00
Tim Furlong 09839e3a6a Update WSDG win32/win64 quick start guide to include dependencies and
instructions for building QtShark; note alternate cygwin package for
'patch' utility; update example setup script to add Qt bin directory to PATH,
and extract out paths as variables.

Change-Id: Id404b8757dbfd0dc1119b89e01bbe2fa139e2b38
Reviewed-on: https://code.wireshark.org/review/2751
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-02 06:08:39 +00:00
Jakub Zawadzki af7528999f Optimize sip dissector: avoid calling tvb_get_string_enc()
Fetch header value, only when we need to parse it.

Change-Id: I3c170ef8ab03985c8111a1b84ac1afc87bc8b5ca
Reviewed-on: https://code.wireshark.org/review/2767
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-02 06:07:44 +00:00
Tim Furlong f737381896 Add a note to Doc/docbook-xml42 requirement in docbook/README.txt indicating
that a later version may be required; e.g. my a2x (from cygwin64) generates a
developer-guide.xml that needs docbook-xml45.

Change-Id: Iea9d4b45e32157a9317e3fcf6794668e3a810c54
Reviewed-on: https://code.wireshark.org/review/2750
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-02 01:21:24 +00:00
Guy Harris 98d8dec61f See if this forces version.h to be built.
(It's not being built by the Ubuntu buildboth when it's building the
Debian package.)

Change-Id: Id7866e13ce72cdda4bb7d5cf0362ba7295ff766b
Reviewed-on: https://code.wireshark.org/review/2772
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-02 01:02:21 +00:00
Guy Harris 096aca67de Make some inconsistent configuration options errors.
This way, if you ask for both setuid and setcap installation of dumpcap,
it will fail, rather than silently (other than a message you might miss)
ignoring the request for setuid installation.  See bug 10246.

Also:

	if you ask for setuid or setcap installation of dumpcap, but
	dumpcap isn't built, it'll let you know that there's nothing to
	make setuid/setcap, and fail;

	if you ask for setcap installation of dumpcap, but setcap wasn't
	found, it'll let you know that it can't install it setcap, and
	fail;

so that it won't silently (other than a message you might miss) ignore
those requests, either.

Change-Id: Ibc01593e59fd1cd1be8c68d8cdacbfdca863efa0
Reviewed-on: https://code.wireshark.org/review/2771
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-02 00:48:28 +00:00
Guy Harris 4cdfc5c014 AUTHORS-SHORT is build in ${CMAKE_BINARY_DIR}, not ${CMAKE_SOURCE_DIR}.
Make the dependencies list indicate that.

Change-Id: I88416e1239130b7661bbd9deccfb289e0b0fd627
Reviewed-on: https://code.wireshark.org/review/2770
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-02 00:35:16 +00:00
Guy Harris ae26b12f3e If -fvisibility=hidden isn't supported, try -xldscope=hidden.
That's the option for newer versions of Sun^WOracle C.

Change-Id: I62c12d5870d84587f81a8789732675021523e9ed
Reviewed-on: https://code.wireshark.org/review/2769
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-02 00:20:46 +00:00
Evan Huus ab1e6f30d2 Bump (again) the amount of work we do for wmem's timing test
Apparently the new win8 vm has a *very* low-resolution timer, and the allocators
are indistinguishable at the previous amount of work.

Change-Id: If4e5bb8f85b1f0d39658f54001c88f42ffddfc47
Reviewed-on: https://code.wireshark.org/review/2768
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 23:48:41 +00:00
Guy Harris 22ea889ee4 For Sun C with linker scoping specifiers, define WS_DLL_PUBLIC_DEF.
This may let us, at least for those compilers, make the default "hidden"
with -xldscope=hidden.

Change-Id: I94e10733c2aba0ff8d77a8bf4f1dc8ecc8b2a47f
Reviewed-on: https://code.wireshark.org/review/2766
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 23:04:05 +00:00
Jeff Morriss a4a624e4c5 Get rid of rpath when we're building RPMs.
Fedora prohibits it, we don't need it, and it gets in the way some times.

Change-Id: I92cee959f471866ff90efe9f96e4fa519c357dd9
Reviewed-on: https://code.wireshark.org/review/2763
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-07-01 22:31:30 +00:00
Jeff Morriss 5f682f1f03 Fix buildroot.
Change-Id: I902db6c69ae5966da1102e4fbcfd9f46867c0b4f
Reviewed-on: https://code.wireshark.org/review/2762
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-07-01 22:30:28 +00:00
Malcolm Walters 2a306f4b05 Fix for Bug 10240.
Include padding length in calculation of correct attribute length

Change-Id: I569c6a9e1be39e3bb997e797a094b80cdcba6b07
Reviewed-on: https://code.wireshark.org/review/2747
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-01 20:49:30 +00:00
Guy Harris a73199e31a Use G_GNUC_PRINTF() for simple_message_box().
We don't need to do the right __attribute__ magic ourselves; GLib does
it for us.

Change-Id: Id31943a8413f0272237be4f868659b5bd5e70626
Reviewed-on: https://code.wireshark.org/review/2758
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 20:39:51 +00:00
Jakub Zawadzki 852d5dac9c Remove executable bit, from not executable files.
Change-Id: I36b303b9c2bf4d6bb717261cdbf39ea16532fe06
Reviewed-on: https://code.wireshark.org/review/2757
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-01 20:37:09 +00:00
Guy Harris e696d0f93d Fix the checks for the Cygwin path.
I.e., do

	if we have 32-bit Cygwin
		CYGWIN_PATH=path to it
	else if we have 64-bit Cygwin
		CYGWIN_PATH=path to it
	else
		fail
	endif

rather than

	CYGWIN_PATH=standard path for 32-bit Cygwin
	if we don't have 32-bit cygwin and we do have 64-bit Cygwin
		CYGWIN_PATH=path to 64-bit cygwin
	else
		fail
	endif

as the latter will fail if we *do* have 32-bit Cygwin.

Change-Id: I42d607a1319263edcc1d6e546b813862b7d33ffa
Reviewed-on: https://code.wireshark.org/review/2756
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 20:19:03 +00:00
Guy Harris aa0f80981a Don't check for -Wl,{option} support.
Not all AC_WIRESHARK_LDFLAGS_CHECK flags are -Wl,{option} flags, so
don't check for that first.  If we want to check for specific compilers
and linkers, we should do that, not for -Wl,{option} support.

Change-Id: Ib9581d4a1573a1ffa2493ce08e6d5845d2601352
Reviewed-on: https://code.wireshark.org/review/2755
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 19:47:07 +00:00
Guy Harris b378f72545 Fix comments to reflect reality.
Change-Id: Id56f5844932371a89785f4ddce87eb66789acdc8
Reviewed-on: https://code.wireshark.org/review/2754
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 19:27:01 +00:00
Guy Harris 27d320112e Pick up stuff from GLib to hide symbols with Sun C.
Note why we don't use G_GNUC_INTERNAL, but duplicate what GLib does, and
don't use G_HAVE_GNUC_VISIBILITY to determine whether we can use
__attribute__ ((visibility (...))).

Change-Id: I0b8d40f40d04e821352522320626173806787214
Reviewed-on: https://code.wireshark.org/review/2753
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 19:21:39 +00:00
Tim Furlong 2211813e21 Add logic to config.nmake to find 64-bit cygwin, and a note warning
about forward slashes in the QT5_BASE_PATH if the recommended qmake
command is used; both of these issues will cause annoyingly non-
obvious errors.

Change-Id: I6f9a662969d1fc1887e75e8b0fde3520bbbea416
Reviewed-on: https://code.wireshark.org/review/2749
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 19:18:29 +00:00
Graham Bloice e1e7dd0cfd Fix the QT build on Qt 5.3 or later to use the windeployqt tool
to copy the rquired Qt files into the runtime directory

Qt 5.2 is broken as windeployqt doesn't take the required --release flag

Also fix the passing of GCC_DLL and GPGERROR_DLL into config.pri so
that the Qt build copies the required files instead of the entire
gnutls bin dir twice (the variables expanded to nothing).

Add support for autodetection of Qt 5.3.0 with msvc2013

Change-Id: I1e9c70a5ff5d1fdfdce88ba15d324f1899c8129c
Reviewed-on: https://code.wireshark.org/review/2734
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 19:16:52 +00:00
Balint Reczey b5e266feda Keep VS Code Analysis happy
Change-Id: I4ef92f715d7a0a1449f1b509ce7ed59651cd1a6a
Reviewed-on: https://code.wireshark.org/review/2745
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 14:24:35 +00:00
Graham Bloice bd79dae438 Remove debugging info from protocol tree for frame
Change-Id: Id7f02087e536964bfa6d01a3646c20035a3ab6cb
Reviewed-on: https://code.wireshark.org/review/2746
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 12:44:31 +00:00
Balint Reczey 147db828d5 Log2() and exp2() are missing on Windows
Change-Id: I8a970f9030fafd8fdcb4e2a24620033ec8005da7
Reviewed-on: https://code.wireshark.org/review/2744
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2014-07-01 10:33:36 +00:00
Guy Harris 0cf54e7827 Drop privileges even earlier.
Do it at the same point at which Wireshark does so.  Do some other
things in the same order as well.

Change-Id: I2925366d49d14271ceffa1a938b5e3450337c772
Reviewed-on: https://code.wireshark.org/review/2743
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 10:11:49 +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 deeb1de24c Squelch some warnings.
Make some arguments and structure members gsize, as that's what stored
into them or passed to them.  (And move a newly-widened-on-LP64 item, to
avoid extra structure padding.)

Add a cast, which also appears necessary to squelch a warning.

Clean up indentation while we're at it.

Change-Id: I0cc92e7d2904c5af1f3f3d93f51b6ecb3aed464d
Reviewed-on: https://code.wireshark.org/review/2741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-01 10:03:20 +00:00
Balint Reczey f90bf8ae2a Increase space allocated for IO Graph slower after 1 million items
Change-Id: I691070b572e519f412a80db5d7415331f07e8e50
Reviewed-on: https://code.wireshark.org/review/2689
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2014-07-01 09:24:39 +00:00
Balint Reczey 524583298b GTK: Unlimited, dynamically allocated IO Graph
Bug: 8460
Change-Id: Id9aad3f5f69bee9e5a62601ecac28a6a7019e623
Reviewed-on: https://code.wireshark.org/review/2672
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2014-07-01 09:24:05 +00:00
Joerg Mayer eb239946c6 Generate version.h before adding subdirs (especially wsutil). Otherwise
build could fail in wsutil because of missing version.h

Change-Id: If6fdf1080c6de9ca1581bcc126506e78ec03a1d8
Reviewed-on: https://code.wireshark.org/review/2740
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-07-01 06:22:29 +00:00
Evan Huus a452d16f2c Optimize epan_new/init_dissection
As Anders correctly pointed out in I7d8f84b2e, constantly resetting state will
turn init_dissection into a bit of a hot path. Especially as we will already
bear the overhead of switching files, we don't want to fall any further behind
than we have to.

This change includes three unrelated optimizations that reduce the cost of
init_dissection by about 40% as measured by callgrind:
 - only initialize ares/ADNS if that preference is enabled (this of course only
   applies if you specify -n to tshark or otherwise disable the preference)
 - use memcpy instead of a loop in sigcomp UDVM init
 - use memcpy instead of a loop in bootp dissector

The only remaining obvious hot spot in this path is reassembly_table_init since
it is called by so many dissectors. Suggestions (perhaps to get rid of the
GPtrArray) welcome.

Oh, and one other change to use g_strerror instead of strerror as insisted
upon by the API pre-commit hook.

Change-Id: I18a74f2b64b25498116079bd4e7fc2b335c7703a
Reviewed-on: https://code.wireshark.org/review/2738
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:21:14 +00:00
Jakub Zawadzki 659d0efc92 sip optimization: avoid calling tvb_get_guint8.
Use tvb_pbrk_guint8, tvb_find_guint8 when possible.

Change-Id: If8090d9b9b92146e9c216f139c056130d6b04e78
Reviewed-on: https://code.wireshark.org/review/2569
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:15:02 +00:00
Joerg Mayer 94e6bbeb3b Put each option on a line of its own.
Change-Id: Ibec60300306e8af7ee230080b113111f93d850dc
Reviewed-on: https://code.wireshark.org/review/2739
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-07-01 02:24:32 +00:00
Balint Reczey 4e9e043a6a Init session id to avoid warning using GCC 4.9
Change-Id: I2091f7eb86c64fd086f44a7cf15e7c5483f9b44c
Reviewed-on: https://code.wireshark.org/review/2716
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 02:05:41 +00:00
Balint Reczey c12f269076 Fix access to uninitialised value
Change-Id: I4c8a15fce631051edd39e7d29c8f0a5e00fcde26
Reviewed-on: https://code.wireshark.org/review/2724
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 02:05:18 +00:00
Balint Reczey 9a676acbd2 Fix access to uninitialised values
Change-Id: Id3592fed0cca5133d493f26d3b8ce27a3cf8505c
Reviewed-on: https://code.wireshark.org/review/2723
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-01 02:04:51 +00:00
Guy Harris bb6f5eae95 Reflect the move of filters.c to libui.
Change-Id: Ic1099927e3fb63c020c622e0a92e99a376908f4e
Reviewed-on: https://code.wireshark.org/review/2737
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 23:20:29 +00:00
Guy Harris efafca71a3 Drop privileges very early on.
TShark relies on dumpcap to capture packets, and TFShark doesn't even do
packet capturing (it dissects files, not network traffic), so neither of
them need, or should run with, special privileges.  If you *must* run
with special privileges in order to capture, grant those privileges to
dumpcap, which has a *lot* fewer lines of code than libwireshark and
TShark/TFShark.

Change-Id: I8f8fedead355ca163895e025df37240d2f232ba4
Reviewed-on: https://code.wireshark.org/review/2736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 23:12:32 +00:00
Guy Harris ac88f71220 Clean up a comment.
SetProcessDEPPolicy() is the API; PSetProcessDEPPolicy is just a local
pointer variable that either points to that API's implementation (if
it's available) or is null (if it isn't).

Change-Id: I676fbb75019e32af511cefa6f1c7b7124ac9d8e8
Reviewed-on: https://code.wireshark.org/review/2735
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 23:03:22 +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