diff options
Diffstat (limited to 'source4/smb_server/tcon.c')
-rw-r--r-- | source4/smb_server/tcon.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/smb_server/tcon.c b/source4/smb_server/tcon.c index dbd0677df1..ad278e2e77 100644 --- a/source4/smb_server/tcon.c +++ b/source4/smb_server/tcon.c @@ -26,6 +26,39 @@ #include "smbd/service_stream.h" #include "ntvfs/ntvfs.h" +int smbsrv_find_service(const char *service) +{ + int iService; + + iService = lp_servicenumber(service); + + if (iService >= 0 && !lp_snum_ok(iService)) { + DEBUG(0,("smbsrv_find_service: Invalid snum %d for '%s'\n",iService, service)); + iService = -1; + } + + if (iService == -1) { + DEBUG(3,("smbsrv_find_service: failed to find service '%s'\n", service)); + } + + return iService; +} + +struct socket_address *smbsrv_get_my_addr(void *p, TALLOC_CTX *mem_ctx) +{ + struct smbsrv_connection *smb_conn = talloc_get_type(p, + struct smbsrv_connection); + + return socket_get_my_addr(smb_conn->connection->socket, mem_ctx); +} + +struct socket_address *smbsrv_get_peer_addr(void *p, TALLOC_CTX *mem_ctx) +{ + struct smbsrv_connection *smb_conn = talloc_get_type(p, + struct smbsrv_connection); + + return socket_get_peer_addr(smb_conn->connection->socket, mem_ctx); +} /**************************************************************************** init the tcon structures |