Commit Graph

58613 Commits

Author SHA1 Message Date
Roland Knall acc581081e Plugin Interface: Add GUI callbacks
Rename ext_menubar to a more appropriate plugin_if.

 External menus can be implemented by plugins to present
 additional menus for deep-packet analysis. One side-effect
 of such menus being implemented as plugins is, that they
 are being executed in different threads and therefore can
 only use limited access to the main GUI. Also, there is
 no safe cross-gui (GTK and Qt) way for many features.

 This patch implements a first functionality, by which a
 plugin implemented using ext_menubar can apply a display
 filter to the main view.

 For now the implementation supports filtering, as well as
 saving a preference.

Change-Id: Iffe4caa954bbeb8ce356352de4dae348a50efba9
Reviewed-on: https://code.wireshark.org/review/8773
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 16:23:08 +00:00
Pascal Quantin d4aa1a1c24 Qt: mark unused parameters as such
Change-Id: Ib53d6da0d6660cf2c6a3283ff6123a2f18a8abda
Reviewed-on: https://code.wireshark.org/review/9128
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25 16:13:34 +00:00
Pascal Quantin e963cbf08c editcap: keep timestamp resolution when converting a nseclibpcap file to pcapng
As reported on https://ask.wireshark.org/questions/43483/why-does-editcap-write-out-nseclibpcap-correctly-with-nanosecond-timestamps-but-not-with-pcapng

Change-Id: I81ec6dd6bdc6008297141ca8e210f4fb989cd3d6
Reviewed-on: https://code.wireshark.org/review/9111
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 16:07:24 +00:00
Martin Kaiser cb84022296 Qt: fix crashes when Wireshark is closed while running a capture
if we haven't captured any packets yet, don't display a warning about
unsaved changes

make sure that we're not running into a scenario where
MainWindow::testCaptureFileClose() tries to close the capture file at
the same time as the pipe handler who sees an eof on the pipe

cf_has_unsaved_data() should return false if we have a temporary file
that contains no packets

Change-Id: I18d75bd658b85d45dd3313d49e2cd654c6300de5
Reviewed-on: https://code.wireshark.org/review/9109
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 15:55:36 +00:00
Jeff Morriss 1810112f2d Add minimize and maximize buttons to the TCP stream dialogs.
The first thing I generally do when I open a graph is to maximize it.
Having a maximize button makes that a lot easier. Call QDialog(NULL,
Qt::Window) similar to g80342e4.

Call QDialog(NULL) in the about box.

Change-Id: I4f229ab579d0912cb03ba8f8d0300d933d0ba914
Reviewed-on: https://code.wireshark.org/review/7072
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25 15:51:29 +00:00
Alexis La Goutte 7e62a03830 fix the 'then' statement is equivalent to the 'else' statement found by PVS Studio (V523)
Change-Id: I016e69f43bad98eb0604852ea658adaa5fe77c12
Reviewed-on: https://code.wireshark.org/review/8786
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 15:40:54 +00:00
Peter Wu 3f5d183a44 Stop using atof/strtod (fixes column sorting of float types)
atof is locale-dependent. In locales such as Swedish, German and Dutch,
the dot is a thousand separator, resulting in wrong conversions for
floats.

While at it, make the mate dissector also be independent of locale.
Blacklist atof in checkAPIs. Lemon is still using strtod, but that is
not our problem for now.

Bug: 11297
Bug: 8964
Change-Id: I6fe3e45eb1d6d95d41aa4f3af1f81a6204a60c63
Reviewed-on: https://code.wireshark.org/review/9116
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 15:38:45 +00:00
Martin Kaiser fe6ece9689 afp: replace all calls to THROW() and do proper error handling
Change-Id: Ie471a67a978aeb54727d03f93b98e3e422441a58
Reviewed-on: https://code.wireshark.org/review/9119
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-25 15:32:49 +00:00
Evan Huus 47abcfc747 Vagrant setup fixes
- add license headers to the scripts
- don't mount `.` into the VM manually, vagrant already puts it in /vagrant/
  for us, just use that.
- build with -j3, slightly more efficient even with two cores

Change-Id: I43580ade7ae2635696072b39e4f18a401a030a85
Reviewed-on: https://code.wireshark.org/review/9127
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-25 15:24:06 +00:00
Alexis La Goutte 92c8c3a3bd TCP: Add expert info to indicate when there is TCP Fast Open SYN (with Cookie)
Coming after Jasper talk #Sharkfest15 about TCP stuff

