Commit Graph

87 Commits

Author SHA1 Message Date
Guy Harris 26bbee3fad Add some long options for capture short options.
The names match tcpdump trunk's names for the corresponding options.

Also have capture_opts.h provide a #define for the part of the short
option string that corresponds to the capture short options that all our
programs that take capture short options take (those are largely the
ones we have in common with tcpdump).

Change-Id: Ia209425959c801725850b56a7d63441ee99b5001
Reviewed-on: https://code.wireshark.org/review/2492
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 21:00:16 +00:00
Guy Harris 312ed10900 Add --help and --version long options.
Also, make the convention for long-only options be that their
case-statement values start at 128, so they avoid colliding with any
ASCII code points, including control characters.

Make the tables of long options "static const" while we're at it, and
get rid of unnecessary casts.

Change-Id: I55702a85e9bc078b1cd0f2803ebb68a710405bab
Reviewed-on: https://code.wireshark.org/review/2491
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 19:19:47 +00:00
Alexis La Goutte 2c00d66fb7 Use pre-scan command line parameters with double while(opt=getopt...)
Don't need launch "Qt" for some console only parameters (-h -v ...)

Based on GTK+ code

Change-Id: I1a810e394088959aefbbb39fb88836591a8b2367
Reviewed-on: https://code.wireshark.org/review/1311
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:41:30 +00:00
Gerald Combs 9803122c8e Ignore SIGPIPE on systems that have it.
According to the GTK+ docs, gtk_init calls "signal(SIGPIPE, SIG_IGN)" at
startup. Replicate that behavior here, otherwise we tend to terminate
unexpectedly.

Change-Id: Ia017402755d647e6050af40deacef6765eea8694
Reviewed-on: https://code.wireshark.org/review/1614
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Gerald Combs <gerald@wireshark.org>
2014-05-12 17:05:06 +00:00
Alexis La Goutte 5ab53e6079 Fix typo in comment (parameterts => parameter)
Change-Id: Ie1fefc27d249929f0f5108b0757768e7e23a9dbe
Reviewed-on: https://code.wireshark.org/review/1310
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 21:34:45 +00:00
Hadriel Kaplan 041f844d72 Add command-line arg for input file format for tshark/wireshark
Now that we have the ability to choose input file format type
in the GUI, we might as well have it in the command-line too.
Plus it would help me in test-stuies if we had a commandline.
So I've added a '-X read_format:Foo' for this.  Using just
'-X read_format:', or with a bad name, will make it print out
the full list (in tshark); just like the '-F' does for output
file formats.

Note: I am *not* putting in code for Win32 GUI,
because I can't compile that and I wouldn't have even
done the GTK one if I could compile Qt originally. (I don't think we need
to add any more features to GTK or Win32, just Qt from now on,
right?)

Change-Id: I2fe6481d186f63bd2303b9e591edf397a2e14b64
Reviewed-on: https://code.wireshark.org/review/493
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-05 18:38:05 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Michal Labedzki 579e7e19ce Wireshark: Add option to choose format type of capture file
The best heuristic can fail, so add possibility to manually choose
capture file format type, so not correctly recognize file format can be
loaded in Wireshark.

On the other side now it is possible to open capture file
as file format to be dissected.

Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a
Reviewed-on: https://code.wireshark.org/review/16
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:43:13 +00:00
Gerald Combs f966980937 Replace "svn" with "git" all over the place.
Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate.
Rename "svnversion.h" to "version.h" as Evan suggested. Update some
URLs. In make-version.pl, make sure we don't set an improper upstream
branch name. Use the number of commits + short hash from `git describe`
for package names by default.

Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96
Reviewed-on: https://code.wireshark.org/review/139
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-07 23:03:03 +00:00
Jörg Mayer 1df5d94c67 include config.h at the top of the file.
A used parameter was marked unused.

svn path=/trunk/; revision=54629
2014-01-07 21:09:03 +00:00
Alexis La Goutte bcacd60c1c Fix indent (use 4 spaces)
svn path=/trunk/; revision=54612
2014-01-05 18:40:07 +00:00
Guy Harris 125a17f8e5 Initialize the error-reporting routines before scanning for plugins, as
the code to scan for them uses those routines.

This means epan_init() no longer takes those routines as arguments -
which is just as well, given that the mechanism in question is no longer
part of libwireshark, but is part of libwsutil.

This should fix bug 9508.

