diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-03 09:18:38 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-03 09:18:38 +0000 |
commit | 399fff106d268a5ea95fd2e60735d92b80bcecb1 (patch) | |
tree | 3b3409a7451b76f514cc200d12b7c4f510563878 /source4/libcli/ndr/ndr_basic.c | |
parent | 87ef172531add2672185ec8935180104c3667894 (diff) | |
download | samba-399fff106d268a5ea95fd2e60735d92b80bcecb1.tar.gz samba-399fff106d268a5ea95fd2e60735d92b80bcecb1.tar.bz2 samba-399fff106d268a5ea95fd2e60735d92b80bcecb1.zip |
added rpcecho EchoData test
(This used to be commit 9c7e4db4712d1b2b7d8125e3ae535efd50b80f58)
Diffstat (limited to 'source4/libcli/ndr/ndr_basic.c')
-rw-r--r-- | source4/libcli/ndr/ndr_basic.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source4/libcli/ndr/ndr_basic.c b/source4/libcli/ndr/ndr_basic.c index 736ad0b762..d06eac3ca9 100644 --- a/source4/libcli/ndr/ndr_basic.c +++ b/source4/libcli/ndr/ndr_basic.c @@ -91,7 +91,19 @@ NTSTATUS ndr_pull_u32(struct ndr_pull *ndr, uint32 *v) } else { *v = IVAL(ndr->data, ndr->offset); } - ndr->offset += 2; + ndr->offset += 4; + return NT_STATUS_OK; +} + +/* + parse a set of bytes +*/ +NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char **data, uint32 n) +{ + NDR_PULL_NEED_BYTES(ndr, n); + NDR_ALLOC_N(ndr, *data, n); + memcpy(*data, ndr->data + ndr->offset, n); + ndr->offset += n; return NT_STATUS_OK; } @@ -138,3 +150,14 @@ NTSTATUS ndr_push_u32(struct ndr_push *ndr, uint32 v) ndr->offset += 4; return NT_STATUS_OK; } + +/* + push some bytes +*/ +NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32 n) +{ + NDR_PUSH_NEED_BYTES(ndr, n); + memcpy(ndr->data + ndr->offset, data, n); + ndr->offset += n; + return NT_STATUS_OK; +} |