summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_subnetdb.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-12-06 23:06:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:45 -0500
commit83b987befdbba857131102700d237728784b6f69 (patch)
treee2256666211d54b6781c1e48ab1ba95ad1b788c3 /source3/nmbd/nmbd_subnetdb.c
parent436b3dd88a703c4f79c638d76cb0219fc8870bda (diff)
downloadsamba-83b987befdbba857131102700d237728784b6f69.tar.gz
samba-83b987befdbba857131102700d237728784b6f69.tar.bz2
samba-83b987befdbba857131102700d237728784b6f69.zip
r12107: Move to a tdb-based wins database. At the moment we still
use it as though it were an in-memory db and dump out to a flat file every 2 mins, but that can now change. Jeremy. (This used to be commit a342681792724c1ae8561ba8d352c4ee6e2a5332)
Diffstat (limited to 'source3/nmbd/nmbd_subnetdb.c')
-rw-r--r--source3/nmbd/nmbd_subnetdb.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index b53a6d7328..b2e1178beb 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -51,34 +51,6 @@ static void add_subnet(struct subnet_record *subrec)
DLIST_ADD(subnetlist, subrec);
}
-/* ************************************************************************** **
- * Comparison routine for ordering the splay-tree based namelists assoicated
- * with each subnet record.
- *
- * Input: Item - Pointer to the comparison key.
- * Node - Pointer to a node the splay tree.
- *
- * Output: The return value will be <0 , ==0, or >0 depending upon the
- * ordinal relationship of the two keys.
- *
- * ************************************************************************** **
- */
-static int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node )
-{
- struct name_record *NR = (struct name_record *)Node;
-
- if( DEBUGLVL( 10 ) ) {
- struct nmb_name *Iname = (struct nmb_name *)Item;
-
- Debug1( "nmbd_subnetdb:namelist_entry_compare()\n" );
- Debug1( "%d == memcmp( \"%s\", \"%s\", %d )\n",
- memcmp( Item, &(NR->name), sizeof(struct nmb_name) ),
- nmb_namestr(Iname), nmb_namestr(&NR->name), (int)sizeof(struct nmb_name) );
- }
-
- return( memcmp( Item, &(NR->name), sizeof(struct nmb_name) ) );
-}
-
/****************************************************************************
stop listening on a subnet
we don't free the record as we don't have proper reference counting for it
@@ -156,10 +128,7 @@ static struct subnet_record *make_subnet(const char *name, enum subnet_type type
return(NULL);
}
- memset( (char *)subrec, '\0', sizeof(*subrec) );
- (void)ubi_trInitTree( subrec->namelist,
- namelist_entry_compare,
- ubi_trOVERWRITE );
+ ZERO_STRUCTP(subrec);
if((subrec->subnet_name = SMB_STRDUP(name)) == NULL) {
DEBUG(0,("make_subnet: malloc fail for subnet name !\n"));