aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2019-08-28 03:37:04 -0400
committerAnders Broman <a.broman58@gmail.com>2019-09-05 03:25:39 +0000
commit168ee5003fa2bfba578118b807d6fdf37ec02abc (patch)
tree7c10842f881b21209e797aac0b14d0c4152aa329 /epan/proto.h
parent05e39afb3fdbf76452a05c1c2a2c3164af9702ed (diff)
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>
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h
index b6f5ef37b0..9ba43f1be4 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -539,6 +539,13 @@ void proto_report_dissector_bug(const char *format, ...)
* See https://tools.ietf.org/html/draft-ietf-quic-transport-08#section-8.1
*/
#define ENC_VARINT_QUIC 0x00000004
+ /*
+ * Use "zig-zag" varint format as described in Protobuf protocol
+ * See https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types
+ */
+#define ENC_VARINT_ZIGZAG 0x00000008
+
+#define ENC_VARIANT_MASK (ENC_VARINT_PROTOBUF|ENC_VARINT_QUIC|ENC_VARINT_ZIGZAG)
/* For cases where a string encoding contains hex, bit-or one or more
* of these for the allowed separator(s), as well as with ENC_STR_HEX.
@@ -1195,6 +1202,10 @@ proto_tree_add_item_ret_int(proto_tree *tree, int hfindex, tvbuff_t *tvb,
const gint start, gint length, const guint encoding, gint32 *retval);
WS_DLL_PUBLIC proto_item *
+proto_tree_add_item_ret_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb,
+ const gint start, gint length, const guint encoding, gint64 *retval);
+
+WS_DLL_PUBLIC proto_item *
proto_tree_add_item_ret_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb,
const gint start, gint length, const guint encoding, guint32 *retval);