Commit Graph

134 Commits

Author SHA1 Message Date
Guy Harris c7970d9356 Add, and use, "fetch signed value" for lengths < 40 bits.
Add 8-bit, 16-bit, 24-bit, and 32-bit "fetch signed value" routines, and
use them rather than casting the result of the 8/16/24/32-bit "fetch
unsigned value" routines to a signed type (which, BTW, isn't sufficient
for 24-bit values, so this appears to fix a bug
in epan/dissectors/packet-zbee-zcl.c).

Use numbers rather than sizeof()s in various tvb_get_ routines.

Change-Id: I0e48a57fac9f70fe42de815c3fa915f1592548bd
Reviewed-on: https://code.wireshark.org/review/26844
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-10 14:55:45 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Dario Lombardo fb8b28005f amqp: check return value of conversation_get_proto_data().
CID: 1325720.
CID: 1325721.

Change-Id: Ia781c70a3580fbd534b470664451e4838948dce4
Reviewed-on: https://code.wireshark.org/review/25045
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-29 01:34:29 +00:00
Helmut Buchsbaum 0c382106f8 dissector/amqp: fix TLS/SSL payload dissection
To enable TLS/SSL payload dissection for AMQPS traffic add the
AMQP handle as SSL dissector for the actual AMQPS port.

Thus we have successfully decrypted our AMQPS traffic using
a pre-master-key file.

Change-Id: I63dec2217fb5645007da010f651846834abacdbc
Reviewed-on: https://code.wireshark.org/review/24335
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-10 18:41:33 +00:00
Michael Mann 27c10ed72e AMQP: Add dissector table for versions so they can be dissected with Decode As
Bug: 14113
Change-Id: I73c4962597d8f8bab83f089c9821269e0b7b1568
Reviewed-on: https://code.wireshark.org/review/24109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Magnus Henoch <magnus.henoch@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 14:01:15 +00:00
Magnus Henoch 4c8dfe6f6e Autodetect more AMQP 0-9 captures
When an capture file containing AMQP 0-9 traffic is missing the
protocol header, and the first packet contains more than one AMQP
frame, we'd fail to detect the protocol version properly, since we'd
check for the frame size being equal to the PDU size.  Fix this case
by checking if the frame fits within the PDU instead.

While it's possible that 0-10 and 1.0 captures could be misdetected as
0-9, this seems highly unlikely.  See details in comment in
packet-amqp.c.

Bug: 14113
Change-Id: I98978ed3919be3daf7fe9a972b87e09f27ba20e3
Reviewed-on: https://code.wireshark.org/review/24108
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-27 21:34:30 +00:00
Pascal Quantin 2de483c092 AMQP: workaround some proto_tree_add_none_format() asserts
Previously proto_tree_add_none_format() could be called with any type
of field type, not FT_NONE only.

Change-Id: I78976a168fc1bf606b72ad38d284bb0bd1794b03
Ping-Bug: 13780
Reviewed-on: https://code.wireshark.org/review/22243
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-20 01:26:20 +00:00
Pascal Quantin 246cbbc2ea AMQP: fix a stack overflow when offset goes back and forth
Previous code assumed that list decoding was successful and that some
bytes were consumed. Let's explicitly check this.

Bug: 13780
Change-Id: I3546b093f309f2b8096f01bc9987ac5ad9e029eb
Reviewed-on: https://code.wireshark.org/review/22235
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
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>
2017-06-19 23:47:35 +00:00
Alexis La Goutte e767f42a24 AMQP: fix field amqp.value is not of type FT_NONE
Bug: 13435
Change-Id: Ib61404fc3a8c461593d2a8a60224463ef2b9c4b6
Reviewed-on: https://code.wireshark.org/review/20309
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>
2017-03-31 10:42:30 +00:00
Guy Harris 0369b504d3 Fix processing of AMQP 0-10 arrays, maps, and conneciton locales.
You can't call proto_tree_add_XXX routines on a proto_item * that hasn't
been given a subtree with proto_item_add_subtree().  Fix that.

The packet offset for a FT_UINT_STRING is a pointer to the first byte of
the *length*, not to the first byte *after* the length.

