Commit Graph

96 Commits

Author SHA1 Message Date
Gerald Combs 103d9140ae Kafka: Check returned offsets.
dissect_kafka_regular_bytes might return -1, so handle that in
dissect_kafka_message_old. Closes #16784.
2020-09-23 05:13:16 +00:00
Alexis La Goutte a4319f3254 ieee80211: fix Wmissing-prototypes
no previous prototype for function 'add_ff_action_public_fields' [-Wmissing-prototypes]

Change-Id: I8be64454a21187cf60a04c903acfbb18f2a12095
2020-09-09 06:06:29 +00:00
Piotr Smolinski e6469a757b Fixed the usage of proto_tree_add_bytes
Bug: 16744
Change-Id: I57e37a3e8a7b3213a381a43b366bad87a39c6625
Reviewed-on: https://code.wireshark.org/review/38000
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-07-31 12:25:00 +00:00
Piotr Smolinski 18bc35e3e5 Support for Kafka 2.5
The change is massive, mostly due to KIP-482. The flexible version coding affects every
string, bytes or array field. In order to keep the compatibility the old and new style field
codings must stay next to each other.

Plus:
* correlation-id request/response matching
* new fields (other than KIP-482)
* some fixes to the messages that were not tested sufficiently before

Bug: 16540
Bug: 16706
Bug: 16708
Change-Id: I39b1b6a230e393d3bee3e3d8625541add9c83e5d
Reviewed-on: https://code.wireshark.org/review/37886
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-24 06:03:03 +00:00
Martin Kaiser dc7f935330 kafka: zstd: free the composite tvb only once
Fix the composite tvb handling for zstd decompression in the same way as
we already did for lz4 and snappy.

Allocate the composite tvb only if we are cetain that data will be added
to it. Do not free the composite tvb ourselves, leave this to epan cleanup.

Change-Id: Iac74ea6e6d220b05858a7eb267276ff983b1b2ab
Reviewed-on: https://code.wireshark.org/review/37900
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-07-19 19:06:48 +00:00
Martin Kaiser 32a804dea2 kafka: snappy: free the composite tvb only once
The snappy decompression routine has the same bug that was fixed for lz4 in
79576219c9 ("kafka: lz4: free the composite tvb only once").

Refactor the composite tvb handling for snappy as well. Allocate the
composite tvb only if we are cetain that data will be added to it.
Do not free the composite tvb ourselves, leave this to epan cleanup.

Change-Id: Ide3a88d1c02e525fe1aadd176068ce68c2330b98
Reviewed-on: https://code.wireshark.org/review/37838
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-13 05:12:09 +00:00
Martin Kaiser 79576219c9 kafka: lz4: free the composite tvb only once
Try to clean up the composite tvb handling during lz4 decompression.

If we detect an error straight away before doing any lz4 decompression, we
don't allocate a composite tvb at all. The comments in the tvb code say
explicitly that we must not call tvb_new_composite() without adding at
least one piece of data.

If we start decompressing and run into problems after creating the
composite tvb and linking it to the packet's main tvb, we must not free
the composite tvb manually. The epan library will do this for us when
dissection of the packet is finished.

While at it, make sure that we always finalize the composite tvb if we
allocated it and added data to it.

Bug: 16672
Change-Id: I3e3fb303a823640d7707277a109019fc3aad22f2
Reviewed-on: https://code.wireshark.org/review/37696
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-05 12:14:07 +00:00
Piotr Smolinski 24712ec073 Kafka: fix the FETCH response alignment issue
There was a problem in FETCH response parsing when the server had more data than the requested
maximal return size. In such case the server checks if the first chunk of data fits into buffer. If it does not,
the first chunk is returned as a whole to the requestor. Otherwise it is assumed that the client is capable
of discarding invalid content and the server pushes maximum available block. It makes sense, because
the default block is 10MB and pushing it opaque leverages zero-copy IO from the file system to the network.

In the existing implementation it was assumed that the last batch is aligned with the end of the buffer.
Actually, if there is some data more, the last part is delivered truncated.

This patch:
* fixes the last part alignment handling
* adds opaque field for truncated content
* moves preferred replica field to the proper context

