diff options
author | Tim Potter <tpot@samba.org> | 2004-06-06 10:25:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:34 -0500 |
commit | b2e95101db1104ed22039be6e441f941c7c56df5 (patch) | |
tree | a2e896f3aab85da33eab155eb7a9343675d3cd1d /source4/build/pidl/packet-dcerpc-eparser.c | |
parent | a12e30a52ec14cb4b4b9c3d8fc38732a27d306d1 (diff) | |
download | samba-b2e95101db1104ed22039be6e441f941c7c56df5.tar.gz samba-b2e95101db1104ed22039be6e441f941c7c56df5.tar.bz2 samba-b2e95101db1104ed22039be6e441f941c7c56df5.zip |
r1045: Wow - we actually compile (but not link) the autogenerated parser from
samr. The array handling is a bit of a mess though.
(This used to be commit 7ff7737832e0e5877ce8bcf329a123a2bce05370)
Diffstat (limited to 'source4/build/pidl/packet-dcerpc-eparser.c')
-rw-r--r-- | source4/build/pidl/packet-dcerpc-eparser.c | 43 |
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; +} |