{
int i, j;
- DEBUG(4,(" %s: nmb_name=%s rr_type=%d rr_class=%d ttl=%d\n",
- hdr,
- namestr(&res->rr_name),
- res->rr_type,
- res->rr_class,
- res->ttl));
-
- if (res->rdlength == 0 || res->rdata == NULL) return;
+ DEBUGADD( 4, ( " %s: nmb_name=%s rr_type=%d rr_class=%d ttl=%d\n",
+ hdr,
+ namestr(&res->rr_name),
+ res->rr_type,
+ res->rr_class,
+ res->ttl ) );
+
+ if( res->rdlength == 0 || res->rdata == NULL )
+ return;
for (i = 0; i < res->rdlength; i+= 16)
{
- DEBUG(4, (" %s %3x char ", hdr, i));
+ DEBUGADD(4, (" %s %3x char ", hdr, i));
for (j = 0; j < 16; j++)
{
if (x < 32 || x > 127) x = '.';
if (i+j >= res->rdlength) break;
- DEBUG(4, ("%c", x));
+ DEBUGADD(4, ("%c", x));
}
- DEBUG(4, (" hex ", i));
+ DEBUGADD(4, (" hex ", i));
for (j = 0; j < 16; j++)
{
if (i+j >= res->rdlength) break;
- DEBUG(4, ("%02X", (unsigned char)res->rdata[i+j]));
+ DEBUGADD(4, ("%02X", (unsigned char)res->rdata[i+j]));
}
- DEBUG(4, ("\n"));
+ DEBUGADD(4, ("\n"));
}
}
void debug_nmb_packet(struct packet_struct *p)
{
struct nmb_packet *nmb = &p->packet.nmb;
-
- DEBUG(4,("nmb packet from %s(%d) header: id=%d opcode=%s(%d) response=%s\n",
- inet_ntoa(p->ip), p->port,
- nmb->header.name_trn_id,
- lookup_opcode_name(nmb->header.opcode),
- nmb->header.opcode,BOOLSTR(nmb->header.response)));
- DEBUG(4,(" header: flags: bcast=%s rec_avail=%s rec_des=%s trunc=%s auth=%s\n",
- BOOLSTR(nmb->header.nm_flags.bcast),
- BOOLSTR(nmb->header.nm_flags.recursion_available),
- BOOLSTR(nmb->header.nm_flags.recursion_desired),
- BOOLSTR(nmb->header.nm_flags.trunc),
- BOOLSTR(nmb->header.nm_flags.authoritative)));
- DEBUG(4,(" header: rcode=%d qdcount=%d ancount=%d nscount=%d arcount=%d\n",
- nmb->header.rcode,
- nmb->header.qdcount,
- nmb->header.ancount,
- nmb->header.nscount,
- nmb->header.arcount));
+
+ if( DEBUGLVL( 4 ) )
+ {
+ dbgtext( "nmb packet from %s(%d) header: id=%d opcode=%s(%d) response=%s\n",
+ inet_ntoa(p->ip), p->port,
+ nmb->header.name_trn_id,
+ lookup_opcode_name(nmb->header.opcode),
+ nmb->header.opcode,
+ BOOLSTR(nmb->header.response) );
+ dbgtext( " header: flags: bcast=%s rec_avail=%s rec_des=%s trunc=%s auth=%s\n",
+ BOOLSTR(nmb->header.nm_flags.bcast),
+ BOOLSTR(nmb->header.nm_flags.recursion_available),
+ BOOLSTR(nmb->header.nm_flags.recursion_desired),
+ BOOLSTR(nmb->header.nm_flags.trunc),
+ BOOLSTR(nmb->header.nm_flags.authoritative) );
+ dbgtext( " header: rcode=%d qdcount=%d ancount=%d nscount=%d arcount=%d\n",
+ nmb->header.rcode,
+ nmb->header.qdcount,
+ nmb->header.ancount,
+ nmb->header.nscount,
+ nmb->header.arcount );
+ }
if (nmb->header.qdcount)
{
- DEBUG(4,(" question: q_name=%s q_type=%d q_class=%d\n",
- namestr(&nmb->question.question_name),
- nmb->question.question_type,
- nmb->question.question_class));
+ DEBUGADD( 4, ( " question: q_name=%s q_type=%d q_class=%d\n",
+ namestr(&nmb->question.question_name),
+ nmb->question.question_type,
+ nmb->question.question_class) );
}
- if (nmb->answers && nmb->header.ancount)
+ if (nmb->answers && nmb->header.ancount)
{
debug_nmb_res_rec(nmb->answers,"answers");
}
/* Now reset the workgroup and server state. */
reset_workgroup_state( subrec, released_name->name, force_new_election );
- DEBUG(0,("\n%s ***** Samba name server %s has stopped being a local master browser for workgroup %s \
-on subnet %s *****\n\n", timestring(), global_myname, released_name->name, subrec->subnet_name));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "*****\n\n" );
+ dbgtext( "Samba name server %s ", global_myname );
+ dbgtext( "has stopped being a local master browser " );
+ dbgtext( "for workgroup %s ", released_name->name );
+ dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
+ }
}
/* Now reset the workgroup and server state. */
reset_workgroup_state( subrec, fail_name->name, force_new_election );
- DEBUG(0,("\n%s ***** Samba name server %s has stopped being a local master browser for workgroup %s \
-on subnet %s *****\n\n", timestring(), global_myname, fail_name->name, subrec->subnet_name));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "*****\n\n" );
+ dbgtext( "Samba name server %s ", global_myname );
+ dbgtext( "has stopped being a local master browser " );
+ dbgtext( "for workgroup %s ", fail_name->name );
+ dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
+ }
}
/*******************************************************************
master browser as soon as possible that we are a local master browser. */
reset_announce_timer();
- DEBUG(0,("\n%s ***** Samba name server %s is now a local master browser for workgroup %s \
-on subnet %s *****\n\n", timestring(), global_myname, work->work_group, subrec->subnet_name));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "*****\n\n" );
+ dbgtext( "Samba name server %s ", global_myname );
+ dbgtext( "is now a local master browser " );
+ dbgtext( "for workgroup %s ", work->work_group );
+ dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name );
+ }
}
static struct cli_state cli;
uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0;
- DEBUG(2,("%s: sync_browse_lists: Sync browse lists with server %s<%02x> at IP %s for workgroup %s\n",
- timestring(), name, nm_type, inet_ntoa(ip), work->work_group ));
+ if( DEBUGLVL( 2 ) )
+ {
+ dbgtext( "sync_browse_lists():\n" );
+ dbgtext( "Sync browse lists with server %s<%02x> ", name, nm_type );
+ dbgtext( "at IP %s ", inet_ntoa( ip ) );
+ dbgtext( "for workgroup %s\n", work->work_group );
+ }
/* Check we're not trying to sync with ourselves. This can happen if we are
a domain *and* a local master browser. */
if (find_name_on_subnet(subrec, &nmbname, FIND_SELF_NAME) == NULL)
{
- DEBUG(0,("add_domain_logon_names: At time %s attempting to become \
-logon server for workgroup %s on subnet %s\n", timestring(), global_myworkgroup,
- subrec->subnet_name));
+ if( DEBUGLVL( 0 ) )
+ {
+ dbgtext( "add_domain_logon_names:\n" );
+ dbgtext( "Attempting to become logon server " );
+ dbgtext( "for workgroup %s ", global_myworkgroup );
+ dbgtext( "on subnet %s\n", subrec->subnet_name );
+ }
become_logon_server(subrec, work);
}
}
static void debug_browse_data(char *outbuf, int len)
{
int i,j;
+
+ DEBUG( 4, ( "debug_browse_data():\n" ) );
for (i = 0; i < len; i+= 16)
{
- DEBUG(4, ("%3x char ", i));
+ DEBUGADD( 4, ( "%3x char ", i ) );
for (j = 0; j < 16; j++)
{
if (i+j >= len)
break;
- DEBUG(4, ("%c", x));
+ DEBUGADD( 4, ( "%c", x ) );
}
- DEBUG(4, (" hex ", i));
+ DEBUGADD( 4, ( " hex ", i ) );
for (j = 0; j < 16; j++)
{
if (i+j >= len)
break;
- DEBUG(4, (" %02x", (unsigned char)outbuf[i+j]));
+ DEBUGADD( 4, ( " %02x", (unsigned char)outbuf[i+j] ) );
}
- DEBUG(4, ("\n"));
+ DEBUGADD( 4, ("\n") );
}
}
{
if (!strcmp(ret->work_group,name))
{
- DEBUG(4, ("found\n"));
+ DEBUGADD(4, ("found.\n"));
return(ret);
}
}
- DEBUG(4, ("not found\n"));
+ DEBUGADD(4, ("not found.\n"));
return NULL;
}
/***************************************************************************
Process a parameter.
***************************************************************************/
-static BOOL do_parameter(char *pszParmName, char *pszParmValue)
+static BOOL do_parameter( char *pszParmName, char *pszParmValue )
{
- if (!bInGlobalSection && bGlobalOnly) return(True);
+ if( !bInGlobalSection && bGlobalOnly )
+ return(True);
- DEBUG(3,("doing parameter %s = %s\n",pszParmName,pszParmValue));
+ DEBUGADD( 3, ( "doing parameter %s = %s\n", pszParmName, pszParmValue ) );
- return lp_do_parameter(bInGlobalSection?-2:iServiceIndex, pszParmName, pszParmValue);
+ return( lp_do_parameter( bInGlobalSection ? -2 : iServiceIndex,
+ pszParmName,
+ pszParmValue ) );
}
/* check for multiple global sections */
if (bInGlobalSection)
{
- DEBUG(3,( "Processing section \"[%s]\"\n", pszSectionName));
+ DEBUG( 3, ( "Processing section \"[%s]\"\n", pszSectionName ) );
return(True);
}