Bug: 16623
Change-Id: Iee6d513ce6711091e5561646a3fd563501eabdda
Reviewed-on: https://code.wireshark.org/review/37446
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-12 06:01:33 +00:00
Martin Mathieson e30f0d0920 Some issues spotted by PVS-Studio in bug 16335. Many more remain
Change-Id: If856e25af8e33eeef5b9e595f1f6820459892b17
Reviewed-on: https://code.wireshark.org/review/36110
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:06:41 +00:00
Dario Lombardo 8dcd1e2bcd kafka: don't use an empty tvb list.
Bug: 16242
Change-Id: I1a7cfa504d46cab681c7803227102cafcda519fa
Reviewed-on: https://code.wireshark.org/review/35277
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-12-02 00:33:45 +00:00
Guy Harris c9c33affd9 Add more checks, fail for negative byte block lengths.
Have dissect_kafka_string_new() set a flag if the length was negative.
If the length is negative, don't try to process what comes afterwards.

Make the length argument to decompression routines unsigned, and do
various checks.  Don't try to decompress a zero-length block, and quit
if the decompressed block is zero-length.

Bug: 16082
Change-Id: I34c2ea99aa096b3f5724d9b113171b105bd6c60b
Reviewed-on: https://code.wireshark.org/review/34867
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-10-27 23:00:10 +00:00
Gerald Combs 7c49d99aca Kafka: Fix a length check.
Skip past our chunk size before checking our available length.

Bug: 16117
Change-Id: I39ddf1f6861de3b3adea59df2f30abfe3a4f7295
Reviewed-on: https://code.wireshark.org/review/34795
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-18 03:43:32 +00:00
Alexis La Goutte 6cf3878a4f Kafka: Fix Dead Store
Fix dead store (Dead assignement/Dead increment) Warning found by Clang

Change-Id: I013c1bdc943033550f497b1be0dfc7979ca49517
Reviewed-on: https://code.wireshark.org/review/34484
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-09 10:56:20 +00:00
Alexis La Goutte 3ebf2e2d51 Kafka: Fix Dead Store
Fix dead store (Dead assignement/Dead increment) Warning found by Clang

Change-Id: I3ac2e2b6a1ed7621f65f1a98e8b7b3704e8b299d
Reviewed-on: https://code.wireshark.org/review/34481
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-09 04:31:57 +00:00
Michael Mann 168ee5003f kafka: Cleanup to use "native" APIs.
Add "native" support for the "zig-zag" version of a varint in proto.[ch] and
tvbuff.[ch].  Convert the use of varint in the KAFKA dissector to use the (new)
"native" API.

Ping-Bug: 15988
Change-Id: Ia83569203877df8c780f4f182916ed6327d0ec6c
Reviewed-on: https://code.wireshark.org/review/34386
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-05 03:25:39 +00:00
Piotr Smolinski 05b6a9ad0b Kafka: fixed OffsetForLeaderEpoch dissection
Bug: 16023
Change-Id: I78e1354ac5509707c818d7968c7067583fb469ba
Reviewed-on: https://code.wireshark.org/review/34379
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-08-27 17:01:27 +00:00
Dario Lombardo b3f67fa1fa kafka: remove unused hf/ei entries.
Change-Id: I98a3a1456fbfeb726a1a81a0b46714556fe951cd
Reviewed-on: https://code.wireshark.org/review/34383
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-27 11:17:07 +00:00
Piotr Smolinski ad94c4d459 Kafka: include zstd compression in Kafka message batches
Change-Id: I1d06486ccf7b174ee9aa621fa3d8acb8b3673777
Reviewed-on: https://code.wireshark.org/review/34222
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-20 13:50:45 +00:00
Piotr Smolinski 6cf81c5633 Kafka: fix the name shadowing
Post-merge fix.

Change-Id: I712d275f90c5a1e425865654143ead7c3a04998b
Reviewed-on: https://code.wireshark.org/review/34332
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-20 13:10:53 +00:00
Piotr Smolinski eabd1b0abb Kafka: add support for Kafka 2.3+ dissection
Existing Apache Kafka support in Wireshark ends at version 0.10.
The version 0.11 (June 2017) brought significant changes to the message
format. This change makes the Wireshark Kafka dissector obsolete.
The recently released Kafka 2.3 has a lot of additions to the wire
protocol, which should be also addressed.

Major changes:
* Applied Kafka protocol changes since 0.10
* Zstd-packed message decompression (since Kafka 2.1)
* Added support for Kafka over TLS decryption

