This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* -------------------------------------------------------------------------- **
* lmb_browserlist - This is our local master browser list.
*/
-ubi_dlNewList( lmb_browserlist );
+struct browse_cache_record *lmb_browserlist;
/* -------------------------------------------------------------------------- **
* Functions...
*/
static void remove_lmb_browser_entry( struct browse_cache_record *browc )
{
- safe_free( ubi_dlRemThis( lmb_browserlist, browc ) );
+ DLIST_REMOVE(lmb_browserlist, browc);
+ SAFE_FREE(browc);
}
/* ************************************************************************** **
struct browse_cache_record *browc;
time_t now = time( NULL );
- browc = (struct browse_cache_record *)malloc( sizeof( *browc ) );
+ browc = SMB_MALLOC_P(struct browse_cache_record);
if( NULL == browc ) {
DEBUG( 0, ("create_browser_in_lmb_cache: malloc fail !\n") );
/* Allow the new lmb to miss an announce period before we remove it. */
browc->death_time = now + ( (CHECK_TIME_MST_ANNOUNCE + 2) * 60 );
- nstrcpy( browc->lmb_name, browser_name);
- nstrcpy( browc->work_group, work_name);
+ unstrcpy( browc->lmb_name, browser_name);
+ unstrcpy( browc->work_group, work_name);
strupper_m( browc->lmb_name );
strupper_m( browc->work_group );
browc->ip = ip;
- (void)ubi_dlAddTail( lmb_browserlist, browc );
+ DLIST_ADD_END(lmb_browserlist, browc, struct browse_cache_record *);
if( DEBUGLVL( 3 ) ) {
Debug1( "nmbd_browserdb:create_browser_in_lmb_cache()\n" );
{
struct browse_cache_record *browc;
- for( browc = (struct browse_cache_record *)ubi_dlFirst( lmb_browserlist );
- browc; browc = (struct browse_cache_record *)ubi_dlNext( browc ) )
- if( strequal( browser_name, browc->lmb_name ) )
+ for( browc = lmb_browserlist; browc; browc = browc->next ) {
+ if( strequal( browser_name, browc->lmb_name ) ) {
break;
+ }
+ }
- return( browc );
+ return browc;
}
/* ************************************************************************** **
struct browse_cache_record *browc;
struct browse_cache_record *nextbrowc;
- for( browc = (struct browse_cache_record *)ubi_dlFirst( lmb_browserlist );
- browc; browc = nextbrowc ) {
- nextbrowc = (struct browse_cache_record *)ubi_dlNext( browc );
+ for( browc = lmb_browserlist; browc; browc = nextbrowc) {
+ nextbrowc = browc->next;
if( browc->death_time < t ) {
if( DEBUGLVL( 3 ) ) {