summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_util.c
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-02-19 16:58:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:57 -0500
commit32a3aa932d2556baf7ee7d38bf694484bf9b04cb (patch)
tree15be47698628d07f22539eaad97f6beba4060066 /source4/librpc/rpc/dcerpc_util.c
parentaa4a3449c2db76de808d0b43cdf463fa7a5203d6 (diff)
downloadsamba-32a3aa932d2556baf7ee7d38bf694484bf9b04cb.tar.gz
samba-32a3aa932d2556baf7ee7d38bf694484bf9b04cb.tar.bz2
samba-32a3aa932d2556baf7ee7d38bf694484bf9b04cb.zip
r13561: Turn all dcerpc connect and socket functions to async version.
Now, each rpc interface (named pipe, tcp/ip, lrpc and unix socket) works asynchronously. Comments to follow. rafal (This used to be commit 789f9d43db7ea59e79d5aa498e2e9fd077448825)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_util.c')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c81
1 files changed, 6 insertions, 75 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 6ef91b87b0..011ed9d81e 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -956,75 +956,6 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np(TALLOC_CTX *tmp_ctx,
}
-/* open a rpc connection to a rpc pipe on SMP using the binding
- structure to determine the endpoint and options */
-static NTSTATUS dcerpc_pipe_connect_ncalrpc(TALLOC_CTX *tmp_ctx,
- struct dcerpc_pipe *p,
- struct dcerpc_binding *binding,
- const struct dcerpc_interface_table *table)
-{
- NTSTATUS status;
-
- status = dcerpc_pipe_open_pipe(p->conn, binding->endpoint);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("Failed to open ncalrpc pipe '%s' - %s\n",
- binding->endpoint, nt_errstr(status)));
- return status;
- }
-
- return status;
-}
-
-
-
-/* open a rpc connection to a rpc pipe on SMP using the binding
- structure to determine the endpoint and options */
-static NTSTATUS dcerpc_pipe_connect_ncacn_unix_stream(TALLOC_CTX *tmp_ctx,
- struct dcerpc_pipe *p,
- struct dcerpc_binding *binding,
- const struct dcerpc_interface_table *table)
-{
- NTSTATUS status;
-
- if (!binding->endpoint) {
- DEBUG(0, ("Path to unix socket not specified\n"));
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- status = dcerpc_pipe_open_unix_stream(p->conn, binding->endpoint);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("Failed to open unix socket %s - %s\n",
- binding->endpoint, nt_errstr(status)));
- talloc_free(p);
- return status;
- }
-
- return status;
-}
-
-/* open a rpc connection to a rpc pipe on TCP/IP sockets using the binding
- structure to determine the endpoint and options */
-static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp(TALLOC_CTX *tmp_ctx,
- struct dcerpc_pipe *p,
- struct dcerpc_binding *binding,
- const struct dcerpc_interface_table *table)
-{
- NTSTATUS status;
- uint32_t port = 0;
-
- port = atoi(binding->endpoint);
-
- status = dcerpc_pipe_open_tcp(p->conn, binding->host, port);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("Failed to connect to %s:%d - %s\n",
- binding->host, port, nt_errstr(status)));
- return status;
- }
-
- return status;
-}
-
-
/* open a rpc connection to a rpc pipe, using the specified
binding structure to determine the endpoint and options */
NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
@@ -1082,17 +1013,17 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
break;
case NCACN_IP_TCP:
- status = dcerpc_pipe_connect_ncacn_ip_tcp(tmp_ctx,
- p, binding, table);
+ status = dcerpc_pipe_connect_ncacn_ip_tcp(tmp_ctx, &pc);
break;
+
case NCACN_UNIX_STREAM:
- status = dcerpc_pipe_connect_ncacn_unix_stream(tmp_ctx,
- p, binding, table);
+ status = dcerpc_pipe_connect_ncacn_unix_stream(tmp_ctx, &pc);
break;
+
case NCALRPC:
- status = dcerpc_pipe_connect_ncalrpc(tmp_ctx,
- p, binding, table);
+ status = dcerpc_pipe_connect_ncalrpc(tmp_ctx, &pc);
break;
+
default:
return NT_STATUS_NOT_SUPPORTED;
}