From a2cef6b69d76c405d754bb2e760551ed49d85dcc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 22 Mar 2022 15:57:18 +0100 Subject: [PATCH] drsuapi_dissect_element_DsReplicaObjectIdentifier_dn parents append --- epan/dissectors/pidl/drsuapi/drsuapi.cnf | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/pidl/drsuapi/drsuapi.cnf b/epan/dissectors/pidl/drsuapi/drsuapi.cnf index f13d6671eb..5d73063a3e 100644 --- a/epan/dissectors/pidl/drsuapi/drsuapi.cnf +++ b/epan/dissectors/pidl/drsuapi/drsuapi.cnf @@ -1293,12 +1293,43 @@ drsuapi_dissect_element_lsa_String_string_(tvbuff_t *tvb _U_, int offset _U_, pa static int drsuapi_dissect_element_DsReplicaObjectIdentifier_dn(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_, struct ndr_generic_array *nga) { + proto_tree *parent_tree = NULL; char *data = NULL; + guint parent_level = 0; offset = dissect_ndr_generic_array_string(tvb, offset, pinfo, tree, di, drep, sizeof(guint16), hf_DsReplicaObjectIdentifier_dn, FALSE, nga, &data); - proto_item_append_text(tree, ": %s", data); + if (tree == NULL) { + return offset; + } + + parent_tree = tree; + for (parent_level = 1, parent_tree = tree; + parent_tree != NULL && parent_level < 10; + parent_level++, + parent_tree = proto_tree_get_parent_tree(parent_tree)) + { + proto_item *parent_item = proto_tree_get_parent(parent_tree); + field_info *fi = NULL; + + if (parent_item == NULL) { + break; + } + + fi = PITEM_FINFO(parent_item); + if (fi == NULL) { + break; + } + + if (parent_level > 3) { + + } + proto_item_append_text(parent_tree, "[%u][%s]: %s", parent_level, fi->hfinfo->name, data); + if (parent_level > 4) { + break; + } + } return offset; } -- 2.11.4.GIT