diff options
author | AndersBroman <anders.broman@ericsson.com> | 2018-02-06 10:40:46 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-02-06 11:43:18 +0000 |
commit | 41b571f9bdef6ea310fde062634245d3f48de8ea (patch) | |
tree | 611dec0162878cd12f71431a3b2bc831abb09925 | |
parent | 3eb8784140dd6f3dfdf4865caa338f7434141620 (diff) |
[Thrift] Add methods for the 64bit types.
Change-Id: I4a3ca0eb715562c9ed535df471edb62830215369
Reviewed-on: https://code.wireshark.org/review/25630
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-thrift.c | 54 | ||||
-rw-r--r-- | epan/dissectors/packet-thrift.h | 2 |
2 files changed, 56 insertions, 0 deletions
diff --git a/epan/dissectors/packet-thrift.c b/epan/dissectors/packet-thrift.c index 01b2a6a4d3..db50111769 100644 --- a/epan/dissectors/packet-thrift.c +++ b/epan/dissectors/packet-thrift.c @@ -186,6 +186,60 @@ dissect_thrift_t_i32(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, in } int +dissect_thrift_t_i64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id) +{ + guint8 type; + + type = tvb_get_guint8(tvb, offset); + if (type != THRIFT_T_I64) { + proto_tree_add_expert(tree, pinfo, &ei_thrift_wrong_type, tvb, offset, 1); + } + + if (show_internal_thrift_fields) { + proto_tree_add_item(tree, hf_thrift_type, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + + proto_tree_add_item(tree, hf_thrift_fid, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } + else { + offset += 3; + } + + proto_tree_add_item(tree, hf_id, tvb, offset, 8, ENC_BIG_ENDIAN); + offset += 8; + + return offset; +} + +int +dissect_thrift_t_u64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id) +{ + guint8 type; + + type = tvb_get_guint8(tvb, offset); + if (type != THRIFT_T_U64) { + proto_tree_add_expert(tree, pinfo, &ei_thrift_wrong_type, tvb, offset, 1); + } + + if (show_internal_thrift_fields) { + proto_tree_add_item(tree, hf_thrift_type, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + + proto_tree_add_item(tree, hf_thrift_fid, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + } + else { + offset += 3; + } + + proto_tree_add_item(tree, hf_id, tvb, offset, 8, ENC_BIG_ENDIAN); + offset += 8; + + return offset; +} + +int dissect_thrift_t_utf7(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id) { guint32 str_len; diff --git a/epan/dissectors/packet-thrift.h b/epan/dissectors/packet-thrift.h index be294cf498..5d93f397c0 100644 --- a/epan/dissectors/packet-thrift.h +++ b/epan/dissectors/packet-thrift.h @@ -51,6 +51,8 @@ WS_DLL_PUBLIC int dissect_thrift_t_stop(tvbuff_t* tvb, packet_info* pinfo _U_, p WS_DLL_PUBLIC int dissect_thrift_t_byte(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id); WS_DLL_PUBLIC int dissect_thrift_t_i32(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id); +WS_DLL_PUBLIC int dissect_thrift_t_u64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id); +WS_DLL_PUBLIC int dissect_thrift_t_i64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id); WS_DLL_PUBLIC int dissect_thrift_t_utf7(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id); /** Dissect a Thrift struct |