Commit Graph

59186 Commits

Author SHA1 Message Date
Guy Harris 6cc1c8d98b Clean up heuristic checks.
Fix heuristic checks to handle sliced packets correctly.  "Correctly"
means "fail the heuristic", as the heuristic checks every single byte of
the putative Ixia trailer, as one thing it does is check the checksum,
which is in the last 2 bytes of the trailer and checks everything before
it.  So just return 0 if the full trailer isn't part of the captured
data.

Try to handle being handed a tvbuff that contains an FCS by looking at
the putative "magic number" locations where it would be if the tvbuff
didn't include the FCS and, if that doesn't match, where it would be if
it *did* include the FCS.  If the former doesn't match but the latter
does, assume that means it does include the FCS, and do all other
processing under that assumption.

Clean up some comments.

Fix an hf_ variable name to match the field name, and put the tvbuff
value fields in the order of their types.

Don't fail if the field length is 0 - it's a value length, so it could
in theory be 0.  Rely on the length checks for individual types to catch
problems.

Change-Id: Idc834aa6637cfbbafd6499060a007e720378154e
Reviewed-on: https://code.wireshark.org/review/10024
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-14 03:06:11 +00:00
Guy Harris 3c5fd58a58 Get rid of trailing whitespace.
Change-Id: I035fad79dd8d01aa3121732f2a9b07d20cc4384f
Reviewed-on: https://code.wireshark.org/review/10023
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-13 23:36:35 +00:00
Guy Harris 814f6173fe Update to reflect reality.
The Ixia trailer is a variable-length sequence of TLVs followed by some
fixed-length fields.  Describe it as such.

Realign some #defines while we're at it.

Change-Id: I5fc45a1d44978f1dc1f13e7098c3f797838db7b3
Reviewed-on: https://code.wireshark.org/review/10022
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-13 23:33:33 +00:00
Ionut Ceausu 5931da979e ixiatrailer: Change format of the protocol so that is supports future fields.
Protocol is TLV protocol and with this change I add one more field to it.
It is entire backward compatible.
Format is as follow:
  Fields	Trailer Length	0xAF12(Signature)	Trailer Checksum

The fields portion of the trailer is a series of 2-byte fields followed by variable
length data. The first byte indicates the field type, the 2nd byte indicates the
field length.   The values supported are listed below:
	1	Reserved (Original Packet Size)
	3	Timestamp (From Local Timebase)
	4	Timestamp (From NTP source)
	5	Timestamp (From GPS)
	6	Timestamp (From 1588)
	7	Timestamp (From Holdover)

Change-Id: I0a3b31cfbc5b6273e1f5326d9841e449735967fe
Reviewed-on: https://code.wireshark.org/review/9854
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-08-13 20:50:08 +00:00
Bill Meier 66f784a89f [config.nmake] Add minor comment about /Zo option for MSVC-2015
Change-Id: Ia4ffc543965160aaf6c39dc19764e62e9e82faa8
Reviewed-on: https://code.wireshark.org/review/10020
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-13 16:05:44 +00:00
Dario Lombardo cd76cf6df8 ieee802.11: changed blurb to stop checkAPI complains.
Change-Id: I9ec74a7af229a1af3ca946acc5af94ede1913c29
Reviewed-on: https://code.wireshark.org/review/10016
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-13 16:02:38 +00:00
Pascal Quantin 7661bb2540 Qt: fix copy of newer files when building with qmake
Change-Id: I8ea5e2770a0c5be3d981d986fa96fe30445db167
Reviewed-on: https://code.wireshark.org/review/10018
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-13 15:59:39 +00:00
Pascal Quantin 2d5f2ae108 GVCP: fix dissection of Stream Channel Packet Size register
Bug: 11442
Change-Id: I1c187bdf7ffd14b2a4f66d29883a4b112486bd35
Reviewed-on: https://code.wireshark.org/review/10014
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-13 15:57:47 +00:00
Anders 738cf424d6 Make building with MSVC2015 work
TODO:

- LUA is commented out probably needs to be built with MSVC 2015.
- GeoIP is commented out, causes packet-ip* to not build.
- Qt not built, needs Qt with MSVC 2015

