summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/config.mk9
-rw-r--r--source4/librpc/idl/drsblobs.idl2
-rw-r--r--source4/librpc/idl/irpc.idl2
-rw-r--r--source4/librpc/idl/lsa.idl2
-rw-r--r--source4/librpc/idl/nbt.idl4
-rw-r--r--source4/librpc/idl/netlogon.idl2
-rw-r--r--source4/librpc/idl/oxidresolver.idl2
-rw-r--r--source4/librpc/idl/remact.idl2
-rw-r--r--source4/librpc/idl/spoolss.idl2
-rw-r--r--source4/librpc/ndr.pc.in2
-rw-r--r--source4/librpc/ndr/libndr.h171
-rw-r--r--source4/librpc/ndr/ndr.c8
-rw-r--r--source4/librpc/ndr/uuid.c2
-rw-r--r--source4/librpc/rpc/dcerpc.c13
-rw-r--r--source4/librpc/rpc/dcerpc.h126
-rw-r--r--source4/librpc/rpc/dcerpc_auth.c5
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c11
-rw-r--r--source4/librpc/rpc/dcerpc_error.c2
-rw-r--r--source4/librpc/rpc/dcerpc_schannel.c3
-rw-r--r--source4/librpc/rpc/dcerpc_secondary.c11
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c7
-rw-r--r--source4/librpc/rpc/dcerpc_smb2.c1
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c1
-rw-r--r--source4/librpc/rpc/dcerpc_util.c21
-rw-r--r--source4/librpc/tests/binding_string.c1
25 files changed, 357 insertions, 55 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index a316e059b3..9b91ba1115 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -11,7 +11,7 @@ OBJ_FILES = \
ndr/ndr_string.o \
ndr/uuid.o
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \
- LIBSAMBA-CONFIG
+ LIBSAMBA-HOSTCONFIG
# End SUBSYSTEM LIBNDR
################################################
@@ -24,7 +24,7 @@ INSTALLDIR = BINDIR
OBJ_FILES = \
tools/ndrdump.o
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG \
+ LIBSAMBA-HOSTCONFIG \
LIBSAMBA-UTIL \
LIBPOPT \
POPT_SAMBA \
@@ -423,7 +423,7 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_WINREG
OBJ_FILES = gen_ndr/ndr_initshutdown_c.o
PUBLIC_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN
-[SUBSYSTEM::dcerpc_mgmt]
+[SUBSYSTEM::RPC_NDR_MGMT]
OBJ_FILES = gen_ndr/ndr_mgmt_c.o
PRIVATE_DEPENDENCIES = NDR_MGMT
@@ -495,6 +495,7 @@ PRIVATE_DEPENDENCIES = \
samba-socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 \
LIBNDR NDR_DCERPC RPC_NDR_EPMAPPER \
NDR_SCHANNEL RPC_NDR_NETLOGON \
+ RPC_NDR_MGMT \
gensec LIBCLI_AUTH LIBCLI_RAW \
LP_RESOLVE
PUBLIC_DEPENDENCIES = CREDENTIALS
@@ -606,7 +607,7 @@ PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC
[PYTHON::swig_dcerpc]
SWIG_FILE = rpc/dcerpc.i
-PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
+PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
[PYTHON::python_echo]
OBJ_FILES = gen_ndr/py_echo.o
diff --git a/source4/librpc/idl/drsblobs.idl b/source4/librpc/idl/drsblobs.idl
index eaea6aa30e..f8cbdac8c5 100644
--- a/source4/librpc/idl/drsblobs.idl
+++ b/source4/librpc/idl/drsblobs.idl
@@ -1,6 +1,6 @@
#include "idl_types.h"
-import "drsuapi.idl";
+import "drsuapi.idl", "misc.idl";
[
uuid("12345778-1234-abcd-0001-00000001"),
diff --git a/source4/librpc/idl/irpc.idl b/source4/librpc/idl/irpc.idl
index 0a53494049..2c659aa785 100644
--- a/source4/librpc/idl/irpc.idl
+++ b/source4/librpc/idl/irpc.idl
@@ -1,6 +1,6 @@
#include "idl_types.h"
-import "security.idl", "nbt.idl";
+import "misc.idl", "security.idl", "nbt.idl";
/*
definitions for irpc primitives
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 3159a7d16d..6d15822ea6 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -4,7 +4,7 @@
lsa interface definition
*/
-import "security.idl";
+import "misc.idl", "security.idl";
[ uuid("12345778-1234-abcd-ef00-0123456789ab"),
version(0.0),
diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl
index 17304bfa0d..aa88360882 100644
--- a/source4/librpc/idl/nbt.idl
+++ b/source4/librpc/idl/nbt.idl
@@ -8,9 +8,9 @@
encoding if it doesn't work out
*/
-import "security.idl", "svcctl.idl";
+import "misc.idl", "security.idl", "svcctl.idl";
[
-helper("libcli/nbt/nbtname.h")
+helper("libcli/nbt/libnbt.h")
]
interface nbt
{
diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl
index d06c2acdd4..b29fc50bfa 100644
--- a/source4/librpc/idl/netlogon.idl
+++ b/source4/librpc/idl/netlogon.idl
@@ -4,7 +4,7 @@
who contributed!
*/
-import "lsa.idl", "samr.idl", "security.idl", "nbt.idl";
+import "misc.idl", "lsa.idl", "samr.idl", "security.idl", "nbt.idl";
#include "idl_types.h"
diff --git a/source4/librpc/idl/oxidresolver.idl b/source4/librpc/idl/oxidresolver.idl
index ac028cec29..95c8a1c5f0 100644
--- a/source4/librpc/idl/oxidresolver.idl
+++ b/source4/librpc/idl/oxidresolver.idl
@@ -10,7 +10,7 @@
(used by DCOM)
*/
-import "orpc.idl";
+import "misc.idl", "orpc.idl";
[
uuid("99fcfec4-5260-101b-bbcb-00aa0021347a"),
diff --git a/source4/librpc/idl/remact.idl b/source4/librpc/idl/remact.idl
index 58d976e078..2165ecfc81 100644
--- a/source4/librpc/idl/remact.idl
+++ b/source4/librpc/idl/remact.idl
@@ -3,7 +3,7 @@
http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm
*/
-import "orpc.idl";
+import "misc.idl", "orpc.idl";
[
uuid("4d9f4ab8-7d1c-11cf-861e-0020af6e7c57"),
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 2144393ebd..64cfd46b0e 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -3,7 +3,7 @@
/*
spoolss interface definitions
*/
-import "security.idl", "winreg.idl";
+import "misc.idl", "security.idl", "winreg.idl";
[ uuid("12345678-1234-abcd-ef00-0123456789ab"),
version(1.0),
diff --git a/source4/librpc/ndr.pc.in b/source4/librpc/ndr.pc.in
index ed4c459214..2f4d95006f 100644
--- a/source4/librpc/ndr.pc.in
+++ b/source4/librpc/ndr.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: ndr
Description: Network Data Representation Core Library
-Requires: samba-config talloc
+Requires: samba-hostconfig talloc
Version: 0.0.1
Libs: -L${libdir} -lndr
Cflags: -I${includedir} -DHAVE_IMMEDIATE_STRUCTURES=1
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 731ef0f60b..2439c386db 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -1,6 +1,7 @@
/*
Unix SMB/CIFS implementation.
rpc interface definitions
+
Copyright (C) Andrew Tridgell 2003
This program is free software; you can redistribute it and/or modify
@@ -17,11 +18,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* This is a public header file that is installed as part of Samba.
+ * If you remove any functions or change their signature, update
+ * the so version number. */
+
#ifndef __LIBNDR_H__
#define __LIBNDR_H__
#include <talloc.h>
#include "lib/util/util.h" /* for discard_const */
+#include <sys/time.h>
#include "lib/charset/charset.h"
/*
@@ -287,8 +293,7 @@ typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, const void *);
typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, const void *);
#include "libcli/util/error.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "librpc/ndr/libndr_proto.h"
+#include "librpc/gen_ndr/misc.h"
extern const struct ndr_syntax_id ndr_transfer_syntax;
extern const struct ndr_syntax_id ndr64_transfer_syntax;
@@ -333,5 +338,167 @@ void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct d
size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags);
void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip);
void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
+enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
+enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_push_flags_fn_t fn);
+size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
+size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push);
+uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
+void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset);
+enum ndr_err_code ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset);
+enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p);
+enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p);
+enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p);
+uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr);
+void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset);
+enum ndr_err_code ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset);
+enum ndr_err_code ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *p);
+enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset);
+enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p);
+size_t ndr_align_size(uint32_t offset, size_t n);
+struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
+enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size);
+struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
+DATA_BLOB ndr_push_blob(struct ndr_push *ndr);
+enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size);
+void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
+void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
+void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr);
+void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
+void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int flags, void *ptr);
+char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, void *ptr);
+char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
+char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
+ ndr_print_function_t fn, const char *name,
+ int flags, void *ptr);
+void ndr_set_flags(uint32_t *pflags, uint32_t new_flags);
+enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr,
+ enum ndr_err_code ndr_err,
+ const char *format, ...) PRINTF_ATTRIBUTE(3,4);
+enum ndr_err_code ndr_push_error(struct ndr_push *ndr,
+ enum ndr_err_code ndr_err,
+ const char *format, ...) PRINTF_ATTRIBUTE(3,4);
+enum ndr_err_code ndr_pull_subcontext_start(struct ndr_pull *ndr,
+ struct ndr_pull **_subndr,
+ size_t header_size,
+ ssize_t size_is);
+enum ndr_err_code ndr_pull_subcontext_end(struct ndr_pull *ndr,
+ struct ndr_pull *subndr,
+ size_t header_size,
+ ssize_t size_is);
+enum ndr_err_code ndr_push_subcontext_start(struct ndr_push *ndr,
+ struct ndr_push **_subndr,
+ size_t header_size,
+ ssize_t size_is);
+enum ndr_err_code ndr_push_subcontext_end(struct ndr_push *ndr,
+ struct ndr_push *subndr,
+ size_t header_size,
+ ssize_t size_is);
+enum ndr_err_code ndr_token_store(TALLOC_CTX *mem_ctx,
+ struct ndr_token_list **list,
+ const void *key,
+ uint32_t value);
+enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v, comparison_fn_t _cmp_fn, bool _remove_tok);
+enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v);
+uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key);
+enum ndr_err_code ndr_pull_array_size(struct ndr_pull *ndr, const void *p);
+uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p);
+enum ndr_err_code ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size);
+enum ndr_err_code ndr_pull_array_length(struct ndr_pull *ndr, const void *p);
+uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p);
+enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length);
+enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val);
+enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val);
+enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val);
+uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p);
+uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p);
+uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p);
+enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
+enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
+enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
+enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
+
+/* from libndr_basic.h */
+#define NDR_SCALAR_PROTO(name, type) \
+enum ndr_err_code ndr_push_ ## name(struct ndr_push *ndr, int ndr_flags, type v); \
+enum ndr_err_code ndr_pull_ ## name(struct ndr_pull *ndr, int ndr_flags, type *v); \
+void ndr_print_ ## name(struct ndr_print *ndr, const char *var_name, type v);
+
+#define NDR_BUFFER_PROTO(name, type) \
+enum ndr_err_code ndr_push_ ## name(struct ndr_push *ndr, int ndr_flags, const type *v); \
+enum ndr_err_code ndr_pull_ ## name(struct ndr_pull *ndr, int ndr_flags, type *v); \
+void ndr_print_ ## name(struct ndr_print *ndr, const char *var_name, const type *v);
+
+NDR_SCALAR_PROTO(uint8, uint8_t)
+NDR_SCALAR_PROTO(int8, int8_t)
+NDR_SCALAR_PROTO(uint16, uint16_t)
+NDR_SCALAR_PROTO(int16, int16_t)
+NDR_SCALAR_PROTO(uint32, uint32_t)
+NDR_SCALAR_PROTO(int32, int32_t)
+NDR_SCALAR_PROTO(udlong, uint64_t)
+NDR_SCALAR_PROTO(udlongr, uint64_t)
+NDR_SCALAR_PROTO(dlong, int64_t)
+NDR_SCALAR_PROTO(hyper, uint64_t)
+NDR_SCALAR_PROTO(pointer, void *)
+NDR_SCALAR_PROTO(time_t, time_t)
+NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS)
+NDR_SCALAR_PROTO(WERROR, WERROR)
+NDR_SCALAR_PROTO(NTTIME, NTTIME)
+NDR_SCALAR_PROTO(NTTIME_1sec, NTTIME)
+NDR_SCALAR_PROTO(NTTIME_hyper, NTTIME)
+NDR_SCALAR_PROTO(DATA_BLOB, DATA_BLOB)
+NDR_SCALAR_PROTO(ipv4address, const char *)
+NDR_SCALAR_PROTO(string, const char *)
+
+enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r);
+enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r);
+void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r);
+bool policy_handle_empty(struct policy_handle *h);
+
+void ndr_check_padding(struct ndr_pull *ndr, size_t n);
+enum ndr_err_code ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v);
+enum ndr_err_code ndr_pull_ref_ptr(struct ndr_pull *ndr, uint32_t *v);
+enum ndr_err_code ndr_pull_bytes(struct ndr_pull *ndr, uint8_t *data, uint32_t n);
+enum ndr_err_code ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *data, uint32_t n);
+enum ndr_err_code ndr_push_align(struct ndr_push *ndr, size_t size);
+enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size);
+enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n);
+enum ndr_err_code ndr_push_zero(struct ndr_push *ndr, uint32_t n);
+enum ndr_err_code ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const uint8_t *data, uint32_t n);
+enum ndr_err_code ndr_push_unique_ptr(struct ndr_push *ndr, const void *p);
+enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p);
+enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr);
+void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type);
+void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, const char *val, uint32_t value);
+void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
+void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
+void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p);
+void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type);
+void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level);
+void ndr_print_array_uint8(struct ndr_print *ndr, const char *name, const uint8_t *data, uint32_t count);
+uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags);
+
+/* strings */
+uint32_t ndr_charset_length(const void *var, charset_t chset);
+size_t ndr_string_array_size(struct ndr_push *ndr, const char *s);
+uint32_t ndr_size_string(int ret, const char * const* string, int flags);
+enum ndr_err_code ndr_pull_string_array(struct ndr_pull *ndr, int ndr_flags, const char ***_a);
+enum ndr_err_code ndr_push_string_array(struct ndr_push *ndr, int ndr_flags, const char **a);
+void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a);
+uint32_t ndr_string_length(const void *_var, uint32_t element_size);
+enum ndr_err_code ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size);
+enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
+enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, charset_t chset);
+
+/* GUIDs */
+bool GUID_equal(const struct GUID *u1, const struct GUID *u2);
+NTSTATUS GUID_from_string(const char *s, struct GUID *guid);
+NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid);
+struct GUID GUID_zero(void);
+bool GUID_all_zero(const struct GUID *u);
+int GUID_compare(const struct GUID *u1, const struct GUID *u2);
+char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid);
+char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid);
+char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid);
+struct GUID GUID_random(void);
#endif /* __LIBNDR_H__ */
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index e6da096403..40852456bc 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -163,7 +163,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_
return NDR_ERR_SUCCESS;
}
-_PUBLIC_ 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, ...)
{
va_list ap;
char *s = NULL;
@@ -181,7 +181,7 @@ _PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format,
free(s);
}
-_PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3)
+_PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...)
{
va_list ap;
int i;
@@ -346,7 +346,7 @@ _PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
*/
_PUBLIC_ enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr,
enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4)
+ const char *format, ...)
{
char *s=NULL;
va_list ap;
@@ -367,7 +367,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr,
*/
_PUBLIC_ enum ndr_err_code ndr_push_error(struct ndr_push *ndr,
enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4)
+ const char *format, ...)
{
char *s=NULL;
va_list ap;
diff --git a/source4/librpc/ndr/uuid.c b/source4/librpc/ndr/uuid.c
index e92df22494..1e6ee0a3db 100644
--- a/source4/librpc/ndr/uuid.c
+++ b/source4/librpc/ndr/uuid.c
@@ -110,7 +110,7 @@ _PUBLIC_ NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid)
/**
* generate a random GUID
*/
-struct GUID GUID_random(void)
+_PUBLIC_ struct GUID GUID_random(void)
{
struct GUID guid;
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index a379398f19..5e32f6f5bf 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -24,13 +24,14 @@
#include "lib/util/dlinklist.h"
#include "lib/events/events.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "libcli/composite/composite.h"
#include "auth/gensec/gensec.h"
#include "param/param.h"
-NTSTATUS dcerpc_init(void)
+_PUBLIC_ NTSTATUS dcerpc_init(void)
{
gensec_init(global_loadparm);
@@ -98,7 +99,7 @@ static struct dcerpc_connection *dcerpc_connection_init(TALLOC_CTX *mem_ctx,
}
/* initialise a dcerpc pipe. */
-struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct event_context *ev,
+_PUBLIC_ struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct event_context *ev,
struct smb_iconv_convenience *ic)
{
struct dcerpc_pipe *p;
@@ -1104,7 +1105,7 @@ static void dcerpc_ship_next_request(struct dcerpc_connection *c)
return the event context for a dcerpc pipe
used by callers who wish to operate asynchronously
*/
-struct event_context *dcerpc_event_context(struct dcerpc_pipe *p)
+_PUBLIC_ struct event_context *dcerpc_event_context(struct dcerpc_pipe *p)
{
return p->conn->event_ctx;
}
@@ -1503,7 +1504,7 @@ _PUBLIC_ NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req)
this can be used when you have ndr push/pull functions in the
standard format
*/
-NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p,
const struct GUID *object,
const struct ndr_interface_table *table,
uint32_t opnum,
@@ -1524,7 +1525,7 @@ NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p,
/*
a useful function for retrieving the server name we connected to
*/
-const char *dcerpc_server_name(struct dcerpc_pipe *p)
+_PUBLIC_ const char *dcerpc_server_name(struct dcerpc_pipe *p)
{
if (!p->conn->transport.target_hostname) {
if (!p->conn->transport.peer_name) {
@@ -1688,7 +1689,7 @@ NTSTATUS dcerpc_alter_context_recv(struct composite_context *ctx)
/*
send a dcerpc alter_context request
*/
-NTSTATUS dcerpc_alter_context(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_alter_context(struct dcerpc_pipe *p,
TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *syntax,
const struct ndr_syntax_id *transfer_syntax)
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index 7c6aa7513b..c4a48a1119 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -20,6 +20,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* This is a public header file that is installed as part of Samba.
+ * If you remove any functions or change their signature, update
+ * the so version number. */
+
#ifndef __DCERPC_H__
#define __DCERPC_H__
@@ -233,6 +237,126 @@ struct smbcli_tree;
struct smb2_tree;
struct socket_address;
-#include "librpc/rpc/dcerpc_proto.h"
+NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
+ struct dcerpc_pipe **pp,
+ const char *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx);
+NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req);
+struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p,
+ const struct GUID *object,
+ const struct ndr_interface_table *table,
+ uint32_t opnum,
+ TALLOC_CTX *mem_ctx,
+ void *r);
+const char *dcerpc_server_name(struct dcerpc_pipe *p);
+struct dcerpc_pipe *dcerpc_pipe_init(TALLOC_CTX *mem_ctx, struct event_context *ev,
+ struct smb_iconv_convenience *ic);
+NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
+ struct smbcli_tree *tree,
+ const char *pipe_name);
+NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p,
+ const struct ndr_interface_table *table);
+NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
+ DATA_BLOB *session_key);
+struct composite_context;
+NTSTATUS dcerpc_secondary_connection_recv(struct composite_context *c,
+ struct dcerpc_pipe **p2);
+NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out);
+
+struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
+ struct dcerpc_binding *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx);
+
+NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+ struct dcerpc_pipe **p);
+
+NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
+ struct dcerpc_pipe **pp,
+ struct dcerpc_binding *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx);
+const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code);
+
+NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
+ struct dcerpc_pipe **p,
+ struct dcerpc_binding *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx);
+char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b);
+NTSTATUS dcerpc_secondary_connection(struct dcerpc_pipe *p,
+ struct dcerpc_pipe **p2,
+ struct dcerpc_binding *b);
+NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
+ struct dcerpc_pipe *p,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
+ uint8_t auth_level);
+struct event_context *dcerpc_event_context(struct dcerpc_pipe *p);
+NTSTATUS dcerpc_init(void);
+struct smbcli_tree *dcerpc_smb_tree(struct dcerpc_connection *c);
+uint16_t dcerpc_smb_fnum(struct dcerpc_connection *c);
+NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
+ struct dcerpc_pipe **pp2,
+ const struct ndr_interface_table *table);
+NTSTATUS dcerpc_alter_context(struct dcerpc_pipe *p,
+ TALLOC_CTX *mem_ctx,
+ const struct ndr_syntax_id *syntax,
+ const struct ndr_syntax_id *transfer_syntax);
+
+NTSTATUS dcerpc_bind_auth(struct dcerpc_pipe *p,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
+ uint8_t auth_type, uint8_t auth_level,
+ const char *service);
+struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_ctx,
+ const char *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct event_context *ev, struct loadparm_context *lp_ctx);
+NTSTATUS dcerpc_pipe_connect_recv(struct composite_context *c,
+ TALLOC_CTX *mem_ctx,
+ struct dcerpc_pipe **pp);
+
+NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
+ const struct ndr_interface_table *table, struct event_context *ev,
+ struct loadparm_context *lp_ctx);
+struct composite_context* dcerpc_secondary_auth_connection_send(struct dcerpc_pipe *p,
+ struct dcerpc_binding *binding,
+ const struct ndr_interface_table *table,
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx);
+NTSTATUS dcerpc_secondary_auth_connection_recv(struct composite_context *c,
+ TALLOC_CTX *mem_ctx,
+ struct dcerpc_pipe **p);
+
+struct composite_context* dcerpc_secondary_connection_send(struct dcerpc_pipe *p,
+ struct dcerpc_binding *b);
+void dcerpc_log_packet(const struct ndr_interface_table *ndr,
+ uint32_t opnum, uint32_t flags,
+ DATA_BLOB *pkt);
+NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower);
+
+NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax);
+
+enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower);
+
+NTSTATUS dcerpc_ndr_request(struct dcerpc_pipe *p,
+ const struct GUID *object,
+ const struct ndr_interface_table *table,
+ uint32_t opnum,
+ TALLOC_CTX *mem_ctx,
+ void *r);
+
#endif /* __DCERPC_H__ */
diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c
index f80ef86413..f990029f1d 100644
--- a/source4/librpc/rpc/dcerpc_auth.c
+++ b/source4/librpc/rpc/dcerpc_auth.c
@@ -25,6 +25,7 @@
#include "libcli/composite/composite.h"
#include "auth/gensec/gensec.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "param/param.h"
/*
@@ -86,7 +87,7 @@ NTSTATUS dcerpc_bind_auth_none_recv(struct composite_context *ctx)
/*
Perform sync non-authenticated dcerpc bind
*/
-NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p,
const struct ndr_interface_table *table)
{
struct composite_context *ctx;
@@ -372,7 +373,7 @@ NTSTATUS dcerpc_bind_auth_recv(struct composite_context *creq)
@retval NTSTATUS status code
*/
-NTSTATUS dcerpc_bind_auth(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_bind_auth(struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
struct loadparm_context *lp_ctx,
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 361be4adcd..cc7f2ddbaa 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -30,6 +30,7 @@
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "auth/credentials/credentials.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
@@ -705,7 +706,7 @@ static void dcerpc_connect_timeout_handler(struct event_context *ev, struct time
start a request to open a rpc connection to a rpc pipe, using
specified binding structure to determine the endpoint and options
*/
-struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
+_PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
@@ -782,7 +783,7 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
/*
receive result of a request to open a rpc connection to a rpc pipe
*/
-NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+_PUBLIC_ NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
struct dcerpc_pipe **p)
{
NTSTATUS status;
@@ -804,7 +805,7 @@ NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC_CTX *mem
open a rpc connection to a rpc pipe, using the specified
binding structure to determine the endpoint and options - sync version
*/
-NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
+_PUBLIC_ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
struct dcerpc_pipe **pp,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
@@ -833,7 +834,7 @@ static void continue_pipe_connect_b(struct composite_context *ctx);
binding to determine the endpoint and options.
The string is to be parsed to a binding structure first.
*/
-struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_ctx,
+_PUBLIC_ struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_ctx,
const char *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
@@ -928,7 +929,7 @@ NTSTATUS dcerpc_pipe_connect_recv(struct composite_context *c,
Open a rpc connection to a rpc pipe, using the specified string
binding to determine the endpoint and options - sync version
*/
-NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
+_PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
struct dcerpc_pipe **pp,
const char *binding,
const struct ndr_interface_table *table,
diff --git a/source4/librpc/rpc/dcerpc_error.c b/source4/librpc/rpc/dcerpc_error.c
index 6394f9cf26..6ea4563ae6 100644
--- a/source4/librpc/rpc/dcerpc_error.c
+++ b/source4/librpc/rpc/dcerpc_error.c
@@ -40,7 +40,7 @@ static const struct dcerpc_fault_table dcerpc_faults[] =
{ NULL, 0}
};
-const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code)
+_PUBLIC_ const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code)
{
int idx = 0;
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c
index 68e211afae..5588b43dcd 100644
--- a/source4/librpc/rpc/dcerpc_schannel.c
+++ b/source4/librpc/rpc/dcerpc_schannel.c
@@ -28,6 +28,7 @@
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "librpc/gen_ndr/ndr_netlogon_c.h"
#include "auth/credentials/credentials.h"
+#include "librpc/rpc/dcerpc_proto.h"
struct schannel_key_state {
struct dcerpc_pipe *pipe;
@@ -396,7 +397,7 @@ NTSTATUS dcerpc_bind_auth_schannel_recv(struct composite_context *c)
/*
Perform schannel authenticated bind - sync version
*/
-NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
+_PUBLIC_ NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c
index ab98215180..abc67ad38b 100644
--- a/source4/librpc/rpc/dcerpc_secondary.c
+++ b/source4/librpc/rpc/dcerpc_secondary.c
@@ -27,6 +27,7 @@
#include "libcli/composite/composite.h"
#include "lib/events/events.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "auth/credentials/credentials.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
@@ -50,7 +51,7 @@ static void continue_pipe_open(struct composite_context *c);
Send request to create a secondary dcerpc connection from a primary
connection
*/
-struct composite_context* dcerpc_secondary_connection_send(struct dcerpc_pipe *p,
+_PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerpc_pipe *p,
struct dcerpc_binding *b)
{
struct composite_context *c;
@@ -183,7 +184,7 @@ static void continue_pipe_open(struct composite_context *c)
Receive result of secondary rpc connection request and return
second dcerpc pipe.
*/
-NTSTATUS dcerpc_secondary_connection_recv(struct composite_context *c,
+_PUBLIC_ NTSTATUS dcerpc_secondary_connection_recv(struct composite_context *c,
struct dcerpc_pipe **p2)
{
NTSTATUS status = composite_wait(c);
@@ -206,7 +207,7 @@ NTSTATUS dcerpc_secondary_connection_recv(struct composite_context *c,
If the primary is a SMB connection then the secondary connection
will be on the same SMB connection, but using a new fnum
*/
-NTSTATUS dcerpc_secondary_connection(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_secondary_connection(struct dcerpc_pipe *p,
struct dcerpc_pipe **p2,
struct dcerpc_binding *b)
{
@@ -234,7 +235,7 @@ struct sec_auth_conn_state {
static void dcerpc_secondary_auth_connection_bind(struct composite_context *ctx);
static void dcerpc_secondary_auth_connection_continue(struct composite_context *ctx);
-struct composite_context* dcerpc_secondary_auth_connection_send(struct dcerpc_pipe *p,
+_PUBLIC_ struct composite_context* dcerpc_secondary_auth_connection_send(struct dcerpc_pipe *p,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
@@ -306,7 +307,7 @@ static void dcerpc_secondary_auth_connection_continue(struct composite_context *
/*
Receive an authenticated pipe, created as a secondary connection
*/
-NTSTATUS dcerpc_secondary_auth_connection_recv(struct composite_context *c,
+_PUBLIC_ NTSTATUS dcerpc_secondary_auth_connection_recv(struct composite_context *c,
TALLOC_CTX *mem_ctx,
struct dcerpc_pipe **p)
{
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 718ce694c5..26fe433b09 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -24,6 +24,7 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
/* transport private information used by SMB pipe transport */
struct smb_private {
@@ -540,7 +541,7 @@ NTSTATUS dcerpc_pipe_open_smb_recv(struct composite_context *c)
return status;
}
-NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
struct smbcli_tree *tree,
const char *pipe_name)
{
@@ -552,7 +553,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p,
/*
return the SMB tree used for a dcerpc over SMB pipe
*/
-struct smbcli_tree *dcerpc_smb_tree(struct dcerpc_connection *c)
+_PUBLIC_ struct smbcli_tree *dcerpc_smb_tree(struct dcerpc_connection *c)
{
struct smb_private *smb;
@@ -567,7 +568,7 @@ struct smbcli_tree *dcerpc_smb_tree(struct dcerpc_connection *c)
/*
return the SMB fnum used for a dcerpc over SMB pipe (hack for torture operations)
*/
-uint16_t dcerpc_smb_fnum(struct dcerpc_connection *c)
+_PUBLIC_ uint16_t dcerpc_smb_fnum(struct dcerpc_connection *c)
{
struct smb_private *smb;
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c
index a0094b8bae..8adca4caba 100644
--- a/source4/librpc/rpc/dcerpc_smb2.c
+++ b/source4/librpc/rpc/dcerpc_smb2.c
@@ -26,6 +26,7 @@
#include "libcli/smb2/smb2_calls.h"
#include "libcli/raw/ioctl.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
/* transport private information used by SMB2 pipe transport */
struct smb2_private {
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index 76389f0d74..7480beae33 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -27,6 +27,7 @@
#include "lib/stream/packet.h"
#include "libcli/composite/composite.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "libcli/resolve/resolve.h"
#include "param/param.h"
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index b8128baf43..dc57735713 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -28,6 +28,7 @@
#include "librpc/gen_ndr/ndr_epmapper_c.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "auth/credentials/credentials.h"
#include "param/param.h"
@@ -236,7 +237,7 @@ const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
/*
form a binding string from a binding structure
*/
-char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
+_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
{
char *s = talloc_strdup(mem_ctx, "");
int i;
@@ -302,7 +303,7 @@ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
/*
parse a binding string into a dcerpc_binding structure
*/
-NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out)
+_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out)
{
struct dcerpc_binding *b;
char *options;
@@ -437,7 +438,7 @@ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_
return NT_STATUS_OK;
}
-NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax)
+_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax)
{
TALLOC_CTX *mem_ctx = talloc_init("floor_get_lhs_data");
struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, NULL);
@@ -633,7 +634,7 @@ enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
return (unsigned int)-1;
}
-enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower)
+_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower)
{
int i;
@@ -715,7 +716,7 @@ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
-NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower)
+_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower)
{
const enum epm_protocol *protseq = NULL;
int num_protocols = -1, i;
@@ -1009,7 +1010,7 @@ NTSTATUS dcerpc_epm_map_binding_recv(struct composite_context *c)
/*
Get endpoint mapping for rpc connection
*/
-NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
+_PUBLIC_ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
const struct ndr_interface_table *table, struct event_context *ev,
struct loadparm_context *lp_ctx)
{
@@ -1329,7 +1330,7 @@ NTSTATUS dcerpc_pipe_auth_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
This may change *p, as it rebinds to a new pipe due to authentication fallback
*/
-NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
+_PUBLIC_ NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
struct dcerpc_pipe **p,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
@@ -1355,7 +1356,7 @@ NTSTATUS dcerpc_generic_session_key(struct dcerpc_connection *c,
/*
fetch the user session key - may be default (above) or the SMB session key
*/
-NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
DATA_BLOB *session_key)
{
return p->conn->security_state.session_key(p->conn, session_key);
@@ -1368,7 +1369,7 @@ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
this triggers on a debug level of >= 10
*/
-void dcerpc_log_packet(const struct ndr_interface_table *ndr,
+_PUBLIC_ void dcerpc_log_packet(const struct ndr_interface_table *ndr,
uint32_t opnum, uint32_t flags,
DATA_BLOB *pkt)
{
@@ -1403,7 +1404,7 @@ void dcerpc_log_packet(const struct ndr_interface_table *ndr,
this uses dcerpc_alter_context() to create a new dcerpc context_id
*/
-NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
+_PUBLIC_ NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
struct dcerpc_pipe **pp2,
const struct ndr_interface_table *table)
{
diff --git a/source4/librpc/tests/binding_string.c b/source4/librpc/tests/binding_string.c
index 5e6fb04515..01cdfae80d 100644
--- a/source4/librpc/tests/binding_string.c
+++ b/source4/librpc/tests/binding_string.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/epmapper.h"
#include "librpc/rpc/dcerpc.h"
+#include "librpc/rpc/dcerpc_proto.h"
#include "torture/torture.h"
static bool test_BindingString(struct torture_context *tctx,