1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s4:ntvfs: add tsocket based addresses to ntvfs_context

metze
This commit is contained in:
Stefan Metzmacher 2010-04-26 13:40:15 +02:00
parent 7bbaab8dff
commit c04d809ba0
2 changed files with 27 additions and 0 deletions

View File

@ -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 {

View File

@ -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),