From e2357c67f5afbfeacafab6997b57ea262cd3c05a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Aug 2004 05:15:41 +0000 Subject: r1757: much simpler (and smaller, faster etc) way of doing relative pointers in pidl. This mechanism should be much easier to extend to the "retrospective subcontexts" that jelmer needs. also produced more standards complient full-pointer offsets. This keeps ethereal happy with decoding our epmapper frames. (This used to be commit ecb7378bbcd86727aedfa04a9e302e06b0a2ccd9) --- source4/librpc/ndr/libndr.h | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'source4/librpc/ndr/libndr.h') diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 57d9766811..7ab5de52fa 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -23,15 +23,15 @@ */ -/* offset lists are used to allow a push/pull function to find the - start of an encapsulating structure */ -struct ndr_ofs_list { - uint32_t offset; - uint32_t base; - struct ndr_ofs_list *next; +/* + this is used by the token store/retrieve code +*/ +struct ndr_token_list { + struct ndr_token_list *next, *prev; + const void *key; + uint32_t value; }; - /* this is the base structure passed to routines that parse MSRPC formatted data @@ -47,9 +47,11 @@ struct ndr_pull { uint32_t offset; TALLOC_CTX *mem_ctx; - /* this points at a list of offsets to the structures being processed. - The first element in the list is the current structure */ - struct ndr_ofs_list *ofs_list; + struct ndr_token_list *relative_list; + + /* this is used to ensure we generate unique reference IDs + between request and reply */ + uint32_t ptr_count; }; struct ndr_pull_save { @@ -66,15 +68,10 @@ struct ndr_push { uint32_t offset; TALLOC_CTX *mem_ctx; + struct ndr_token_list *relative_list; + /* this is used to ensure we generate unique reference IDs */ uint32_t ptr_count; - - /* this points at a list of offsets to the structures being processed. - The first element in the list is the current structure */ - struct ndr_ofs_list *ofs_list; - - /* this list is used by the [relative] code to find the offsets */ - struct ndr_ofs_list *relative_list, *relative_list_end; }; struct ndr_push_save { -- cgit