svn path=/trunk/; revision=53796
2013-12-05 09:30:22 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Gerald Combs fd51955989 Tap listeners have to be registered before we read our prefs.
svn path=/trunk/; revision=53491
2013-11-21 20:24:01 +00:00
Gerald Combs ea28298e96 Add a statistics tree dialog.
Add menu items for each corresponding item in gtk/main_menubar.c that
calls gtk_stats_tree_cb(). Hopefully that's everything. Note that we use
quite a bit less code than the GTK+ flavor and why we might not want to
do that. Change a few things in ui/qt/CMakeLists.txt to more closely
match the GTK+ version. Add plumbing for tap registrations in
CMakeLists.txt and Makefile.am. Add the ability to copy text as CSV or
YAML.

svn path=/trunk/; revision=53464
2013-11-21 01:28:17 +00:00
Guy Harris 06098fce7b Add routines to set the personal file directory paths (personal
configuration file directory and directory in which to save captures),
have the routine to parse -P options use them, and move that routine to
libui.

Have that routine just return a gboolean.

svn path=/trunk/; revision=53435
2013-11-19 19:45:38 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Gerald Combs 60d6458150 Move the geometry shenanigans a bit further ahead in the startup
sequence. Fix some prefs logic.

svn path=/trunk/; revision=52991
2013-10-30 23:54:46 +00:00
Gerald Combs 9075922f42 Add initial support for geometry settings in the main window.
In the current Qt startup sequence the main window + splash screen is
displayed before the main preferences are loaded which means we can't
immediately apply the correct geometry. For now, use an animation to
morph from the default to the saved geometry after the prefs are loaded.

Get rid of main_do_quit() (Qt) and main_window_exit() (Qt+GTK). It looks
like they were unused.

Add wsApp->isInitialized() and use it to see if we should exit() when
the main window is closed. Otherwise we won't shut the application down
and clean up properly.

svn path=/trunk/; revision=52988
2013-10-30 22:39:52 +00:00
Gerald Combs ba49d9bcf0 Revert part of 52896 and (for now) all of 52935. As Jeff pointed out,
the PortableApps version relies on U3_-prefixed environment variables.

svn path=/trunk/; revision=52941
2013-10-29 04:05:27 +00:00
Gerald Combs 69741d086b Remove U3 code and packaging.
svn path=/trunk/; revision=52896
2013-10-27 17:15:39 +00:00
Jeff Morriss 3b1463d6b3 Clean up warnings when we don't HAVE_LIBPCAP.
svn path=/trunk/; revision=52680
2013-10-18 21:32:59 +00:00
Gerald Combs 1f2043d69c Solaris Studio C++ won't let us pass the address of main() to
init_progfile_dir(). Try using QCoreApplication::applicationFilePath()
instead.

svn path=/trunk/; revision=52559
2013-10-12 02:29:17 +00:00
Gerald Combs 564ca2d5e9 Try to fix Qt compilation when libpcap is disabled.
svn path=/trunk/; revision=52552
2013-10-11 21:26:26 +00:00
Gerald Combs a6f406ac5a Strip out references to PortAudio. Qt has its own audio module (Phonon).
We'll presumably use that.

svn path=/trunk/; revision=52282
2013-09-30 07:55:11 +00:00
Alexis La Goutte fef81954ab add qtshark /path/mycap.pcapng support (from GTK code...)
svn path=/trunk/; revision=51881
2013-09-09 19:30:10 +00:00
Alexis La Goutte 37260a4e09 Use the same variable name than GTK (cf_name)
svn path=/trunk/; revision=51880
2013-09-09 19:30:02 +00:00
Alexis La Goutte f99f7bf17e From Dean Lee via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8597 Qtshark: Chinese Simp translation
From me :
Add to the (new) Qtshark Language selector

svn path=/trunk/; revision=51871
2013-09-09 17:49:15 +00:00
Alexis La Goutte fe4407ebc7 Add Preference to change Language (in QtShark)
Need restart application to change language

svn path=/trunk/; revision=51869
2013-09-09 16:20:45 +00:00
Evan Huus a795048300 Correctly update the pane layout whenever the preferences are changed, you no
longer need to restart for that to take effect. Hopefully I got all the slot
ordering right.

svn path=/trunk/; revision=51720
2013-09-03 13:29:09 +00:00
Evan Huus 78529b2038 Separate window creation from the laying out of the list/tree/byte panes. This
more-or-less restores the correct splash behaviour on startup.

svn path=/trunk/; revision=51719
2013-09-03 12:53:32 +00:00
Evan Huus 785c1a5310 Respect the layout preference (just the horizontal/vertical splitting of the
panes, not yet which data goes in which pane).

