diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-08-11 07:48:02 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-08-11 07:48:02 +0000 |
commit | 67f06501f6612e642f4a3aaeb5d9a12a4afe909e (patch) | |
tree | c803a825f710a0a8952d8661792953aa6ee00062 /epan | |
parent | a4fdfacbb3d1aef7a19eb12906523378f61d6603 (diff) |
From Matthieu Patou <mat@matws.net>
Add new helper function for DCE/RPC NDR data blobs
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38472 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.c | 27 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.h | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index ecdfc22570..724d4b4f07 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -50,6 +50,7 @@ static int hf_lsa_String_name_size = -1; static gint ett_nt_unicode_string = -1; static gint ett_lsa_String = -1; +static gint ett_nt_data_blob = -1; @@ -78,6 +79,31 @@ const value_string platform_id_vals[] = { }; int +dissect_ndr_datablob(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, int hf_index, + int use_remaining_space) +{ + proto_item *item; + guint32 len; + proto_tree *subtree = tree; + + item = proto_tree_add_text(tree, tvb, offset, 0, "%s", + proto_registrar_get_name(hf_index)); + + subtree = proto_item_add_subtree(item, ett_nt_data_blob); + + if (use_remaining_space) { + len = tvb_length_remaining (tvb, offset); + } else { + offset = dissect_ndr_uint32(tvb, offset, pinfo, subtree, drep, + hf_index, &len); + } + proto_tree_add_text(tree, tvb, offset, len, "Blob data"); + offset += len; + return offset; +} + +int dissect_null_term_string(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hf_index, int levels _U_) @@ -1946,6 +1972,7 @@ void dcerpc_smb_init(int proto_dcerpc) static gint *ett[] = { &ett_nt_unicode_string, + &ett_nt_data_blob, &ett_nt_counted_string, &ett_nt_counted_byte_array, &ett_nt_policy_hnd, diff --git a/epan/dissectors/packet-dcerpc-nt.h b/epan/dissectors/packet-dcerpc-nt.h index 8519fd6619..9e977070ef 100644 --- a/epan/dissectors/packet-dcerpc-nt.h +++ b/epan/dissectors/packet-dcerpc-nt.h @@ -84,6 +84,10 @@ extern const value_string platform_id_vals[]; ALIGN_TO_2_BYTES; \ } \ } +int +dissect_ndr_datablob(tvbuff_t *tvb, int offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, int hf_index, + int use_remaining_space); int dissect_null_term_string(tvbuff_t *tvb, int offset, packet_info *pinfo, |