Commit Graph

77 Commits

Author SHA1 Message Date
Guy Harris b013d5c4d9 Initialize the dissection options along with the other command-line options.
Change-Id: I35ff8f36d12831d408666c3422444371a2ac0c25
Reviewed-on: https://code.wireshark.org/review/19391
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-23 03:33:41 +00:00
Guy Harris 5aacafba8e Handle -K, -n, -N, and -u in the common dissection option code.
Also update tfshark to use that code.

Change-Id: Ic03fb8ff48c8bfc460298d180b436e53f0076cbe
Reviewed-on: https://code.wireshark.org/review/18588
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>
2016-10-31 05:05:50 +00:00
Guy Harris 706c106634 Have the routine that handles dissection options not exit.
Have it return TRUE if the option is OK and FALSE if it isn't, and let
its caller exit as appropriate.

Also, rename it - it's not adding something to a collection, it's just
handling the option.

Change-Id: I41863cbb67b7c257d900d3011609891b9b4a7467
Reviewed-on: https://code.wireshark.org/review/18587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-31 00:37:42 +00:00
Guy Harris 03c6937e62 Have routines for parsing options that affect dissection.
Have them handle -d, -t, --disable-protocol, --disable-heuristic, and
--enable-heuristic for TShark and both flavors of Wireshark.

Change-Id: I612c276b1f9df8a2092202d23ab3d48be7857e85
Reviewed-on: https://code.wireshark.org/review/18583
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>
2016-10-30 22:57:16 +00:00
Guy Harris cd64e4ece2 Move --fullscreen out of LONGOPT_CAPTURE_COMMON.
It's not a capture option, so it doesn't belong there.

Change-Id: I8aa6719a5a8e90c734c7acfc01b1ba2818498de3
Reviewed-on: https://code.wireshark.org/review/18427
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-24 09:22:09 +00:00
Dario Lombardo af7fc8b7e4 Qt: add fullscreen feature.
The feature activates/deactivates fullscreen mode of Qt UI.
A new menu item has been added as well as a shortcut (F11 or Ctrl+Cmd+F)
according to browsers common shortcut.

Change-Id: I01906b494d0a13ce70d27c00ebbe03e6ec87cbd7
Reviewed-on: https://code.wireshark.org/review/18332
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-23 23:25:49 +00:00
Gerald Combs 37252634c4 UI: Free up the -m flag.
The -m (monospace font) flag was deprecated in 2.2. Go ahead and remove
it in 2.3 / 2.4.

Change-Id: I6b4911174675cedec979621c2776353314e73eb1
Reviewed-on: https://code.wireshark.org/review/18193
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-14 03:46:27 +00:00
Guy Harris 8629e60922 More signed vs. unsigned argument cleanups.
Use the get.*guint32 routines to get unsigned values.

Change-Id: I75e83b2d21bdf08c7c995e36e4deb3b1c6d6959d
Reviewed-on: https://code.wireshark.org/review/17651
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-11 20:49:05 +00:00
Gerald Combs 5cf7fcdf0f Qt+Gtk: Fix the -t command line flag.
Add the time format to commandline_param_info_t and apply it when we've
finished application initialization.

Bug: 12489
Change-Id: Ice626198a610567e945a8e53c0c1093797e8208e
Reviewed-on: https://code.wireshark.org/review/16232
Reviewed-by: Gerald Combs <gerald@wireshark.org>
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-07-01 02:10:22 +00:00
Guy Harris f0e676496d Global, not static.
Change-Id: I185a1786365f185f18f3ec492a8ef165d61595ed
Reviewed-on: https://code.wireshark.org/review/16185
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 02:58:46 +00:00
Guy Harris 3ebac2babb Have commandline_other_options() directly fill in the global structure.
Other code looks at the global structure, so there won't be other
structures; just fill in the global structure directly.

Change-Id: I4dc87b79168c5a7c9ab1f085aa2d78cc6d2c9019
Reviewed-on: https://code.wireshark.org/review/16184
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 02:55:38 +00:00
Guy Harris ac4ad2bd44 Don't set quit_after_cap if no pcap, as it's not present.
Change-Id: I871f75394ba66967d7d7be203bd9e235575458e1
Reviewed-on: https://code.wireshark.org/review/16183
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 01:56:57 +00:00
Guy Harris 5d019cfb13 Make quit_after_cap an item in commandline_param_info_t.
And make the commandline_info structure global, so all the places that
look at quit_after_cap can get at it.

Change-Id: I006329cf8842c655cca36f024570855d1b16e107
Reviewed-on: https://code.wireshark.org/review/16182
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 01:40:39 +00:00
Guy Harris 3f49e897f6 Pull quit_after_cap out of the global capture options.
Really, all the GUI-related options should be pulled out, so they're not
cluttering up dumpcap and tshark.

