svn commit: samba r11781 - in branches/SAMBA_4_0/source: librpc/idl scripting/libjs smb_server

metze at samba.org metze at samba.org
Fri Nov 18 12:20:19 GMT 2005


Author: metze
Date: 2005-11-18 12:20:16 +0000 (Fri, 18 Nov 2005)
New Revision: 11781

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

Log:
rename tree to tcons to match the sessions substructure of smbsrv_connection

metze
Modified:
   branches/SAMBA_4_0/source/librpc/idl/irpc.idl
   branches/SAMBA_4_0/source/scripting/libjs/management.js
   branches/SAMBA_4_0/source/smb_server/conn.c
   branches/SAMBA_4_0/source/smb_server/management.c
   branches/SAMBA_4_0/source/smb_server/reply.c
   branches/SAMBA_4_0/source/smb_server/smb_server.h


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/irpc.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/irpc.idl	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/librpc/idl/irpc.idl	2005-11-18 12:20:16 UTC (rev 11781)
@@ -66,7 +66,7 @@
 	******************************************************/
 	typedef [v1_enum] enum {
 		SMBSRV_INFO_SESSIONS,
-		SMBSRV_INFO_TREES
+		SMBSRV_INFO_TCONS
 	} smbsrv_info_level;
 
 	typedef struct {
@@ -87,16 +87,16 @@
 		astring share_name;
 		astring client_ip;
 		NTTIME  connect_time;
-	} smbsrv_tree_info;
+	} smbsrv_tcon_info;
 
 	typedef struct {
-		uint32 num_trees;
-		[size_is(num_trees)] smbsrv_tree_info *trees;
-	} smbsrv_trees;
+		uint32 num_tcons;
+		[size_is(num_tcons)] smbsrv_tcon_info *tcons;
+	} smbsrv_tcons;
 
 	typedef union {
 		[case(SMBSRV_INFO_SESSIONS)] smbsrv_sessions sessions;
-		[case(SMBSRV_INFO_TREES)]    smbsrv_trees    trees;
+		[case(SMBSRV_INFO_TCONS)]    smbsrv_tcons    tcons;
 	} smbsrv_info;
 
 	void smbsrv_information(

Modified: branches/SAMBA_4_0/source/scripting/libjs/management.js
===================================================================
--- branches/SAMBA_4_0/source/scripting/libjs/management.js	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/scripting/libjs/management.js	2005-11-18 12:20:16 UTC (rev 11781)
@@ -39,7 +39,7 @@
 /*
   return a list of current tree connects
 */
-function smbsrv_trees()
+function smbsrv_tcons()
 {
 	var irpc = irpc_init();
 	status = irpc.connect("smb_server");
@@ -48,7 +48,7 @@
 	}
 
 	var io = irpcObj();
-	io.input.level = irpc.SMBSRV_INFO_TREES;
+	io.input.level = irpc.SMBSRV_INFO_TCONS;
 	status = irpc.smbsrv_information(io);
 	if (status.is_ok != true) {
 		return undefined;
@@ -57,10 +57,10 @@
 	/* gather the results into a single array */
 	var i, count=0, ret = new Object();
 	for (i=0;i<io.results.length;i++) {
-		var trees = io.results[i].info.trees.trees;
+		var tcons = io.results[i].info.tcons.tcons;
 		var j;
-		for (j=0;j<trees.length;j++) {
-			ret[count] = trees[j];
+		for (j=0;j<tcons.length;j++) {
+			ret[count] = tcons[j];
 			count++;
 		}
 	}

Modified: branches/SAMBA_4_0/source/smb_server/conn.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/conn.c	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/smb_server/conn.c	2005-11-18 12:20:16 UTC (rev 11781)
@@ -31,8 +31,8 @@
 ****************************************************************************/
 NTSTATUS smbsrv_init_tcons(struct smbsrv_connection *smb_conn)
 {
-	smb_conn->tree.idtree_tid = idr_init(smb_conn);
-	NT_STATUS_HAVE_NO_MEMORY(smb_conn->tree.idtree_tid);
+	smb_conn->tcons.idtree_tid = idr_init(smb_conn);
+	NT_STATUS_HAVE_NO_MEMORY(smb_conn->tcons.idtree_tid);
 	return NT_STATUS_OK;
 }
 
@@ -41,7 +41,7 @@
 ****************************************************************************/
 struct smbsrv_tcon *smbsrv_tcon_find(struct smbsrv_connection *smb_conn, uint_t tid)
 {
-	return idr_find(smb_conn->tree.idtree_tid, tid);
+	return idr_find(smb_conn->tcons.idtree_tid, tid);
 }
 
 /*
@@ -59,8 +59,8 @@
 	/* tell the ntvfs backend that we are disconnecting */
 	ntvfs_disconnect(tcon);
 
-	idr_remove(tcon->smb_conn->tree.idtree_tid, tcon->tid);
-	DLIST_REMOVE(tcon->smb_conn->tree.tcons, tcon);
+	idr_remove(tcon->smb_conn->tcons.idtree_tid, tcon->tid);
+	DLIST_REMOVE(tcon->smb_conn->tcons.list, tcon);
 	return 0;
 }
 
@@ -75,7 +75,7 @@
 	tcon = talloc_zero(smb_conn, struct smbsrv_tcon);
 	if (!tcon) return NULL;
 
-	i = idr_get_new_random(smb_conn->tree.idtree_tid, tcon, UINT16_MAX);
+	i = idr_get_new_random(smb_conn->tcons.idtree_tid, tcon, UINT16_MAX);
 	if (i == -1) {
 		DEBUG(1,("ERROR! Out of connection structures\n"));	       
 		return NULL;
@@ -87,7 +87,7 @@
 
 	talloc_set_destructor(tcon, smbsrv_tcon_destructor);
 
-	DLIST_ADD(smb_conn->tree.tcons, tcon);
+	DLIST_ADD(smb_conn->tcons.list, tcon);
 
 	return tcon;
 }

Modified: branches/SAMBA_4_0/source/smb_server/management.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/management.c	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/smb_server/management.c	2005-11-18 12:20:16 UTC (rev 11781)
@@ -62,30 +62,30 @@
 /*
   return a list of tree connects
 */
-static NTSTATUS smbsrv_tree_information(struct irpc_message *msg, 
-					   struct smbsrv_information *r)
+static NTSTATUS smbsrv_tcon_information(struct irpc_message *msg, 
+					struct smbsrv_information *r)
 {
 	struct smbsrv_connection *smb_conn = talloc_get_type(msg->private, struct smbsrv_connection);
 	int i=0, count=0;
 	struct smbsrv_tcon *tcon;
 
 	/* count the number of tcons */
-	for (tcon=smb_conn->tree.tcons; tcon; tcon=tcon->next) {
+	for (tcon=smb_conn->tcons.list; tcon; tcon=tcon->next) {
 		count++;
 	}
 
-	r->out.info.trees.num_trees = count;
-	r->out.info.trees.trees = talloc_array(r, struct smbsrv_tree_info, count);
-	NT_STATUS_HAVE_NO_MEMORY(r->out.info.trees.trees);
+	r->out.info.tcons.num_tcons = count;
+	r->out.info.tcons.tcons = talloc_array(r, struct smbsrv_tcon_info, count);
+	NT_STATUS_HAVE_NO_MEMORY(r->out.info.tcons.tcons);
 
-	for (tcon=smb_conn->tree.tcons; tcon; tcon=tcon->next) {
-		struct smbsrv_tree_info *info = &r->out.info.trees.trees[i];
+	for (tcon=smb_conn->tcons.list; tcon; tcon=tcon->next) {
+		struct smbsrv_tcon_info *info = &r->out.info.tcons.tcons[i];
 		info->tid          = tcon->tid;
 		info->share_name   = lp_servicename(tcon->service);
 		info->connect_time = timeval_to_nttime(&tcon->connect_time);
 		info->client_ip    = socket_get_peer_addr(smb_conn->connection->socket, r);
 		i++;
-	}	
+	}
 
 	return NT_STATUS_OK;
 }
@@ -99,8 +99,8 @@
 	switch (r->in.level) {
 	case SMBSRV_INFO_SESSIONS:
 		return smbsrv_session_information(msg, r);
-	case SMBSRV_INFO_TREES:
-		return smbsrv_tree_information(msg, r);
+	case SMBSRV_INFO_TCONS:
+		return smbsrv_tcon_information(msg, r);
 	}
 
 	return NT_STATUS_OK;

Modified: branches/SAMBA_4_0/source/smb_server/reply.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/reply.c	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/smb_server/reply.c	2005-11-18 12:20:16 UTC (rev 11781)
@@ -1200,7 +1200,7 @@
 	struct smbsrv_tcon *tcon;
 	REQ_CHECK_WCT(req, 0);
 
-	for (tcon=req->smb_conn->tree.tcons;tcon;tcon=tcon->next) {
+	for (tcon=req->smb_conn->tcons.list;tcon;tcon=tcon->next) {
 		req->tcon = tcon;
 		status = ntvfs_exit(req);
 		req->tcon = NULL;
@@ -2181,7 +2181,7 @@
 
 	/* in user level security we are supposed to close any files
 	   open by this user on all open tree connects */
-	for (tcon=req->smb_conn->tree.tcons;tcon;tcon=tcon->next) {
+	for (tcon=req->smb_conn->tcons.list;tcon;tcon=tcon->next) {
 		req->tcon = tcon;
 		status = ntvfs_logoff(req);
 		req->tcon = NULL;

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.h
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb_server.h	2005-11-18 11:45:24 UTC (rev 11780)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.h	2005-11-18 12:20:16 UTC (rev 11781)
@@ -222,13 +222,13 @@
 
 	/* the context associated with open tree connects on a smb socket */
 	struct {
-		/* list of open tree connects */
-		struct smbsrv_tcon *tcons;
-
 		/* an id tree used to allocate tids */
 		struct idr_context *idtree_tid;
-	} tree;
 
+		/* list of open tree connects */
+		struct smbsrv_tcon *list;
+	} tcons;
+
 	/* context associated with currently valid session setups */
 	struct {
 		int num_validated_vuids;



More information about the samba-cvs mailing list