diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-06 21:33:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:52 -0500 |
commit | cac2379a2fc570308f24142959fabe5ae4462aff (patch) | |
tree | d3b089e3b3527e9208c639a00b8208caeba6d2ed /source4/nbt_server | |
parent | 6bc52259aa668666f2f40abfd8da181d5aaf8b6e (diff) | |
download | samba-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')
-rw-r--r-- | source4/nbt_server/dgram/netlogon.c | 4 | ||||
-rw-r--r-- | source4/nbt_server/dgram/ntlogon.c | 2 | ||||
-rw-r--r-- | source4/nbt_server/interfaces.c | 6 | ||||
-rw-r--r-- | source4/nbt_server/irpc.c | 4 | ||||
-rw-r--r-- | source4/nbt_server/packet.c | 14 | ||||
-rw-r--r-- | source4/nbt_server/register.c | 6 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 32 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 28 | ||||
-rw-r--r-- | source4/nbt_server/wins/winswack.c | 18 |
9 files changed, 57 insertions, 57 deletions
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c index ba32bb123e..2f96970a65 100644 --- a/source4/nbt_server/dgram/netlogon.c +++ b/source4/nbt_server/dgram/netlogon.c @@ -39,7 +39,7 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot, struct nbt_netlogon_packet *netlogon) { struct nbt_name *name = &packet->data.msg.dest_name; - struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, False); + struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, false); struct nbt_netlogon_packet reply; struct nbt_netlogon_response_from_pdc *pdc; const char *ref_attrs[] = {"nETBIOSName", NULL}; @@ -102,7 +102,7 @@ static void nbtd_netlogon_getdc2(struct dgram_mailslot_handler *dgmslot, struct nbt_netlogon_packet *netlogon) { struct nbt_name *name = &packet->data.msg.dest_name; - struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, False); + struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, false); struct nbt_netlogon_packet reply; struct nbt_netlogon_response_from_pdc2 *pdc; struct ldb_context *samctx; diff --git a/source4/nbt_server/dgram/ntlogon.c b/source4/nbt_server/dgram/ntlogon.c index 9d80a44ce6..ce1f725038 100644 --- a/source4/nbt_server/dgram/ntlogon.c +++ b/source4/nbt_server/dgram/ntlogon.c @@ -35,7 +35,7 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot, struct nbt_ntlogon_packet *ntlogon) { struct nbt_name *name = &packet->data.msg.dest_name; - struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, False); + struct nbtd_interface *reply_iface = nbtd_find_reply_iface(iface, src->addr, false); struct nbt_ntlogon_packet reply; struct nbt_ntlogon_sam_logon_reply *logon; diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 27d733aeff..f2a875142a 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -282,7 +282,7 @@ const char **nbtd_address_list(struct nbtd_interface *iface, TALLOC_CTX *mem_ctx struct nbtd_server *nbtsrv = iface->nbtsrv; const char **ret = NULL; struct nbtd_interface *iface2; - BOOL is_loopback = False; + bool is_loopback = false; if (iface->ip_address) { is_loopback = iface_same_net(iface->ip_address, "127.0.0.1", "255.0.0.0"); @@ -313,7 +313,7 @@ const char **nbtd_address_list(struct nbtd_interface *iface, TALLOC_CTX *mem_ctx find the interface to use for sending a outgoing request */ struct nbtd_interface *nbtd_find_request_iface(struct nbtd_server *nbtd_server, - const char *address, BOOL allow_bcast_iface) + const char *address, bool allow_bcast_iface) { struct nbtd_interface *cur; @@ -337,7 +337,7 @@ struct nbtd_interface *nbtd_find_request_iface(struct nbtd_server *nbtd_server, * find the interface to use for sending a outgoing reply */ struct nbtd_interface *nbtd_find_reply_iface(struct nbtd_interface *iface, - const char *address, BOOL allow_bcast_iface) + const char *address, bool allow_bcast_iface) { struct nbtd_server *nbtd_server = iface->nbtsrv; diff --git a/source4/nbt_server/irpc.c b/source4/nbt_server/irpc.c index 6200c6bba5..8f2f7fc2c2 100644 --- a/source4/nbt_server/irpc.c +++ b/source4/nbt_server/irpc.c @@ -119,7 +119,7 @@ static NTSTATUS nbtd_getdcname(struct irpc_message *msg, { struct nbtd_server *server = talloc_get_type(msg->private, struct nbtd_server); - struct nbtd_interface *iface = nbtd_find_request_iface(server, req->in.ip_address, True); + struct nbtd_interface *iface = nbtd_find_request_iface(server, req->in.ip_address, true); struct getdc_state *s; struct nbt_ntlogon_packet p; struct nbt_ntlogon_sam_logon *r; @@ -169,7 +169,7 @@ static NTSTATUS nbtd_getdcname(struct irpc_message *msg, return status; } - msg->defer_reply = True; + msg->defer_reply = true; return NT_STATUS_OK; } diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c index 5a220d1546..6b8e266f6d 100644 --- a/source4/nbt_server/packet.c +++ b/source4/nbt_server/packet.c @@ -42,7 +42,7 @@ void nbtd_bad_packet(struct nbt_name_packet *packet, see if an incoming packet is a broadcast packet from one of our own interfaces */ -BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, +bool nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, const struct socket_address *src) { @@ -51,7 +51,7 @@ BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, /* if its not a broadcast then its not considered a self packet */ if (!(packet->operation & NBT_FLAG_BROADCAST)) { - return False; + return false; } /* @@ -63,13 +63,13 @@ BOOL nbtd_self_packet_and_bcast(struct nbt_name_socket *nbtsock, */ if (iface->nbtsock == nbtsock && iface != iface->nbtsrv->bcast_interface) { - return False; + return false; } return nbtd_self_packet(nbtsock, packet, src); } -BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock, +bool nbtd_self_packet(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, const struct socket_address *src) { @@ -79,18 +79,18 @@ BOOL nbtd_self_packet(struct nbt_name_socket *nbtsock, /* if its not from the nbt port, then it wasn't a broadcast from us */ if (src->port != lp_nbt_port(global_loadparm)) { - return False; + return false; } /* we have to loop over our interface list, seeing if its from one of our own interfaces */ for (iface=nbtsrv->interfaces;iface;iface=iface->next) { if (strcmp(src->addr, iface->ip_address) == 0) { - return True; + return true; } } - return False; + return false; } diff --git a/source4/nbt_server/register.c b/source4/nbt_server/register.c index 0ef77af4c5..4ec70e319b 100644 --- a/source4/nbt_server/register.c +++ b/source4/nbt_server/register.c @@ -96,9 +96,9 @@ static void name_refresh_handler(struct event_context *ev, struct timed_event *t io.in.address = iface->ip_address; io.in.nb_flags = iname->nb_flags; io.in.ttl = iname->ttl; - io.in.register_demand = False; - io.in.broadcast = True; - io.in.multi_homed = False; + io.in.register_demand = false; + io.in.broadcast = true; + io.in.multi_homed = false; io.in.timeout = 3; io.in.retries = 0; 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; } |