summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-16 10:03:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:43 -0500
commita6878f6c6e17ea99baf57e5724d524548a44ada8 (patch)
treeab330ca0026650d07d4c1d693ba77f43c81aab0e /source4/librpc/ndr
parent845f5596c86928b7db4337c8c269130bc55338fe (diff)
downloadsamba-a6878f6c6e17ea99baf57e5724d524548a44ada8.tar.gz
samba-a6878f6c6e17ea99baf57e5724d524548a44ada8.tar.bz2
samba-a6878f6c6e17ea99baf57e5724d524548a44ada8.zip
r5414: - added libcli/wins/, a basic client library for WINS replication
- added a new IDL type "udlongr", which is like udlong, but with the two uint32 halves reversed - modified the winsrepl.idl to cope with a wider range of packets (This used to be commit bc8d60c918f2e268d591aac464fc6a78c38a4cf9)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_basic.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 5eecb1d60b..5f91cef2e8 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -132,6 +132,19 @@ NTSTATUS ndr_pull_udlong(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
}
/*
+ parse a udlongr
+*/
+NTSTATUS ndr_pull_udlongr(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
+{
+ NDR_PULL_ALIGN(ndr, 4);
+ NDR_PULL_NEED_BYTES(ndr, 8);
+ *v = ((uint64_t)NDR_IVAL(ndr, ndr->offset)) << 32;
+ *v |= NDR_IVAL(ndr, ndr->offset+4);
+ ndr->offset += 8;
+ return NT_STATUS_OK;
+}
+
+/*
parse a dlong
*/
NTSTATUS ndr_pull_dlong(struct ndr_pull *ndr, int ndr_flags, int64_t *v)
@@ -329,7 +342,7 @@ NTSTATUS ndr_push_int32(struct ndr_push *ndr, int ndr_flags, int32_t v)
}
/*
- push a uint64
+ push a udlong
*/
NTSTATUS ndr_push_udlong(struct ndr_push *ndr, int ndr_flags, uint64_t v)
{
@@ -342,6 +355,19 @@ NTSTATUS ndr_push_udlong(struct ndr_push *ndr, int ndr_flags, uint64_t v)
}
/*
+ push a udlongr
+*/
+NTSTATUS ndr_push_udlongr(struct ndr_push *ndr, int ndr_flags, uint64_t v)
+{
+ NDR_PUSH_ALIGN(ndr, 4);
+ NDR_PUSH_NEED_BYTES(ndr, 8);
+ NDR_SIVAL(ndr, ndr->offset+4, (v>>32));
+ NDR_SIVAL(ndr, ndr->offset, (v & 0xFFFFFFFF));
+ ndr->offset += 8;
+ return NT_STATUS_OK;
+}
+
+/*
push a int64
*/
NTSTATUS ndr_push_dlong(struct ndr_push *ndr, int ndr_flags, int64_t v)
@@ -1107,6 +1133,11 @@ void ndr_print_udlong(struct ndr_print *ndr, const char *name, uint64_t v)
v);
}
+void ndr_print_udlongr(struct ndr_print *ndr, const char *name, uint64_t v)
+{
+ ndr_print_udlong(ndr, name, v);
+}
+
void ndr_print_dlong(struct ndr_print *ndr, const char *name, int64_t v)
{
ndr->print(ndr, "%-25s: 0x%08x%08x (%lld)", name,