diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-04-26 13:40:15 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-04-27 13:01:57 +0200 |
commit | c04d809ba001ebca17b68eae3a9f7d37454a290c (patch) | |
tree | d1b8d0af513097cc7e110c5b0c6be0237eebc5b6 /source4/ntvfs | |
parent | 7bbaab8dffcfe55b5da099840ec200be4d098b69 (diff) | |
download | samba-c04d809ba001ebca17b68eae3a9f7d37454a290c.tar.gz samba-c04d809ba001ebca17b68eae3a9f7d37454a290c.tar.bz2 samba-c04d809ba001ebca17b68eae3a9f7d37454a290c.zip |
s4:ntvfs: add tsocket based addresses to ntvfs_context
metze
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/ntvfs.h | 2 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs_interface.c | 25 |
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), |