summaryrefslogtreecommitdiff
path: root/source4/nbt_server/wins
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-10-06 21:33:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:52 -0500
commitcac2379a2fc570308f24142959fabe5ae4462aff (patch)
treed3b089e3b3527e9208c639a00b8208caeba6d2ed /source4/nbt_server/wins
parent6bc52259aa668666f2f40abfd8da181d5aaf8b6e (diff)
downloadsamba-cac2379a2fc570308f24142959fabe5ae4462aff.tar.gz
samba-cac2379a2fc570308f24142959fabe5ae4462aff.tar.bz2
samba-cac2379a2fc570308f24142959fabe5ae4462aff.zip
r25546: Convert to standard bool type.
(This used to be commit ac83dbf199fd442fc994d43a6e5e9fda8d4c88b6)
Diffstat (limited to 'source4/nbt_server/wins')
-rw-r--r--source4/nbt_server/wins/winsdb.c32
-rw-r--r--source4/nbt_server/wins/winsserver.c28
-rw-r--r--source4/nbt_server/wins/winswack.c18
3 files changed, 39 insertions, 39 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 2789873c59..91996b24d3 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -366,8 +366,8 @@ static int winsdb_addr_sort_list (struct winsdb_addr **p1, struct winsdb_addr **
struct winsdb_addr *a1 = talloc_get_type(*p1, struct winsdb_addr);
struct winsdb_addr *a2 = talloc_get_type(*p2, struct winsdb_addr);
struct winsdb_handle *h= talloc_get_type(opaque, struct winsdb_handle);
- BOOL a1_owned = False;
- BOOL a2_owned = False;
+ bool a1_owned = false;
+ bool a2_owned = false;
/*
* first the owned addresses with the newest to the oldest address
@@ -378,11 +378,11 @@ static int winsdb_addr_sort_list (struct winsdb_addr **p1, struct winsdb_addr **
}
if (strcmp(a2->wins_owner, h->local_owner) == 0) {
- a2_owned = True;
+ a2_owned = true;
}
if (strcmp(a1->wins_owner, h->local_owner) == 0) {
- a1_owned = True;
+ a1_owned = true;
}
return a2_owned - a1_owned;
@@ -391,12 +391,12 @@ static int winsdb_addr_sort_list (struct winsdb_addr **p1, struct winsdb_addr **
struct winsdb_addr **winsdb_addr_list_add(struct winsdb_handle *h, const struct winsdb_record *rec,
struct winsdb_addr **addresses, const char *address,
const char *wins_owner, time_t expire_time,
- BOOL is_name_registration)
+ bool is_name_registration)
{
struct winsdb_addr *old_addr = NULL;
size_t len = 0;
size_t i;
- BOOL found_old_replica = False;
+ bool found_old_replica = false;
/*
* count the addresses and maybe
@@ -444,10 +444,10 @@ struct winsdb_addr **winsdb_addr_list_add(struct winsdb_handle *h, const struct
* record at all, find the oldest owned address
*/
for (i=0; addresses[i]; i++) {
- BOOL cur_is_replica = False;
+ bool cur_is_replica = false;
/* find out if the current address is a replica */
if (strcmp(addresses[i]->wins_owner, h->local_owner) != 0) {
- cur_is_replica = True;
+ cur_is_replica = true;
}
/*
@@ -461,7 +461,7 @@ struct winsdb_addr **winsdb_addr_list_add(struct winsdb_handle *h, const struct
* that would be replaced
*/
if (!found_old_replica && cur_is_replica) {
- found_old_replica = True;
+ found_old_replica = true;
old_addr = addresses[i];
continue;
}
@@ -621,7 +621,7 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_
struct ldb_message_element *el;
struct nbt_name *name;
uint32_t i, j, num_values;
- BOOL we_are_owner = False;
+ bool we_are_owner = false;
rec = talloc(mem_ctx, struct winsdb_record);
if (rec == NULL) {
@@ -683,7 +683,7 @@ NTSTATUS winsdb_record(struct winsdb_handle *h, struct ldb_message *msg, TALLOC_
}
if (strcmp(rec->wins_owner, h->local_owner) == 0) {
- we_are_owner = True;
+ we_are_owner = true;
}
/*
@@ -945,7 +945,7 @@ failed:
return NBT_RCODE_SVR;
}
-static BOOL winsdb_check_or_add_module_list(struct winsdb_handle *h)
+static bool winsdb_check_or_add_module_list(struct winsdb_handle *h)
{
int trans;
int ret;
@@ -997,17 +997,17 @@ static BOOL winsdb_check_or_add_module_list(struct winsdb_handle *h)
if (!h->ldb) goto failed;
talloc_free(tmp_ctx);
- return True;
+ return true;
skip:
if (trans == LDB_SUCCESS) ldb_transaction_cancel(h->ldb);
talloc_free(tmp_ctx);
- return True;
+ return true;
failed:
if (trans == LDB_SUCCESS) ldb_transaction_cancel(h->ldb);
talloc_free(tmp_ctx);
- return False;
+ return false;
}
struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_caller caller)
@@ -1015,7 +1015,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, enum winsdb_handle_cal
struct winsdb_handle *h = NULL;
const char *owner;
unsigned int flags = 0;
- BOOL ret;
+ bool ret;
int ldb_err;
h = talloc(mem_ctx, struct winsdb_handle);
diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c
index eb45bf5fc2..2ff5e3f69b 100644
--- a/source4/nbt_server/wins/winsserver.c
+++ b/source4/nbt_server/wins/winsserver.c
@@ -44,7 +44,7 @@ uint32_t wins_server_ttl(struct wins_server *winssrv, uint32_t ttl)
return ttl;
}
-static enum wrepl_name_type wrepl_type(uint16_t nb_flags, struct nbt_name *name, BOOL mhomed)
+static enum wrepl_name_type wrepl_type(uint16_t nb_flags, struct nbt_name *name, bool mhomed)
{
/* this copes with the nasty hack that is the type 0x1c name */
if (name->type == NBT_NAME_LOGON) {
@@ -86,7 +86,7 @@ static uint8_t wins_register_new(struct nbt_name_socket *nbtsock,
rec.type = type;
rec.state = WREPL_STATE_ACTIVE;
rec.node = node;
- rec.is_static = False;
+ rec.is_static = false;
rec.expire_time = time(NULL) + ttl;
rec.version = 0; /* will be allocated later */
rec.wins_owner = NULL; /* will be set later */
@@ -99,7 +99,7 @@ static uint8_t wins_register_new(struct nbt_name_socket *nbtsock,
address,
winssrv->wins_db->local_owner,
rec.expire_time,
- True);
+ true);
if (rec.addresses == NULL) return NBT_RCODE_SVR;
DEBUG(4,("WINS: accepted registration of %s with address %s\n",
@@ -134,7 +134,7 @@ static uint8_t wins_update_ttl(struct nbt_name_socket *nbtsock,
winsdb_addr->address,
winssrv->wins_db->local_owner,
rec->expire_time,
- True);
+ true);
if (rec->addresses == NULL) return NBT_RCODE_SVR;
}
@@ -170,7 +170,7 @@ static uint8_t wins_sgroup_merge(struct nbt_name_socket *nbtsock,
address,
winssrv->wins_db->local_owner,
rec->expire_time,
- True);
+ true);
if (rec->addresses == NULL) return NBT_RCODE_SVR;
DEBUG(5,("WINS: sgroup merge of %s at %s\n",
@@ -249,11 +249,11 @@ static void wins_wack_allow(struct wack_state *s)
* and update the time stamp and owner for the ownes that are still there
*/
for (i=0; rec->addresses[i]; i++) {
- BOOL found = False;
+ bool found = false;
for (j=0; j < s->io.out.num_addresses; j++) {
if (strcmp(rec->addresses[i]->address, s->io.out.addresses[j]) != 0) continue;
- found = True;
+ found = true;
break;
}
if (found) {
@@ -262,7 +262,7 @@ static void wins_wack_allow(struct wack_state *s)
s->reg_address,
s->winssrv->wins_db->local_owner,
rec->expire_time,
- True);
+ true);
if (rec->addresses == NULL) goto failed;
continue;
}
@@ -275,7 +275,7 @@ static void wins_wack_allow(struct wack_state *s)
s->reg_address,
s->winssrv->wins_db->local_owner,
rec->expire_time,
- True);
+ true);
if (rec->addresses == NULL) goto failed;
/* if we have more than one address, this becomes implicit a MHOMED record */
@@ -302,7 +302,7 @@ static void wack_wins_challenge_handler(struct composite_context *c_req)
{
struct wack_state *s = talloc_get_type(c_req->async.private_data,
struct wack_state);
- BOOL found;
+ bool found;
uint32_t i;
s->status = wins_challenge_recv(c_req, s, &s->io);
@@ -328,11 +328,11 @@ static void wack_wins_challenge_handler(struct composite_context *c_req)
* with the address trying to be registered, then deny
* the registration
*/
- found = False;
+ found = false;
for (i=0; i < s->io.out.num_addresses; i++) {
if (strcmp(s->reg_address, s->io.out.addresses[i]) != 0) continue;
- found = True;
+ found = true;
break;
}
if (!found) {
@@ -421,7 +421,7 @@ static void nbtd_winsserver_register(struct nbt_name_socket *nbtsock,
uint8_t rcode = NBT_RCODE_OK;
uint16_t nb_flags = packet->additional[0].rdata.netbios.addresses[0].nb_flags;
const char *address = packet->additional[0].rdata.netbios.addresses[0].ipaddr;
- BOOL mhomed = ((packet->operation & NBT_OPCODE) == NBT_OPCODE_MULTI_HOME_REG);
+ bool mhomed = ((packet->operation & NBT_OPCODE) == NBT_OPCODE_MULTI_HOME_REG);
enum wrepl_name_type new_type = wrepl_type(nb_flags, name, mhomed);
struct winsdb_addr *winsdb_addr = NULL;
@@ -628,7 +628,7 @@ static void nbtd_wins_randomize1Clist(const char **addresses, struct socket_addr
idx = sidx = r % num_addrs;
while (1) {
- BOOL same;
+ bool same;
/* if the current one is in the same subnet, use it */
same = iface_same_net(addresses[idx], src->addr, mask);
diff --git a/source4/nbt_server/wins/winswack.c b/source4/nbt_server/wins/winswack.c
index a2b479673a..304edcf8de 100644
--- a/source4/nbt_server/wins/winswack.c
+++ b/source4/nbt_server/wins/winswack.c
@@ -48,7 +48,7 @@ static void wins_challenge_handler(struct nbt_name_request *req)
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
- iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, True);
+ iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, true);
if (!iface) {
composite_error(ctx, NT_STATUS_INTERNAL_ERROR);
return;
@@ -104,13 +104,13 @@ struct composite_context *wins_challenge_send(TALLOC_CTX *mem_ctx, struct wins_c
/* setup a name query to the first address */
state->query.in.name = *state->io->in.name;
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
- state->query.in.broadcast = False;
- state->query.in.wins_lookup = True;
+ state->query.in.broadcast = false;
+ state->query.in.wins_lookup = true;
state->query.in.timeout = 1;
state->query.in.retries = 2;
ZERO_STRUCT(state->query.out);
- iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, True);
+ iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, true);
if (!iface) {
goto failed;
}
@@ -164,7 +164,7 @@ static void wins_release_demand_handler(struct nbt_name_request *req)
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
state->release.in.retries = (state->addresses_left > 1 ? 0 : 2);
- iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->release.in.dest_addr, True);
+ iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->release.in.dest_addr, true);
if (!iface) {
composite_error(ctx, NT_STATUS_INTERNAL_ERROR);
return;
@@ -220,12 +220,12 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s
state->release.in.name = *state->io->in.name;
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
state->release.in.address = state->release.in.dest_addr;
- state->release.in.broadcast = False;
+ state->release.in.broadcast = false;
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
state->release.in.retries = (state->addresses_left > 1 ? 0 : 2);
ZERO_STRUCT(state->release.out);
- iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->release.in.dest_addr, True);
+ iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->release.in.dest_addr, true);
if (!iface) {
goto failed;
}
@@ -316,7 +316,7 @@ NTSTATUS nbtd_proxy_wins_challenge(struct irpc_message *msg,
s->c_req->async.fn = proxy_wins_challenge_handler;
s->c_req->async.private_data = s;
- msg->defer_reply = True;
+ msg->defer_reply = true;
return NT_STATUS_OK;
}
@@ -375,6 +375,6 @@ NTSTATUS nbtd_proxy_wins_release_demand(struct irpc_message *msg,
s->c_req->async.fn = proxy_wins_release_demand_handler;
s->c_req->async.private_data = s;
- msg->defer_reply = True;
+ msg->defer_reply = true;
return NT_STATUS_OK;
}