summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/ntvfs/ntvfs.h2
-rw-r--r--source4/ntvfs/ntvfs_interface.c25
2 files changed, 27 insertions, 0 deletions
diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h
index 5e9c657737..5b551cd345 100644
--- a/source4/ntvfs/ntvfs.h
+++ b/source4/ntvfs/ntvfs.h
@@ -212,6 +212,8 @@ struct ntvfs_context {
void *private_data;
struct socket_address *(*get_my_addr)(void *private_data, TALLOC_CTX *mem_ctx);
struct socket_address *(*get_peer_addr)(void *private_data, TALLOC_CTX *mem_ctx);
+ const struct tsocket_address *local_address;
+ const struct tsocket_address *remote_address;
} client;
struct {
diff --git a/source4/ntvfs/ntvfs_interface.c b/source4/ntvfs/ntvfs_interface.c
index 808bd97e61..c743126d24 100644
--- a/source4/ntvfs/ntvfs_interface.c
+++ b/source4/ntvfs/ntvfs_interface.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "ntvfs/ntvfs.h"
+#include "lib/tsocket/tsocket.h"
/* connect/disconnect */
NTSTATUS ntvfs_connect(struct ntvfs_request *req, union smb_tcon *tcon)
@@ -666,6 +667,30 @@ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->exit(ntvfs->next, req);
}
+/* client connection callback */
+NTSTATUS ntvfs_set_addresses(struct ntvfs_context *ntvfs,
+ const struct tsocket_address *local_address,
+ const struct tsocket_address *remote_address)
+{
+ ntvfs->client.local_address = tsocket_address_copy(local_address, ntvfs);
+ NT_STATUS_HAVE_NO_MEMORY(ntvfs->client.local_address);
+
+ ntvfs->client.remote_address = tsocket_address_copy(remote_address, ntvfs);
+ NT_STATUS_HAVE_NO_MEMORY(ntvfs->client.remote_address);
+
+ return NT_STATUS_OK;
+}
+
+const struct tsocket_address *ntvfs_get_local_address(struct ntvfs_module_context *ntvfs)
+{
+ return ntvfs->ctx->client.local_address;
+}
+
+const struct tsocket_address *ntvfs_get_remote_address(struct ntvfs_module_context *ntvfs)
+{
+ return ntvfs->ctx->client.remote_address;
+}
+
/* oplock helpers */
NTSTATUS ntvfs_set_oplock_handler(struct ntvfs_context *ntvfs,
NTSTATUS (*handler)(void *private_data, struct ntvfs_handle *handle, uint8_t level),