r13840: Mark some functions as public.
[samba.git] / source / librpc / ndr / ndr.c
index 26190b199e5665a51899daaae7831110c905fc53..1f626df13b3e10329e0071ddd74bb319c97b7c9d 100644 (file)
@@ -46,7 +46,7 @@ const struct dcerpc_syntax_id ndr64_transfer_syntax = {
 /*
   work out the number of bytes needed to align on a n byte boundary
 */
-size_t ndr_align_size(uint32_t offset, size_t n)
+_PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n)
 {
        if ((offset & (n-1)) == 0) return 0;
        return n - (offset & (n-1));
@@ -55,7 +55,7 @@ size_t ndr_align_size(uint32_t offset, size_t n)
 /*
   initialise a ndr parse structure from a data blob
 */
-struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
+_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
 {
        struct ndr_pull *ndr;
 
@@ -72,7 +72,7 @@ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
 /*
   advance by 'size' bytes
 */
-NTSTATUS ndr_pull_advance(struct ndr_pull *ndr, uint32_t size)
+_PUBLIC_ NTSTATUS ndr_pull_advance(struct ndr_pull *ndr, uint32_t size)
 {
        ndr->offset += size;
        if (ndr->offset > ndr->data_size) {
@@ -98,14 +98,14 @@ static NTSTATUS ndr_pull_set_offset(struct ndr_pull *ndr, uint32_t ofs)
 }
 
 /* save the offset/size of the current ndr state */
-void ndr_pull_save(struct ndr_pull *ndr, struct ndr_pull_save *save)
+_PUBLIC_ void ndr_pull_save(struct ndr_pull *ndr, struct ndr_pull_save *save)
 {
        save->offset = ndr->offset;
        save->data_size = ndr->data_size;
 }
 
 /* restore the size/offset of a ndr structure */
-void ndr_pull_restore(struct ndr_pull *ndr, struct ndr_pull_save *save)
+_PUBLIC_ void ndr_pull_restore(struct ndr_pull *ndr, struct ndr_pull_save *save)
 {
        ndr->offset = save->offset;
        ndr->data_size = save->data_size;
@@ -113,7 +113,7 @@ void ndr_pull_restore(struct ndr_pull *ndr, struct ndr_pull_save *save)
 
 
 /* create a ndr_push structure, ready for some marshalling */
-struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
+_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
 {
        struct ndr_push *ndr;
 
@@ -134,20 +134,20 @@ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
 
 
 /* create a ndr_push structure, ready for some marshalling */
-struct ndr_push *ndr_push_init(void)
+_PUBLIC_ struct ndr_push *ndr_push_init(void)
 {
        return ndr_push_init_ctx(NULL);
 }
 
 /* free a ndr_push structure */
-void ndr_push_free(struct ndr_push *ndr)
+_PUBLIC_ void ndr_push_free(struct ndr_push *ndr)
 {
        talloc_free(ndr);
 }
 
 
 /* return a DATA_BLOB structure for the current ndr_push marshalled data */
-DATA_BLOB ndr_push_blob(struct ndr_push *ndr)
+_PUBLIC_ DATA_BLOB ndr_push_blob(struct ndr_push *ndr)
 {
        DATA_BLOB blob;
        blob.data = ndr->data;
@@ -162,7 +162,7 @@ DATA_BLOB ndr_push_blob(struct ndr_push *ndr)
 /*
   expand the available space in the buffer to 'size'
 */
-NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32_t size)
+_PUBLIC_ NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32_t size)
 {
        if (ndr->alloc_size > size) {
                return NT_STATUS_OK;
@@ -181,7 +181,7 @@ NTSTATUS ndr_push_expand(struct ndr_push *ndr, uint32_t size)
        return NT_STATUS_OK;
 }
 
-void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
+_PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
 {
        va_list ap;
        char *s = NULL;
@@ -217,7 +217,7 @@ static void ndr_print_string_helper(struct ndr_print *ndr, const char *format, .
 /*
   a useful helper function for printing idl structures via DEBUG()
 */
-void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
+_PUBLIC_ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -233,7 +233,7 @@ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr)
 /*
   a useful helper function for printing idl unions via DEBUG()
 */
-void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
+_PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -250,7 +250,7 @@ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level,
 /*
   a useful helper function for printing idl function calls via DEBUG()
 */
-void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int flags, void *ptr)
+_PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int flags, void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -267,24 +267,30 @@ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int fla
 /*
   a useful helper function for printing idl function calls to a string
 */
-char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
+_PUBLIC_ char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
                                ndr_print_function_t fn, const char *name, 
                                int flags, void *ptr)
 {
        struct ndr_print *ndr;
+       char *ret = NULL;
 
        ndr = talloc_zero(mem_ctx, struct ndr_print);
        if (!ndr) return NULL;
-       ndr->private = talloc_strdup(mem_ctx, "");
+       ndr->private = talloc_strdup(ndr, "");
+       if (!ndr->private) {
+               goto failed;
+       }
        ndr->print = ndr_print_string_helper;
        ndr->depth = 1;
        ndr->flags = 0;
        fn(ndr, name, flags, ptr);
+       ret = talloc_steal(mem_ctx, ndr->private);
+failed:
        talloc_free(ndr);
-       return ndr->private;
+       return ret;
 }
 
-void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
+_PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
 {
        /* the big/little endian flags are inter-dependent */
        if (new_flags & LIBNDR_FLAG_LITTLE_ENDIAN) {
@@ -324,7 +330,7 @@ static NTSTATUS ndr_map_error(enum ndr_err_code err)
 /*
   return and possibly log an NDR error
 */
-NTSTATUS ndr_pull_error(struct ndr_pull *ndr, 
+_PUBLIC_ NTSTATUS ndr_pull_error(struct ndr_pull *ndr, 
                        enum ndr_err_code err, const char *format, ...) _PRINTF_ATTRIBUTE(3,4)
 {
        char *s=NULL;
@@ -344,7 +350,7 @@ NTSTATUS ndr_pull_error(struct ndr_pull *ndr,
 /*
   return and possibly log an NDR error
 */
-NTSTATUS ndr_push_error(struct ndr_push *ndr, enum ndr_err_code err, const char *format, ...)  _PRINTF_ATTRIBUTE(3,4)
+_PUBLIC_ NTSTATUS ndr_push_error(struct ndr_push *ndr, enum ndr_err_code err, const char *format, ...)  _PRINTF_ATTRIBUTE(3,4)
 {
        char *s=NULL;
        va_list ap;
@@ -364,7 +370,7 @@ NTSTATUS ndr_push_error(struct ndr_push *ndr, enum ndr_err_code err, const char
   handle subcontext buffers, which in midl land are user-marshalled, but
   we use magic in pidl to make them easier to cope with
 */
-NTSTATUS ndr_pull_subcontext_start(struct ndr_pull *ndr, 
+_PUBLIC_ NTSTATUS ndr_pull_subcontext_start(struct ndr_pull *ndr, 
                                   struct ndr_pull **_subndr,
                                   size_t header_size,
                                   ssize_t size_is)
@@ -423,7 +429,7 @@ NTSTATUS ndr_pull_subcontext_start(struct ndr_pull *ndr,
        return NT_STATUS_OK;
 }
 
-NTSTATUS ndr_pull_subcontext_end(struct ndr_pull *ndr, 
+_PUBLIC_ NTSTATUS ndr_pull_subcontext_end(struct ndr_pull *ndr, 
                                 struct ndr_pull *subndr,
                                 size_t header_size,
                                 ssize_t size_is)
@@ -440,7 +446,7 @@ NTSTATUS ndr_pull_subcontext_end(struct ndr_pull *ndr,
        return NT_STATUS_OK;
 }
 
-NTSTATUS ndr_push_subcontext_start(struct ndr_push *ndr,
+_PUBLIC_ NTSTATUS ndr_push_subcontext_start(struct ndr_push *ndr,
                                   struct ndr_push **_subndr,
                                   size_t header_size,
                                   ssize_t size_is)
@@ -458,7 +464,7 @@ NTSTATUS ndr_push_subcontext_start(struct ndr_push *ndr,
 /*
   push a subcontext header 
 */
-NTSTATUS ndr_push_subcontext_end(struct ndr_push *ndr,
+_PUBLIC_ NTSTATUS ndr_push_subcontext_end(struct ndr_push *ndr,
                                 struct ndr_push *subndr,
                                 size_t header_size,
                                 ssize_t size_is)
@@ -497,7 +503,7 @@ NTSTATUS ndr_push_subcontext_end(struct ndr_push *ndr,
 /*
   store a token in the ndr context, for later retrieval
 */
-NTSTATUS ndr_token_store(TALLOC_CTX *mem_ctx, 
+_PUBLIC_ NTSTATUS ndr_token_store(TALLOC_CTX *mem_ctx, 
                         struct ndr_token_list **list, 
                         const void *key, 
                         uint32_t value)
@@ -516,7 +522,7 @@ NTSTATUS ndr_token_store(TALLOC_CTX *mem_ctx,
 /*
   retrieve a token from a ndr context, using cmp_fn to match the tokens
 */
-NTSTATUS ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v,
+_PUBLIC_ NTSTATUS ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v,
                                   comparison_fn_t _cmp_fn, BOOL _remove_tok)
 {
        struct ndr_token_list *tok;
@@ -537,7 +543,7 @@ found:
 /*
   retrieve a token from a ndr context
 */
-NTSTATUS ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v)
+_PUBLIC_ NTSTATUS ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v)
 {
        return ndr_token_retrieve_cmp_fn(list, key, v, NULL, True);
 }
@@ -545,7 +551,7 @@ NTSTATUS ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint3
 /*
   peek at but don't removed a token from a ndr context
 */
-uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key)
+_PUBLIC_ uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key)
 {
        NTSTATUS status;
        uint32_t v;
@@ -557,7 +563,7 @@ uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key)
 /*
   pull an array size field and add it to the array_size_list token list
 */
-NTSTATUS ndr_pull_array_size(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_pull_array_size(struct ndr_pull *ndr, const void *p)
 {
        uint32_t size;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &size));
@@ -567,7 +573,7 @@ NTSTATUS ndr_pull_array_size(struct ndr_pull *ndr, const void *p)
 /*
   get the stored array size field
 */
-uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->array_size_list, p);
 }
@@ -575,7 +581,7 @@ uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p)
 /*
   check the stored array size field
 */
-NTSTATUS ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size)
+_PUBLIC_ NTSTATUS ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size)
 {
        uint32_t stored;
        stored = ndr_token_peek(&ndr->array_size_list, p);
@@ -590,7 +596,7 @@ NTSTATUS ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size)
 /*
   pull an array length field and add it to the array_length_list token list
 */
-NTSTATUS ndr_pull_array_length(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_pull_array_length(struct ndr_pull *ndr, const void *p)
 {
        uint32_t length, offset;
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &offset));
@@ -605,7 +611,7 @@ NTSTATUS ndr_pull_array_length(struct ndr_pull *ndr, const void *p)
 /*
   get the stored array length field
 */
-uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->array_length_list, p);
 }
@@ -613,7 +619,7 @@ uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p)
 /*
   check the stored array length field
 */
-NTSTATUS ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length)
+_PUBLIC_ NTSTATUS ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length)
 {
        uint32_t stored;
        stored = ndr_token_peek(&ndr->array_length_list, p);
@@ -628,17 +634,17 @@ 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, const void *p, uint32_t val)
+_PUBLIC_ 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, const void *p, uint32_t val)
+_PUBLIC_ 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);
 }
 
-NTSTATUS ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val)
+_PUBLIC_ NTSTATUS ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val)
 {
        return ndr_token_store(ndr, &ndr->switch_list, p, val);
 }