Change-Id: I1658077931b89b9a22ee32e5ed7de38e07fb6a55
Reviewed-on: https://code.wireshark.org/review/8683
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-08-13 12:03:53 +00:00
Dario Lombardo 6087f2a260 fuzz-test.sh: added missing option in help.
Change-Id: I7651e18ec6e8338cddc82be90257c5f183804c7c
Reviewed-on: https://code.wireshark.org/review/10011
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-13 11:24:08 +00:00
Michael Mann beb5c0b765 Eliminate proto_tree_add_text from some dissectors.
Change-Id: I1e6bf52fad1b1fffefc174a557ff836f400e8fd7
Reviewed-on: https://code.wireshark.org/review/9996
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>
2015-08-13 04:19:48 +00:00
Gerald Combs 61d1ea4172 Initialize another variable.
Change-Id: Ie53a16dc482a9c38538077f6d6a2717cfaddbaa4
Reviewed-on: https://code.wireshark.org/review/10010
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 22:20:19 +00:00
Dario Lombardo 0b7d1611d0 editcap: add change offset.
This option skips some bytes when fuzzing, that prevents some headers from being changed. This focuses fuzzer to a smaller part of the packet.

Change-Id: I1db83235e93f2774a9991e3af70f633487b816fa
Reviewed-on: https://code.wireshark.org/review/9982
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-08-12 21:23:30 +00:00
Gerald Combs 99e3244324 Initialize a couple of variables.
Change-Id: I10471b770356ad46a10740198156055e1480eeb3
Reviewed-on: https://code.wireshark.org/review/10008
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 21:13:24 +00:00
Alexis La Goutte db2692c44c Qt (main_window) fix no previous prototype for '...' [-Wmissing-prototypes]
Change-Id: I43901d37817f9b79d508336253e766d740939e70
Reviewed-on: https://code.wireshark.org/review/10003
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-08-12 21:04:30 +00:00
Alexis La Goutte 2449c7ad77 GTP: fix indent (use 4 spaces)
Change-Id: I2f0645adee2aff32122a8ccb60843e1bfd0897e1
Reviewed-on: https://code.wireshark.org/review/10004
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-12 21:03:35 +00:00
Bill Meier 451dd051cd [lwres] Fix (32 bit ?) MSVC-2015 warning: "conversion from 'size_t' to 'guint16', possible loss of data"
Change-Id: Ifc71d1c2afc3ff16f950f2f1c3c9e7142d62fc16
Reviewed-on: https://code.wireshark.org/review/10007
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-12 20:53:00 +00:00
Bill Meier d20f2b6422 [pdc] Fix a few [msvc-2015?] warnings about 'constant compared to constant'
Essentially: Do the version checks at compile time using
             #if statements (even though the compiler
             probably optimized out the run time checks).

Change-Id: I4879b39729ba5bd6b1c478ac43c107cb9fb445b3
Reviewed-on: https://code.wireshark.org/review/10006
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-12 20:52:24 +00:00
Bill Meier 6ae8df4a43 [pdc] [msvc-2015] Change a variable type to prevent 32-bit MSVC-2015 "internal error"
[...]\packet-pdc.c(205) : fatal error C1001: An internal error has occurred in the compiler.

