Commit Graph

55131 Commits

Author SHA1 Message Date
Daniel Mack ed0b19b94b Make boolean bitmask type 64-bit wide
There are protocols out there that have 64-bit wide bit mask fields, so
make the internal representation and bitfield decoders 64-bit aware.

For this, the ws_ctz() fallback and bits_count_ones() have to be tweaked
slightly.

Change-Id: I19237b954a69c9e6c55864f281993c1e8731a233
Reviewed-on: https://code.wireshark.org/review/4158
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-12 14:15:12 +00:00
Matthieu Patou 29afac24a5 Add support for NTTIME_hyper and NTTIME_1sec
It's hyper with 8 bytes alignment it can have 1/100000 sec resolution or 1sec resolution

Bug: 10541
Change-Id: Iecc4c6d1bd1695a4c02db72e1617134254810cd9
Reviewed-on: https://code.wireshark.org/review/4606
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-12 14:08:44 +00:00
Guy Harris b3490c20ce Use the wtap_read_bytes{_or_eof}() routines.
Change-Id: I4f707bc714b2643d0f6c568f3367e712ee635d8e
Reviewed-on: https://code.wireshark.org/review/4612
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-11 23:07:41 +00:00
Stig Bjørlykke eb72d2a160 Use variable name 'len' when handling length.
Change-Id: Icb1d81316d1ead3455c68ad55e52b8120b7dccf9
Reviewed-on: https://code.wireshark.org/review/4609
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-11 20:41:58 +00:00
Guy Harris 8eefa4d9f9 Use the count-of-records fields to figure out how many records to read.
Fetch the count of records from one of the locations where it appears to
be, and, currently, require that it be equal to the count at the other
location where it appears to be; if they ever differ, we'll need the
file in order to reverse-engineer some more.

Fix the way we *write* .rf5 files - it turns out that we were

	1) not writing the full file size;

	2) not writing the packet count in the right location.

Detect files written by the old code, and get the packet count from the
right location for those files.

Change-Id: I7ce83afbc9dbbd300c81c96ef8f7785a0aeefa7a
Reviewed-on: https://code.wireshark.org/review/4608
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-11 20:11:58 +00:00
Matthieu Patou e331083812 Add dissection of MIDL_NDRHEADERBLOB used in drsuapi and some other protocols
Bug: 10540
Change-Id: If4a8603a7cb62894cc46094056dd5313039884b2
Reviewed-on: https://code.wireshark.org/review/4604
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-11 04:04:36 +00:00
Gerald Combs 81f9976b06 CMake: Don't add Custom.make to the bundle.
Change-Id: I08f2701e4450f34aa9d840cc5f507e9348e115bd
Reviewed-on: https://code.wireshark.org/review/4605
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-11 00:27:06 +00:00
Michael Mann 6e42a72923 Dissection of sid28 needs null check.
Bug: 10542
Change-Id: I8fcfbbd96833af2c57754a4c8f96cf702972e22a
Reviewed-on: https://code.wireshark.org/review/4603
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 23:24:18 +00:00
Gerald Combs 5c5bf3b370 Update READMEs to reflect recent CMake environment changes.
Change-Id: Idbf879f20448eea0b69e793271439dec877832e9
Reviewed-on: https://code.wireshark.org/review/4602
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-10 22:05:10 +00:00
Guy Harris ffa377b22f Use names more like the other names in open_info.
For open_info, use names based on the names in other lists.

Also, in comments, indicate what the three count 'em three tables are
used for, and clean up the type/subtype table.

Change-Id: I7a763119e790d5970f87dff05284f465eebfb7e7
Reviewed-on: https://code.wireshark.org/review/4599
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 20:20:29 +00:00
cbontje d330cd4ecb DNP3 Protocol Bugfix / Enhancement
- Fix for Single-bit Objects offset-pointer
- Enhancement for Obj 12 Var 2 (Pattern Control Block) and Var 3 (Pattern Mask) Decoding

Bug: 10558
Change-Id: I8d3f6cee4acbab09d0b93dab6b868cddd842b682
Reviewed-on: https://code.wireshark.org/review/4597
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 20:19:08 +00:00
Anish Bhatt f7588eaec2 [ELMI] Add missing information elements, add support for sub-information elements.
Bug 10532

Updated with Bandwidth Profile support