Change-Id: I2b01bc6dfe24e28454101da59720d2c74603b88f
Reviewed-on: https://code.wireshark.org/review/9120
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-25 15:21:49 +00:00
Alexis La Goutte c37b05d8ab ARUBA (ERM): Add type 5
it using PeekRemote-Ng (with Header version = 2)

Change-Id: I601cb7ecfaf01e51ec696502d10918f869486d01
Reviewed-on: https://code.wireshark.org/review/9126
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25 15:13:21 +00:00
Alexis La Goutte 85d39893e0 Aruba (ERM): Add missing type 4 (PPI) to Decode AS
Change-Id: If2cb75fc9992bec2d699c5abace06dccc8bfb4ae
Reviewed-on: https://code.wireshark.org/review/9125
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-25 15:12:59 +00:00
Joerg Mayer 0a28aa4a1d Revert commit cc8ed845ed
Author: Maarten Bezemer <maarten.bezemer@gmail.com>
Date:   Wed Nov 12 13:39:07 2014 +0100

    Invoke asn2wrs.py using a custom command

Fixes  bugid 11304

Once there is a better solution feel free to revert the revert.

Change-Id: Id64b621c5f3b8a934ce9ec5c3c127326efab46f2
Reviewed-on: https://code.wireshark.org/review/9122
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-06-25 07:40:05 +00:00
Martin Mathieson ba5e0a3262 Netflow: fix typo (wrong time units for duration)
Bug: 11295
Change-Id: Id732dd77609bc453e81703595882b20f68742618
Reviewed-on: https://code.wireshark.org/review/9121
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-25 06:27:18 +00:00
Evan Huus 5aaaa550fd Add basic Vagrant configuration
For non-linux developers this should somewhat simplify development with e.g.
valgrind and other useful tools.

Change-Id: I973ab7412ad9a61f0892c25c079ea3424208abd1
Reviewed-on: https://code.wireshark.org/review/9117
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-25 02:53:40 +00:00
Pascal Quantin d1a81df8c0 NAS EPS: fix a missed capital letter
Change-Id: I937b832807e7fb5af69d0f3238011b41f9223f12
Reviewed-on: https://code.wireshark.org/review/9118
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25 02:36:12 +00:00
Pascal Quantin 6126a64550 Fix proto_tree_add_bytes_item() when we fail to decode number from string
We still need to insert an empty g_byte_array

Bug: 11309
Change-Id: Idf2ed8ea81b3f612ef8d6ae1aed158108dcc4356
Reviewed-on: https://code.wireshark.org/review/9114
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25 01:46:13 +00:00
Martin Kaiser 585f944f65 acse: don't THROW() an exception from a dissector
we already have an expert info, we can simply exit

Change-Id: I8adbfb084991195152a02bbef64c38c5aa9e841e
Reviewed-on: https://code.wireshark.org/review/9113
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-25 01:02:24 +00:00
Pascal Quantin cdc7d25004 Add ability to export PDUs for heuristic dissectors also
Change-Id: I1bf1aa9794f9b4f106edffd4986fc0b1014522fa
Reviewed-on: https://code.wireshark.org/review/9099
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25 00:10:13 +00:00
Evan Huus f5b09f2c8a print blank strings in -Tfields
I'm not 100% sure if this is really a good idea in all cases, but at least some
people want it.

Bug: 10906
Change-Id: I26e69a683781cdc6ba1cfcd6a41458bbca7ca2c0
Reviewed-on: https://code.wireshark.org/review/9108
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 23:14:37 +00:00
Michael Mann cf8eed97cb Dissect 802.3 Jumbo frames while capturing.
Following the code Olivier Montanuy's code suggestion from bug 5390.

Bug: 5390
Change-Id: Ie7425a76fd65fc9d50474c010b4a5beb1b3cf73e
Reviewed-on: https://code.wireshark.org/review/7588
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 22:33:17 +00:00
Alexis La Goutte f75e52ba71 file.c: fix Fix Branch condition evaluates to a garbage value found by Clang Analyzer
Change-Id: Ib7c9e114973f78775cf17889b6aeab217cb6d0ef
Reviewed-on: https://code.wireshark.org/review/9101
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 22:21:00 +00:00
Evan Huus 89cc85b5ef Disable "Refresh Interfaces" when capturing
It breaks restarts, and doesn't do anything useful at this point anyways.

