svn commit: samba r15747 - in branches/SAMBA_4_0/source/smb_server: . smb

metze at samba.org metze at samba.org
Sat May 20 12:15:09 GMT 2006


Author: metze
Date: 2006-05-20 12:15:05 +0000 (Sat, 20 May 2006)
New Revision: 15747

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15747

Log:
move some functions to the protocol independend part of the 
smb server

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb/service.c
   branches/SAMBA_4_0/source/smb_server/tcon.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb/service.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb/service.c	2006-05-20 12:11:46 UTC (rev 15746)
+++ branches/SAMBA_4_0/source/smb_server/smb/service.c	2006-05-20 12:15:05 UTC (rev 15747)
@@ -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 @@
 		}
 	}
 
-	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;

Modified: branches/SAMBA_4_0/source/smb_server/tcon.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/tcon.c	2006-05-20 12:11:46 UTC (rev 15746)
+++ branches/SAMBA_4_0/source/smb_server/tcon.c	2006-05-20 12:15:05 UTC (rev 15747)
@@ -26,7 +26,40 @@
 #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
 ****************************************************************************/



More information about the samba-cvs mailing list