You currently have to restart for the change to take effect. I also had to move
the preferences-reading (and thus the epan_init) call to before the main window
instantiation so that the preference was actually available for use. This means
that the progress-bar doesn't show up for very long any more, since most of the
work is already done by the time it appears.

I'm sure there is a way to delay just the layout setup until later, but I kept
getting slot errors I couldn't figure out...

svn path=/trunk/; revision=51647
2013-09-02 16:03:13 +00:00
Evan Huus ae176260e5 Add long-opts support to qtshark. Take -r or --read-file to open a capture file
immediately from the CLI. Get rid of the comment concerning multi-pass parsing
of the options, it only applied to the GTK version.

svn path=/trunk/; revision=51640
2013-09-02 14:15:23 +00:00
Evan Huus 72b18b1b8e Remove a bunch of commented code copied from the GTK version. We don't need it
(yet) and it is getting in the way while I try and add some argument parsing.
It's still in the GTK version if we want it.

svn path=/trunk/; revision=51639
2013-09-02 13:59:05 +00:00
Gerald Combs 74b205bc84 Set our connection capture filter in main() similar to the GTK+ version.
svn path=/trunk/; revision=51621
2013-08-31 16:53:24 +00:00
Jeff Morriss 0a669967fa Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
svn path=/trunk/; revision=50656
2013-07-16 02:35:33 +00:00
Jeff Morriss 56735f8c16 Move u3.{h,c} and g711.{h,c} into wsutil.
Project g711.h against multiple inclusion and add C++ compatibility wrapper.

svn path=/trunk/; revision=50654
2013-07-16 02:04:55 +00:00
Jeff Morriss 4dcc156cf3 Move the print modules into epan.
svn path=/trunk/; revision=50526
2013-07-12 03:50:50 +00:00
Jeff Morriss 16206348d9 Move disabled_protos.{h,c} into epan.
svn path=/trunk/; revision=50521
2013-07-12 01:40:06 +00:00
Luis Ontanon 24a5467228 Propagate the main_window_update change of few commits ago into the qt client
:wq



svn path=/trunk/; revision=50198
2013-06-27 19:24:39 +00:00
Guy Harris 1b7fc5422d And handle the no-libpcap case here as well.
svn path=/trunk/; revision=49508
2013-05-22 10:26:07 +00:00
Guy Harris fb7ae678e4 More capture_options -> capture_session changes.
svn path=/trunk/; revision=49499
2013-05-22 08:47:17 +00:00
Guy Harris dd3dcc7a01 And reflect the new capture_options structure here.
svn path=/trunk/; revision=49494
2013-05-22 07:45:11 +00:00
Guy Harris 8596d17d7f Pull the capture-session state information out of capture_opts and put
it into a separate capture_session structure.  capture_opts should
contain only user-specified option information (and stuff directly
derived from it, such as the "capturing from a pipe" flag).

svn path=/trunk/; revision=49493
2013-05-22 07:44:28 +00:00
Guy Harris 1ca63098ac Rename capture_opts_trim_iface() to
capture_opts_default_iface_if_necessary(), to reflect what it actually
does.

svn path=/trunk/; revision=49491
2013-05-22 04:49:31 +00:00
Guy Harris 39779a7bee Send the output of the -D and -L options to the standard output rather
than the standard error.

In Wireshark on Windows, create a console before doing so and destroy it
before exiting.  Don't do that in TShark or dumpcap, as those are
console-mode programs on Windows.

This should fix bug 8609 and still allow "wireshark -D" and "wireshark
-L" to work when the standard output isn't redirected.

svn path=/trunk/; revision=49025
2013-04-25 05:47:11 +00:00
Jeff Morriss c2ced4a2ab Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written to
that directory since 2001 and reading from that directory was only left in for
backwards compatibility with versions prior to r4702.  I think it's now safe
to remove that backwards compatibility.

This eliminates the last argument of get_persconffile_path().

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437

svn path=/trunk/; revision=48797
2013-04-09 02:48:03 +00:00
Gerald Combs dcb3a4a8a5 Add support for software updates. Remove qtshark.rc and use
image/wireshark.rc (which contains resources needed by WinSparkle)
instead.

svn path=/trunk/; revision=48147
2013-03-06 22:04:17 +00:00
Jeff Morriss 19214234ae Followup to r48081: use the DEFAULT_CAPTURE_BUFFER_SIZE macro from r47942.
svn path=/trunk/; revision=48085
2013-03-05 15:22:28 +00:00
Chris Maynard 2b93c3b31e Default capture buffer size is now 2MB. (See also r47920 and r47937)
svn path=/trunk/; revision=48081
2013-03-05 02:09:37 +00:00