diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-01 22:13:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:38 -0500 |
commit | efa384375f61049d7e7c43a77dc8abe0e034e04d (patch) | |
tree | 9640f28b0ecc1e7e9a309254fcce6ed2b1950a2f /source4/utils/nmblookup.c | |
parent | 621fcfcd1c8dc4ccbe8f3d58d988b9ce40b3fad3 (diff) | |
download | samba-efa384375f61049d7e7c43a77dc8abe0e034e04d.tar.gz samba-efa384375f61049d7e7c43a77dc8abe0e034e04d.tar.bz2 samba-efa384375f61049d7e7c43a77dc8abe0e034e04d.zip |
r25454: Use standard bool types in a couple more places.
(This used to be commit 9243b551f30c7aa2763115516a6adcfe5bbddc58)
Diffstat (limited to 'source4/utils/nmblookup.c')
-rw-r--r-- | source4/utils/nmblookup.c | 50 |
1 files changed, 25 insertions, 25 deletions
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<num_interfaces;i++) { const char *bcast = iface_n_bcast(i); if (bcast == NULL) continue; - status = do_node_query(nbtsock, bcast, node_name, node_type, True); + status = do_node_query(nbtsock, bcast, node_name, node_type, true); if (NT_STATUS_IS_OK(status)) break; } } if (!NT_STATUS_IS_OK(status)) { printf("Lookup failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; } talloc_free(tmp_ctx); @@ -259,7 +259,7 @@ static BOOL process_one(const char *name) */ int main(int argc, const char *argv[]) { - BOOL ret = True; + bool ret = true; poptContext pc; int opt; enum { @@ -316,22 +316,22 @@ int main(int argc, const char *argv[]) options.unicast_address = poptGetOptArg(pc); break; case OPT_FIND_MASTER: - options.find_master = True; + options.find_master = true; break; case OPT_WINS_LOOKUP: - options.wins_lookup = True; + options.wins_lookup = true; break; case OPT_NODE_STATUS: - options.node_status = True; + options.node_status = true; break; case OPT_ROOT_PORT: - options.root_port = True; + options.root_port = true; break; case OPT_LOOKUP_BY_IP: - options.lookup_by_ip = True; + options.lookup_by_ip = true; break; case OPT_CASE_SENSITIVE: - options.case_sensitive = True; + options.case_sensitive = true; break; } } |