Change-Id: I0f31eb6c78a5e34bcb1c286a9a10730b3b63481c
Reviewed-on: https://code.wireshark.org/review/4571
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: Michael Mann <mmann78@netscape.net>
2014-10-10 19:29:14 +00:00
Michael Mann a168c44fc0 Remove (almost all) proto_tree_add_text calls in ISUP dissector.
Change-Id: I57a01eacaa02e45c23bb4827ae982c897fb308ee
Reviewed-on: https://code.wireshark.org/review/4592
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>
2014-10-10 19:14:14 +00:00
Pascal Quantin a1933022f2 NCP: switch to wmem memory and ensure that all fields are initialized
Change-Id: Ia17e189baed05d8020654e6702a51f51bd384f26
Reviewed-on: https://code.wireshark.org/review/4589
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 19:02:36 +00:00
Guy Harris 685d3034d5 Version 3 has only absolute timestamps; don't set nsg_creltime.
Version 3's time stamps are all absolute, so we can directly use the
value in the file; we don't need to keep track of the time in the
private data structure, and some compilers issue warnings due to setting
it and then not using the value to which we set it.

Change some names and indentation to match other file versions while
we're at it.

Change-Id: I97698d933b87a8ad58d9e88ceedd75004797df69
Reviewed-on: https://code.wireshark.org/review/4596
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 18:41:00 +00:00
Pascal Quantin 6463d2a7e6 GSM MAP: fix detection of SMS direction when application context version is < 3
Bug: 10547
Change-Id: I4708fd9977e635c66ef1350ce5098520e4c2ce1e
Reviewed-on: https://code.wireshark.org/review/4579
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 18:26:49 +00:00
Gerald Combs 98d77e2b15 CMake: Bundle the "share" directory files and directories.
Work around a CMake bug using file globbing.

Change-Id: I67dc8268154e05834e5d4e7d8f22c6eb25b24c1f
Reviewed-on: https://code.wireshark.org/review/4595
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-10 16:48:36 +00:00
Bill Meier 23e78cd6bd Add editor modelines; Adjust whitespace as needed.
Change-Id: I3dc57f4c2ca57585103e3b71503ac4c332903e50
Reviewed-on: https://code.wireshark.org/review/4594
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-10 14:50:08 +00:00
AndersBroman bdbc8e3a79 GTPv2: Presence-Reporting-Area-Elements-List do full dissection of ECGI
and TAI.

