summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-08-11 19:48:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:51 -0500
commit1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a (patch)
tree3b193a8d482844dbdd05ae335882c800908bdd0f /source4/librpc/ndr
parentca72bdfecbea2e332821bc292b4bb34f6c96ac2e (diff)
downloadsamba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.tar.gz
samba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.tar.bz2
samba-1d3b81e6c0c4c654c7395fe84b053cd77ef7d81a.zip
r1736: - Pidl updates:
- Support for "object oriented" interfaces in pidl - Support for inherited interfaces in pidl - Simplification of the support for properties on an interface - Start on dcom rpc torture tests (This used to be commit 45c3d0036b8510102816f9cdff9210098259cc5f)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_basic.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 5d4ade096f..bf72e0ad8b 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -207,6 +207,21 @@ NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *da
}
/*
+ pull a const array of HYPER_T
+*/
+NTSTATUS ndr_pull_array_HYPER_T(struct ndr_pull *ndr, int ndr_flags, HYPER_T *data, uint32_t n)
+{
+ uint32_t i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
+ for (i=0;i<n;i++) {
+ NDR_CHECK(ndr_pull_HYPER_T(ndr, &data[i]));
+ }
+ return NT_STATUS_OK;
+}
+
+/*
push a uint8
*/
NTSTATUS ndr_push_uint8(struct ndr_push *ndr, uint8_t v)
@@ -347,6 +362,21 @@ NTSTATUS ndr_push_array_uint32(struct ndr_push *ndr, int ndr_flags, const uint32
}
/*
+ push an array of HYPER_T
+*/
+NTSTATUS ndr_push_array_HYPER_T(struct ndr_push *ndr, int ndr_flags, const HYPER_T *data, uint32_t n)
+{
+ int i;
+ if (!(ndr_flags & NDR_SCALARS)) {
+ return NT_STATUS_OK;
+ }
+ for (i=0;i<n;i++) {
+ NDR_CHECK(ndr_push_HYPER_T(ndr, data[i]));
+ }
+ return NT_STATUS_OK;
+}
+
+/*
save the current position
*/
void ndr_push_save(struct ndr_push *ndr, struct ndr_push_save *save)
@@ -798,6 +828,24 @@ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level
ndr->print(ndr, "UNKNOWN LEVEL %u", level);
}
+void ndr_print_array_HYPER_T(struct ndr_print *ndr, const char *name,
+ const HYPER_T *data, uint32_t count)
+{
+ int i;
+
+ ndr->print(ndr, "%s: ARRAY(%d)", name, count);
+ ndr->depth++;
+ for (i=0;i<count;i++) {
+ char *idx=NULL;
+ asprintf(&idx, "[%d]", i);
+ if (idx) {
+ ndr_print_HYPER_T(ndr, idx, data[i]);
+ free(idx);
+ }
+ }
+ ndr->depth--;
+}
+
void ndr_print_array_uint32(struct ndr_print *ndr, const char *name,
const uint32_t *data, uint32_t count)
{