Bug: 15988
Change-Id: I2bba2cfefa884638b6d4d6f32ce7d016cbba0e28
Reviewed-on: https://code.wireshark.org/review/34224
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-20 06:38:52 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
Jaap Keuter 71268f8bd1 Apply port preferences during dissector handoff registration
Handling of preferences is often done in the dissector handoff
registration. Therefore this function is often registered as
callback while registering preference handling for the module.
In this way the preferences are processed both when registering
the dissector and when changes happen.

Some dissectors opt to register a seperate callback function to
be called when preferences change. Now these have to be called
from the dissector handoff function explicitly, in order to have
the preferences processed during dissector registration.

This becomes explicitly apparent when the port registration comes
into play. With the migration to using dissector registration on
ports with preference this port (range) is often retrieved from
the preferences to match against the ports in a packet to determine
an incoming or outgoing packet of a server. In case the callback
function is not called from the dissector registration this
determination fails, until the preferences are applied/changed,
causing the preference handling callback to be called.

This change add the calling of the callback during dissector
registration, fixing some dissector port registrations in the
process.

Change-Id: Ieaea7f63f8f9062c56582a042a3a5a862e286406
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/30848
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-01 15:52:37 +00:00
Dario Lombardo 9b9a0d0f88 kafka: fix builds without Snappy or LZ4 support
Avoid passing an uninitialized "raw" pointer to "proto_tree_add_item".

Change-Id: Ic7d3542b4aa5650f452aad7ac3b783769cb44eb7
Reviewed-on: https://code.wireshark.org/review/28922
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-08-01 21:47:33 +00:00
Tim Cuthbertson c9ecb01f36 Kafka: add info when we lack decompression support
Change-Id: I4c1b5d84bd1a6dfa811fd8ffbd576ac8dfd448af
Reviewed-on: https://code.wireshark.org/review/28749
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-01 08:59:52 +00:00
Tim Cuthbertson 1ec79c84f0 Kafka: add support for additional Produce, Fetch, OffsetCommit and Heartbeat API versions
Change-Id: I5bd41ed299e586b953042683acf2f05c678a7e93
Reviewed-on: https://code.wireshark.org/review/28748
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Evan Huus <eapache@gmail.com>
2018-07-21 00:01:45 +00:00
Joerg Mayer 0d31ec328f Check for HAVE_LZ4FRAME_H in the LZ4 detection process and use it
Change-Id: I919621b8c4c809eb181d563251eeb099b767ad82
Reviewed-on: https://code.wireshark.org/review/26940
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-15 05:34:08 +00:00
Dario Lombardo 0b62dce005 kafka: raise the required version to 1.5.0 for lz4_frame.
Change-Id: I25619260572163872915c56bcf242e8ff8190b47
Reviewed-on: https://code.wireshark.org/review/26890
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Tested-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-04-13 09:19:36 +00:00
Dario Lombardo 0c30760c95 kafka: check lz4 version in a single point.
This allows a better check of the required version.

Change-Id: I6c4aab67c73434aff4ad744caa2d0add9ec6225c
Reviewed-on: https://code.wireshark.org/review/26889
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-11 23:05:57 +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
Jeff Widman 0e85c0ad1e Fix typo: Heatbeat --> Heartbeat
Change-Id: I864850b29f9c816a4d1592cd5bba2b9d0159b139
Reviewed-on: https://code.wireshark.org/review/24289
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-11-08 03:31:25 +00:00
João Valverde 299bd4628a Fix unitialized variable warnings that popped up with -Og
Using GCC version 7.1.1.

