diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-05-20 12:15:05 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:08:12 -0500 |
commit | 7930ae6a70dd80e93d593383eca028722ab90251 (patch) | |
tree | 35a9e8fb787465d375c8ad7a7175e564f839db79 /source4/smb_server | |
parent | 607e97bef0df1db588c888e21ac6b8826c9282d7 (diff) | |
download | samba-7930ae6a70dd80e93d593383eca028722ab90251.tar.gz samba-7930ae6a70dd80e93d593383eca028722ab90251.tar.bz2 samba-7930ae6a70dd80e93d593383eca028722ab90251.zip |
r15747: move some functions to the protocol independend part of the
smb server
metze
(This used to be commit 79af05551fe5f7b364c9f515ba4db54dd72907f8)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/smb/service.c | 43 | ||||
-rw-r--r-- | source4/smb_server/tcon.c | 33 |
2 files changed, 34 insertions, 42 deletions
diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index 7c703c8920..176b954ac6 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -23,46 +23,6 @@ #include "smbd/service_stream.h" #include "ntvfs/ntvfs.h" - -/** - * Find a service entry. service is always in dos codepage. - * - * @param service is modified (to canonical form??) - **/ -static int find_service(const char *service) -{ - int iService; - - iService = lp_servicenumber(service); - - if (iService >= 0 && !lp_snum_ok(iService)) { - DEBUG(0,("Invalid snum %d for %s\n",iService, service)); - iService = -1; - } - - if (iService == -1) { - DEBUG(3,("find_service() failed to find service %s\n", service)); - } - - return iService; -} - -static 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); -} - -static 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); -} - /**************************************************************************** Make a connection, given the snum to connect to, and the vuser of the connecting user if appropriate. @@ -176,8 +136,7 @@ static NTSTATUS make_connection(struct smbsrv_request *req, } } - snum = find_service(service); - + snum = smbsrv_find_service(service); if (snum == -1) { DEBUG(0,("couldn't find service %s\n", service)); return NT_STATUS_BAD_NETWORK_NAME; 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 |