aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc-nt.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-11 07:48:02 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-11 07:48:02 +0000
commit67f06501f6612e642f4a3aaeb5d9a12a4afe909e (patch)
treec803a825f710a0a8952d8661792953aa6ee00062 /epan/dissectors/packet-dcerpc-nt.c
parenta4fdfacbb3d1aef7a19eb12906523378f61d6603 (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/dissectors/packet-dcerpc-nt.c')
-rw-r--r--epan/dissectors/packet-dcerpc-nt.c27
1 files changed, 27 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,