summaryrefslogtreecommitdiff
path: root/source4/smb_server/conn.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-06-29 07:40:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:49 -0500
commit118f3edd27f5adacc1da636ed05b33f04999584f (patch)
treeb4b314537144d48820589e925c4e3fb08f293ee5 /source4/smb_server/conn.c
parentb87fa55bdc69fe50743ddb58977e408853abb4cb (diff)
downloadsamba-118f3edd27f5adacc1da636ed05b33f04999584f.tar.gz
samba-118f3edd27f5adacc1da636ed05b33f04999584f.tar.bz2
samba-118f3edd27f5adacc1da636ed05b33f04999584f.zip
r1291: rename struct smbsrv_context to smbsrv_connection
because this is the connection state per transport layer (tcp) connection I also moved the substructs directly into smbsrv_connection, because they don't need a struct name and we should allway pass the complete smbsrv_connection struct into functions metze (This used to be commit 60f823f201fcedf5473008e8453a6351e73a92c7)
Diffstat (limited to 'source4/smb_server/conn.c')
-rw-r--r--source4/smb_server/conn.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source4/smb_server/conn.c b/source4/smb_server/conn.c
index e275854325..197d925f34 100644
--- a/source4/smb_server/conn.c
+++ b/source4/smb_server/conn.c
@@ -30,18 +30,18 @@
/****************************************************************************
init the tcon structures
****************************************************************************/
-void conn_init(struct smbsrv_context *smb_ctx)
+void conn_init(struct smbsrv_connection *smb_conn)
{
- smb_ctx->tree.bmap = bitmap_allocate(MAX_CONNECTIONS);
+ smb_conn->tree.bmap = bitmap_allocate(MAX_CONNECTIONS);
}
/****************************************************************************
check if a snum is in use
****************************************************************************/
-BOOL conn_snum_used(struct smbsrv_context *smb_ctx, int snum)
+BOOL conn_snum_used(struct smbsrv_connection *smb_conn, int snum)
{
struct smbsrv_tcon *tcon;
- for (tcon=smb_ctx->tree.tcons;tcon;tcon=tcon->next) {
+ for (tcon=smb_conn->tree.tcons;tcon;tcon=tcon->next) {
if (tcon->service == snum) {
return(True);
}
@@ -53,15 +53,15 @@ BOOL conn_snum_used(struct smbsrv_context *smb_ctx, int snum)
/****************************************************************************
find a tcon given a cnum
****************************************************************************/
-struct smbsrv_tcon *conn_find(struct smbsrv_context *smb_ctx, uint_t cnum)
+struct smbsrv_tcon *conn_find(struct smbsrv_connection *smb_conn, uint_t cnum)
{
int count=0;
struct smbsrv_tcon *tcon;
- for (tcon=smb_ctx->tree.tcons;tcon;tcon=tcon->next,count++) {
+ for (tcon=smb_conn->tree.tcons;tcon;tcon=tcon->next,count++) {
if (tcon->cnum == cnum) {
if (count > 10) {
- DLIST_PROMOTE(smb_ctx->tree.tcons, tcon);
+ DLIST_PROMOTE(smb_conn->tree.tcons, tcon);
}
return tcon;
}
@@ -76,13 +76,13 @@ struct smbsrv_tcon *conn_find(struct smbsrv_context *smb_ctx, uint_t cnum)
The randomisation stops problems with the server dieing and clients
thinking the server is still available.
****************************************************************************/
-struct smbsrv_tcon *conn_new(struct smbsrv_context *smb_ctx)
+struct smbsrv_tcon *conn_new(struct smbsrv_connection *smb_conn)
{
TALLOC_CTX *mem_ctx;
struct smbsrv_tcon *tcon;
int i;
- i = bitmap_find(smb_ctx->tree.bmap, 1);
+ i = bitmap_find(smb_conn->tree.bmap, 1);
if (i == -1) {
DEBUG(1,("ERROR! Out of connection structures\n"));
@@ -98,13 +98,13 @@ struct smbsrv_tcon *conn_new(struct smbsrv_context *smb_ctx)
tcon->mem_ctx = mem_ctx;
tcon->cnum = i;
- tcon->smb_ctx = smb_ctx;
+ tcon->smb_conn = smb_conn;
- bitmap_set(smb_ctx->tree.bmap, i);
+ bitmap_set(smb_conn->tree.bmap, i);
- smb_ctx->tree.num_open++;
+ smb_conn->tree.num_open++;
- DLIST_ADD(smb_ctx->tree.tcons, tcon);
+ DLIST_ADD(smb_conn->tree.tcons, tcon);
return tcon;
}
@@ -112,10 +112,10 @@ struct smbsrv_tcon *conn_new(struct smbsrv_context *smb_ctx)
/****************************************************************************
close all tcon structures
****************************************************************************/
-void conn_close_all(struct smbsrv_context *smb_ctx)
+void conn_close_all(struct smbsrv_connection *smb_conn)
{
struct smbsrv_tcon *tcon, *next;
- for (tcon=smb_ctx->tree.tcons;tcon;tcon=next) {
+ for (tcon=smb_conn->tree.tcons;tcon;tcon=next) {
next=tcon->next;
close_cnum(tcon);
}
@@ -126,12 +126,12 @@ void conn_close_all(struct smbsrv_context *smb_ctx)
/****************************************************************************
clear a vuid out of the validity cache, and as the 'owner' of a connection.
****************************************************************************/
-void conn_clear_vuid_cache(struct smbsrv_context *smb_ctx, uint16_t vuid)
+void conn_clear_vuid_cache(struct smbsrv_connection *smb_conn, uint16_t vuid)
{
struct smbsrv_tcon *tcon;
uint_t i;
- for (tcon=smb_ctx->tree.tcons;tcon;tcon=tcon->next) {
+ for (tcon=smb_conn->tree.tcons;tcon;tcon=tcon->next) {
for (i=0;i<tcon->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
if (tcon->vuid_cache.list[i] == vuid) {
tcon->vuid_cache.list[i] = UID_FIELD_INVALID;
@@ -145,12 +145,12 @@ void conn_clear_vuid_cache(struct smbsrv_context *smb_ctx, uint16_t vuid)
Free a tcon structure.
****************************************************************************/
-void conn_free(struct smbsrv_context *smb_ctx, struct smbsrv_tcon *tcon)
+void conn_free(struct smbsrv_connection *smb_conn, struct smbsrv_tcon *tcon)
{
- DLIST_REMOVE(smb_ctx->tree.tcons, tcon);
+ DLIST_REMOVE(smb_conn->tree.tcons, tcon);
- bitmap_clear(smb_ctx->tree.bmap, tcon->cnum);
- smb_ctx->tree.num_open--;
+ bitmap_clear(smb_conn->tree.bmap, tcon->cnum);
+ smb_conn->tree.num_open--;
talloc_destroy(tcon->mem_ctx);
}