From efa384375f61049d7e7c43a77dc8abe0e034e04d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Oct 2007 22:13:02 +0000 Subject: r25454: Use standard bool types in a couple more places. (This used to be commit 9243b551f30c7aa2763115516a6adcfe5bbddc58) --- source4/utils/nmblookup.c | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'source4/utils/nmblookup.c') diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index affc38e3e7..ada5b839b7 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -34,12 +34,12 @@ static struct { const char *broadcast_address; const char *unicast_address; - BOOL find_master; - BOOL wins_lookup; - BOOL node_status; - BOOL root_port; - BOOL lookup_by_ip; - BOOL case_sensitive; + bool find_master; + bool wins_lookup; + bool node_status; + bool root_port; + bool lookup_by_ip; + bool case_sensitive; } options; /* @@ -102,7 +102,7 @@ static char *node_status_flags(TALLOC_CTX *mem_ctx, uint16_t flags) } /* do a single node status */ -static BOOL do_node_status(struct nbt_name_socket *nbtsock, +static bool do_node_status(struct nbt_name_socket *nbtsock, const char *addr) { struct nbt_name_status io; @@ -133,10 +133,10 @@ static BOOL do_node_status(struct nbt_name_socket *nbtsock, io.out.status.statistics.unit_id[3], io.out.status.statistics.unit_id[4], io.out.status.statistics.unit_id[5]); - return True; + return true; } - return False; + return false; } /* do a single node query */ @@ -144,7 +144,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock, const char *addr, const char *node_name, enum nbt_name_type node_type, - BOOL broadcast) + bool broadcast) { struct nbt_name_query io; NTSTATUS status; @@ -176,7 +176,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock, } -static BOOL process_one(const char *name) +static bool process_one(const char *name) { TALLOC_CTX *tmp_ctx = talloc_new(NULL); enum nbt_name_type node_type = NBT_NAME_CLIENT; @@ -184,7 +184,7 @@ static BOOL process_one(const char *name) struct socket_address *all_zero_addr; struct nbt_name_socket *nbtsock; NTSTATUS status = NT_STATUS_OK; - BOOL ret = True; + bool ret = true; if (!options.case_sensitive) { name = strupper_talloc(tmp_ctx, name); @@ -214,14 +214,14 @@ static BOOL process_one(const char *name) if (!all_zero_addr) { talloc_free(tmp_ctx); - return False; + return false; } status = socket_listen(nbtsock->sock, all_zero_addr, 0, 0); if (!NT_STATUS_IS_OK(status)) { printf("Failed to bind to local port 137 - %s\n", nt_errstr(status)); talloc_free(tmp_ctx); - return False; + return false; } } @@ -232,22 +232,22 @@ static BOOL process_one(const char *name) } if (options.broadcast_address) { - status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, True); + status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, true); } else if (options.unicast_address) { - status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, False); + status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, false); } else { int i, num_interfaces = iface_count(); for (i=0;i