diff options
author | Michael Mann <mmann78@netscape.net> | 2017-09-23 09:05:21 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-10-09 11:31:19 +0000 |
commit | d8d60b4980882e37b73df3bfead8c2b09daba091 (patch) | |
tree | c41c195ce3971a71e8afea965740a7e87bf54609 /epan/proto.h | |
parent | c6a0e2a7916a689dfb642b004d07f6fc76fd04f3 (diff) |
Add ENC_VARINT_PROTOBUF
Encoding of integer datatypes of Protocol buffers
https://developers.google.cn/protocol-buffers/docs/encoding
Change-Id: I9f6d65ddca099c15c0634984e9394131f98d35a9
Reviewed-on: https://code.wireshark.org/review/23813
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h index 075f758d7f..6df43936d8 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -525,6 +525,8 @@ WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *message); /* this can't collide with ENC_SEP_* because they can be used simultaneously */ #define ENC_NUM_PREF 0x00200000 +#define ENC_VARINT_PROTOBUF 0x00000002 + /* 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. * See hex_str_to_bytes_encoding() in epan/strutil.h for details. @@ -728,6 +730,8 @@ typedef struct #define FI_LITTLE_ENDIAN 0x00000008 /** The protocol field value is in big endian */ #define FI_BIG_ENDIAN 0x00000010 +/** The protocol field value is a varint */ +#define FI_VARINT 0x00000020 /** Field value start from nth bit (values from 0x20 - 0x100) */ #define FI_BITS_OFFSET(n) (((n) & 7) << 5) /** Field value takes n bits (values from 0x100 - 0x4000) */ @@ -1137,6 +1141,10 @@ proto_tree_add_item_ret_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, const gint start, gint length, const guint encoding, guint64 *retval); WS_DLL_PUBLIC proto_item * +proto_tree_add_item_ret_varint(proto_tree *tree, int hfindex, tvbuff_t *tvb, + const gint start, gint length, const guint encoding, guint64 *retval, gint *lenretval); + +WS_DLL_PUBLIC proto_item * proto_tree_add_item_ret_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, const gint start, gint length, const guint encoding, gboolean *retval); |