@@ -646,17 +652,17 @@ NTSTATUS ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32
 /*
   retrieve a switch value
  */
-uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p)
+_PUBLIC_ 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, const void *p)
+_PUBLIC_ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->switch_list, p);
 }
 
-uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p)
+_PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->switch_list, p);
 }
@@ -664,7 +670,7 @@ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p)
 /*
   pull a struct from a blob using NDR
 */
-NTSTATUS ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
+_PUBLIC_ NTSTATUS ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                              ndr_pull_flags_fn_t fn)
 {
        struct ndr_pull *ndr;
@@ -678,7 +684,7 @@ NTSTATUS ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *
 /*
   pull a struct from a blob using NDR - failing if all bytes are not consumed
 */
-NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
+_PUBLIC_ NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                                  ndr_pull_flags_fn_t fn)
 {
        struct ndr_pull *ndr;
@@ -699,7 +705,7 @@ NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, vo
 /*
   pull a union from a blob using NDR, given the union discriminator
 */
-NTSTATUS ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
+_PUBLIC_ NTSTATUS ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                             uint32_t level, ndr_pull_flags_fn_t fn)
 {
        struct ndr_pull *ndr;
@@ -721,7 +727,7 @@ NTSTATUS ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p
 /*
   push a struct to a blob using NDR
 */
-NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p,
+_PUBLIC_ NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p,
                              ndr_push_flags_fn_t fn)
 {
        NTSTATUS status;
@@ -743,7 +749,7 @@ NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *
 /*
   push a union to a blob using NDR
 */
-NTSTATUS ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
+_PUBLIC_ NTSTATUS ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
                             uint32_t level, ndr_push_flags_fn_t fn)
 {
        NTSTATUS status;
@@ -766,7 +772,7 @@ NTSTATUS ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
 /*
   generic ndr_size_*() handler for structures
 */
-size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
+_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
 {
        struct ndr_push *ndr;
        NTSTATUS status;
@@ -790,7 +796,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_flags_fn_t push)
+_PUBLIC_ 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;
@@ -815,7 +821,7 @@ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_f
 /*
   get the current base for relative pointers for the push
 */
-uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr)
+_PUBLIC_ uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr)
 {
        return ndr->relative_base_offset;
 }