Properly pluralize "entry".

Change-Id: I7f2a55eaad850e3e52e62eb061e0444d176c593a
Reviewed-on: https://code.wireshark.org/review/20785
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-29 16:28:21 +00:00
Michael Mann f4b0abc729 Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves.  Saving the
handle then to avoid finding it later.
Not sure if this will increase unnecessary register_dissector functions
(instead of using create_dissector_handle in proto_reg_handoff function)
when other dissectors copy/paste, but it should make startup time
a few microseconds better.

Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43
Reviewed-on: https://code.wireshark.org/review/19481
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-12-31 07:31:42 +00:00
Michael Mann b86d72a0d1 Allow ampq messages to be bigger than 64k
Also fix a field type conflict noticed in provided capture

Bug: 13050
Change-Id: I3d2643299b6db2729641c72b2e1f054f170b4907
Reviewed-on: https://code.wireshark.org/review/18571
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: Roland Knall <rknall@gmail.com>
2016-10-30 08:47:20 +00:00
Michael Mann b5587379b7 Overhaul AMQP dissector
1. Remove AMQP_INCREMENT macro.  Bounds checking mostly handled already
by proto_tree_add_xxx and tvb_get_xxx.  Needed to add a few more
tvb_reported_length_remaining() calls for completeness.
2. Fill in some of the gaps of unaccounted for bytes.  Still have way
too many instances where bytes aren't claimed by a field.
3. Some small reordering of functions allowed for massive removal of
formal declarations.
4. Add amqp_0_10_get_32bit_size_new to add a field, check for size and
add expert info if size > 0xFFFF
5. Remove "hf_" from list type items as they are not real hf_ fields
and could cause confusion.  Also made items static.
6. Convert some FT_STRING and FT_BYTES fields to FT_UINT_STRING and
FT_UINT_BYTES.  Helps account for some "missing" bytes.

Change-Id: I7ed269221d294ce89feacc0642b2070681288172
Reviewed-on: https://code.wireshark.org/review/18423
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-24 18:27:18 +00:00
boris.bochkarev 812e5fd893 AMPQ: Fix malformed packed in session.expected and session.confirmed.
Bug: 13037
Change-Id: I935ff68050eb085789d9bd99b5ec833609c6fdca
Reviewed-on: https://code.wireshark.org/review/18336
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-22 20:56:08 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Pascal Quantin 22257e8cf5 p_XXX_proto_data: only allow the use of pinfo and file scopes
Those are the only ones meaningful. Let's convert the buggy dissectors
and add an assert to avoid the misuse of the pool parameter in the future

Change-Id: I65f470b757f163f11a25cd352ffe168d1f8a86d3
Reviewed-on: https://code.wireshark.org/review/17748
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-09-17 15:46:36 +00:00
Michael Mann 2ab4155794 tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.

Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27 15:20:06 +00:00
Alexis La Goutte ab82d4519f AMQP: Fix false positive
ERROR: NO ARRAY: epan/dissectors/packet-amqp.c, ei_amqp_amqp_1_0_frame_length_exceeds_65K

