summaryrefslogtreecommitdiff
path: root/source4/build/pidl/packet-dcerpc-eparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl/packet-dcerpc-eparser.c')
-rw-r--r--source4/build/pidl/packet-dcerpc-eparser.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/build/pidl/packet-dcerpc-eparser.c b/source4/build/pidl/packet-dcerpc-eparser.c
index bafdf34006..f7cf575932 100644
--- a/source4/build/pidl/packet-dcerpc-eparser.c
+++ b/source4/build/pidl/packet-dcerpc-eparser.c
@@ -65,3 +65,46 @@ void ndr_pull_policy_handle(struct e_ndr_pull *e_ndr, int hf)
e_ndr->tvb, e_ndr->offset, e_ndr->pinfo, e_ndr->tree,
e_ndr->drep, hf, NULL, NULL, 0, 0);
}
+
+void ndr_pull_advance(struct e_ndr_pull *ndr, int offset)
+{
+ e_ndr->offset += offset;
+}
+
+void ndr_pull_subcontext_flags_fn(struct e_ndr_pull *ndr, size_t sub_size,
+ void *base,
+ void (*fn)(struct e_ndr_pull *,
+ int ndr_flags))
+{
+ struct e_ndr_pull ndr2;
+
+ ndr_pull_subcontext_header(ndr, sub_size, &ndr2);
+ fn(&ndr2, NDR_SCALARS|NDR_BUFFERS, base);
+ if (sub_size) {
+ ndr_pull_advance(ndr, ndr2.data_size);
+ } else {
+ ndr_pull_advance(ndr, ndr2.offset);
+ }
+}
+
+/*
+ mark the start of a structure
+*/
+void ndr_pull_struct_start(struct e_ndr_pull *ndr)
+{
+ struct ndr_ofs_list *ofs;
+ ofs = g_malloc(sizeof(*ofs));
+ ofs->offset = ndr->offset;
+ ofs->next = ndr->ofs_list;
+ ndr->ofs_list = ofs;
+}
+
+/*
+ mark the end of a structure
+*/
+void ndr_pull_struct_end(struct e_ndr_pull *ndr)
+{
+ struct ndr_ofs_list *ofs = ndr->ofs_list->next;
+ g_free(ndr->ofs_list);
+ ndr->ofs_list = ofs;
+}