@@ -823,7 +829,7 @@ uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr)
 /*
   restore the old base for relative pointers for the push
 */
-void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset)
+_PUBLIC_ void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset)
 {
        ndr->relative_base_offset = offset;
 }
@@ -832,7 +838,7 @@ void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset
   setup the current base for relative pointers for the push
   called in the NDR_SCALAR stage
 */
-NTSTATUS ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset)
+_PUBLIC_ NTSTATUS ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset)
 {
        ndr->relative_base_offset = offset;
        return ndr_token_store(ndr, &ndr->relative_base_list, p, offset);
@@ -842,7 +848,7 @@ NTSTATUS ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *
   setup the current base for relative pointers for the push
   called in the NDR_BUFFERS stage
 */
-NTSTATUS ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p)
 {
        return ndr_token_retrieve(&ndr->relative_base_list, p, &ndr->relative_base_offset);
 }
@@ -851,7 +857,7 @@ NTSTATUS ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *
   push a relative object - stage1
   this is called during SCALARS processing
 */
-NTSTATUS ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p)
 {
        if (p == NULL) {
                NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
@@ -866,7 +872,7 @@ NTSTATUS ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p)
   push a relative object - stage2
   this is called during buffers processing
 */
-NTSTATUS ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
 {
        struct ndr_push_save save;
        uint32_t ptr_offset = 0xFFFFFFFF;
@@ -894,7 +900,7 @@ NTSTATUS ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
 /*
   get the current base for relative pointers for the pull
 */
-uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr)
+_PUBLIC_ uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr)
 {
        return ndr->relative_base_offset;
 }
