summaryrefslogtreecommitdiff
path: root/librpc/ndr/ndr_basic.c
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2009-12-10 10:04:48 +0300
committerStefan Metzmacher <metze@samba.org>2009-12-12 10:21:22 +0100
commitf0054da041b961bde25f63791d3b33cc834bd365 (patch)
treed708d6ecc65c0999ba26927c0cd5c20594d568c8 /librpc/ndr/ndr_basic.c
parent5767b1dacc546baef1db569315ba1309bbb99566 (diff)
downloadsamba-f0054da041b961bde25f63791d3b33cc834bd365.tar.gz
samba-f0054da041b961bde25f63791d3b33cc834bd365.tar.bz2
samba-f0054da041b961bde25f63791d3b33cc834bd365.zip
librpc/ndr: add support for relative_short pointers
relative_short is like relative but instead of having the offset coded on 4 bytes it's coded on 2 bytes. Such things happen in GET_DFS_REFERAL messages. Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'librpc/ndr/ndr_basic.c')
-rw-r--r--librpc/ndr/ndr_basic.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index 64fa5a6299..1fd6fdea74 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -176,6 +176,18 @@ _PUBLIC_ enum ndr_err_code ndr_pull_double(struct ndr_pull *ndr, int ndr_flags,
}
/*
+ parse a pointer referent identifier stored in 2 bytes
+*/
+_PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v)
+{
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, v));
+ if (*v != 0) {
+ ndr->ptr_count++;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+/*
parse a pointer referent identifier
*/
_PUBLIC_ enum ndr_err_code ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v)