(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
 Help menu, or open the Technical Support help file for more information

INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information

Change-Id: I505898d0c76244a56d75af1a1c5bf30554dd9a2b
Reviewed-on: https://code.wireshark.org/review/10005
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-12 20:51:19 +00:00
Gerald Combs 5c80f08648 Add DCE-RPC and ONC-RPC service response time dialogs.
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC
service response time statistics. Try to make it as lightweight as
possible, since we might want to pull this into the RPC dissectors
similar to the other SRT statistics.

Allow program names on the command line in place of numbers or UUIDs. Make
matches case-insensitive. E.g. the following are equivalent:

    -z rpc,srt,100003,3
    -z rpc,srt,nfs,3
    -z rpc,srt,NFS,3

as are the following:

    -z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56
    -z dcerpc,srt,nspi,56
    -z dcerpc,srt,NSPI,56

Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4
Reviewed-on: https://code.wireshark.org/review/9981
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 20:17:35 +00:00
Gerald Combs 412f5b3716 Expert information dialog performance improvements.
Inserting QTreeWidgetItems individually is slow. This isn't a problem if
you only have a few items but the Expert Information dialog can have
thousands. Add "packet" tree items in groups, which should be much
faster. Note that we still add "group" tree items individually since
that gives us a nice progress indicator.

While we're here, make sure we show the dialog before tapping packets.

Bug: 11439
Change-Id: I8a182f4158d078cae5f42b8d1355414197f423e1
Reviewed-on: https://code.wireshark.org/review/10000
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 19:27:34 +00:00
Stig Bjørlykke bde416afcc Lua: Moved deregister out of wslua_cleanup
Change-Id: Ia43aa0e5f09400ef9923288b362256094a1241b8
Reviewed-on: https://code.wireshark.org/review/9998
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-12 13:23:07 +00:00
Stig Bjørlykke 5a926946f4 Initialize is_reloading_lua at startup
Change-Id: I211e0f4b86cff1c311d4ae67cbb47de14846144f
Reviewed-on: https://code.wireshark.org/review/9997
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-12 12:52:16 +00:00
Stig Bjørlykke dc7443fcc9 Added guards for deregistered fields
This is functions used when redissecting after a Lua plugins reload.

Change-Id: Ida14526faec1992006938a6732ee894ac83c2d12
Reviewed-on: https://code.wireshark.org/review/9995
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-12 12:09:43 +00:00
AndersBroman a3e3d60310 Align comments
Change-Id: Iab59ba51700b018337552018c76e30dcbd41f3f6
Reviewed-on: https://code.wireshark.org/review/9993
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-12 11:27:38 +00:00
AndersBroman cd16301b36 [GTP] Direct Tunnel Flags 7.7.81 is currently specified with one data
octet.

Change-Id: Iab7917b23e6be03f63a92ef0aaf0814c9cbea2c3
Reviewed-on: https://code.wireshark.org/review/9992
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-12 08:16:41 +00:00
Michael Mann bfdc2cb7a3 Eliminate proto_tree_add_text from some dissectors.
Change-Id: I7a7778802c442b254626a7676cb74ca2855fa65e
Reviewed-on: https://code.wireshark.org/review/9977
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>
2015-08-12 08:14:12 +00:00
Guy Harris 50b51a66f7 Some further questions, asked in comments.
Change-Id: I41c7918b7396934c651fb957d3b61db0c7a19527
Reviewed-on: https://code.wireshark.org/review/9990
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-12 05:42:56 +00:00
Guy Harris 260ae6a71e Clean up the file header description.
Change-Id: I4928f99cdc2b8fc2a3aef648b613ce0b93ed3563
Reviewed-on: https://code.wireshark.org/review/9989
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-12 02:01:03 +00:00
Guy Harris 1100ba9ac7 Update comments.
Change-Id: I4b0b4bb31901208e09a535ef922e134116309531
Reviewed-on: https://code.wireshark.org/review/9988
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-12 01:38:34 +00:00
Guy Harris 36c50fe462 Document Colasoft Capsa file support.
Change-Id: I89374413f3e08e2a35923b8bd4c128b3c659158a
Reviewed-on: https://code.wireshark.org/review/9987
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-12 01:32:49 +00:00
Guy Harris 7b39eacf66 It looks as if the origin of the time stamps is the UN*X epoch.
If we assume that, the time stamps of the sample captures on the
Colasoft site are in the range 2000-2014, and the HTTP time stamps in
the HTTP capture from there are close to the packet time stamps.

Change-Id: Id0e29c03dc8ada40f1040b95f169b4f3a8954a0f
Reviewed-on: https://code.wireshark.org/review/9986
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-12 01:27:47 +00:00
Martin Kaiser 14c75250ab [Qt Expert Info dialogue] remove our tap listener when the dialogue is destroyed
if we don't do this, there'll be a dangling tap listener and we'll see a
crash when its reset method is called

this can be triggered by opening another expert info dialogue, this will
invoke cf_retap_packets() and reset_tap_listeners() which in turn calls
the reset method of each registered tap listener

Bug: 11432
Change-Id: I8fc13351666c875e1a3641f31bada8e80d167ab2
Reviewed-on: https://code.wireshark.org/review/9979
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-11 21:27:13 +00:00
Stig Bjørlykke f1a4db34b3 Lua: Remove unneeded call in wslua_cleanup
Change-Id: I0cda00001b40e5951d680d72dbc8043cbe8b9309
Reviewed-on: https://code.wireshark.org/review/9980
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 20:06:36 +00:00
Stig Bjørlykke 58ec64c36e wmem: Fix wmem_tree_remove_string
Always set is_removed when insert data in a node.

Change-Id: I8fb50932a369e3f4fe8a1f743462683fff705cc2
Reviewed-on: https://code.wireshark.org/review/9978
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 19:55:01 +00:00
Guy Harris 4309b964f5 Sort dump_open_table_base[] in the right order.
As the comment says, "Entries must be sorted by
WTAP_FILE_TYPE_SUBTYPE_xxx values in ascending order."  If they're not,
the file type to file type string routines don't give the right answer.

Change-Id: I06afe7bb98cb36c54ddc831113bb632598ab2eb0
Reviewed-on: https://code.wireshark.org/review/9975
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-11 19:16:48 +00:00
Alexis La Goutte de70d2a18a H225: fix indent (use 2 spaces) and add modelines info
Change-Id: Ibe4cf8d004c6c94f745e5c620100af9483fa6a31
Reviewed-on: https://code.wireshark.org/review/9934
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-11 16:33:38 +00:00
Stig Bjørlykke d6c6b0899d wmem: Mark removed strings with is_removed
This will allow integer value 0 again.

Change-Id: Ibfa4249ea8b887971d3b3214ad9e4d095d20d155
Reviewed-on: https://code.wireshark.org/review/9973
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 14:15:49 +00:00
Stig Bjørlykke ecc4f756bd Added Reload Lua plugins.
This is initial support for reloading Lua plugins without
restarting the application.

Still todo:
- Deregister FileHandlers
- Support deregister ProtoField with existing abbrev (same_name_hfinfo)
- Add a progress dialog when reloading many plugins
- Search for memory leakages in wslua functions

Change-Id: I48870d8741251705ca15ffe1068613fcb0cb18c1
Reviewed-on: https://code.wireshark.org/review/5028
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 12:09:07 +00:00
AndersBroman 70d06deb2e [SMCR] Minimum 4 bytes is required to perform the heuristic check.
Change-Id: I29426147cb1443af3c9cc9dc1b60beabe9a94277
Reviewed-on: https://code.wireshark.org/review/9972
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-11 11:54:47 +00:00
AndersBroman f23382434b [Diameter] Add expert info to subdissection of 3GPP AVP:s
Change-Id: Ic2ec0696f1f6b8bb918dd04aa898dccdb8b90ece
Reviewed-on: https://code.wireshark.org/review/9971
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-11 11:36:51 +00:00
AndersBroman 25796075a1 [ENEA LINX over TCP] Make the TCP port registration a preference defalted
to 0.

Change-Id: I837bf8ac9d5724dd485f0bc62f3fe32bedd3eb0e
Reviewed-on: https://code.wireshark.org/review/9970
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-11 11:10:04 +00:00
AndersBroman c262bf28bc [GIOP] A GIOP message can have size = 0 (CloseConnection)
Change-Id: I1feb6135c79191aa3ac7f36bbc969e6b36314107
Reviewed-on: https://code.wireshark.org/review/9969
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-11 09:16:13 +00:00
Martin Kaiser 56a9b53773 zbee-nwk-gp: fix a memory leak when keys are defined in the preferences
==5932== 33 (32 direct, 1 indirect) bytes in 1 blocks are definitely lost in loss record 2,124 of 4,121
==5932==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==5932==    by 0xA024F30: g_malloc (gmem.c:159)
==5932==    by 0xA03A9E5: g_memdup (gstrfuncs.c:384)
==5932==    by 0x70754D2: gp_init_zbee_security (packet-zbee-nwk-gp.c:1459)
==5932==    by 0xA03A78C: g_slist_foreach (gslist.c:840)
==5932==    by 0x67E867C: init_dissection (packet.c:249)
==5932==    by 0x67DC202: epan_new (epan.c:160)
==5932==    by 0x414B16: cf_open (tshark.c:2464)
==5932==    by 0x40CF8A: main (tshark.c:2169)

Change-Id: I7c0ce0717957525ca18eb4888ed3389debc89a49
Reviewed-on: https://code.wireshark.org/review/9967
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-11 04:09:44 +00:00
Martin Kaiser b1be6bce66 zigbee: remove some more if (tree) checks
Change-Id: I81b46ec7d9d919ff2779d1005063e9ef6c92e097
Reviewed-on: https://code.wireshark.org/review/9966
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-08-10 21:16:09 +00:00
Martin Kaiser 52a7b79db1 remove some unnecessary if (tree) checks
Change-Id: Ib0f4cc47ede7b840cba38ecad04bd17bb6bccd55
Reviewed-on: https://code.wireshark.org/review/9965
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-08-10 20:28:55 +00:00
AndersBroman 94bb2765e8 Try to fix the build bou by copying tha cast made in glib.
Change-Id: I6da06b8e6ae272b940ef4ee47ce6b253bf9f3699
Reviewed-on: https://code.wireshark.org/review/9961
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-10 11:21:00 +00:00
Pascal Quantin e1003ee753 editcap: fix -T <encapsulation type> option when output format is pcapng
Right now the output encapsulation type is ignored if the output (default) format is set to pcapng.

Change-Id: Ibffaaed5979bf63ed4e3fa3b1f859a82b401d80b
Reviewed-on: https://code.wireshark.org/review/9911
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-10 08:32:17 +00:00
Alexis La Goutte 7fb514fe4d GSM (a_common): fix indent (replace tab by 8 spaces)
Change-Id: Id1d6bfcb04ac75d767fe6f09454dc8235de7bc75
Reviewed-on: https://code.wireshark.org/review/9928
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-10 08:31:18 +00:00
AndersBroman 76d4b80b8e g_slist_free_full () does not exist until GLIB 2.28
Change-Id: I81df5b4dbe1916eca51cdb72199de7a90471bd07
Reviewed-on: https://code.wireshark.org/review/9960
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-10 08:28:39 +00:00