Missing a space after { (need fix check ?)

Change-Id: Idce3b270c53feb7fc12e8c82fb87932faa1e468d
Reviewed-on: https://code.wireshark.org/review/15728
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>
2016-06-05 10:04:09 +00:00
Michael Mann 6a847b7e01 Fix expert_info errors found by new and improved checkhfs.pl.
Change-Id: I30f1b92ee438361c3bd58743f7d1ae8d5ffc96f0
Reviewed-on: https://code.wireshark.org/review/15718
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-05 06:11:12 +00:00
Joerg Mayer 8f3ad91905 Fix some warnings/errors of type
git/epan/dissectors/packet-a21.c:478:25: error: 'item' was marked unused but was used
      [-Werror,-Wused-but-marked-unused]
        proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown"));
                               ^
Added manual change id because file-jpeg.c forced the use of commit -n

Change-Id: Iffff53d6253758c8454d9583f0a11f317c8390cb

Fix warnings/errors of type:
git/epan/dissectors/packet-ax25-kiss.c:205:52: error: 'pseudo_header' was marked unused but was
      used [-Werror,-Wused-but-marked-unused]
                        return capture_ax25( pd, l_offset, len, cpinfo, pseudo_header );

Fix checkhf warnings:
Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_address_netswitch
Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_address_subswitch
Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_poll_reply_trailer
Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_rdm_universe
Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_tod_data_universe

Change-Id: Id1fa12afb97a8e9cd4ed0ea25351c3b2639c930e
Reviewed-on: https://code.wireshark.org/review/14667
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 12:46:31 +00:00
Michael Mann 072f0856cb packet-amqp.c: Fix multiple fields with incompatible types
Change-Id: I68b7fa0b5d7fae86289807d7ef01a2141dcb8ff6
Reviewed-on: https://code.wireshark.org/review/14059
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-28 08:48:50 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
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>
2016-01-08 20:04:56 +00:00
Guy Harris ff435f9fcc Don't cast away constness.
Change-Id: I8ca89bea19d7d014b81713455c85d2253f906058
Reviewed-on: https://code.wireshark.org/review/12971
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31 22:03:43 +00:00
Guy Harris 0a21bc3d56 Use wmem_strdup_printf().
Change-Id: Ifb9dd16ab4435c23ea2914e16a65a17f9c61c0cb
Reviewed-on: https://code.wireshark.org/review/12970
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-31 22:02:31 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 3aefd3b5b2 Create real dissector tables for SSL and DTLS to use.
Since ssl_dissector_[add|delete] only take TCP dissectors, remove the parameter and just use it within the "internal" ssl_association_add call.

Change-Id: I0fdf941389934c20cbacf910250e17520614e706
Reviewed-on: https://code.wireshark.org/review/11591
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-07 14:11:01 +00:00
Petr Gotthard c4f00a825d AMQP: Fix usage of p_(add|get)_proto_data.
The p_(add|get)_proto_data() functions are used to store data related
to an AMQP frame. The stored information gets overwritten if there are
multiple small AMQP frames in one TCP/IP packet.

As suggested by Pascal and https://code.wireshark.org/review/#/c/10579/,
we should use tvb_raw_offset as key for p_(add|get)_proto_data().

Change-Id: I860df8af51a6fbbef495985747313ae96402cc5c
Reviewed-on: https://code.wireshark.org/review/10836
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: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-07 12:08:11 +00:00
Petr Gotthard c7d98e19b9 AMQP: Fix warnings and the OSX 10.5 x86 build
The AMQP channel number is 16-bit only.

packet-amqp.c: In function 'dissect_amqp_0_9_method_channel_close':
packet-amqp.c:8481: warning: cast to pointer from integer of different size
packet-amqp.c: In function 'get_conversation_channel':
packet-amqp.c:10512: warning: cast to pointer from integer of different size
packet-amqp.c:10518: warning: cast to pointer from integer of different size

Change-Id: I398ecfb19ecb7e741c2ed0675c1c625bf6a894f9
Reviewed-on: https://code.wireshark.org/review/10793
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-05 09:06:24 +00:00
Petr Gotthard 9e3a5fecbc AMQP: Navigation between publish/delivery and related ack/nack
This patch adds cross-references between publish/delivery and
ack/nack frames. This improves user comfort when inspecting the traffic.

Change-Id: I819b19474a3f0351eb769eadf3d32042cb5f5256
Reviewed-on: https://code.wireshark.org/review/10745
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 03:03:24 +00:00
Petr Gotthard b0eee2e4fc AMQP 0-9-1: More expert information
A little usability improvement: Warn user on connection and channel
errors and when a message is undeliverable.

Change-Id: I6106a63472b1fb5cbbabcf82a90af0f489030458
Reviewed-on: https://code.wireshark.org/review/10573
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-09-19 08:18:40 +00:00
Guy Harris 2ba0ea3722 Fix the conversion of milliseconds to seconds and nanoseconds.
1 millisecond = 1000000 nanoseconds, not 1000 nanoseconds, and
nstime->nsecs is nanoseconds, not microseconds.

Change-Id: I6925ff80f6443015f83ca00bad2a347d10eadd7c
Reviewed-on: https://code.wireshark.org/review/10060
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-16 19:34:50 +00:00
Petr Gotthard 8b8d37801c AMQP 1.0: Fix OSX build errors
packet-amqp.c:10660: warning: implicit conversion shortens 64-bit value into a 32-bit value
packet-amqp.c:10661: warning: implicit conversion shortens 64-bit value into a 32-bit value

Change-Id: Ic1c19edf10432dccb5fc4f3ea07defd45b9eef17
Reviewed-on: https://code.wireshark.org/review/10054
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-08-16 17:57:28 +00:00
Petr Gotthard b1d33db258 AMQP 1.0: Refactor to fix parsing of timestamps
Timestamps are currently dissected as integer numbers; two aspects need to
be recatored to correctly dissect timestamps:
 - the add_1_0_proto_item() function
 - protocol fields (hf_xxx) and the get_amqp_1_0_value_formatter()

(1)
The AMQP 1.0 dissector rely on the proto_tree_add_item. There is only one
invocation common for all datatypes (in add_1_0_proto_item), which cannot
pass any type-specific ENC_xxx specifiers and it cannot handle custom
datatypes like AMQP timestamp.

I propose to replace the add_1_0_proto_item() by type-specific dissectors that
will correctly set the ENC_xxx specifiers and handle exceptional cases like
the AMQP timestamp or the zero-length true/false datatypes.

(2)
The get_amqp_1_0_value_formatter implements a table-driven magic to select
alternate hf_xxx field based on the actual datatype. This however
 - defines alternate fields where the standard permits only one datatype
 - does not support fields that can contain any datatype ("*")
 - does not support FT_TIMESTAMP

I propose to make this mechanism less table-driven (more explicit and more
flexible) and allow all alternates permitted by the standard.

Change-Id: Ib2cbda632d4c81ec3e6b81f539fe77bb913afc1c
Reviewed-on: https://code.wireshark.org/review/9528
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-16 13:00:41 +00:00
Petr Gotthard a7f2b7f1de AMQP 1.0: Fix dissection of UUID datatypes
Set a correct data length: 16-bytes, not 1-byte. And use the
standard function to print the uuid.

Change-Id: Ic4cc8d8de3f469e43664fbd7f6eb89083dc83be6
Reviewed-on: https://code.wireshark.org/review/8905
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-12 13:18:50 +00:00
Petr Gotthard 70fa77f1a3 AMQP 1.0: Don't treat decimal[32|64|128] as packet errors
Packets with a decimal datatype should be correctly dissected.
Yet, we still cannot display the decimal floating-point numbers as
there is no support in printf and glib.

Change-Id: I48a6dafd1e12ab55f660fad37a759dd16a9cf4b1
Reviewed-on: https://code.wireshark.org/review/8902
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-12 13:16:38 +00:00
Petr Gotthard 7a927d60d4 AMQP 1.0: float/double should be in network byte order
The standard says that (unless otherwise specified) AMQP uses
network byte order for all numeric values.

Change-Id: I3ca154a6fb882d9194a9af891f92f760aae776eb
Reviewed-on: https://code.wireshark.org/review/8889
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-11 17:37:10 +00:00
Petr Gotthard 74421b35c2 AMQP 1.0: 'char' should be 4-bytes UTF32
Change-Id: I219b65fd989e1811eda9e2b7197148e6b22ef97a
Reviewed-on: https://code.wireshark.org/review/8887
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-11 17:35:06 +00:00
Alexis La Goutte a36ec5a0bb AMQP: fix The 'format_name' variable is assigned to itself found by PVS Studio (V570)
Change-Id: I97cdfc20cc635bccea5c96db33f46cdd970e933a
Reviewed-on: https://code.wireshark.org/review/8785
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Petr Gotthard <petr.gotthard@centrum.cz>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-08 17:33:58 +00:00
Petr Gotthard 4e32899f6c AMQP: Introduce support for AMQP over TLS/SSL (AMQPS).
Modified dissect_amqp to the new-style dissector.
Added amqp.ssl.port to protocol preferences.
Registered the AMQP dissector with SSL.

Fixed an error in dissect_amqp that appeared when the first segment was smaller
than the minimum header size required to determine the protocol version (8b).

...plus enhanced the AMQP 0-9-1 to display also the protocol id,
so the packets list shows "0-9-1" instead "9-1".

Change-Id: Ia44e0791b6ee78ad594de342c4f2401bad9beb4e
Reviewed-on: https://code.wireshark.org/review/7044
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Petr Gotthard <petr.gotthard@centrum.cz>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-03-03 12:34:08 +00:00
Petr Gotthard 55eb35adc0 AMQP: Fix one warning from Clang Code Analysis
Since 'values' is always 'length/4', we can have it as 'gint' and avoid
the Clang warning concerning the while cycle.
>> cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]

