summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/client.h3
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/librpc/rpc/dcerpc.h2
-rw-r--r--source3/rpc_client/cli_pipe.c39
-rw-r--r--source3/rpc_client/ndr.c2
5 files changed, 48 insertions, 2 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 86b4bee662..09fdb81462 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -95,6 +95,9 @@ struct rpc_pipe_client {
/* The following is only non-null on a netlogon pipe. */
struct dcinfo *dc;
+
+ /* Used by internal rpc_pipe_client */
+ pipes_struct *pipes_struct;
};
/* Transport encryption state. */
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 03c021683a..9ce6a9d7f1 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5244,6 +5244,10 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
const struct ndr_syntax_id *abstract_syntax,
struct rpc_pipe_client **presult);
+NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax,
+ NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r),
+ struct auth_serversupplied_info *serversupplied_info,
+ struct rpc_pipe_client **presult);
NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
const struct ndr_syntax_id *interface,
struct rpc_pipe_client **presult);
diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h
index 1a1fd83060..48019a421d 100644
--- a/source3/librpc/rpc/dcerpc.h
+++ b/source3/librpc/rpc/dcerpc.h
@@ -57,7 +57,7 @@ struct rpc_request {
enum dcerpc_transport_t {
NCA_UNKNOWN, NCACN_NP, NCACN_IP_TCP, NCACN_IP_UDP, NCACN_VNS_IPC,
NCACN_VNS_SPP, NCACN_AT_DSP, NCADG_AT_DDP, NCALRPC, NCACN_UNIX_STREAM,
- NCADG_UNIX_DGRAM, NCACN_HTTP, NCADG_IPX, NCACN_SPX };
+ NCADG_UNIX_DGRAM, NCACN_HTTP, NCADG_IPX, NCACN_SPX, NCACN_INTERNAL };
/** this describes a binding to a particular transport/pipe */
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 0a606f2438..6e2ffc933b 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -4170,3 +4170,42 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+
+/**
+ * Create a new RPC client context which uses a local dispatch function.
+ */
+NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax,
+ NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r),
+ struct auth_serversupplied_info *serversupplied_info,
+ struct rpc_pipe_client **presult)
+{
+ struct rpc_pipe_client *result;
+
+ result = TALLOC_ZERO_P(mem_ctx, struct rpc_pipe_client);
+ if (result == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ result->transport_type = NCACN_INTERNAL;
+
+ result->abstract_syntax = *abstract_syntax;
+ result->transfer_syntax = ndr_transfer_syntax;
+ result->dispatch = dispatch;
+
+ result->pipes_struct = TALLOC_ZERO_P(mem_ctx, pipes_struct);
+ if (result->pipes_struct == NULL) {
+ TALLOC_FREE(result);
+ return NT_STATUS_NO_MEMORY;
+ }
+ result->pipes_struct->mem_ctx = mem_ctx;
+ result->pipes_struct->server_info = serversupplied_info;
+ result->pipes_struct->pipe_bound = true;
+
+ result->max_xmit_frag = -1;
+ result->max_recv_frag = -1;
+
+ *presult = result;
+ return NT_STATUS_OK;
+}
+
+
diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c
index 9c3205eca3..6c40f09ab8 100644
--- a/source3/rpc_client/ndr.c
+++ b/source3/rpc_client/ndr.c
@@ -25,7 +25,7 @@
NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
const struct ndr_interface_table *table,
- uint32 opnum, void *r)
+ uint32_t opnum, void *r)
{
prs_struct q_ps, r_ps;
const struct ndr_interface_call *call;