Change-Id: I7447a48fc97efb1eb15a016a29165f69d37f40a6
Reviewed-on: https://code.wireshark.org/review/23399
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-09-05 22:31:01 +00:00
AndersBroman 511b9dda82 [Kafka] The inclusion of LZ4 broke building on Ubuntu 14.04, since it has lz4-r114.
But the lz4 frame API was introduced in [r123](https://github.com/lz4/lz4/blob/r123/lz4frame.h).
Put the code behind a lz4 version check.

Change-Id: If8a7e5f7f2e7c9beac89eec334368a5b95a1bc3f
Reviewed-on: https://code.wireshark.org/review/21684
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-05-16 12:32:03 +00:00
Peter Wu b56041627a kafka: fix -Wmissing-field-initializers by removing unneeded code
LZ4F_decompress accepts a NULL parameter to apply default parameters, do
not bother setting a parameter (this also avoids
-Wmissing-field-initializers warnings from clang).

Change-Id: Id2cd8d58cd9339dd5af395092a8104b559b6e194
Reviewed-on: https://code.wireshark.org/review/21675
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-16 00:11:50 +00:00
Guy Harris b960f5f4c2 Explicitly initialize the current only member of dec_opts.
At least some compilers will warn about not initializing the reserved
values.

Change-Id: Id907468be757a1cd3137140d285803f3e9f1724a
Reviewed-on: https://code.wireshark.org/review/21674
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-15 23:03:14 +00:00
Pascal Quantin 8112b8d7a8 Kafka: add LZ4 decompression
Change-Id: Idf2f63782c8751778ad88f46a7f65fe7d5d49f3b
Reviewed-on: https://code.wireshark.org/review/21577
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-05-13 11:54:31 +00:00
Martin Mathieson 6a0b5b33af Fix kafka build error by casting
Change-Id: I34a5f60c49d09a8cec4a2c9ab49ea48ef67527cd
Reviewed-on: https://code.wireshark.org/review/21540
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2017-05-07 15:18:54 +00:00
Martin Mathieson d89b83a9e4 Kafka: show decompressed messages more clearly
Change-Id: I8edf251d9ab26f93bf54d8032706ac7b9e4f6dd1
Reviewed-on: https://code.wireshark.org/review/21538
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2017-05-07 08:08:26 +00:00
Alexis La Goutte 9a8d90698b dissector: fix typo reponse -> response
Change-Id: I5d12b7038c0ed602cd5b3b416c35893986018f85
Reviewed-on: https://code.wireshark.org/review/20626
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-19 16:50:01 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Your Name 98d350aedd Cast larger types to time_t
Resolves truncation warnings on the x86 clang build

Change-Id: I14ebbe39b8235bd1b909c488c0402b77deb6dde1
Reviewed-on: https://code.wireshark.org/review/19354
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-12-20 19:17:51 +00:00
Dmitry Lazurkin ced54aeb06 kafka: add expert info about unsupported api key and version
Change-Id: I622e6f06529377e089cbeeb83d926135f983d3f3
Reviewed-on: https://code.wireshark.org/review/19194
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-12-17 22:54:55 +00:00
Martin Mathieson 74bc8f8bc6 Add a preference to control whether string and byte lengths appear in protocol tree
Change-Id: I6be13d9adb8871cbbf4604155e8e7175a74ddaa3
Reviewed-on: https://code.wireshark.org/review/19188
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dmitry Lazurkin <dilaz03@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-12-10 23:33:17 +00:00
Dmitry Lazurkin 548b9febb3 kafka: add dissection for rest of api keys
- support rest of api keys
- dissect kafka.required_acks with constants
- dissect kafka.message_timestamp_type
- add expert info about missing request

Change-Id: I3d18936adac6702a61f545385bdec1b75b564bd9
Reviewed-on: https://code.wireshark.org/review/18954
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-12-05 21:45:18 +00:00
Michael Mann fb9a356e46 Add prefs_get_uint_value and prefs_get_range_value
This allows dissectors to not need to know about the internal preference structure.

Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2
Reviewed-on: https://code.wireshark.org/review/18864
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-11-22 16:47:47 +00:00
Martin Mathieson bb4ecec2d0 Kafka: show API versions in root, and don't show bogus size for GZIP messages.
Change-Id: Ib8182537a791ed24bcc417594713dd6c206ce0ce
Reviewed-on: https://code.wireshark.org/review/18885
Reviewed-by: Dmitry Lazurkin <dilaz03@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-11-21 20:04:58 +00:00
Martin Mathieson 7ecbad89a9 kafka: fix mac build breakage by adding int cast
Change-Id: Ic57d49f7408f041b60b719a3da4971c499122930
Reviewed-on: https://code.wireshark.org/review/18888
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-11-20 11:41:32 +00:00
Dmitry Lazurkin 4eb61deedc kafka: Update supported api keys to latest spec
Details:
- update supported api keys
- add api key ApiVersions
- change api key names according to documentation
- add pcapng files for supported api keys
- add new documentation link
- add declaration of lz4 message codec

Change-Id: I943dc31144890dcd3dd333981a86754668c2bec4
Reviewed-on: https://code.wireshark.org/review/18861
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-11-19 22:11:03 +00:00
Pascal Quantin dbb391a646 Kafka: add Snappy decompression support
Change-Id: Ida8d941809a4e0f2fd4d9f142363187a757d0278
Reviewed-on: https://code.wireshark.org/review/18288
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2016-10-19 12:55:17 +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