Change-Id: I95d9ebf1d6f4eabe30b557fdc937d56006f8b123
Reviewed-on: https://code.wireshark.org/review/4593
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-10 13:45:27 +00:00
Guy Harris 7e49f06190 wtap_file_read_till_separator() can return values other than 1 on success.
It returns the length of the string it read, so only treat 0 and -1 as
errors.  (0 either means "EOF" or "string is zero length", but this is
only in the code that reads numbers, and a number needs at least 1
digit, so both EOF and "zero-length string" mean "this isn't a valid
Peek tagged file".)

Change-Id: Ib83eb2f1e53d912a2138be01480e2b464cf936db
Reviewed-on: https://code.wireshark.org/review/4591
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 10:22:29 +00:00
Guy Harris f5b06c5630 Fix some more int-to-enum conversion complaint.
While we're at it, log a message if a Lua file format module lacks a
read or a seek-read routine, rather than completely silently ignoring
that module if it claims a file.

Change-Id: I9778f7835922439e2d3708614689280ef7b61d33
Reviewed-on: https://code.wireshark.org/review/4590
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 08:14:38 +00:00
Gerald Combs 3a4cab751e CMake: Bundle our libraries.
Change-Id: I5df4d794602f7e53c2f4f496597f8eaf7c7b6eaa
Reviewed-on: https://code.wireshark.org/review/4588
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-10 01:45:55 +00:00
Gerald Combs 33d20c64dc Add back a value_string conversion lost in g58cc452.
I don't have a capture to check but this appears to be correct.

Change-Id: I93405d1e3ec4aac3761d06e257db3ec2e32b2fc2
Reviewed-on: https://code.wireshark.org/review/4587
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-10 01:40:16 +00:00
Guy Harris 45f2afc696 Oops, missed one.
Change-Id: I0847846d50d6979f0f50a00438a834c7c7c2acc0
Reviewed-on: https://code.wireshark.org/review/4586
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 01:30:40 +00:00
Guy Harris 4f4e01b36b Don't treat int return values as valid wtap_open_return_val values.
They happen to be, at least now, but that's not valid in C++, and it's
probably unwise in any case.

Change-Id: Ifd49920cfaa376e5e7788329ee83db3956a7cdff
Reviewed-on: https://code.wireshark.org/review/4585
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 01:14:37 +00:00
Guy Harris 9754192f9b Cast size_t to to gulong as the length argument to g_snprintf().
Sadly, the GTK+ folks decided not to use size_t for the size argument,
so it doesn't do the right thing on LLP64 platforms such as Windows.

Change-Id: I2aa9096215c488b48f1cf68d2a285a48abb6f07f
Reviewed-on: https://code.wireshark.org/review/4584
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 01:09:29 +00:00
Guy Harris 5947291294 Fix declared types of open routines.
Change-Id: Ifa38dfec31ec5b03f00d6e077902184a9ae2ee0e
Reviewed-on: https://code.wireshark.org/review/4583
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 01:04:43 +00:00
Gerald Combs bea24cfdad CMake: Bundle our plugins.
plugins/*/CMakeLists.txt has a lot of repitition. We might want to
create a module or include file to simplify things.

Change-Id: Iadd453c286a4127beacd80edf6dc200aa9148852
Reviewed-on: https://code.wireshark.org/review/4582
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-09 23:57:43 +00:00
Guy Harris 45e462985d Use an enum for the open-routine return value, as per Evan Huus's suggestion.
Clean up some things we ran across while making those changes.

Change-Id: Ic0d8943d36e6e120d7af0a6148fad98015d1e83e
Reviewed-on: https://code.wireshark.org/review/4581
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-09 23:45:30 +00:00
Pascal Quantin 112c90a04b Kerberos: fix decryption of DCERPC with Kerberos encryption
Bug: 10538
Change-Id: I4e6feaf218da7f977f6c63d8bc204635f387672c
Reviewed-on: https://code.wireshark.org/review/4566
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 21:45:18 +00:00
Pascal Quantin 7690afbc54 Kerberos: remove debug logs when loading a keytab
Bug: 10543
Change-Id: I9ea20cd4d046cc072c21fd3f87f6d6be40b08b27
Reviewed-on: https://code.wireshark.org/review/4567
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 20:57:56 +00:00
Pascal Quantin 40e6d764c5 GTPv2: fix an infinite loop
Bug: 10548
Change-Id: I916e15cecf0ec9dc607362b902709567d69243df
Reviewed-on: https://code.wireshark.org/review/4578
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 20:34:16 +00:00
Gerald Combs e00ac05cf3 CMake: Build an application bundle (Wireshark.app) on OS X.
Add an ENABLE_APPLICATION_BUNDLE option which is enabled by default on
OS X and disabled elsewhere. The bundle is currently bare-bones and only
contains the main executables, Info.plist, and application icon.

Capitalize the main application name when ENABLE_APPLICATION_BUNDLE is
set and on Windows.

Start updating CPackConfig.txt for OS X packaging.

To do:

  - Add supporting libraries and frameworks.

  - Make the bundle standalone. I.e. call FIXUP_BUNDLE or
    replicate the relevant parts of osx-app.sh

Change-Id: I4e25abd3b8cbe121ec8615b98706a15c58812cdb
Reviewed-on: https://code.wireshark.org/review/4577
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-09 20:07:48 +00:00
Michael Mann 58cc452d6f Eliminate proto_tree_add_text from packet-lmp.c
Also "refactored" a few fields into proto_tree_add_bitmask calls.

Change-Id: I3a222b38e1992943d6ee4bd300026bc28c5bbb78
Reviewed-on: https://code.wireshark.org/review/4575
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-09 19:47:38 +00:00
Sean O. Stalley 608207fcf6 Add Dissection of MA packets over UDP
Change-Id: Ic6e1cbb623f3e84b73ce7e4608f291baadc77bf6
Reviewed-on: https://code.wireshark.org/review/4576
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 19:41:19 +00:00
Michael Mann 39b281461d Eliminate proto_tree_add_text from packet-nbns.c
Some other cleanup while in the neighborhood.  Not sure the all the proto_tree_add_expert calls are needed after each field (having implicit bounds error thrown should be sufficient), but left them in there.

Change-Id: I3ca75ec9f51ccbed6b6ca792789daa8e7cebf34a
Reviewed-on: https://code.wireshark.org/review/4574
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-09 17:13:39 +00:00
Anish Bhatt 1c51075376 [BACnet][trivial] change strings as per Bug 9640
Change-Id: I542b5a96bcff6c779359b80ddce513524852272c
Reviewed-on: https://code.wireshark.org/review/4572
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-09 07:49:55 +00:00
Stig Bjørlykke 4edda1b2ce Lua: Improved TreeItem:add documentation.
The protofield is optional and can not be replaced with 'nil'
as with the other fields for this function.

Change-Id: I2b1dd7f290264394b400cea2110b65b657c71456
Reviewed-on: https://code.wireshark.org/review/4549
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-09 05:42:13 +00:00
Guy Harris e7e2f9c639 Make the OPEN_INFO_ values members of an enum.
Change-Id: I93dbd14f81492764bf5854ee40eebcd1e04f3e01
Reviewed-on: https://code.wireshark.org/review/4570
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-09 00:27:32 +00:00
Gerald Combs 3ee8efdfea Be less lazy about disabling a Visual C++ warning.
As Graham pointed out, "#pragma warning(disable..." affects the rest
of the file. Add a push+pop so that we only operate on the line in
question. Ideally we'd be able to use "suppress" but an "#endif"
prevents that.

Change-Id: Ia01d6c245879f1c845dc68c18caea2cbceb273ef
Reviewed-on: https://code.wireshark.org/review/4569
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-08 22:50:17 +00:00
Guy Harris d1ec1e85f8 Use WTAP_ERR_DECOMPRESS for decompression errors.
Distringuish "the compression data has a problem" from "the capture file
(not compressed, or after decompression) data has a problem", with
WTAP_ERR_DECOMPRESS used for the former (whether it's the gzipping
decoded by our gunzip code or the Sniffer compression) and
WTAP_ERR_BAD_FILE used for the latter.

Change-Id: I8e6bff7edb480deba00c52a9e5afff607492e085
Reviewed-on: https://code.wireshark.org/review/4568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 22:49:08 +00:00
Tomasz Moń 0066776f72 Fix --extcap-dlts call in extcap_example.py.
There is regular expression that extracts only the number from
--extcap-interface argument and only that number (as string) is being
passed to extcap_dlts().

Change-Id: I5159f9405a766c1edff792213b2aef72b9a29ba4
Reviewed-on: https://code.wireshark.org/review/4550
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-08 21:32:40 +00:00
Guy Harris c83169f343 Only set err_info on an error, and use g_strdup_printf().
If the goal is to look like a libwiretap routine, we only need to set
*err_info on an error, and we should set it to a g_mallocated string (or
NULL).

Handle WTAP_ERR_UNSUPPORTED while we're at it - we never return it, but
we never return WTAP_ERR_UNSUPPORTED_ENCAP, either, but we handle it.

Change-Id: I9d93c43278d22f0fa77ec1cf7f29b476c8dd0dd0
Reviewed-on: https://code.wireshark.org/review/4565
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 21:13:17 +00:00
Guy Harris dbf8024eeb No need to set *err_info if there's no error.
Change-Id: I98ae9ec50e079d48b6247bb208528b7c5ad16027
Reviewed-on: https://code.wireshark.org/review/4564
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 21:05:05 +00:00
Guy Harris a307ed66cc Robopatch and remove #MISSING comments.
Change-Id: I611882a8b268046665488381be64aca89cdf3194
Reviewed-on: https://code.wireshark.org/review/4563
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 20:54:40 +00:00
Guy Harris 21e844bd82 Use WTAP_ERR_BAD_FILE for malformed compressed data in DOS Sniffer files.
Get rid of WTAP_ERR_UNC_TRUNCATED and WTAP_ERR_UNC_BAD_OFFSET, and lump
them under WTAP_ERR_BAD_FILE, with an error string; they're just another
form of "this file isn't a valid file of the type in question".

Change-Id: I0e9ac7c2ee66c8d789234a301c1dc2173aef1312
Reviewed-on: https://code.wireshark.org/review/4562
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 20:50:42 +00:00
Gerald Combs c303a2ebf5 Make sure we don't dereference a null pointer.
Change-Id: I033c60cdc5b78f4db31903277c659661e0dc5123
Reviewed-on: https://code.wireshark.org/review/4561
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-08 20:46:20 +00:00
Guy Harris ea5587a090 Fix a comment.
Change-Id: I0ebaa1b99bc9c7e51be10f3f8825280782f26190
Reviewed-on: https://code.wireshark.org/review/4560
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 20:25:19 +00:00
Stig Bjørlykke 23286b7b14 ANSI 683: Removed unused assignments.
Change-Id: I952ce5329f69fa947e39b020a70a06f2bbf8a014
Reviewed-on: https://code.wireshark.org/review/4558
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-08 20:12:37 +00:00
Guy Harris 97e462d116 "long" does not necessary mean "64-bit". Use G_GINT64_MODIFIER.
Change-Id: I2521bf368ea30ac691af50c760a63b81efedeeae
Reviewed-on: https://code.wireshark.org/review/4559
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 20:10:07 +00:00