summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-16 18:46:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:32 -0500
commita949db7c6d4bd35df59ba066111e6566172d4814 (patch)
treec7978edc8c96fc63bb8333e4dd8703bc857a0215 /source4/ntvfs
parent3948fcac493ed131bc40358138e8dc17a58853f7 (diff)
downloadsamba-a949db7c6d4bd35df59ba066111e6566172d4814.tar.gz
samba-a949db7c6d4bd35df59ba066111e6566172d4814.tar.bz2
samba-a949db7c6d4bd35df59ba066111e6566172d4814.zip
r14486: remove the need of a stream_connection on a dcesrv_connection,
and let the transport set callbacks for getting the own and peer socket_address metze (This used to be commit 56fac3ddbbeecb834e5c7a439df344e11fe12a7b)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 7a572268d4..24ee1451d6 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -32,6 +32,7 @@
#include "libcli/rap/rap.h"
#include "ntvfs/ipc/proto.h"
#include "rpc_server/dcerpc_server.h"
+#include "smbd/service_stream.h"
#define IPC_BASE_FNUM 0x400
@@ -41,6 +42,8 @@
struct ipc_private {
struct idr_context *idtree_fnum;
+ struct stream_connection *stream_conn;
+
struct dcesrv_context *dcesrv;
/* a list of open pipes */
@@ -95,6 +98,8 @@ static NTSTATUS ipc_connect(struct ntvfs_module_context *ntvfs,
private->pipe_list = NULL;
+ private->stream_conn = req->smb_conn->connection;
+
private->idtree_fnum = idr_init(private);
NT_STATUS_HAVE_NO_MEMORY(private->idtree_fnum);
@@ -173,6 +178,19 @@ static int ipc_fd_destructor(void *ptr)
return 0;
}
+static struct socket_address *ipc_get_my_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx)
+{
+ struct ipc_private *private = dce_conn->transport.private_data;
+
+ return socket_get_my_addr(private->stream_conn->socket, mem_ctx);
+}
+
+static struct socket_address *ipc_get_peer_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx)
+{
+ struct ipc_private *private = dce_conn->transport.private_data;
+
+ return socket_get_peer_addr(private->stream_conn->socket, mem_ctx);
+}
/*
open a file backend - used for MSRPC pipes
@@ -227,7 +245,7 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs,
p,
ep_description,
req->session->session_info,
- srv_conn,
+ srv_conn->event.ctx,
0,
&p->dce_conn);
if (!NT_STATUS_IS_OK(status)) {
@@ -235,6 +253,11 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs,
return status;
}
+ p->dce_conn->transport.private_data = private;
+ p->dce_conn->transport.report_output_data = NULL;
+ p->dce_conn->transport.get_my_addr = ipc_get_my_addr;
+ p->dce_conn->transport.get_peer_addr = ipc_get_peer_addr;
+
DLIST_ADD(private->pipe_list, p);
p->smbpid = req->smbpid;