Change-Id: I4342f9e3fcd5df7779f41414ab6f789fe402e3af
Reviewed-on: https://code.wireshark.org/review/6979
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-06 12:32:07 +00:00
Petr Gotthard eb855554b6 AMQP: Add more COL_INFO description for some packets/frames.
Change-Id: If70dc3972d99d34d8e37dd26045076e515fd4d2c
Reviewed-on: https://code.wireshark.org/review/6968
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-06 12:30:02 +00:00
Alexis La Goutte 383caa72cf AMQP: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ie55dd06b6c4d6f77012e8e13079279ded2997907
Reviewed-on: https://code.wireshark.org/review/6920
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-03 01:12:22 +00:00
Alexis La Goutte 37a2cd0e84 AMQP: fix declaration of 'index' shadows a global declaration
St*** Mac OS X buildbot...

Part 2 (Oups...)

Change-Id: I082d73d4581365d7152aca764e4dfe599ce12c64
Reviewed-on: https://code.wireshark.org/review/6923
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-02 22:00:03 +00:00
Alexis La Goutte 0b2c8b044c AMQP: fix declaration of 'index' shadows a global declaration
St*** Mac OS X buildbot...

Change-Id: I5efff34ce818f52fb6414191c58b5cabb388ba26
Reviewed-on: https://code.wireshark.org/review/6922
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-02 21:46:50 +00:00
Petr Gotthard c96b3ac999 AMQP 0-9-1: Fix dissection of field types.
This patch resolves review comments I received from the AMQP 0-9-1 community.
Some field types were not implemented, other field types (introduced by my
earlier patch) were incorrectly parsed.
https://groups.google.com/forum/#!topic/rabbitmq-users/PR7P1bgonwo