@@ -902,7 +908,7 @@ uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr)
 /*
   restore the old base for relative pointers for the pull
 */
-void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset)
+_PUBLIC_ void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset)
 {
        ndr->relative_base_offset = offset;
 }
@@ -911,7 +917,7 @@ void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset
   setup the current base for relative pointers for the pull
   called in the NDR_SCALAR stage
 */
-NTSTATUS ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset)
+_PUBLIC_ NTSTATUS ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset)
 {
        ndr->relative_base_offset = offset;
        return ndr_token_store(ndr, &ndr->relative_base_list, p, offset);
@@ -921,7 +927,7 @@ NTSTATUS ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *
   setup the current base for relative pointers for the pull
   called in the NDR_BUFFERS stage
 */
-NTSTATUS ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *p)
 {
        return ndr_token_retrieve(&ndr->relative_base_list, p, &ndr->relative_base_offset);
 }
@@ -930,7 +936,7 @@ NTSTATUS ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *
   pull a relative object - stage1
   called during SCALARS processing
 */
-NTSTATUS ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset)
+_PUBLIC_ NTSTATUS ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset)
 {
        rel_offset += ndr->relative_base_offset;
        if (rel_offset > ndr->data_size) {
@@ -945,7 +951,7 @@ NTSTATUS ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t re
   pull a relative object - stage2
   called during BUFFERS processing
 */
-NTSTATUS ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p)
 {
        uint32_t rel_offset;
        NDR_CHECK(ndr_token_retrieve(&ndr->relative_list, p, &rel_offset));