svn commit: samba r25546 - in branches/SAMBA_4_0: . source/nbt_server source/nbt_server/dgram source/nbt_server/wins

jelmer at samba.org jelmer at samba.org
Sat Oct 6 21:33:19 GMT 2007


Author: jelmer
Date: 2007-10-06 21:33:16 +0000 (Sat, 06 Oct 2007)
New Revision: 25546

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25546

Log:
Convert to standard bool type.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/nbt_server/dgram/netlogon.c
   branches/SAMBA_4_0/source/nbt_server/dgram/ntlogon.c
   branches/SAMBA_4_0/source/nbt_server/interfaces.c
   branches/SAMBA_4_0/source/nbt_server/irpc.c
   branches/SAMBA_4_0/source/nbt_server/packet.c
   branches/SAMBA_4_0/source/nbt_server/register.c
   branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
   branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
   branches/SAMBA_4_0/source/nbt_server/wins/winswack.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/nbt_server/dgram/netlogon.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/dgram/netlogon.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/dgram/netlogon.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -39,7 +39,7 @@
 				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 @@
 				 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;

Modified: branches/SAMBA_4_0/source/nbt_server/dgram/ntlogon.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/dgram/ntlogon.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/dgram/ntlogon.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -35,7 +35,7 @@
 				   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;
 

Modified: branches/SAMBA_4_0/source/nbt_server/interfaces.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/interfaces.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/interfaces.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -282,7 +282,7 @@
 	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 @@
   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 @@
  * 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;
 

Modified: branches/SAMBA_4_0/source/nbt_server/irpc.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/irpc.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/irpc.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -119,7 +119,7 @@
 {
 	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 @@
 		return status;
 	}
 
-	msg->defer_reply = True;
+	msg->defer_reply = true;
 	return NT_STATUS_OK;
 }
 

Modified: branches/SAMBA_4_0/source/nbt_server/packet.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/packet.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/packet.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -42,7 +42,7 @@
   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 @@
 
 	/* 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 @@
 	 */
 	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 @@
 	
 	/* 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;
 }
 
 

Modified: branches/SAMBA_4_0/source/nbt_server/register.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/register.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/register.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -96,9 +96,9 @@
 	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;
 

Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -366,8 +366,8 @@
 	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 @@
 	}
 
 	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 @@
 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 @@
 	 * 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 @@
 		 * 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 @@
 	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 @@
 	}
 
 	if (strcmp(rec->wins_owner, h->local_owner) == 0) {
-		we_are_owner = True;
+		we_are_owner = true;
 	}
 
 	/* 
@@ -945,7 +945,7 @@
 	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 @@
 	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 *h = NULL;
 	const char *owner;
 	unsigned int flags = 0;
-	BOOL ret;
+	bool ret;
 	int ldb_err;
 
 	h = talloc(mem_ctx, struct winsdb_handle);

Modified: branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winsserver.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -44,7 +44,7 @@
 	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 @@
 	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 @@
 						 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 @@
 						      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 @@
 						  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 @@
 	 * 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 @@
 							      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 @@
 					      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 @@
 {
 	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 @@
 	 * 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 @@
 	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 @@
 	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);

Modified: branches/SAMBA_4_0/source/nbt_server/wins/winswack.c
===================================================================
--- branches/SAMBA_4_0/source/nbt_server/wins/winswack.c	2007-10-06 21:31:00 UTC (rev 25545)
+++ branches/SAMBA_4_0/source/nbt_server/wins/winswack.c	2007-10-06 21:33:16 UTC (rev 25546)
@@ -48,7 +48,7 @@
 
 			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 @@
 	/* 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 @@
 			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 @@
 	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 @@
 	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 @@
 	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;
 }



More information about the samba-cvs mailing list