I had to split the dissect_amqp_0_9_field_table() function into two parts
and put the field value dissectors in a separate function:
dissect_amqp_0_9_field_value().

Change-Id: I9aa7d73e426a790830ad260ca6892a7650791e6c
Reviewed-on: https://code.wireshark.org/review/6882
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>
2015-02-02 20:59:37 +00:00
Petr Gotthard a30022784a AMQP 0-9-1: Add missing methods connection.block and connection.unblock.
Change-Id: I11b32b876ec0f43b1faa2ab40ab66e7f18d981c2
Reviewed-on: https://code.wireshark.org/review/6857
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>
2015-02-01 07:25:13 +00:00
Guy Harris 25f1df4459 "%l[doux]" doesn't mean "64-bit integer".
Use G_GINT64_MODIFIER as the format modifier to indicate that the value
being printed is 64-bit; there is no guarantee that long is 64-bit (it's
not 64-bit on ILP32 platforms such as 32-bit Windows and 32-bit UN*X, or
even on LLP64 platforms such as 64-bit Windows).

Change-Id: I0444f7f396969824f1040c06a67753718c32881b
Reviewed-on: https://code.wireshark.org/review/6838
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-28 21:06:02 +00:00
Petr Gotthard 9e647a96b6 Extended AMQP 0-9 dissector to support AMQP 0-9-1 methods and datatypes. Backward compatibility to AMQP 0-9 is maintained.
Change-Id: Ie39cb40dca3d9f778ef2c04cbef24c968a91ec6c
Reviewed-on: https://code.wireshark.org/review/6791
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>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-28 20:01:17 +00:00