summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-03-12 17:12:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:02 -0500
commite9ca6e48fff41c5f457075156a8c4b2c729c5527 (patch)
treeabfe42de2722644947b586350c20339158188014 /source4/librpc/ndr/ndr.c
parentf58143b0256d470e17f2c0a09a7c1a352855d385 (diff)
downloadsamba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.tar.gz
samba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.tar.bz2
samba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.zip
r5775: Remove some unused functions (unions are no longer as special as they used to be)
Add oxid mapping table support in DCOM (This used to be commit e193555f0eec2dda8c8760e9668181200fef0a1e)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r--source4/librpc/ndr/ndr.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index f3394d1e44..b96a231a90 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -644,12 +644,12 @@ NTSTATUS ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length)
/*
store a switch value
*/
-NTSTATUS ndr_push_set_switch_value(struct ndr_push *ndr, void *p, uint32_t val)
+NTSTATUS ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val)
{
return ndr_token_store(ndr, &ndr->switch_list, p, val);
}
-NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, void *p, uint32_t val)
+NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val)
{
return ndr_token_store(ndr, &ndr->switch_list, p, val);
}
@@ -657,12 +657,12 @@ NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, void *p, uint32_t val)
/*
retrieve a switch value
*/
-uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, void *p)
+uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p)
{
return ndr_token_peek(&ndr->switch_list, p);
}
-uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, void *p)
+uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p)
{
return ndr_token_peek(&ndr->switch_list, p);
}
@@ -729,21 +729,6 @@ NTSTATUS ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
return NT_STATUS_OK;
}
-
-/*
- pull a union from a blob using NDR
-*/
-NTSTATUS ndr_pull_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, uint32_t level, void *p,
- ndr_pull_union_fn_t fn)
-{
- struct ndr_pull *ndr;
- ndr = ndr_pull_init_blob(blob, mem_ctx);
- if (!ndr) {
- return NT_STATUS_NO_MEMORY;
- }
- return fn(ndr, NDR_SCALARS|NDR_BUFFERS, level, p);
-}
-
/*
pull a struct from a blob using NDR
*/
@@ -807,7 +792,7 @@ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
/*
generic ndr_size_*() handler for unions
*/
-size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_union_fn_t push)
+size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push)
{
struct ndr_push *ndr;
NTSTATUS status;
@@ -819,7 +804,8 @@ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_union_f
ndr = ndr_push_init_ctx(NULL);
if (!ndr) return 0;
ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
- status = push(ndr, NDR_SCALARS|NDR_BUFFERS, level, discard_const(p));
+ ndr_push_set_switch_value(ndr, p, level);
+ status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
if (!NT_STATUS_IS_OK(status)) {
return 0;
}