Bug: 11176
Change-Id: I6a010becf851fea8690b445874b29b54546fb2e3
Reviewed-on: https://code.wireshark.org/review/9106
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 21:43:13 +00:00
Evan Huus 0d28caf880 qt: fix more button states
As in gcc614a9 we have to manually uncheck buttons if we decide not to action
them.

Change-Id: Ia5dc29a292bc6d75a1e8753da06a053cafa66866
Reviewed-on: https://code.wireshark.org/review/9107
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 21:42:35 +00:00
Evan Huus cc614a93d8 qt: fix button state when cancelling save
If the user decides not to capture after all, by hitting cancel when prompted
for their unsaved changes, we have to manually uncheck the button again because
Qt helpfully checks it for us.

Bug: 11145
Change-Id: I362d72787ddb138d382a899d091698c6652eebb2
Reviewed-on: https://code.wireshark.org/review/9102
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 21:26:39 +00:00
Pascal Quantin 1f0226cce9 dumpcap: fix files capture autostop condition
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-06-24 21:24:41 +00:00
Evan Huus ec094b5cc1 Initialize default stats before using them
Quick hack fix for bug 11275.

The longer fix I am still thinking about, but it goes something like this: we
have a terribly confusing dependency graph in ordering our various preferences,
so it's fragile and needs refactoring.

1. We must call epan_init before we read the preferences files, since dissectors
register many preferences.
2. We must call pre_init_prefs before we call prefs_register_modules, since that
inits the default values of the "global" preferences structure. `init_prefs()`
handles this normally.
3. We must call epan_init before we call init_prefs since init_prefs depends on
UATs being initialized (which is something epan_init does).
4. We must call prefs_register_modules before we call epan_init since that
generates the `protocols` subtree which is needed for registering
dissector-specific preferences.

The above graph has a cycle, which I *think* can be solved by splitting
prefs_register_modules?

Bug: 11275
Change-Id: I08dae6a7ade178896e0de5e5091f7eeaca95846f
Reviewed-on: https://code.wireshark.org/review/9098
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 19:48:09 +00:00
Gerald Combs 137c495352 Run compress-pngs.sh.
Change-Id: If662cfbe6ad2ce80916d32750476e95f607fe902
Reviewed-on: https://code.wireshark.org/review/9100
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-24 19:26:46 +00:00
Joerg Mayer 58b03547f1 Add a bunch of " I missed in my previous patch.
Change-Id: Ia94034bdb2148bca641b7c9bc6ec3f900c7574d3
Reviewed-on: https://code.wireshark.org/review/9097
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-06-24 17:47:14 +00:00
Evan Huus 95ac3908d8 Remove the last deprecated tvb_length calls
And remove the shims themselves!

Change-Id: I511c06eb21eaf68d1dc36bbb9558408807472f9c
Reviewed-on: https://code.wireshark.org/review/9088
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 17:32:40 +00:00
Alexis La Goutte 86e562f27d Qt: Add x-capture-file-reload@2x.svg to Makefile.am
Change-Id: I497290eff821167a31468a10af23ab762eff32fe
Reviewed-on: https://code.wireshark.org/review/9095
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-24 17:17:35 +00:00
Guy Harris d406b28ebb Don't export libnghttp2 routines outside libwireshark.
Hopefully this will fix build issues that popped up on Windows, as well
as making the library a bit cleaner.

Change-Id: I5b5266af4b41e10aba32abdb46bfe811ab11b45d
Reviewed-on: https://code.wireshark.org/review/9087
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-24 17:13:09 +00:00
Alexis La Goutte 17c59f5090 Qt: Add Reload button on MainToolBar
Add @2x versions of x-capture-file-reload as well.

Change-Id: I08819cf66903884e0344a4f9bcd891befb582e90
Reviewed-on: https://code.wireshark.org/review/9066
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-24 17:10:01 +00:00
Evan Huus 5dcd207cc6 Check _MSC_VER is defined before we use it
Otherwise it breaks a bunch of stuff on Linux machines because of the way gcc's
preprocessor works (buildbot decryption tests, extcap, etc).

Originally added in Ic5360089f96be620fbe99ba4e819e0caa5ca0215

Change-Id: Iad43fa1415aa331ae375771adac0818ea1b99060
Reviewed-on: https://code.wireshark.org/review/9091
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 15:34:18 +00:00
Alexis La Goutte b7aacfdd46 libnghttp2: readd remove check for CONFIG.H
i hope will be fixed Windows 32 buildbot

