summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
committerJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
commit30191d1a5704ad2b158386b511558972d539ce47 (patch)
tree4f46e5c4f28f672ab661aa18f45745860970a88c /source3/nmbd
parent789856f63ff73fec66298e95c91c60db7bdaf14e (diff)
downloadsamba-30191d1a5704ad2b158386b511558972d539ce47.tar.gz
samba-30191d1a5704ad2b158386b511558972d539ce47.tar.bz2
samba-30191d1a5704ad2b158386b511558972d539ce47.zip
RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/asyncdns.c8
-rw-r--r--source3/nmbd/nmbd.c34
-rw-r--r--source3/nmbd/nmbd_become_lmb.c20
-rw-r--r--source3/nmbd/nmbd_elections.c6
-rw-r--r--source3/nmbd/nmbd_incomingdgrams.c2
-rw-r--r--source3/nmbd/nmbd_incomingrequests.c14
-rw-r--r--source3/nmbd/nmbd_lmhosts.c2
-rw-r--r--source3/nmbd/nmbd_mynames.c2
-rw-r--r--source3/nmbd/nmbd_namelistdb.c10
-rw-r--r--source3/nmbd/nmbd_namequery.c10
-rw-r--r--source3/nmbd/nmbd_nameregister.c8
-rw-r--r--source3/nmbd/nmbd_namerelease.c8
-rw-r--r--source3/nmbd/nmbd_nodestatus.c2
-rw-r--r--source3/nmbd/nmbd_packets.c48
-rw-r--r--source3/nmbd/nmbd_processlogon.c2
-rw-r--r--source3/nmbd/nmbd_responserecordsdb.c2
-rw-r--r--source3/nmbd/nmbd_sendannounce.c2
-rw-r--r--source3/nmbd/nmbd_serverlistdb.c4
-rw-r--r--source3/nmbd/nmbd_subnetdb.c4
-rw-r--r--source3/nmbd/nmbd_synclists.c4
-rw-r--r--source3/nmbd/nmbd_winsserver.c42
-rw-r--r--source3/nmbd/nmbd_workgroupdb.c2
22 files changed, 118 insertions, 118 deletions
diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c
index f572aefc78..b9c9ffb1c6 100644
--- a/source3/nmbd/asyncdns.c
+++ b/source3/nmbd/asyncdns.c
@@ -166,7 +166,7 @@ void start_async_dns(void)
/***************************************************************************
check if a particular name is already being queried
****************************************************************************/
-static BOOL query_current(struct query_record *r)
+static bool query_current(struct query_record *r)
{
return dns_current &&
nmb_name_equal(&r->name,
@@ -177,7 +177,7 @@ static BOOL query_current(struct query_record *r)
/***************************************************************************
write a query to the child process
****************************************************************************/
-static BOOL write_child(struct packet_struct *p)
+static bool write_child(struct packet_struct *p)
{
struct query_record r;
@@ -285,7 +285,7 @@ void run_dns_queue(void)
queue a DNS query
****************************************************************************/
-BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question)
+bool queue_dns_query(struct packet_struct *p,struct nmb_name *question)
{
if (in_dns || fd_in == -1)
return False;
@@ -317,7 +317,7 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question)
we use this when we can't do async DNS lookups
****************************************************************************/
-BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question)
+bool queue_dns_query(struct packet_struct *p,struct nmb_name *question)
{
struct name_record *namerec = NULL;
struct in_addr dns_ip;
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index f0de0b8485..46808f51de 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -26,22 +26,22 @@ int ClientNMB = -1;
int ClientDGRAM = -1;
int global_nmb_port = -1;
-extern BOOL rescan_listen_set;
-extern BOOL global_in_nmbd;
+extern bool rescan_listen_set;
+extern bool global_in_nmbd;
-extern BOOL override_logfile;
+extern bool override_logfile;
/* are we running as a daemon ? */
-static BOOL is_daemon;
+static bool is_daemon;
/* fork or run in foreground ? */
-static BOOL Fork = True;
+static bool Fork = True;
/* log to standard output ? */
-static BOOL log_stdout;
+static bool log_stdout;
/* have we found LanMan clients yet? */
-BOOL found_lm_clients = False;
+bool found_lm_clients = False;
/* what server type are we currently */
@@ -174,7 +174,7 @@ static void expire_names_and_servers(time_t t)
Reload the list of network interfaces.
************************************************************************** */
-static BOOL reload_interfaces(time_t t)
+static bool reload_interfaces(time_t t)
{
static time_t lastt;
int n;
@@ -286,9 +286,9 @@ static BOOL reload_interfaces(time_t t)
Reload the services file.
**************************************************************************** */
-static BOOL reload_nmbd_services(BOOL test)
+static bool reload_nmbd_services(bool test)
{
- BOOL ret;
+ bool ret;
set_remote_machine_name("nmbd", False);
@@ -317,7 +317,7 @@ static BOOL reload_nmbd_services(BOOL test)
/**************************************************************************** **
* React on 'smbcontrol nmbd reload-config' in the same way as to SIGHUP
- * We use buf here to return BOOL result to process() when reload_interfaces()
+ * We use buf here to return bool result to process() when reload_interfaces()
* detects that there are no subnets.
**************************************************************************** */
@@ -337,7 +337,7 @@ static void msg_reload_nmbd_services(struct messaging_context *msg,
/* If reload_interfaces() returned True */
/* we need to shutdown if there are no subnets... */
/* pass this info back to process() */
- *((BOOL*)data->data) = reload_interfaces(0);
+ *((bool *)data->data) = reload_interfaces(0);
}
}
@@ -407,8 +407,8 @@ static void msg_nmbd_send_packet(struct messaging_context *msg,
static void process(void)
{
- BOOL run_election;
- BOOL no_subnets;
+ bool run_election;
+ bool no_subnets;
while( True ) {
time_t t = time(NULL);
@@ -649,7 +649,7 @@ static void process(void)
Open the socket communication.
**************************************************************************** */
-static BOOL open_sockets(BOOL isdaemon, int port)
+static bool open_sockets(bool isdaemon, int port)
{
/*
* The sockets opened here will be used to receive broadcast
@@ -693,10 +693,10 @@ static BOOL open_sockets(BOOL isdaemon, int port)
int main(int argc, const char *argv[])
{
pstring logfile;
- static BOOL opt_interactive;
+ static bool opt_interactive;
poptContext pc;
static char *p_lmhosts = dyn_LMHOSTSFILE;
- static BOOL no_process_group = False;
+ static bool no_process_group = False;
int opt;
struct poptOption long_options[] = {
POPT_AUTOHELP
diff --git a/source3/nmbd/nmbd_become_lmb.c b/source3/nmbd/nmbd_become_lmb.c
index ac65917d23..8aedd2c478 100644
--- a/source3/nmbd/nmbd_become_lmb.c
+++ b/source3/nmbd/nmbd_become_lmb.c
@@ -71,7 +71,7 @@ static void remove_permanent_name_from_unicast( struct subnet_record *subrec,
******************************************************************/
static void reset_workgroup_state( struct subnet_record *subrec, const char *workgroup_name,
- BOOL force_new_election )
+ bool force_new_election )
{
struct work_record *work;
struct server_record *servrec;
@@ -133,10 +133,10 @@ static void unbecome_local_master_success(struct subnet_record *subrec,
struct nmb_name *released_name,
struct in_addr released_ip)
{
- BOOL force_new_election = False;
+ bool force_new_election = False;
unstring relname;
- memcpy((char *)&force_new_election, userdata->data, sizeof(BOOL));
+ memcpy((char *)&force_new_election, userdata->data, sizeof(bool));
DEBUG(3,("unbecome_local_master_success: released name %s.\n",
nmb_namestr(released_name)));
@@ -164,10 +164,10 @@ static void unbecome_local_master_fail(struct subnet_record *subrec, struct resp
{
struct name_record *namerec;
struct userdata_struct *userdata = rrec->userdata;
- BOOL force_new_election = False;
+ bool force_new_election = False;
unstring failname;
- memcpy((char *)&force_new_election, userdata->data, sizeof(BOOL));
+ memcpy((char *)&force_new_election, userdata->data, sizeof(bool));
DEBUG(0,("unbecome_local_master_fail: failed to release name %s. \
Removing from namelist anyway.\n", nmb_namestr(fail_name)));
@@ -195,7 +195,7 @@ Removing from namelist anyway.\n", nmb_namestr(fail_name)));
******************************************************************/
static void release_1d_name( struct subnet_record *subrec, const char *workgroup_name,
- BOOL force_new_election)
+ bool force_new_election)
{
struct nmb_name nmbname;
struct name_record *namerec;
@@ -203,7 +203,7 @@ static void release_1d_name( struct subnet_record *subrec, const char *workgroup
make_nmb_name(&nmbname, workgroup_name, 0x1d);
if((namerec = find_name_on_subnet( subrec, &nmbname, FIND_SELF_NAME))!=NULL) {
struct userdata_struct *userdata;
- size_t size = sizeof(struct userdata_struct) + sizeof(BOOL);
+ size_t size = sizeof(struct userdata_struct) + sizeof(bool);
if((userdata = (struct userdata_struct *)SMB_MALLOC(size)) == NULL) {
DEBUG(0,("release_1d_name: malloc fail.\n"));
@@ -212,8 +212,8 @@ static void release_1d_name( struct subnet_record *subrec, const char *workgroup
userdata->copy_fn = NULL;
userdata->free_fn = NULL;
- userdata->userdata_len = sizeof(BOOL);
- memcpy((char *)userdata->data, &force_new_election, sizeof(BOOL));
+ userdata->userdata_len = sizeof(bool);
+ memcpy((char *)userdata->data, &force_new_election, sizeof(bool));
release_name(subrec, namerec,
unbecome_local_master_success,
@@ -268,7 +268,7 @@ static void release_msbrowse_name_fail( struct subnet_record *subrec,
******************************************************************/
void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
- BOOL force_new_election)
+ bool force_new_election)
{
struct name_record *namerec;
struct nmb_name nmbname;
diff --git a/source3/nmbd/nmbd_elections.c b/source3/nmbd/nmbd_elections.c
index ef06ef0547..db32461f06 100644
--- a/source3/nmbd/nmbd_elections.c
+++ b/source3/nmbd/nmbd_elections.c
@@ -216,7 +216,7 @@ yet registered on subnet %s\n", nmb_namestr(&nmbname), subrec->subnet_name ));
Determine if I win an election.
******************************************************************/
-static BOOL win_election(struct work_record *work, int version,
+static bool win_election(struct work_record *work, int version,
uint32 criterion, int timeup, const char *server_name)
{
int mytimeup = time(NULL) - StartupTime;
@@ -328,10 +328,10 @@ done:
be done by run_elections().
***************************************************************************/
-BOOL check_elections(void)
+bool check_elections(void)
{
struct subnet_record *subrec;
- BOOL run_any_election = False;
+ bool run_any_election = False;
for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
struct work_record *work;
diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c
index ba533f4b0c..9fe344c39b 100644
--- a/source3/nmbd/nmbd_incomingdgrams.c
+++ b/source3/nmbd/nmbd_incomingdgrams.c
@@ -22,7 +22,7 @@
#include "includes.h"
-extern BOOL found_lm_clients;
+extern bool found_lm_clients;
#if 0
diff --git a/source3/nmbd/nmbd_incomingrequests.c b/source3/nmbd/nmbd_incomingrequests.c
index 292a580ef9..90773c1395 100644
--- a/source3/nmbd/nmbd_incomingrequests.c
+++ b/source3/nmbd/nmbd_incomingrequests.c
@@ -58,9 +58,9 @@ void process_name_release_request(struct subnet_record *subrec,
struct in_addr owner_ip;
struct nmb_name *question = &nmb->question.question_name;
unstring qname;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
- BOOL group = (nb_flags & NB_GROUP) ? True : False;
+ bool group = (nb_flags & NB_GROUP) ? True : False;
struct name_record *namerec;
int rcode = 0;
@@ -153,7 +153,7 @@ void process_name_refresh_request(struct subnet_record *subrec,
{
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
struct in_addr from_ip;
putip((char *)&from_ip,&nmb->additional->rdata[2]);
@@ -190,9 +190,9 @@ void process_name_registration_request(struct subnet_record *subrec,
{
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
- BOOL group = (nb_flags & NB_GROUP) ? True : False;
+ bool group = (nb_flags & NB_GROUP) ? True : False;
struct name_record *namerec = NULL;
int ttl = nmb->additional->ttl;
struct in_addr from_ip;
@@ -439,12 +439,12 @@ void process_name_query_request(struct subnet_record *subrec, struct packet_stru
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
int name_type = question->name_type;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
int ttl=0;
int rcode = 0;
char *prdata = NULL;
char rdata[6];
- BOOL success = False;
+ bool success = False;
struct name_record *namerec = NULL;
int reply_data_len = 0;
int i;
diff --git a/source3/nmbd/nmbd_lmhosts.c b/source3/nmbd/nmbd_lmhosts.c
index eba7329418..8dda58e352 100644
--- a/source3/nmbd/nmbd_lmhosts.c
+++ b/source3/nmbd/nmbd_lmhosts.c
@@ -75,7 +75,7 @@ void load_lmhosts_file(const char *fname)
subnet it will be found by normal name query processing.
****************************************************************************/
-BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp)
+bool find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp)
{
struct name_record *namerec;
diff --git a/source3/nmbd/nmbd_mynames.c b/source3/nmbd/nmbd_mynames.c
index 8fa5439ee3..2eb376fc17 100644
--- a/source3/nmbd/nmbd_mynames.c
+++ b/source3/nmbd/nmbd_mynames.c
@@ -110,7 +110,7 @@ static void insert_refresh_name_into_unicast( struct subnet_record *subrec,
Also add the magic Samba names.
**************************************************************************/
-BOOL register_my_workgroup_and_names(void)
+bool register_my_workgroup_and_names(void)
{
struct subnet_record *subrec;
int i;
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c
index 75259a3672..46a9830b25 100644
--- a/source3/nmbd/nmbd_namelistdb.c
+++ b/source3/nmbd/nmbd_namelistdb.c
@@ -97,7 +97,7 @@ void remove_name_from_namelist(struct subnet_record *subrec,
struct name_record *find_name_on_subnet(struct subnet_record *subrec,
const struct nmb_name *nmbname,
- BOOL self_only)
+ bool self_only)
{
struct nmb_name uc_name;
struct name_record *name_ret;
@@ -139,7 +139,7 @@ struct name_record *find_name_on_subnet(struct subnet_record *subrec,
************************************************************************/
struct name_record *find_name_for_remote_broadcast_subnet(struct nmb_name *nmbname,
- BOOL self_only)
+ bool self_only)
{
struct subnet_record *subrec;
struct name_record *namerec;
@@ -179,7 +179,7 @@ void update_name_ttl( struct name_record *namerec, int ttl )
Add an entry to a subnet name list.
***********************************************************************/
-BOOL add_name_to_subnet( struct subnet_record *subrec,
+bool add_name_to_subnet( struct subnet_record *subrec,
const char *name,
int type,
uint16 nb_flags,
@@ -188,7 +188,7 @@ BOOL add_name_to_subnet( struct subnet_record *subrec,
int num_ips,
struct in_addr *iplist)
{
- BOOL ret = False;
+ bool ret = False;
struct name_record *namerec;
time_t time_now = time(NULL);
@@ -333,7 +333,7 @@ static void remove_nth_ip_in_record( struct name_record *namerec, int ind)
Utility function to check if an IP address exists in a name record.
******************************************************************/
-BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip )
+bool find_ip_in_name_record( struct name_record *namerec, struct in_addr ip )
{
int i;
diff --git a/source3/nmbd/nmbd_namequery.c b/source3/nmbd/nmbd_namequery.c
index ea170d3aaa..c1c5f5238a 100644
--- a/source3/nmbd/nmbd_namequery.c
+++ b/source3/nmbd/nmbd_namequery.c
@@ -31,7 +31,7 @@ static void query_name_response( struct subnet_record *subrec,
struct packet_struct *p)
{
struct nmb_packet *nmb = &p->packet.nmb;
- BOOL success = False;
+ bool success = False;
struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name;
struct in_addr answer_ip;
@@ -139,7 +139,7 @@ static void query_name_timeout_response(struct subnet_record *subrec,
{
struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb;
/* We can only fail here, never succeed. */
- BOOL failed = True;
+ bool failed = True;
struct nmb_name *question_name = &sent_nmb->question.question_name;
if(rrec->num_msgs != 0) {
@@ -168,7 +168,7 @@ static void query_name_timeout_response(struct subnet_record *subrec,
name is not there we look for the name on the given subnet.
****************************************************************************/
-static BOOL query_local_namelists(struct subnet_record *subrec, struct nmb_name *nmbname,
+static bool query_local_namelists(struct subnet_record *subrec, struct nmb_name *nmbname,
struct name_record **namerecp)
{
struct name_record *namerec;
@@ -192,7 +192,7 @@ static BOOL query_local_namelists(struct subnet_record *subrec, struct nmb_name
Try and query for a name.
****************************************************************************/
-BOOL query_name(struct subnet_record *subrec, const char *name, int type,
+bool query_name(struct subnet_record *subrec, const char *name, int type,
query_name_success_function success_fn,
query_name_fail_function fail_fn,
struct userdata_struct *userdata)
@@ -254,7 +254,7 @@ BOOL query_name(struct subnet_record *subrec, const char *name, int type,
Try and query for a name from nmbd acting as a WINS server.
****************************************************************************/
-BOOL query_name_from_wins_server(struct in_addr ip_to,
+bool query_name_from_wins_server(struct in_addr ip_to,
const char *name, int type,
query_name_success_function success_fn,
query_name_fail_function fail_fn,
diff --git a/source3/nmbd/nmbd_nameregister.c b/source3/nmbd/nmbd_nameregister.c
index d781e0d89f..b7f5a3d45b 100644
--- a/source3/nmbd/nmbd_nameregister.c
+++ b/source3/nmbd/nmbd_nameregister.c
@@ -40,8 +40,8 @@ static void register_name_response(struct subnet_record *subrec,
*/
struct nmb_packet *nmb = &p->packet.nmb;
- BOOL bcast = nmb->header.nm_flags.bcast;
- BOOL success = True;
+ bool bcast = nmb->header.nm_flags.bcast;
+ bool success = True;
struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name;
struct nmb_name *answer_name = &nmb->answers->rr_name;
struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb;
@@ -248,8 +248,8 @@ static void register_name_timeout_response(struct subnet_record *subrec,
*/
struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb;
- BOOL bcast = sent_nmb->header.nm_flags.bcast;
- BOOL success = False;
+ bool bcast = sent_nmb->header.nm_flags.bcast;
+ bool success = False;
struct nmb_name *question_name = &sent_nmb->question.question_name;
uint16 nb_flags = 0;
int ttl = 0;
diff --git a/source3/nmbd/nmbd_namerelease.c b/source3/nmbd/nmbd_namerelease.c
index cf19a3295e..4be7396f2e 100644
--- a/source3/nmbd/nmbd_namerelease.c
+++ b/source3/nmbd/nmbd_namerelease.c
@@ -34,8 +34,8 @@ static void release_name_response(struct subnet_record *subrec,
* error. If we are releasing unicast, then we expect to get a response.
*/
struct nmb_packet *nmb = &p->packet.nmb;
- BOOL bcast = nmb->header.nm_flags.bcast;
- BOOL success = True;
+ bool bcast = nmb->header.nm_flags.bcast;
+ bool success = True;
struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name;
struct nmb_name *answer_name = &nmb->answers->rr_name;
struct in_addr released_ip;
@@ -107,7 +107,7 @@ static void release_name_timeout_response(struct subnet_record *subrec,
doesn't respond and someone else wants the name then the
normal WACK/name query from the WINS server will cope */
struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb;
- BOOL bcast = sent_nmb->header.nm_flags.bcast;
+ bool bcast = sent_nmb->header.nm_flags.bcast;
struct nmb_name *question_name = &sent_nmb->question.question_name;
struct in_addr released_ip;
@@ -150,7 +150,7 @@ static void wins_release_name(struct name_record *namerec,
for (i = 0; i < namerec->data.num_ips; i++) {
struct in_addr wins_ip = wins_srv_ip_tag(wins_tags[t], namerec->data.ip[i]);
- BOOL last_one = ((i==namerec->data.num_ips - 1) && !wins_tags[t+1]);
+ bool last_one = ((i==namerec->data.num_ips - 1) && !wins_tags[t+1]);
if (queue_release_name(unicast_subnet,
release_name_response,
release_name_timeout_response,
diff --git a/source3/nmbd/nmbd_nodestatus.c b/source3/nmbd/nmbd_nodestatus.c
index 8d51f13006..168ccf1ad4 100644
--- a/source3/nmbd/nmbd_nodestatus.c
+++ b/source3/nmbd/nmbd_nodestatus.c
@@ -77,7 +77,7 @@ static void node_status_timeout_response(struct subnet_record *subrec,
Try and do a node status to a name - given the name & IP address.
****************************************************************************/
-BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
+bool node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
struct in_addr send_ip, node_status_success_function success_fn,
node_status_fail_function fail_fn, struct userdata_struct *userdata)
{
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index cb13febe46..b19b1d3599 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -30,7 +30,7 @@ extern int num_response_packets;
static void queue_packet(struct packet_struct *packet);
-BOOL rescan_listen_set = False;
+bool rescan_listen_set = False;
/*******************************************************************
@@ -141,9 +141,9 @@ static uint16 generate_name_trn_id(void)
Either loops back or sends out a completed NetBIOS packet.
**************************************************************************/
-static BOOL send_netbios_packet(struct packet_struct *p)
+static bool send_netbios_packet(struct packet_struct *p)
{
- BOOL loopback_this_packet = False;
+ bool loopback_this_packet = False;
/* Check if we are sending to or from ourselves as a WINS server. */
if(ismyip_v4(p->ip) && (p->port == global_nmb_port))
@@ -174,7 +174,7 @@ static BOOL send_netbios_packet(struct packet_struct *p)
**************************************************************************/
static struct packet_struct *create_and_init_netbios_packet(struct nmb_name *nmbname,
- BOOL bcast, BOOL rec_des,
+ bool bcast, bool rec_des,
struct in_addr to_ip)
{
struct packet_struct *packet = NULL;
@@ -221,7 +221,7 @@ static struct packet_struct *create_and_init_netbios_packet(struct nmb_name *nmb
Sets up the common elements of register, refresh or release packet.
**************************************************************************/
-static BOOL create_and_init_additional_record(struct packet_struct *packet,
+static bool create_and_init_additional_record(struct packet_struct *packet,
uint16 nb_flags,
const struct in_addr *register_ip)
{
@@ -269,7 +269,7 @@ static BOOL create_and_init_additional_record(struct packet_struct *packet,
Sends out a name query.
**************************************************************************/
-static BOOL initiate_name_query_packet( struct packet_struct *packet)
+static bool initiate_name_query_packet( struct packet_struct *packet)
{
struct nmb_packet *nmb = NULL;
@@ -291,7 +291,7 @@ static BOOL initiate_name_query_packet( struct packet_struct *packet)
Sends out a name query - from a WINS server.
**************************************************************************/
-static BOOL initiate_name_query_packet_from_wins_server( struct packet_struct *packet)
+static bool initiate_name_query_packet_from_wins_server( struct packet_struct *packet)
{
struct nmb_packet *nmb = NULL;
@@ -313,7 +313,7 @@ static BOOL initiate_name_query_packet_from_wins_server( struct packet_struct *p
Sends out a name register.
**************************************************************************/
-static BOOL initiate_name_register_packet( struct packet_struct *packet,
+static bool initiate_name_register_packet( struct packet_struct *packet,
uint16 nb_flags, const struct in_addr *register_ip)
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -337,7 +337,7 @@ static BOOL initiate_name_register_packet( struct packet_struct *packet,
Sends out a multihomed name register.
**************************************************************************/
-static BOOL initiate_multihomed_name_register_packet(struct packet_struct *packet,
+static bool initiate_multihomed_name_register_packet(struct packet_struct *packet,
uint16 nb_flags, struct in_addr *register_ip)
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -365,7 +365,7 @@ for name %s IP %s (bcast=%s) to IP %s\n",
Sends out a name refresh.
**************************************************************************/
-static BOOL initiate_name_refresh_packet( struct packet_struct *packet,
+static bool initiate_name_refresh_packet( struct packet_struct *packet,
uint16 nb_flags, struct in_addr *refresh_ip)
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -389,7 +389,7 @@ static BOOL initiate_name_refresh_packet( struct packet_struct *packet,
Sends out a name release.
**************************************************************************/
-static BOOL initiate_name_release_packet( struct packet_struct *packet,
+static bool initiate_name_release_packet( struct packet_struct *packet,
uint16 nb_flags, struct in_addr *release_ip)
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -413,7 +413,7 @@ static BOOL initiate_name_release_packet( struct packet_struct *packet,
Sends out a node status.
**************************************************************************/
-static BOOL initiate_node_status_packet( struct packet_struct *packet )
+static bool initiate_node_status_packet( struct packet_struct *packet )
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -442,7 +442,7 @@ static BOOL initiate_node_status_packet( struct packet_struct *packet )
broadcast subnet.
****************************************************************************/
-static BOOL assert_check_subnet(struct subnet_record *subrec)
+static bool assert_check_subnet(struct subnet_record *subrec)
{
if( subrec == remote_broadcast_subnet) {
DEBUG(0,("assert_check_subnet: Attempt to send packet on remote broadcast subnet. \
@@ -587,7 +587,7 @@ struct response_record *queue_register_multihomed_name( struct subnet_record *su
{
struct packet_struct *p;
struct response_record *rrec;
- BOOL ret;
+ bool ret;
/* Sanity check. */
if(subrec != unicast_subnet) {
@@ -872,7 +872,7 @@ void reply_netbios_packet(struct packet_struct *orig_packet,
struct nmb_packet *nmb = NULL;
struct res_rec answers;
struct nmb_packet *orig_nmb = &orig_packet->packet.nmb;
- BOOL loopback_this_packet = False;
+ bool loopback_this_packet = False;
int rr_type = RR_TYPE_NB;
const char *packet_type = "unknown";
@@ -1179,7 +1179,7 @@ command code %d from %s IP %s to %s\n", subrec->subnet_name, command, nmb_namest
stage as subsequent processing is expensive.
****************************************************************************/
-static BOOL listening(struct packet_struct *p,struct nmb_name *nbname)
+static bool listening(struct packet_struct *p,struct nmb_name *nbname)
{
struct subnet_record *subrec = NULL;
@@ -1307,9 +1307,9 @@ packet sent to name %s from IP %s\n",
Validate a response nmb packet.
****************************************************************************/
-static BOOL validate_nmb_response_packet( struct nmb_packet *nmb )
+static bool validate_nmb_response_packet( struct nmb_packet *nmb )
{
- BOOL ignore = False;
+ bool ignore = False;
switch (nmb->header.opcode) {
case NMB_NAME_REG_OPCODE:
@@ -1358,9 +1358,9 @@ static BOOL validate_nmb_response_packet( struct nmb_packet *nmb )
Validate a request nmb packet.
****************************************************************************/
-static BOOL validate_nmb_packet( struct nmb_packet *nmb )
+static bool validate_nmb_packet( struct nmb_packet *nmb )
{
- BOOL ignore = False;
+ bool ignore = False;
switch (nmb->header.opcode) {
case NMB_NAME_REG_OPCODE:
@@ -1657,7 +1657,7 @@ on subnet %s\n", rrec->response_id, inet_ntoa(rrec->packet->ip), subrec->subnet_
plus the broadcast sockets.
***************************************************************************/
-static BOOL create_listen_fdset(fd_set **ppset, int **psock_array, int *listen_number, int *maxfd)
+static bool create_listen_fdset(fd_set **ppset, int **psock_array, int *listen_number, int *maxfd)
{
int *sock_array = NULL;
struct subnet_record *subrec = NULL;
@@ -1729,7 +1729,7 @@ only use %d.\n", (count*2) + 2, FD_SETSIZE));
return True if the socket is dead
***************************************************************************/
-BOOL listen_for_packets(BOOL run_election)
+bool listen_for_packets(bool run_election)
{
static fd_set *listen_set = NULL;
static int listen_number = 0;
@@ -1874,13 +1874,13 @@ BOOL listen_for_packets(BOOL run_election)
Construct and send a netbios DGRAM.
**************************************************************************/
-BOOL send_mailslot(BOOL unique, const char *mailslot,char *buf, size_t len,
+bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
const char *srcname, int src_type,
const char *dstname, int dest_type,
struct in_addr dest_ip,struct in_addr src_ip,
int dest_port)
{
- BOOL loopback_this_packet = False;
+ bool loopback_this_packet = False;
struct packet_struct p;
struct dgram_packet *dgram = &p.packet.dgram;
char *ptr,*p2;
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 4b5fe28d4e..feb7941cc3 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -48,7 +48,7 @@ void process_logon_packet(struct packet_struct *p, char *buf,int len,
uint16 lmnttoken = 0;
uint16 lm20token = 0;
uint32 domainsidsize;
- BOOL short_request = False;
+ bool short_request = False;
char *getdc;
char *uniuser; /* Unicode user name. */
pstring ascuser;
diff --git a/source3/nmbd/nmbd_responserecordsdb.c b/source3/nmbd/nmbd_responserecordsdb.c
index 640a1861ef..22a038ef2e 100644
--- a/source3/nmbd/nmbd_responserecordsdb.c
+++ b/source3/nmbd/nmbd_responserecordsdb.c
@@ -225,7 +225,7 @@ matching record.\n", id));
Check if a refresh is queued for a particular name on a particular subnet.
**************************************************************************/
-BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec)
+bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec)
{
struct response_record *rrec = NULL;
diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c
index 661b68f331..6670c55bf3 100644
--- a/source3/nmbd/nmbd_sendannounce.c
+++ b/source3/nmbd/nmbd_sendannounce.c
@@ -26,7 +26,7 @@
#include "includes.h"
extern int updatecount;
-extern BOOL found_lm_clients;
+extern bool found_lm_clients;
/****************************************************************************
Send a browser reset packet.
diff --git a/source3/nmbd/nmbd_serverlistdb.c b/source3/nmbd/nmbd_serverlistdb.c
index 9bd80b7270..5ac4888365 100644
--- a/source3/nmbd/nmbd_serverlistdb.c
+++ b/source3/nmbd/nmbd_serverlistdb.c
@@ -288,7 +288,7 @@ void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,
x_fprintf(fp, "\"%s\"\n", description);
}
-void write_browse_list(time_t t, BOOL force_write)
+void write_browse_list(time_t t, bool force_write)
{
struct subnet_record *subrec;
struct work_record *work;
@@ -297,7 +297,7 @@ void write_browse_list(time_t t, BOOL force_write)
uint32 stype;
int i;
XFILE *fp;
- BOOL list_changed = force_write;
+ bool list_changed = force_write;
static time_t lasttime = 0;
/* Always dump if we're being told to by a signal. */
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 7fd241cf62..39aa4577bb 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -188,7 +188,7 @@ struct subnet_record *make_normal_subnet(const struct interface *iface)
Create subnet entries.
**************************************************************************/
-BOOL create_subnets(void)
+bool create_subnets(void)
{
/* We only count IPv4 interfaces whilst we're waiting. */
int num_interfaces = iface_count_v4();
@@ -323,7 +323,7 @@ BOOL create_subnets(void)
Function to tell us if we can use the unicast subnet.
******************************************************************/
-BOOL we_are_a_wins_client(void)
+bool we_are_a_wins_client(void)
{
if (wins_srv_count() > 0) {
return True;
diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c
index 6b716bdf35..df71e6db43 100644
--- a/source3/nmbd/nmbd_synclists.c
+++ b/source3/nmbd/nmbd_synclists.c
@@ -63,7 +63,7 @@ static void callback(const char *sname, uint32 stype,
static void sync_child(char *name, int nm_type,
char *workgroup,
- struct in_addr ip, BOOL local, BOOL servers,
+ struct in_addr ip, bool local, bool servers,
char *fname)
{
fstring unix_workgroup;
@@ -141,7 +141,7 @@ static void sync_child(char *name, int nm_type,
void sync_browse_lists(struct work_record *work,
char *name, int nm_type,
- struct in_addr ip, BOOL local, BOOL servers)
+ struct in_addr ip, bool local, bool servers)
{
struct sync_record *s;
static int counter;
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index 66c060f652..38962c2b39 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -207,7 +207,7 @@ static TDB_DATA name_to_key(const struct nmb_name *nmbname)
on the linked list. We will free this later in XXXX().
*****************************************************************************/
-struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, BOOL self_only)
+struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, bool self_only)
{
TDB_DATA data, key;
struct name_record *nr = NULL;
@@ -262,7 +262,7 @@ struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, BOO
Overwrite or add a given name in the wins.tdb.
*****************************************************************************/
-static BOOL store_or_replace_wins_namerec(const struct name_record *namerec, int tdb_flag)
+static bool store_or_replace_wins_namerec(const struct name_record *namerec, int tdb_flag)
{
TDB_DATA key, data;
int ret;
@@ -288,7 +288,7 @@ static BOOL store_or_replace_wins_namerec(const struct name_record *namerec, int
Overwrite a given name in the wins.tdb.
*****************************************************************************/
-BOOL wins_store_changed_namerec(const struct name_record *namerec)
+bool wins_store_changed_namerec(const struct name_record *namerec)
{
return store_or_replace_wins_namerec(namerec, TDB_REPLACE);
}
@@ -297,7 +297,7 @@ BOOL wins_store_changed_namerec(const struct name_record *namerec)
Primary interface into creating and overwriting records in the wins.tdb.
*****************************************************************************/
-BOOL add_name_to_wins_subnet(const struct name_record *namerec)
+bool add_name_to_wins_subnet(const struct name_record *namerec)
{
return store_or_replace_wins_namerec(namerec, TDB_INSERT);
}
@@ -307,7 +307,7 @@ BOOL add_name_to_wins_subnet(const struct name_record *namerec)
on the linked list.
*****************************************************************************/
-BOOL remove_name_from_wins_namelist(struct name_record *namerec)
+bool remove_name_from_wins_namelist(struct name_record *namerec)
{
TDB_DATA key;
int ret;
@@ -412,7 +412,7 @@ static void update_wins_flag(struct name_record *namerec, int flags)
Return the general ID value and increase it if requested.
*****************************************************************************/
-static void get_global_id_and_update(SMB_BIG_UINT *current_id, BOOL update)
+static void get_global_id_and_update(SMB_BIG_UINT *current_id, bool update)
{
/*
* it's kept as a static here, to prevent people from messing
@@ -482,7 +482,7 @@ static void wins_hook(const char *operation, struct name_record *namerec, int tt
Determine if this packet should be allocated to the WINS server.
*****************************************************************************/
-BOOL packet_is_for_wins_server(struct packet_struct *packet)
+bool packet_is_for_wins_server(struct packet_struct *packet)
{
struct nmb_packet *nmb = &packet->packet.nmb;
@@ -562,7 +562,7 @@ static int get_ttl_from_packet(struct nmb_packet *nmb)
Load or create the WINS database.
*****************************************************************************/
-BOOL initialise_wins(void)
+bool initialise_wins(void)
{
time_t time_now = time(NULL);
XFILE *fp;
@@ -600,8 +600,8 @@ BOOL initialise_wins(void)
int ttl;
const char *ptr;
char *p;
- BOOL got_token;
- BOOL was_ip;
+ bool got_token;
+ bool was_ip;
int i;
unsigned int hash;
int version;
@@ -804,9 +804,9 @@ void wins_process_name_refresh_request( struct subnet_record *subrec,
{
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
- BOOL group = (nb_flags & NB_GROUP) ? True : False;
+ bool group = (nb_flags & NB_GROUP) ? True : False;
struct name_record *namerec = NULL;
int ttl = get_ttl_from_packet(nmb);
struct in_addr from_ip;
@@ -1110,12 +1110,12 @@ void wins_process_name_registration_request(struct subnet_record *subrec,
unstring name;
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
int ttl = get_ttl_from_packet(nmb);
struct name_record *namerec = NULL;
struct in_addr from_ip;
- BOOL registering_group_name = (nb_flags & NB_GROUP) ? True : False;
+ bool registering_group_name = (nb_flags & NB_GROUP) ? True : False;
struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0");
putip((char *)&from_ip,&nmb->additional->rdata[2]);
@@ -1480,12 +1480,12 @@ void wins_process_multihomed_name_registration_request( struct subnet_record *su
{
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
int ttl = get_ttl_from_packet(nmb);
struct name_record *namerec = NULL;
struct in_addr from_ip;
- BOOL group = (nb_flags & NB_GROUP) ? True : False;
+ bool group = (nb_flags & NB_GROUP) ? True : False;
struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0");
unstring qname;
@@ -1994,11 +1994,11 @@ void wins_process_name_release_request(struct subnet_record *subrec,
{
struct nmb_packet *nmb = &p->packet.nmb;
struct nmb_name *question = &nmb->question.question_name;
- BOOL bcast = nmb->header.nm_flags.bcast;
+ bool bcast = nmb->header.nm_flags.bcast;
uint16 nb_flags = get_nb_flags(nmb->additional->rdata);
struct name_record *namerec = NULL;
struct in_addr from_ip;
- BOOL releasing_group_name = (nb_flags & NB_GROUP) ? True : False;;
+ bool releasing_group_name = (nb_flags & NB_GROUP) ? True : False;;
putip((char *)&from_ip,&nmb->additional->rdata[2]);
@@ -2110,7 +2110,7 @@ release name %s as this record is not active anymore.\n", nmb_namestr(question)
static int wins_processing_traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state)
{
time_t t = *(time_t *)state;
- BOOL store_record = False;
+ bool store_record = False;
struct name_record *namerec = NULL;
struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0");
@@ -2302,7 +2302,7 @@ static int wins_writedb_traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA db
}
-void wins_write_database(time_t t, BOOL background)
+void wins_write_database(time_t t, bool background)
{
static time_t last_write_time = 0;
pstring fname, fnamenew;
@@ -2380,7 +2380,7 @@ void nmbd_wins_new_entry(struct messaging_context *msg,
struct name_record *namerec = NULL;
struct name_record *new_namerec = NULL;
struct nmb_name question;
- BOOL overwrite=False;
+ bool overwrite=False;
struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0");
int i;
diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c
index 82c3a31669..1845401d9e 100644
--- a/source3/nmbd/nmbd_workgroupdb.c
+++ b/source3/nmbd/nmbd_workgroupdb.c
@@ -269,7 +269,7 @@ on subnet %s\n", name, subrec->subnet_name));
Dump a copy of the workgroup database into the log file.
**************************************************************************/
-void dump_workgroups(BOOL force_write)
+void dump_workgroups(bool force_write)
{
struct subnet_record *subrec;
int debuglevel = force_write ? 0 : 4;