Change-Id: I0276dee2be48bae3498a819d8c0c2747fe1352e7
Reviewed-on: https://code.wireshark.org/review/16180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-28 00:21:53 +00:00
Guy Harris 72d9785cfc We need global_capture_opts if we have extcap, even without pcap.
Change-Id: I16b778064c1cd2bbf281fb5192bf35da252e99dd
Reviewed-on: https://code.wireshark.org/review/16179
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-27 23:49:39 +00:00
Gerald Combs bcae998048 Qt: Support the -j, -J, and -l command line flags
Add support for -j, -J, and -l. Mark the -m flag deprecated.

Bug: 12546
Change-Id: Ic44b3997840018e5d571aa1813a1646bce11d4a6
Reviewed-on: https://code.wireshark.org/review/16083
Reviewed-by: Gerald Combs <gerald@wireshark.org>
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-06-23 03:03:51 +00:00
Guy Harris 88b7a48bf5 Pull the options structure initialization into commandline_other_options().
Change-Id: I931cde27a81566dfa0ce6e5c9307bfc1a4d5fe54
Reviewed-on: https://code.wireshark.org/review/16033
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-20 07:00:07 +00:00
Guy Harris bea1950d07 Protect some code that's only for Wireshark-with-pcap.
Put that code inside #ifdef HAVE_LIBPCAP/#endif.

Change-Id: I85768fd49a008341a95ac3c8656e96afa6741fbe
Reviewed-on: https://code.wireshark.org/review/16030
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-20 00:42:57 +00:00
Guy Harris e79e834ecf Move some option checking to common code.
Change-Id: Icff9dacd73ea933c59ed664db05098dd8cb3dbf5
Reviewed-on: https://code.wireshark.org/review/16029
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 23:37:08 +00:00
Guy Harris 234d8eacec Pass the info strings directly to commandline_early_options().
Just pass them directly as arguments, don't stuff them into a structure.

Change-Id: Iac84226f54898bc953011bca64795e9049762905
Reviewed-on: https://code.wireshark.org/review/16022
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 21:12:41 +00:00
Guy Harris 85c805d60e Handle capture options in pcap-less Wireshark in the commandline_ routines.
Get rid of the capture_option_specified and arg_error members of the
commandline_capture_param_info_t and commandline_param_info_t
structures, and have them be local variables in
commandline_early_options() and commandline_other_options().  Have
commandline_early_options() print the "sorry, Wireshark wasn't built
with pcap" and exit if -D was specified but Wireshark wasn't built with
pcap.

Change-Id: I0efcdea89d9585af8f3c0a28aee060f33d3ec5fd
Reviewed-on: https://code.wireshark.org/review/16021
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 20:21:30 +00:00
Guy Harris 0ca9fc11b0 Fix indentation.
Change-Id: I71332dc35047e7d8d32b428fb99b8b9368c41de6
Reviewed-on: https://code.wireshark.org/review/16020
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 20:00:23 +00:00
Guy Harris 42985f4f17 Those aren't capture options, they're the options we must process early.
The only one of those options that has anything to do with packet
capture is -i, and all we do there is check for an argument of "-"; the
rest are either

	1) options that affect your preference settings (-C to select
	   the profile, -P to set the personal file directory path);

	2) options that just print something to the standard output or
	   error and exit, before firing up the GUI;

	3) extension command line options (-X).

Change-Id: Iba9b8b14fe468e2ca9d4c67e1a9b8103603678d9
Reviewed-on: https://code.wireshark.org/review/16019
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 19:56:04 +00:00
Michael Mann 147b3d5149 Ability to invoke "Decode As..." as command-line argument for GUIshark.
TShark has had the functionality for awhile. While the GUI version
still has ways to change and persist Decode As functionality, adding
command line functionality gives the Decode As from initial launch
of the GUI.
Was also an excuse to refactor a bunch of code out of tshark.c

Bug: 5143
Change-Id: Ie67007d75e897bc06cc9afd9b84372a96b93778c
Reviewed-on: https://code.wireshark.org/review/16008
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-19 18:59:07 +00:00
Guy Harris 6febf9b740 Get rid of an unused variable; set a structure member.
There's no need for the capture_option_specified variable, but we *do*
need to initialize the capture_option_specified member of *param_info
before parsing the flags.

Change-Id: I89d0b8c338c2784742b21ba4e854f702ce491849
Reviewed-on: https://code.wireshark.org/review/16017
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 16:29:39 +00:00
Guy Harris f4fd1a3640 Fix problems when compiling without pcap.
Change-Id: Id682a76ac561f92f65638bbdfcd4236eb92e46b7
Reviewed-on: https://code.wireshark.org/review/16010
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 07:50:09 +00:00
Michael Mann 9b5b4443cf Refactor command-line handling of GUI options.
Both GTK and Qt both use the same command-line options, so refactor
the parsing and (possibly) applying of those arguments to a single
location.

Ping-Bug: 12546
Change-Id: Ib31e576c509c5d3d21c33d3247640d9f9c68661b
Reviewed-on: https://code.wireshark.org/review/16006
Reviewed-by: Michael Mann <mmann78@netscape.net>
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>
2016-06-19 05:56:45 +00:00