summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-07-16 12:59:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:40 -0500
commit013b689f919d7c778b300d136fded5548b6053f1 (patch)
tree3f8d4eeb4b8e4403dfb176407a09537f3d826ff4
parent63771f737865f4a6d85d709559b55e08eeaef3e3 (diff)
downloadsamba-013b689f919d7c778b300d136fded5548b6053f1.tar.gz
samba-013b689f919d7c778b300d136fded5548b6053f1.tar.bz2
samba-013b689f919d7c778b300d136fded5548b6053f1.zip
r1535: Create a subtree for each array element.
(This used to be commit 4099e10d435436c092ca0e512fd4ddafdf4ae6a5)
-rw-r--r--source4/build/pidl/packet-dcerpc-eparser.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source4/build/pidl/packet-dcerpc-eparser.c b/source4/build/pidl/packet-dcerpc-eparser.c
index 4762ac9278..8debaf0aab 100644
--- a/source4/build/pidl/packet-dcerpc-eparser.c
+++ b/source4/build/pidl/packet-dcerpc-eparser.c
@@ -13,6 +13,8 @@ static int hf_string4_offset = -1;
static int hf_string4_len2 = -1;
static int hf_string_data = -1;
+static gint ett_array = -1;
+
/* Create a ndr_pull structure from data stored in a tvb at a given offset. */
struct e_ndr_pull *ndr_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
@@ -523,17 +525,25 @@ void ndr_pull_array(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags,
proto_tree *tree,
int ndr_flags))
{
+ proto_tree **subtrees;
int i;
+
+ subtrees = (proto_tree **)g_malloc(sizeof(proto_tree **) * count);
+
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
for (i=0;i<count;i++) {
- pull_fn(ndr, tree, NDR_SCALARS);
+ proto_item *item;
+ item = proto_tree_add_text(tree, ndr->tvb, ndr->offset, 0, "Array entry");
+ subtrees[i] = proto_item_add_subtree(item, ett_array);
+ pull_fn(ndr, subtrees[i], NDR_SCALARS);
}
if (!(ndr_flags & NDR_BUFFERS)) goto done;
buffers:
for (i=0;i<count;i++) {
- pull_fn(ndr, tree, NDR_BUFFERS);
+ pull_fn(ndr, subtrees[i], NDR_BUFFERS);
}
- done: ;
+ done:
+ g_free(subtrees);
}
void proto_register_eparser(void)
@@ -547,9 +557,12 @@ void proto_register_eparser(void)
{ &hf_subcontext_size_4, { "Subcontext size4", "eparser.subcontext_size4", FT_UINT16, BASE_DEC, NULL, 0x0, "Subcontext size4", HFILL }},
{ &hf_relative_ofs, { "Relative offset", "eparser.relative_offset", FT_UINT32, BASE_DEC, NULL, 0x0, "Relative offset", HFILL }},
};
-
+ static gint *ett[] = {
+ &ett_array,
+ };
int proto_dcerpc;
proto_dcerpc = proto_get_id_by_filter_name("dcerpc");
proto_register_field_array(proto_dcerpc, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
}