Change-Id: Ie4429193d354ff70b4802fa8a734cb35a69c090c
Reviewed-on: https://code.wireshark.org/review/9090
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-24 15:31:07 +00:00
Evan Huus 69cdfe9410 Remove another batch of deprecated tvb_length calls
Change-Id: Icfdde38e40cca05d0705a081153a4ea3e8782ee7
Reviewed-on: https://code.wireshark.org/review/9086
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 04:30:35 +00:00
Alexis La Goutte d0faa9adf8 HTTP2: Update to libnghttp2 1.0.4
Change-Id: Ia92d183b7e7b5a604d75eee13b64b827ad0af903
Reviewed-on: https://code.wireshark.org/review/9054
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 03:27:49 +00:00
Joerg Mayer ae92a8347e Update build instructions for cmake near the end a bit
Change-Id: I7d5b8ab3479cc4268b6cc5ae7822066a69b740dc
Reviewed-on: https://code.wireshark.org/review/9085
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-06-24 02:31:15 +00:00
Guy Harris 14252551b2 Handle downloading and installing CMake 3.x.
Change-Id: I2347e3e36008fee006e9f66997d45b562eacc7dc
Reviewed-on: https://code.wireshark.org/review/9084
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-24 02:09:35 +00:00
Evan Huus 9b5b7c1a90 Remove deprecated tvb_length calls
Trust that the files in epan/ immediately (not dissectors) know what they're
doing so just blindly convert them to captured length.

Change-Id: I872f7d58b2e15ae82c75fd56f4873996fbc97be7
Reviewed-on: https://code.wireshark.org/review/9083
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 00:31:25 +00:00
Guy Harris 893e1e516a Fill in the 802.11 pseudo-header and call the "802.11+radio" dissector.
Do with the Prism and AVS headers what we do with the radiotap, PPI,
etc. headers.

Change-Id: I4b2522a2b294f53f22c363cd43604c4af0304fc2
Reviewed-on: https://code.wireshark.org/review/9082
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-24 00:25:39 +00:00
Evan Huus f92fab41a5 Remove a bunch more deprecated tvb_length calls
(getting really close!)

Change-Id: Ibf22a5f727c4dc0070b78144a4b0ab8e0c5e1bce
Reviewed-on: https://code.wireshark.org/review/9081
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 00:22:50 +00:00
Guy Harris ad784bc7ce Put the frequency/channel and RSSI data into columns.
Change-Id: I039e727aff46c08b93908a216608e196ed4bd662
Reviewed-on: https://code.wireshark.org/review/9080
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-24 00:21:51 +00:00
Guy Harris a8acb53e36 Pass the signal and noise dBm values to the 802.11 radio dissector.
Change-Id: Ia3fa6ba0b1d16315c77895f3e8ae96ed7e5e1e02
Reviewed-on: https://code.wireshark.org/review/9079
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-24 00:19:18 +00:00
Robert Cragie fa6ebae939 Improved prefix display and comments for IID copying
Change-Id: I58f56dd5cfc212e53bd7e9d575d2cf9b4b4f2b27
Reviewed-on: https://code.wireshark.org/review/8886
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 00:13:05 +00:00
Peter Wu 93592e4af7 openwire: remove useless register_init_routine call
Change-Id: Ifc638e92d4b148a2efeb6c488ab4dc2a57a054e7
Reviewed-on: https://code.wireshark.org/review/9076
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-23 22:48:11 +00:00
Evan Huus 0a9a2554a4 Remove more deprecated tvb_length calls
Change-Id: Ie137e6f4e20fe26b1a4d9510e267896219c1c631
Reviewed-on: https://code.wireshark.org/review/9075
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-23 22:17:56 +00:00
Martin Mathieson d4f6480253 ISAKMP: fix Cisco fragmentation support.
Last flag wasn't mapping to 'more fragments' properly, and reassembly
should only be attempted on the last frame.

Bug: 7940
Change-Id: I565f2b72b6eb68dc32e0f57a43a098a8f203a800
Reviewed-on: https://code.wireshark.org/review/9073
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-23 21:32:25 +00:00
Martin Kaiser e53337accf replace another bunch of deprecated tvb_length calls
Change-Id: Ib7c50b55942220d48de025642154b4bf3f39c8a2
Reviewed-on: https://code.wireshark.org/review/9074
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-23 21:04:41 +00:00
Martin Mathieson 99ab5c9d38 netflow: cope with multiple duration types in one flow.
Bug: 11295
Change-Id: I71493e13989dbc29e3e3e7d518d3b6686fbec01a
Reviewed-on: https://code.wireshark.org/review/9063
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-06-23 20:44:19 +00:00