Przeglądaj źródła

The redundant ring take 4 patch. This includes modes for active, passive,
and none. Read openais.conf.5 for information regarding how to configure
redundant ring.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1032 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 lat temu
rodzic
commit
483a9baac7
29 zmienionych plików z 1748 dodań i 825 usunięć
  1. 0 1
      exec/aisparser.c
  2. 20 16
      exec/amf.c
  3. 6 6
      exec/cfg.c
  4. 114 126
      exec/ckpt.c
  5. 37 37
      exec/clm.c
  6. 89 69
      exec/cpg.c
  7. 21 27
      exec/evs.c
  8. 121 116
      exec/evt.c
  9. 4 5
      exec/ipc.c
  10. 20 20
      exec/lck.c
  11. 6 6
      exec/main.c
  12. 36 36
      exec/msg.c
  13. 4 4
      exec/service.h
  14. 16 16
      exec/sync.c
  15. 14 5
      exec/totem.h
  16. 60 23
      exec/totemconfig.c
  17. 1 2
      exec/totemconfig.h
  18. 29 13
      exec/totemmrp.c
  19. 17 14
      exec/totemmrp.h
  20. 67 7
      exec/totemnet.c
  21. 10 2
      exec/totemnet.h
  22. 65 26
      exec/totempg.c
  23. 23 16
      exec/totempg.h
  24. 671 84
      exec/totemrrp.c
  25. 16 4
      exec/totemrrp.h
  26. 251 122
      exec/totemsrp.c
  27. 10 4
      exec/totemsrp.h
  28. 1 1
      exec/vsf.h
  29. 19 17
      exec/vsf_ykd.c

+ 0 - 1
exec/aisparser.c

@@ -115,7 +115,6 @@ static int parse_section(FILE *fp,
 
 			loc--;
 			*loc = '\0';
-printf ("creating object %d %s\n", parent_handle, section);
 			objdb->object_create (parent_handle, &new_parent,
 					      section, strlen (section));
 			if (parse_section(fp, objdb, new_parent, error_string))

+ 20 - 16
exec/amf.c

@@ -81,6 +81,10 @@ enum amf_message_req_types {
 	MESSAGE_REQ_EXEC_AMF_ADMINISTRATIVE_STATE_GROUP_SET = 4
 };
 
+#ifndef HOST_NAME_MAX
+# define HOST_NAME_MAX 255
+#endif
+
 struct invocation {
 	void *data;
 	int interface;
@@ -115,9 +119,9 @@ struct component_terminate_callback_data {
 	
 static void amf_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
 static int amf_lib_exit_fn (void *conn);
@@ -156,23 +160,23 @@ static void message_handler_req_lib_amf_response (void *conn, void *msg);
 
 static void message_handler_req_exec_amf_operational_state_comp_set (
 	void *message,
-	struct totem_ip_address *source);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_amf_presence_state_comp_set (
 	void *message,
-	struct totem_ip_address *source);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_amf_administrative_state_csi_set (
 	void *message,
-	struct totem_ip_address *source);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_amf_administrative_state_unit_set (
 	void *message,
-	struct totem_ip_address *source);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_amf_administrative_state_group_set (
 	void *message,
-	struct totem_ip_address *source);
+	unsigned int nodeid);
 
 static void presence_state_comp_set (
 	struct amf_comp *comp,
@@ -993,9 +997,9 @@ static int amf_exec_init_fn (struct objdb_iface_ver0 *objdb)
 }
 static void amf_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 #ifdef COMPILE_OUT
@@ -2265,7 +2269,7 @@ static  void operational_state_unit_set (
 
 static void message_handler_req_exec_amf_operational_state_comp_set (
 	void *message,
-	struct totem_ip_address *address)
+	unsigned int nodeid)
 {
 	struct req_exec_amf_operational_state_comp_set *req_exec_amf_operational_state_comp_set =
 		(struct req_exec_amf_operational_state_comp_set *)message;
@@ -2300,7 +2304,7 @@ static void message_handler_req_exec_amf_operational_state_comp_set (
 
 static void message_handler_req_exec_amf_presence_state_comp_set (
 	void *message,
-	struct totem_ip_address *address)
+	unsigned int nodeid)
 {
 	struct req_exec_amf_presence_state_comp_set *req_exec_amf_presence_state_comp_set =
 		(struct req_exec_amf_presence_state_comp_set *)message;
@@ -2363,7 +2367,7 @@ static void message_handler_req_exec_amf_presence_state_comp_set (
 
 static void message_handler_req_exec_amf_administrative_state_csi_set (
 	void *message,
-	struct totem_ip_address *address)
+	unsigned int nodeid)
 {
 //	struct req_exec_amf_administrative_state_csi_set *req_exec_amf_administrative_state_csi_set =
 //		(struct req_exec_amf_administrative_state_csi_set *)message;
@@ -2371,7 +2375,7 @@ static void message_handler_req_exec_amf_administrative_state_csi_set (
 }
 static void message_handler_req_exec_amf_administrative_state_unit_set (
 	void *message,
-	struct totem_ip_address *address)
+	unsigned int nodeid)
 {
 //	struct req_exec_amf_administrative_state_unit_set *req_exec_amf_administrative_state_unit_set =
 //		(struct req_exec_amf_administrative_state_unit_set *)message;
@@ -2379,7 +2383,7 @@ static void message_handler_req_exec_amf_administrative_state_unit_set (
 }
 static void message_handler_req_exec_amf_administrative_state_group_set (
 	void *message,
-	struct totem_ip_address *source)
+	unsigned int nodeid)
 {
 //	struct req_exec_amf_administrative_state_group_set *req_exec_amf_administrative_state_group_set =
 //		(struct req_exec_amf_administrative_state_group_set *)message;

+ 6 - 6
exec/cfg.c

@@ -66,9 +66,9 @@
 
 static void cfg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
 static int cfg_exec_init_fn (struct objdb_iface_ver0 *objdb);
@@ -193,9 +193,9 @@ static int cfg_exec_init_fn (struct objdb_iface_ver0 *objdb)
 }
 static void cfg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 }

+ 114 - 126
exec/ckpt.c

@@ -88,7 +88,7 @@ struct saCkptCheckpointSection {
 
 struct ckpt_refcnt {
 	int count;
-	struct totem_ip_address addr;
+	unsigned int nodeid;
 };
 
 struct saCkptCheckpoint {
@@ -198,6 +198,7 @@ static void message_handler_req_lib_ckpt_checkpointsynchronizeasync (
 static void message_handler_req_lib_ckpt_sectioniterationinitialize (
 	void *conn,
 	void *msg);
+
 static void message_handler_req_lib_ckpt_sectioniterationfinalize (
 	void *conn,
 	void *msg);
@@ -208,65 +209,65 @@ static void message_handler_req_lib_ckpt_sectioniterationnext (
 
 static void message_handler_req_exec_ckpt_checkpointopen (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_synchronize_state (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_synchronize_section (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_checkpointclose (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_checkpointunlink (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_checkpointretentiondurationset (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_checkpointretentiondurationexpire (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectioncreate (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectiondelete (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectionexpirationtimeset (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectionwrite (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectionoverwrite (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_ckpt_sectionread (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void ckpt_recovery_activate (void);
 static void ckpt_recovery_initialize (void);
 static int  ckpt_recovery_process (void);
 static void ckpt_recovery_finalize();
 static void ckpt_recovery_abort(void);
-static void ckpt_recovery_process_members_exit(
-	struct totem_ip_address *left_list, 
+static void ckpt_recovery_process_members_exit (
+	unsigned int *left_list,
 	int left_list_entries); 
-static void ckpt_replace_localhost_ip (struct totem_ip_address *joined_list);
+static void ckpt_replace_localhost_ip (unsigned int *joined_list);
 
 void checkpoint_release (struct saCkptCheckpoint *checkpoint);
 void timer_function_retention (void *data);
@@ -317,12 +318,12 @@ static int recovery_abort = 0;
 
 static struct memb_ring_id saved_ring_id;
 
-static void ckpt_confchg_fn(
-		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
-		struct memb_ring_id *ring_id);
+static void ckpt_confchg_fn (
+	enum totem_configuration_type configuration_type,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
+	struct memb_ring_id *ring_id);
 
 /*
  * Executive Handler Definition
@@ -625,7 +626,7 @@ struct req_exec_ckpt_synchronize_state {
 	SaNameT checkpointName;
 	SaCkptCheckpointCreationAttributesT checkpointCreationAttributes;
 	SaCkptSectionDescriptorT sectionDescriptor;	
-	struct totem_ip_address *source_addr;
+	unsigned int nodeid;
 	struct ckpt_refcnt ckpt_refcount[PROCESSOR_COUNT_MAX];
 };
 
@@ -641,25 +642,27 @@ struct req_exec_ckpt_synchronize_section {
 /* 
  * Implementation
  */
-static int processor_index_set(struct totem_ip_address *proc_addr, 
+static int processor_index_set(
+	unsigned int nodeid,
 	struct ckpt_refcnt *ckpt_refcount) 
 {
 	int i;
 	for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-		if (ckpt_refcount[i].addr.family == 0) {
+		if (ckpt_refcount[i].nodeid == 0) {
 			/*
 			 * If the source addresses do not match and this element
 			 * has no stored value then store the new value and 
 			 * return the Index.
 		 	 */		
-			totemip_copy(&ckpt_refcount[i].addr, proc_addr);
+			ckpt_refcount[i].nodeid = nodeid;
 			return i;
 		}
 		/*
 		* If the source addresses match then this processor index
 		* has already been set
 		*/
-		else if (totemip_equal(&ckpt_refcount[i].addr, proc_addr)) {
+		else
+		if (ckpt_refcount[i].nodeid == nodeid) {
 			return -1;
 		}
 
@@ -669,35 +672,34 @@ static int processor_index_set(struct totem_ip_address *proc_addr,
 	 * to store the new Processor.	
 	 */
 	for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-		if (ckpt_refcount[i].addr.family == 0) {
-			log_printf (LOG_LEVEL_ERROR,"Processor Set: Index %d has proc 0 and count 0\n", i);
-		}
-		else {
-			log_printf (LOG_LEVEL_ERROR,"Processor Set: Index %d has proc %s and count %d\n",
-                                i,
-                                totemip_print(&ckpt_refcount[i].addr),
-                                ckpt_refcount[i].count);
-                }
+		log_printf (LOG_LEVEL_ERROR,"Processor Set: Index %d has proc %s and count %d\n",
+			i,
+			totempg_ifaces_print (ckpt_refcount[i].nodeid),
+			ckpt_refcount[i].count);
         }
 
 	return -1;
 }
 
-static int processor_add (struct totem_ip_address *proc_addr, int count, struct ckpt_refcnt *ckpt_refcount) 
+static int processor_add (
+	unsigned int nodeid,
+	int count,
+	struct ckpt_refcnt *ckpt_refcount) 
 {
 	int i;
         for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-                if (ckpt_refcount[i].addr.family == 0) {
+                if (ckpt_refcount[i].nodeid == 0) {
 			log_printf (LOG_LEVEL_DEBUG,"processor_add found empty slot to insert new item\n");
-                        totemip_copy(&ckpt_refcount[i].addr, proc_addr);
+			ckpt_refcount[i].nodeid = nodeid;
 			ckpt_refcount[i].count = count;
                         return i;
                 }
 		/*Dont know how we missed this in the processor find but update this*/
-		else if (totemip_equal(&ckpt_refcount[i].addr, proc_addr)) {
+		else
+		if (ckpt_refcount[i].nodeid == nodeid) {
 			ckpt_refcount[i].count += count;
-			log_printf (LOG_LEVEL_DEBUG,"processor_add for existent proc. ip %s, New count = %d\n",
-				totemip_print(&ckpt_refcount[i].addr),
+			log_printf (LOG_LEVEL_DEBUG,"processor_add for existent proc. nodeid %s, New count = %d\n",
+				totempg_ifaces_print (ckpt_refcount[i].nodeid),
 				ckpt_refcount[i].count);
 
 			return i;
@@ -709,21 +711,17 @@ static int processor_add (struct totem_ip_address *proc_addr, int count, struct
          */
 	log_printf (LOG_LEVEL_ERROR,"Processor Add Failed. Dumping Refcount Array\n");
 	for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-		if (ckpt_refcount[i].addr.family == 0) {
-			log_printf (LOG_LEVEL_ERROR,"Processor Add: Index %d has proc 0 and count 0\n", i);
-		}
-		else {
-			log_printf (LOG_LEVEL_ERROR,"Processor Add: Index %d has proc %s and count %d\n",
-				i,
-				totemip_print(&ckpt_refcount[i].addr),
-				ckpt_refcount[i].count);
-		}
+		log_printf (LOG_LEVEL_ERROR,"Processor Add: Index %d has proc %s and count %d\n",
+			i,
+			totempg_ifaces_print (ckpt_refcount[i].nodeid),
+			ckpt_refcount[i].count);
 	}
         return -1;
 
 }
 
-static int processor_index_find(struct totem_ip_address *proc_addr,
+static int processor_index_find(
+	unsigned int nodeid,
 	struct ckpt_refcnt *ckpt_refcount) 
 { 
 	int i;
@@ -732,7 +730,7 @@ static int processor_index_find(struct totem_ip_address *proc_addr,
 		 * If the source addresses match then return the index
 		 */
 		
-		if (totemip_equal(&ckpt_refcount[i].addr, proc_addr)) {
+		if (ckpt_refcount[i].nodeid ==  nodeid) {
 			return i;
 		}				
 	}
@@ -752,25 +750,26 @@ static int ckpt_refcount_total(struct ckpt_refcnt *ckpt_refcount)
 	return total;
 }
 
-static void initialize_ckpt_refcount_array (struct ckpt_refcnt *ckpt_refcount) 
+static void initialize_ckpt_refcount_array (
+	struct ckpt_refcnt *ckpt_refcount) 
 {
-	memset((char*)ckpt_refcount, 0, PROCESSOR_COUNT_MAX * sizeof(struct ckpt_refcnt));
+	memset((char*)ckpt_refcount, 0,
+		PROCESSOR_COUNT_MAX * sizeof(struct ckpt_refcnt));
 }
 
-static void merge_ckpt_refcounts(struct ckpt_refcnt *local, struct ckpt_refcnt *network)
+static void merge_ckpt_refcounts (
+	struct ckpt_refcnt *local,
+	struct ckpt_refcnt *network)
 {
 	int index,i;	
 
 	for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-		if (local[i].addr.family == 0) {
-			continue;
-		}
-		index  = processor_index_find (&local[i].addr, network);
+		index  = processor_index_find (local[i].nodeid, network);
 		if (index == -1) { /*Could Not Find the Local Entry in the remote.Add to it*/
-			log_printf (LOG_LEVEL_DEBUG,"calling processor_add for ip %s, count %d\n",
-				totemip_print(&local[i].addr),
+			log_printf (LOG_LEVEL_DEBUG,"calling processor_add for nodeid %s, count %d\n",
+				totempg_ifaces_print (local[i].nodeid),
 				local[i].count);
-			index = processor_add (&local[i].addr, local[i].count, network);
+			index = processor_add (local[i].nodeid, local[i].count, network);
 			if (index == -1) {
 				log_printf(LOG_LEVEL_ERROR,
 					"merge_ckpt_refcounts : could not add a new processor as the MAX limit of procs is reached.Exiting\n");
@@ -786,8 +785,8 @@ static void merge_ckpt_refcounts(struct ckpt_refcnt *local, struct ckpt_refcnt *
 			else {
 				/*Found a match for this proc in the Network choose the larger of the 2.*/
 				network[index].count += local[i].count; 
-				log_printf (LOG_LEVEL_DEBUG,"setting count for %s = %d\n",
-					totemip_print(&network[index].addr),
+				log_printf (LOG_LEVEL_DEBUG,"setting count for nodeid %s = %d\n",
+					totempg_ifaces_print (network[index].nodeid),
 					network[index].count);
 			}
 		}
@@ -921,7 +920,8 @@ static int ckpt_recovery_process (void)
 					memcpy(&request_exec_sync_state.sectionDescriptor,
 							&ckptCheckpointSection->sectionDescriptor,
 							sizeof(SaCkptSectionDescriptorT));						
-					memcpy(&request_exec_sync_state.source_addr, &this_ip, sizeof(struct totem_ip_address));
+						
+					request_exec_sync_state.nodeid = this_ip->nodeid;
 				 			
 					memcpy(request_exec_sync_state.ckpt_refcount,
 							checkpoint->ckpt_refcount,
@@ -930,16 +930,10 @@ static int ckpt_recovery_process (void)
 
 					log_printf (LOG_LEVEL_DEBUG, "CKPT: New Sync State Message Values\n");
 					for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-						if (request_exec_sync_state.ckpt_refcount[i].addr.family == 0) {
-							log_printf (LOG_LEVEL_DEBUG,"Index %d has proc 0 and count %d\n", i,
-								request_exec_sync_state.ckpt_refcount[i].count);
-						}
-						else {
-							log_printf (LOG_LEVEL_DEBUG,"Index %d has proc %s and count %d\n",
-							i,
-							totemip_print(&request_exec_sync_state.ckpt_refcount[i].addr),
-							request_exec_sync_state.ckpt_refcount[i].count);
-						}
+						log_printf (LOG_LEVEL_DEBUG,"Index %d has proc %s and count %d\n",
+						i,
+						totempg_ifaces_print (request_exec_sync_state.ckpt_refcount[i].nodeid),
+						request_exec_sync_state.ckpt_refcount[i].count);
 					}
 	
 					iovecs[0].iov_base = (char *)&request_exec_sync_state;
@@ -1169,53 +1163,52 @@ static void ckpt_recovery_abort (void)
 	return;
 }
 
-static void ckpt_replace_localhost_ip (struct totem_ip_address *joined_list) {
+static void ckpt_replace_localhost_ip (unsigned int *joined_list) {
 	struct list_head *checkpoint_list;
         struct saCkptCheckpoint *checkpoint;
-        struct totem_ip_address local_ip;
+        unsigned int localhost_nodeid = 0;
         int index;
 
 	assert(joined_list);
 
-	totemip_localhost(AF_INET, &local_ip);
-
 	for (checkpoint_list = checkpoint_list_head.next;
 		checkpoint_list != &checkpoint_list_head;
 		checkpoint_list = checkpoint_list->next) {
 
 		checkpoint = list_entry (checkpoint_list,
 			struct saCkptCheckpoint, list);
-		index = processor_index_find(&local_ip, checkpoint->ckpt_refcount);
+		index = processor_index_find(localhost_nodeid, checkpoint->ckpt_refcount);
 		if (index == -1) {
 			continue;
 		}		
-		memcpy(&checkpoint->ckpt_refcount[index].addr, joined_list, sizeof(struct in_addr));
-		log_printf (LOG_LEVEL_DEBUG, "Transitioning From Local Host replacing 127.0.0.1 with %s ...\n",
-			totemip_print(joined_list));
+		checkpoint->ckpt_refcount[index].nodeid = joined_list[0];
+		log_printf (LOG_LEVEL_DEBUG, "Transitioning From Local Host replacing 127.0.0.1 with %x ...\n",
+			joined_list[0]);
 
 	}
 	process_localhost_transition = 0;
 }
 
 
-static void ckpt_recovery_process_members_exit(struct totem_ip_address *left_list, 
+static void ckpt_recovery_process_members_exit (
+	unsigned int *left_list, 
 	int left_list_entries)
 {
 	struct list_head *checkpoint_list;
 	struct saCkptCheckpoint *checkpoint;
-	struct totem_ip_address *member;
-	struct totem_ip_address local_ip;
+	unsigned int *member_nodeid;
+	unsigned int localhost_nodeid;
 	int index;
 	int i;
 
-	totemip_localhost(AF_INET, &local_ip);
+	localhost_nodeid = 0; // TODO
 	
 	if (left_list_entries == 0) {
 		return;
 	}
-
+// TODO this is wrong
 	if ((left_list_entries == 1) && 
-	    (totemip_equal(left_list, &local_ip))) {
+	    *left_list == localhost_nodeid) {
 		process_localhost_transition = 1;
 		return; 
 	}
@@ -1223,7 +1216,7 @@ static void ckpt_recovery_process_members_exit(struct totem_ip_address *left_lis
 	/*
 	 *  Iterate left_list_entries. 
 	 */
-	member = left_list;
+	member_nodeid = left_list;
 	for (i = 0; i < left_list_entries; i++) {		
 		checkpoint_list = checkpoint_list_head.next;
 
@@ -1232,7 +1225,8 @@ iterate_while_loop:
 			checkpoint = list_entry (checkpoint_list,
 				struct saCkptCheckpoint, list);			
 			assert (checkpoint > 0);
-			index = processor_index_find(member, checkpoint->ckpt_refcount);
+			index = processor_index_find(*member_nodeid,
+				checkpoint->ckpt_refcount);
 			assert (-1 <= index);
 			assert (index < PROCESSOR_COUNT_MAX);			
 			if (index < 0) {
@@ -1254,10 +1248,10 @@ iterate_while_loop:
 				assert(0);
 			}		
 			checkpoint->ckpt_refcount[index].count = 0;
-			memset((char*)&checkpoint->ckpt_refcount[index].addr, 0, sizeof(struct in_addr));			
+			checkpoint->ckpt_refcount[index].nodeid = 0;
 			checkpoint_list = checkpoint_list->next;
 		}
-		member++;
+		member_nodeid++;
 	}
 
 	clean_checkpoint_list(&checkpoint_list_head);
@@ -1308,9 +1302,9 @@ void clean_checkpoint_list(struct list_head *head)
 
 static void ckpt_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id) 
 {
 	if (configuration_type == TOTEM_CONFIGURATION_REGULAR) {
@@ -1525,7 +1519,7 @@ static int ckpt_exec_init_fn (struct objdb_iface_ver0 *objdb)
 
 static void message_handler_req_exec_ckpt_checkpointopen (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_checkpointopen *req_exec_ckpt_checkpointopen = (struct req_exec_ckpt_checkpointopen *)message;
 	struct req_lib_ckpt_checkpointopen *req_lib_ckpt_checkpointopen = (struct req_lib_ckpt_checkpointopen *)&req_exec_ckpt_checkpointopen->req_lib_ckpt_checkpointopen;
@@ -1656,12 +1650,12 @@ static void message_handler_req_exec_ckpt_checkpointopen (
 	 * 
 	 */
 	 
-	 proc_index = processor_index_find(source_addr,ckptCheckpoint->ckpt_refcount);
+	 proc_index = processor_index_find(nodeid,ckptCheckpoint->ckpt_refcount);
 	 if (proc_index == -1) {/* Could not find, lets set the processor to an index.*/
-	 	proc_index = processor_index_set(source_addr,ckptCheckpoint->ckpt_refcount);
+	 	proc_index = processor_index_set(nodeid,ckptCheckpoint->ckpt_refcount);
 	 }
 	 if (proc_index != -1 ) {	 
-		 totemip_copy(&ckptCheckpoint->ckpt_refcount[proc_index].addr, source_addr);
+		ckptCheckpoint->ckpt_refcount[proc_index].nodeid = nodeid;
 	 	ckptCheckpoint->ckpt_refcount[proc_index].count++;
 	 }
 	 else {
@@ -1747,16 +1741,10 @@ static int recovery_checkpoint_open(
 	log_printf (LOG_LEVEL_DEBUG, "CKPT: recovery_checkpoint_open %s\n", &checkpointName->value);
 	log_printf (LOG_LEVEL_DEBUG, "CKPT: recovery_checkpoint_open refcount Values\n");
 	for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) {
-        	if (ref_cnt[i].addr.family == 0) {
-			log_printf (LOG_LEVEL_DEBUG,"Index %d has proc 0 and count %d\n", i,
-				ref_cnt[i].count);
-		}
-		else {
-			log_printf (LOG_LEVEL_DEBUG,"Index %d has proc %s and count %d\n",
-				i,
-				totemip_print(&ref_cnt[i].addr),
-				ref_cnt[i].count);
-		}
+		log_printf (LOG_LEVEL_DEBUG,"Index %d has proc %s and count %d\n",
+			i,
+			totempg_ifaces_print (ref_cnt[i].nodeid),
+			ref_cnt[i].count);
 	}
 
 	
@@ -1875,7 +1863,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_synchronize_state (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	int retcode;
 	struct req_exec_ckpt_synchronize_state *req_exec_ckpt_sync_state 
@@ -1909,7 +1897,7 @@ static void message_handler_req_exec_ckpt_synchronize_state (
 
 static void message_handler_req_exec_ckpt_synchronize_section (
 	void *message,
-	struct totem_ip_address *source_addr) 
+	unsigned int nodeid)
 {
 	int retcode;
 	struct req_exec_ckpt_synchronize_section *req_exec_ckpt_sync_section 
@@ -2031,7 +2019,7 @@ void timer_function_retention (void *data)
 
 static void message_handler_req_exec_ckpt_checkpointclose (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_checkpointclose *req_exec_ckpt_checkpointclose = (struct req_exec_ckpt_checkpointclose *)message;
 	struct res_lib_ckpt_checkpointclose res_lib_ckpt_checkpointclose;
@@ -2054,7 +2042,7 @@ static void message_handler_req_exec_ckpt_checkpointclose (
 	 * sent out later as a part of the sync process.	 
 	 */
 	
-	proc_index = processor_index_find(source_addr, checkpoint->ckpt_refcount);
+	proc_index = processor_index_find(nodeid, checkpoint->ckpt_refcount);
 	if (proc_index != -1 ) {	 		
 	 	checkpoint->ckpt_refcount[proc_index].count--;
 	}
@@ -2103,7 +2091,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_checkpointunlink (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_checkpointunlink *req_exec_ckpt_checkpointunlink = (struct req_exec_ckpt_checkpointunlink *)message;
 
@@ -2151,7 +2139,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_checkpointretentiondurationset (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_checkpointretentiondurationset *req_exec_ckpt_checkpointretentiondurationset = (struct req_exec_ckpt_checkpointretentiondurationset *)message;
 	struct res_lib_ckpt_checkpointretentiondurationset res_lib_ckpt_checkpointretentiondurationset;
@@ -2196,7 +2184,7 @@ static void message_handler_req_exec_ckpt_checkpointretentiondurationset (
 
 static void message_handler_req_exec_ckpt_checkpointretentiondurationexpire (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_checkpointretentiondurationexpire *req_exec_ckpt_checkpointretentiondurationexpire = (struct req_exec_ckpt_checkpointretentiondurationexpire *)message;
 	struct req_exec_ckpt_checkpointunlink req_exec_ckpt_checkpointunlink;
@@ -2215,7 +2203,7 @@ static void message_handler_req_exec_ckpt_checkpointretentiondurationexpire (
 				MESSAGE_REQ_EXEC_CKPT_CHECKPOINTUNLINK);
 
 		req_exec_ckpt_checkpointunlink.source.conn = 0;
-		req_exec_ckpt_checkpointunlink.source.addr.family = 0;
+		req_exec_ckpt_checkpointunlink.source.nodeid = 0;
 
 		memcpy (&req_exec_ckpt_checkpointunlink.req_lib_ckpt_checkpointunlink.checkpointName,
 			&req_exec_ckpt_checkpointretentiondurationexpire->checkpointName,
@@ -2375,7 +2363,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectioncreate (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectioncreate *req_exec_ckpt_sectioncreate = (struct req_exec_ckpt_sectioncreate *)message;
 	struct req_lib_ckpt_sectioncreate *req_lib_ckpt_sectioncreate = (struct req_lib_ckpt_sectioncreate *)&req_exec_ckpt_sectioncreate->req_lib_ckpt_sectioncreate;
@@ -2519,7 +2507,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectiondelete (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectiondelete *req_exec_ckpt_sectiondelete = (struct req_exec_ckpt_sectiondelete *)message;
 	struct req_lib_ckpt_sectiondelete *req_lib_ckpt_sectiondelete = (struct req_lib_ckpt_sectiondelete *)&req_exec_ckpt_sectiondelete->req_lib_ckpt_sectiondelete;
@@ -2583,7 +2571,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectionexpirationtimeset (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectionexpirationtimeset *req_exec_ckpt_sectionexpirationtimeset = (struct req_exec_ckpt_sectionexpirationtimeset *)message;
 	struct req_lib_ckpt_sectionexpirationtimeset *req_lib_ckpt_sectionexpirationtimeset = (struct req_lib_ckpt_sectionexpirationtimeset *)&req_exec_ckpt_sectionexpirationtimeset->req_lib_ckpt_sectionexpirationtimeset;
@@ -2723,7 +2711,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectionwrite (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectionwrite *req_exec_ckpt_sectionwrite = (struct req_exec_ckpt_sectionwrite *)message;
 	struct req_lib_ckpt_sectionwrite *req_lib_ckpt_sectionwrite = (struct req_lib_ckpt_sectionwrite *)&req_exec_ckpt_sectionwrite->req_lib_ckpt_sectionwrite;
@@ -2823,7 +2811,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectionoverwrite (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectionoverwrite *req_exec_ckpt_sectionoverwrite = (struct req_exec_ckpt_sectionoverwrite *)message;
 	struct req_lib_ckpt_sectionoverwrite *req_lib_ckpt_sectionoverwrite = (struct req_lib_ckpt_sectionoverwrite *)&req_exec_ckpt_sectionoverwrite->req_lib_ckpt_sectionoverwrite;
@@ -2903,7 +2891,7 @@ error_exit:
 
 static void message_handler_req_exec_ckpt_sectionread (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_ckpt_sectionread *req_exec_ckpt_sectionread = (struct req_exec_ckpt_sectionread *)message;
 	struct req_lib_ckpt_sectionread *req_lib_ckpt_sectionread = (struct req_lib_ckpt_sectionread *)&req_exec_ckpt_sectionread->req_lib_ckpt_sectionread;

+ 37 - 37
exec/clm.c

@@ -110,9 +110,9 @@ SaClmClusterNodeT *clm_get_by_nodeid (unsigned int node_id)
  */
 static void clm_confchg_fn (
 	enum totem_configuration_type configuration_type,
-    struct totem_ip_address *member_list, int member_list_entries,
-    struct totem_ip_address *left_list, int left_list_entries,
-    struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
 static void clm_sync_init (void);
@@ -131,7 +131,7 @@ static int clm_lib_exit_fn (void *conn);
 
 static void message_handler_req_exec_clm_nodejoin (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void exec_clm_nodejoin_endian_convert (void *msg);
 
@@ -184,28 +184,28 @@ static struct openais_lib_handler clm_lib_service[] =
 static struct openais_exec_handler clm_exec_service[] =
 {
 	{
-		.exec_handler_fn		= message_handler_req_exec_clm_nodejoin,
+		.exec_handler_fn	= message_handler_req_exec_clm_nodejoin,
 		.exec_endian_convert_fn	= exec_clm_nodejoin_endian_convert
 	}
 };
 	
 struct openais_service_handler clm_service_handler = {
-	.name						= (unsigned char*)"openais cluster membership service B.01.01",
-	.id							= CLM_SERVICE,
-	.private_data_size			= sizeof (struct clm_pd),
-	.lib_init_fn				= clm_lib_init_fn,
-	.lib_exit_fn				= clm_lib_exit_fn,
-	.lib_service				= clm_lib_service,
-	.lib_service_count			= sizeof (clm_lib_service) / sizeof (struct openais_lib_handler),
-	.exec_init_fn				= clm_exec_init_fn,
-	.exec_dump_fn				= NULL,
-	.exec_service				= clm_exec_service,
-	.exec_service_count		= sizeof (clm_exec_service) / sizeof (struct openais_exec_handler),
-	.confchg_fn					= clm_confchg_fn,
-	.sync_init					= clm_sync_init,
-	.sync_process				= clm_sync_process,
-	.sync_activate				= clm_sync_activate,
-	.sync_abort					= clm_sync_abort,
+	.name			= (unsigned char*)"openais cluster membership service B.01.01",
+	.id			= CLM_SERVICE,
+	.private_data_size	= sizeof (struct clm_pd),
+	.lib_init_fn		= clm_lib_init_fn,
+	.lib_exit_fn		= clm_lib_exit_fn,
+	.lib_service		= clm_lib_service,
+	.lib_service_count	= sizeof (clm_lib_service) / sizeof (struct openais_lib_handler),
+	.exec_init_fn		= clm_exec_init_fn,
+	.exec_dump_fn		= NULL,
+	.exec_service		= clm_exec_service,
+	.exec_service_count	= sizeof (clm_exec_service) / sizeof (struct openais_exec_handler),
+	.confchg_fn		= clm_confchg_fn,
+	.sync_init		= clm_sync_init,
+	.sync_process		= clm_sync_process,
+	.sync_activate		= clm_sync_activate,
+	.sync_abort		= clm_sync_abort,
 };
 
 /*
@@ -219,15 +219,15 @@ static struct openais_service_handler_iface_ver0 clm_service_handler_iface = {
 
 static struct lcr_iface openais_clm_ver0[1] = {
 	{
-		.name					= "openais_clm",
-		.version				= 0,
-		.versions_replace		= 0,
+		.name			= "openais_clm",
+		.version		= 0,
+		.versions_replace	= 0,
 		.versions_replace_count = 0,
-		.dependencies			= 0,
-		.dependency_count		= 0,
-		.constructor			= NULL,
-		.destructor				= NULL,
-		.interfaces				= NULL
+		.dependencies		= 0,
+		.dependency_count	= 0,
+		.constructor		= NULL,
+		.destructor		= NULL,
+		.interfaces		= NULL
 	}
 };
 
@@ -466,9 +466,9 @@ static int clm_nodejoin_send (void)
 
 static void clm_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 
@@ -483,20 +483,20 @@ static void clm_confchg_fn (
 	log_printf (LOG_LEVEL_NOTICE, "CLM CONFIGURATION CHANGE\n");
 	log_printf (LOG_LEVEL_NOTICE, "New Configuration:\n");
 	for (i = 0; i < member_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totemip_print (&member_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (member_list[i]));
 	}
 	log_printf (LOG_LEVEL_NOTICE, "Members Left:\n");
 	for (i = 0; i < left_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totemip_print (&left_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (left_list[i]));
 	}
 
 	log_printf (LOG_LEVEL_NOTICE, "Members Joined:\n");
 	for (i = 0; i < joined_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totemip_print (&joined_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (joined_list[i]));
 	}
 
 	for (i = 0; i < left_list_entries; i++) {
-		nodes[i] = left_list[i].nodeid;
+		nodes[i] = left_list[i];
 	}
 
 	libraryNotificationLeave (nodes, i);
@@ -564,7 +564,7 @@ static void exec_clm_nodejoin_endian_convert (void *msg)
 
 static void message_handler_req_exec_clm_nodejoin (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_clm_nodejoin *req_exec_clm_nodejoin = (struct req_exec_clm_nodejoin *)message;
 	int found = 0;

+ 89 - 69
exec/cpg.c

@@ -76,25 +76,24 @@ enum cpg_message_req_types {
 	MESSAGE_REQ_EXEC_CPG_MCAST = 3
 };
 
-#define LEFT_LIST_INITIAL_SIZE 32
 struct removed_group
 {
 	struct group_info *gi;
 	struct list_head list; /* on removed_list */
 	int left_list_entries;
+	struct cpg_groupinfo left_list[PROCESSOR_COUNT_MAX];
 	int left_list_size;
-	struct cpg_groupinfo left_list[LEFT_LIST_INITIAL_SIZE]; /* Can expand if needed */
 };
 
 struct group_info {
-	struct cpg_name groupName;
+	struct cpg_name group_name;
 	struct list_head members;
 	struct list_head list;    /* on hash list */
 	struct removed_group *rg; /* when a node goes down */
 };
 
 struct process_info {
-	struct totem_ip_address node;
+	unsigned int nodeid;
 	uint32_t pid;
 	uint32_t flags;
 	void *conn;
@@ -105,7 +104,7 @@ struct process_info {
 
 struct join_list_entry {
 	uint32_t pid;
-	struct cpg_name groupName;
+	struct cpg_name group_name;
 };
 
 static struct list_head group_lists[GROUP_HASH_SIZE];
@@ -115,9 +114,9 @@ static struct list_head group_lists[GROUP_HASH_SIZE];
  */
 static void cpg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
 static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb);
@@ -128,19 +127,19 @@ static int cpg_lib_exit_fn (void *conn);
 
 static void message_handler_req_exec_cpg_procjoin (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_cpg_procleave (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_cpg_joinlist (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_cpg_mcast (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void exec_cpg_procjoin_endian_convert (void *msg);
 
@@ -284,23 +283,27 @@ __attribute__ ((constructor)) static void cpg_comp_register (void) {
 
 struct req_exec_cpg_procjoin {
 	struct req_header header;
-	struct cpg_name groupName;
+	struct cpg_name group_name;
 	uint32_t pid;
 	uint32_t reason;
 };
 
 struct req_exec_cpg_mcast {
 	struct req_header header;
-	struct cpg_name groupName;
+	struct cpg_name group_name;
 	uint32_t msglen;
 	uint32_t pid;
 	char message[];
 };
 
-static int notify_lib_joinlist(struct group_info *gi, void *conn,
-			       int joined_list_entries, struct cpg_groupinfo *joined_list,
-			       int left_list_entries, struct cpg_groupinfo *left_list,
-			       int id)
+static int notify_lib_joinlist(
+	struct group_info *gi,
+	void *conn,
+	int joined_list_entries,
+	struct cpg_groupinfo *joined_list,
+	int left_list_entries,
+	struct cpg_groupinfo *left_list,
+	int id)
 {
 	int count = 0;
 	char *buf;
@@ -334,7 +337,7 @@ static int notify_lib_joinlist(struct group_info *gi, void *conn,
 
 	res->header.size = size;
 	res->header.id = id;
-	memcpy(&res->groupName, &gi->groupName, sizeof(struct cpg_name));
+	memcpy(&res->group_name, &gi->group_name, sizeof(struct cpg_name));
 
 	/* Build up the message */
 	count = 0;
@@ -345,11 +348,11 @@ static int notify_lib_joinlist(struct group_info *gi, void *conn,
 			   own leave notifications), so exclude them from the members list here */
 			int i;
 			for (i=0; i<left_list_entries; i++) {
-				if (left_list[i].pid == pi->pid && left_list[i].nodeId == pi->node.nodeid)
+				if (left_list[i].pid == pi->pid && left_list[i].nodeid == pi->nodeid)
 					goto next_member;
 			}
 
-			retgi->nodeId = pi->node.nodeid;
+			retgi->nodeid = pi->nodeid;
 			retgi->pid = pi->pid;
 			retgi++;
 			count++;
@@ -416,7 +419,7 @@ static int cpg_lib_exit_fn (void *conn)
 
 	if (gi) {
 		notify_info.pid = pi->pid;
-		notify_info.nodeId = this_ip->nodeid;
+		notify_info.nodeid = this_ip->nodeid;
 		notify_info.reason = CONFCHG_CPG_REASON_PROCDOWN;
 		cpg_node_joinleave_send(gi, pi, MESSAGE_REQ_EXEC_CPG_PROCLEAVE, CONFCHG_CPG_REASON_PROCDOWN);
 		list_del(&pi->list);
@@ -432,7 +435,7 @@ static struct group_info *get_group(struct cpg_name *name)
 
 	for (iter = group_lists[hash].next; iter != &group_lists[hash]; iter = iter->next) {
 		gi = list_entry(iter, struct group_info, list);
-		if (memcmp(gi->groupName.value, name->value, name->length) == 0)
+		if (memcmp(gi->group_name.value, name->value, name->length) == 0)
 			break;
 	}
 
@@ -442,7 +445,7 @@ static struct group_info *get_group(struct cpg_name *name)
 			log_printf(LOG_LEVEL_WARNING, "Unable to allocate group_info struct");
 			return NULL;
 		}
-		memcpy(&gi->groupName, name, sizeof(struct cpg_name));
+		memcpy(&gi->group_name, name, sizeof(struct cpg_name));
 		gi->rg = NULL;
 		list_init(&gi->members);
 		list_add(&gi->list, &group_lists[hash]);
@@ -456,7 +459,7 @@ static int cpg_node_joinleave_send (struct group_info *gi, struct process_info *
 	struct iovec req_exec_cpg_iovec;
 	int result;
 
-	memcpy(&req_exec_cpg_procjoin.groupName, &gi->groupName, sizeof(struct cpg_name));
+	memcpy(&req_exec_cpg_procjoin.group_name, &gi->group_name, sizeof(struct cpg_name));
 	req_exec_cpg_procjoin.pid = pi->pid;
 	req_exec_cpg_procjoin.reason = reason;
 
@@ -471,7 +474,9 @@ static int cpg_node_joinleave_send (struct group_info *gi, struct process_info *
 	return (result);
 }
 
-static void remove_node_from_groups(struct totem_ip_address *node, struct list_head *remlist)
+static void remove_node_from_groups(
+	unsigned int nodeid,
+	struct list_head *remlist)
 {
 	int i;
 	struct list_head *iter, *iter2, *tmp;
@@ -484,7 +489,7 @@ static void remove_node_from_groups(struct totem_ip_address *node, struct list_h
 			for (iter2 = gi->members.next, tmp = iter2->next; iter2 != &gi->members; iter2 = tmp, tmp = iter2->next) {
 				pi = list_entry(iter2, struct process_info, list);
 
-				if (pi->node.nodeid == node->nodeid) {
+				if (pi->nodeid == nodeid) {
 
 					/* Add it to the list of nodes to send notifications for */
 					if (!gi->rg) {
@@ -493,7 +498,7 @@ static void remove_node_from_groups(struct totem_ip_address *node, struct list_h
 							list_add(&gi->rg->list, remlist);
 							gi->rg->gi = gi;
 							gi->rg->left_list_entries = 0;
-							gi->rg->left_list_size = LEFT_LIST_INITIAL_SIZE;
+							gi->rg->left_list_size = PROCESSOR_COUNT_MAX;
 						}
 						else {
 							log_printf(LOG_LEVEL_CRIT, "Unable to allocate removed group struct. CPG callbacks will be junk.");
@@ -515,12 +520,12 @@ static void remove_node_from_groups(struct totem_ip_address *node, struct list_h
 							log_printf(LOG_LEVEL_CRIT, "Unable to realloc removed group struct. CPG callbacks will be junk.");
 							return;
 						}
-						newrg->left_list_size = newsize+LEFT_LIST_INITIAL_SIZE;
+						newrg->left_list_size = newsize+PROCESSOR_COUNT_MAX;
 						gi->rg = newrg;
 						list_add(&gi->rg->list, remlist);
 					}
 					gi->rg->left_list[gi->rg->left_list_entries].pid = pi->pid;
-					gi->rg->left_list[gi->rg->left_list_entries].nodeId = pi->node.nodeid;
+					gi->rg->left_list[gi->rg->left_list_entries].nodeid = pi->nodeid;
 					gi->rg->left_list[gi->rg->left_list_entries].reason = CONFCHG_CPG_REASON_NODEDOWN;
 					gi->rg->left_list_entries++;
 
@@ -536,12 +541,11 @@ static void remove_node_from_groups(struct totem_ip_address *node, struct list_h
 
 static void cpg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
-
 	int i;
 	struct list_head removed_list;
 
@@ -556,7 +560,7 @@ static void cpg_confchg_fn (
 
 	/* Remove nodes from joined groups and add removed groups to the list */
 	for (i = 0; i < left_list_entries; i++) {
-		remove_node_from_groups(&left_list[i], &removed_list);
+		remove_node_from_groups(left_list[i], &removed_list);
 	}
 
 	if (!list_empty(&removed_list)) {
@@ -581,7 +585,7 @@ static void exec_cpg_procjoin_endian_convert (void *msg)
 	struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = (struct req_exec_cpg_procjoin *)msg;
 
 	req_exec_cpg_procjoin->pid = swab32(req_exec_cpg_procjoin->pid);
-	req_exec_cpg_procjoin->groupName.length = swab32(req_exec_cpg_procjoin->groupName.length);
+	req_exec_cpg_procjoin->group_name.length = swab32(req_exec_cpg_procjoin->group_name.length);
 	req_exec_cpg_procjoin->reason = swab32(req_exec_cpg_procjoin->reason);
 }
 
@@ -592,7 +596,7 @@ static void exec_cpg_joinlist_endian_convert (void *msg)
 
 	while ((void*)jle < msg + res->size) {
 		jle->pid = swab32(jle->pid);
-		jle->groupName.length = swab32(jle->groupName.length);
+		jle->group_name.length = swab32(jle->group_name.length);
 		jle++;
 	}
 }
@@ -603,11 +607,15 @@ static void exec_cpg_mcast_endian_convert (void *msg)
 
 	req_exec_cpg_mcast->pid = swab32(req_exec_cpg_mcast->pid);
 	req_exec_cpg_mcast->msglen = swab32(req_exec_cpg_mcast->msglen);
-	req_exec_cpg_mcast->groupName.length = swab32(req_exec_cpg_mcast->groupName.length);
+	req_exec_cpg_mcast->group_name.length = swab32(req_exec_cpg_mcast->group_name.length);
 
 }
 
-static void do_proc_join(struct cpg_name *name, uint32_t pid, struct totem_ip_address *node, int reason)
+static void do_proc_join(
+	struct cpg_name *name,
+	uint32_t pid,
+	unsigned int nodeid,
+	int reason)
 {
 	struct group_info *gi;
 	struct process_info *pi;
@@ -620,13 +628,15 @@ static void do_proc_join(struct cpg_name *name, uint32_t pid, struct totem_ip_ad
 	/* See if it already exists in this group */
 	for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
 		pi = list_entry(iter, struct process_info, list);
-		if (pi->pid == pid && pi->node.nodeid == node->nodeid) {
+		if (pi->pid == pid && pi->nodeid == nodeid) {
 
 			/* It could be a local join message */
-			if (node->nodeid == this_ip->nodeid && (!pi->flags & PI_FLAG_MEMBER))
+			if ((nodeid == this_ip->nodeid) &&
+				(!pi->flags & PI_FLAG_MEMBER)) {
 				goto local_join;
-			else
+			} else {
 				return;
+			}
 		}
 	}
 
@@ -635,7 +645,7 @@ static void do_proc_join(struct cpg_name *name, uint32_t pid, struct totem_ip_ad
 		log_printf(LOG_LEVEL_WARNING, "Unable to allocate process_info struct");
 		return;
 	}
-	totemip_copy(&pi->node, node);
+	pi->nodeid = nodeid;
 	pi->pid = pid;
 	pi->group = gi;
 	pi->conn = NULL;
@@ -646,7 +656,7 @@ local_join:
 
 	pi->flags = PI_FLAG_MEMBER;
 	notify_info.pid = pi->pid;
-	notify_info.nodeId = node->nodeid;
+	notify_info.nodeid = nodeid;
 	notify_info.reason = reason;
 
 	notify_lib_joinlist(gi, NULL,
@@ -657,18 +667,20 @@ local_join:
 
 static void message_handler_req_exec_cpg_procjoin (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = (struct req_exec_cpg_procjoin *)message;
 
 	log_printf(LOG_LEVEL_DEBUG, "got procjoin message from cluster\n");
 
-	do_proc_join(&req_exec_cpg_procjoin->groupName, req_exec_cpg_procjoin->pid, source_addr, CONFCHG_CPG_REASON_JOIN);
+	do_proc_join(&req_exec_cpg_procjoin->group_name,
+		req_exec_cpg_procjoin->pid, nodeid,
+		CONFCHG_CPG_REASON_JOIN);
 }
 
 static void message_handler_req_exec_cpg_procleave (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_cpg_procjoin *req_exec_cpg_procjoin = (struct req_exec_cpg_procjoin *)message;
 	struct group_info *gi;
@@ -678,11 +690,11 @@ static void message_handler_req_exec_cpg_procleave (
 
 	log_printf(LOG_LEVEL_DEBUG, "got procleave message from cluster\n");
 
-	gi = get_group(&req_exec_cpg_procjoin->groupName); /* this will always succeed ! */
+	gi = get_group(&req_exec_cpg_procjoin->group_name); /* this will always succeed ! */
 	assert(gi);
 
 	notify_info.pid = req_exec_cpg_procjoin->pid;
-	notify_info.nodeId = source_addr->nodeid;
+	notify_info.nodeid = nodeid;
 	notify_info.reason = req_exec_cpg_procjoin->reason;
 
 	notify_lib_joinlist(gi, NULL,
@@ -694,7 +706,7 @@ static void message_handler_req_exec_cpg_procleave (
 	for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
 		pi = list_entry(iter, struct process_info, list);
 		if (pi->pid == req_exec_cpg_procjoin->pid &&
-		    pi->node.nodeid == source_addr->nodeid) {
+		    pi->nodeid == nodeid) {
 
 			list_del(&pi->list);
 			if (!pi->conn)
@@ -712,26 +724,29 @@ static void message_handler_req_exec_cpg_procleave (
 /* Got a proclist from another node */
 static void message_handler_req_exec_cpg_joinlist (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct res_header *res = (struct res_header *)message;
 	struct join_list_entry *jle = (struct join_list_entry *)(message + sizeof(struct res_header));
 
-	log_printf(LOG_LEVEL_DEBUG, "got joinlist message from node %s\n", totemip_print(source_addr));
+	log_printf(LOG_LEVEL_NOTICE, "got joinlist message from node %x\n",
+		nodeid);
 
 	/* Ignore our own messages */
-	if (totemip_equal(source_addr, this_ip))
+	if (nodeid == this_ip->nodeid) {
 		return;
+	}
 
 	while ((void*)jle < message + res->size) {
-		do_proc_join(&jle->groupName, jle->pid, source_addr, CONFCHG_CPG_REASON_NODEUP);
+		do_proc_join(&jle->group_name, jle->pid, nodeid,
+			CONFCHG_CPG_REASON_NODEUP);
 		jle++;
 	}
 }
 
 static void message_handler_req_exec_cpg_mcast (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_cpg_mcast *req_exec_cpg_mcast = (struct req_exec_cpg_mcast *)message;
 	struct res_lib_cpg_deliver_callback *res_lib_cpg_mcast;
@@ -740,7 +755,7 @@ static void message_handler_req_exec_cpg_mcast (
 	struct group_info *gi;
 	struct list_head *iter;
 
-	gi = get_group(&req_exec_cpg_mcast->groupName); /* this will always succeed ! */
+	gi = get_group(&req_exec_cpg_mcast->group_name); /* this will always succeed ! */
 	assert(gi);
 
 	res_lib_cpg_mcast = (struct res_lib_cpg_deliver_callback *)buf;
@@ -748,21 +763,26 @@ static void message_handler_req_exec_cpg_mcast (
 	res_lib_cpg_mcast->header.size = sizeof(*res_lib_cpg_mcast) + msglen;
 	res_lib_cpg_mcast->msglen = msglen;
 	res_lib_cpg_mcast->pid = req_exec_cpg_mcast->pid;
-	res_lib_cpg_mcast->nodeid = source_addr->nodeid;
-	memcpy(&res_lib_cpg_mcast->groupName, &gi->groupName, sizeof(struct cpg_name));
-	memcpy(&res_lib_cpg_mcast->message, req_exec_cpg_mcast->message, msglen);
+	res_lib_cpg_mcast->nodeid = nodeid;
+	memcpy(&res_lib_cpg_mcast->group_name, &gi->group_name,
+		sizeof(struct cpg_name));
+	memcpy(&res_lib_cpg_mcast->message, req_exec_cpg_mcast->message,
+		msglen);
 
 	/* Send to all interested members */
 	for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
 		struct process_info *pi = list_entry(iter, struct process_info, list);
 		if (pi->trackerconn) {
-			openais_conn_send_response(pi->trackerconn, buf, res_lib_cpg_mcast->header.size);
+			openais_conn_send_response(
+				pi->trackerconn,
+				buf,
+				res_lib_cpg_mcast->header.size);
 		}
 	}
 }
 
 
-static void cpg_exec_send_joinlist()
+static void cpg_exec_send_joinlist(void)
 {
 	int count = 0;
 	char *buf;
@@ -782,7 +802,7 @@ static void cpg_exec_send_joinlist()
 			gi = list_entry(iter, struct group_info, list);
 			for (iter2 = gi->members.next; iter2 != &gi->members; iter2 = iter2->next) {
 				struct process_info *pi = list_entry(iter2, struct process_info, list);
-				if (pi->pid && pi->node.nodeid == this_ip->nodeid) {
+				if (pi->pid && pi->nodeid == this_ip->nodeid) {
 					count++;
 				}
 			}
@@ -809,8 +829,8 @@ static void cpg_exec_send_joinlist()
 			for (iter2 = gi->members.next; iter2 != &gi->members; iter2 = iter2->next) {
 
 				struct process_info *pi = list_entry(iter2, struct process_info, list);
-				if (pi->pid && pi->node.nodeid == this_ip->nodeid) {
-					memcpy(&jle->groupName, &gi->groupName, sizeof(struct cpg_name));
+				if (pi->pid && pi->nodeid == this_ip->nodeid) {
+					memcpy(&jle->group_name, &gi->group_name, sizeof(struct cpg_name));
 					jle->pid = pi->pid;
 					jle++;
 				}
@@ -853,14 +873,14 @@ static void message_handler_req_lib_cpg_join (void *conn, void *message)
 		goto join_err;
 	}
 
-	gi = get_group(&req_lib_cpg_join->groupName);
+	gi = get_group(&req_lib_cpg_join->group_name);
 	if (!gi) {
 		error = SA_AIS_ERR_NO_SPACE;
 		goto join_err;
 	}
 
 	/* Add a node entry for us */
-	totemip_copy(&pi->node, this_ip);
+	pi->nodeid = this_ip->nodeid;
 	pi->pid = req_lib_cpg_join->pid;
 	pi->group = gi;
 	list_add(&pi->list, &gi->members);
@@ -931,7 +951,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
 	req_exec_cpg_mcast.header.id = SERVICE_ID_MAKE(CPG_SERVICE, MESSAGE_REQ_EXEC_CPG_MCAST);
 	req_exec_cpg_mcast.pid = pi->pid;
 	req_exec_cpg_mcast.msglen = msglen;
-	memcpy(&req_exec_cpg_mcast.groupName, &gi->groupName, sizeof(struct cpg_name));
+	memcpy(&req_exec_cpg_mcast.group_name, &gi->group_name, sizeof(struct cpg_name));
 
 	req_exec_cpg_iovec[0].iov_base = &req_exec_cpg_mcast;
 	req_exec_cpg_iovec[0].iov_len = sizeof(req_exec_cpg_mcast);
@@ -976,7 +996,7 @@ static void message_handler_req_lib_cpg_trackstart (void *conn, void *message)
 
 	log_printf(LOG_LEVEL_DEBUG, "got trackstart request on %p\n", conn);
 
-	gi = get_group(&req_lib_cpg_trackstart->groupName);
+	gi = get_group(&req_lib_cpg_trackstart->group_name);
 	if (!gi) {
 		error = SA_AIS_ERR_NO_SPACE;
 		goto tstart_ret;
@@ -1005,7 +1025,7 @@ static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
 
 	log_printf(LOG_LEVEL_DEBUG, "got trackstop request on %p\n", conn);
 
-	gi = get_group(&req_lib_cpg_trackstop->groupName);
+	gi = get_group(&req_lib_cpg_trackstop->group_name);
 	if (!gi) {
 		error = SA_AIS_ERR_NO_SPACE;
 		goto tstop_ret;

+ 21 - 27
exec/evs.c

@@ -48,6 +48,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include "totem.h"
 #include "../include/saAis.h"
 #include "../include/ipc_gen.h"
 #include "../include/ipc_evs.h"
@@ -56,7 +57,6 @@
 #include "../lcr/lcr_comp.h"
 #include "aispoll.h"
 #include "totempg.h"
-#include "totemip.h"
 #include "main.h"
 #include "mempool.h"
 #include "service.h"
@@ -72,12 +72,12 @@ enum evs_exec_message_req_types {
 static int evs_exec_init_fn(struct objdb_iface_ver0 *objdb);
 static void evs_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
-static void message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr);
+static void message_handler_req_exec_mcast (void *msg, unsigned int nodeid);
 
 static void req_exec_mcast_endian_convert (void *msg);
 
@@ -209,13 +209,11 @@ struct res_evs_confchg_callback res_evs_confchg_callback;
 
 static void evs_confchg_fn (
 	enum totem_configuration_type configuration_type,
-    struct totem_ip_address *member_list, int member_list_entries,
-    struct totem_ip_address *left_list, int left_list_entries,
-    struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
-
-	int i;
 	struct list_head *list;
 	struct evs_pd *evs_pd;
 
@@ -226,20 +224,16 @@ static void evs_confchg_fn (
 	res_evs_confchg_callback.header.id = MESSAGE_RES_EVS_CONFCHG_CALLBACK;
 	res_evs_confchg_callback.header.error = SA_AIS_OK;
 
-	for (i = 0; i < member_list_entries; i++) {
-		totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.member_list[i],
-			&member_list[i]);
-	}
+	memcpy (res_evs_confchg_callback.member_list,
+		member_list, member_list_entries);
 	res_evs_confchg_callback.member_list_entries = member_list_entries;
-	for (i = 0; i < left_list_entries; i++) {
-		totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.left_list[i],
-			&left_list[i]);
-	}
+
+	memcpy (res_evs_confchg_callback.left_list,
+		left_list, left_list_entries);
 	res_evs_confchg_callback.left_list_entries = left_list_entries;
-	for (i = 0; i < joined_list_entries; i++) {
-		totemip_copy((struct totem_ip_address *)&res_evs_confchg_callback.joined_list[i],
-			&joined_list[i]);
-	}
+
+	memcpy (res_evs_confchg_callback.joined_list,
+		joined_list, joined_list_entries);
 	res_evs_confchg_callback.joined_list_entries = joined_list_entries;
 
 	/*
@@ -457,8 +451,7 @@ static void message_handler_req_evs_membership_get (void *conn, void *msg)
 	res_lib_evs_membership_get.header.size = sizeof (struct res_lib_evs_membership_get);
 	res_lib_evs_membership_get.header.id = MESSAGE_RES_EVS_MEMBERSHIP_GET;
 	res_lib_evs_membership_get.header.error = EVS_OK;
-	totemip_copy((struct totem_ip_address *)&res_lib_evs_membership_get.local_addr,
-		this_ip);
+	res_lib_evs_membership_get.local_nodeid = this_ip->nodeid;
 	memcpy (&res_lib_evs_membership_get.member_list,
 		&res_evs_confchg_callback.member_list,
 		sizeof (res_lib_evs_membership_get.member_list));
@@ -474,7 +467,9 @@ static void req_exec_mcast_endian_convert (void *msg)
 {
 }
 
-static void message_handler_req_exec_mcast (void *msg, struct totem_ip_address *source_addr)
+static void message_handler_req_exec_mcast (
+	void *msg,
+	unsigned int nodeid)
 {
 	struct req_exec_evs_mcast *req_exec_evs_mcast = (struct req_exec_evs_mcast *)msg;
 	struct res_evs_deliver_callback res_evs_deliver_callback;
@@ -513,8 +508,7 @@ static void message_handler_req_exec_mcast (void *msg, struct totem_ip_address *
 		}
 
 		if (found) {
-			totemip_copy((struct totem_ip_address *)&res_evs_deliver_callback.evs_address,
-				source_addr);
+			res_evs_deliver_callback.local_nodeid = nodeid;
 			openais_conn_send_response (evs_pd->conn, &res_evs_deliver_callback,
 				sizeof (struct res_evs_deliver_callback));
 			openais_conn_send_response (evs_pd->conn, msg_addr,

+ 121 - 116
exec/evt.c

@@ -58,7 +58,6 @@
 #include "aispoll.h"
 #include "mempool.h"
 #include "main.h"
-#include "totemip.h"
 #include "totempg.h"
 #include "swab.h"
 #include "print.h"
@@ -110,9 +109,9 @@ static void lib_evt_event_data_get(void *conn, void *message);
 
 static void evt_conf_change(
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id);
 
 static int evt_lib_init(void *conn);
@@ -188,9 +187,9 @@ static struct openais_lib_handler evt_lib_service[] = {
 };
 
 	
-static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr);
-static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr);
-static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr);
+static void evt_remote_evt(void *msg, unsigned int nodeid);
+static void evt_remote_recovery_evt(void *msg, unsigned int nodeid);
+static void evt_remote_chan_op(void *msg, unsigned int nodeid);
 
 static struct openais_exec_handler evt_exec_service[] = {
 	{
@@ -352,15 +351,15 @@ static struct list_head *next_retained = 0;
 static struct list_head *next_chan = 0;
 static enum recovery_phases recovery_phase = evt_recovery_complete;
 static int				left_member_count = 0;
-static struct totem_ip_address 	*left_member_list = 0;
+static unsigned int *left_member_list = 0;
 static int				joined_member_count = 0;
-static struct totem_ip_address 	*joined_member_list = 0;
+static unsigned int *joined_member_list = 0;
 static int			 	total_member_count = 0;
-static struct totem_ip_address 	*current_member_list = 0;
+static unsigned int *current_member_list = 0;
 static int				trans_member_count = 0;
-static struct totem_ip_address	*trans_member_list = 0;
+static unsigned int *trans_member_list = 0;
 static int				add_count = 0;
-static struct totem_ip_address 	*add_list = 0;
+static unsigned int *add_list = 0;
 static int				processed_open_counts = 0;
 
 /*
@@ -625,7 +624,7 @@ struct event_svr_channel_subscr {
  * mn_entry:			List of all nodes.
  */
 struct member_node_data {
-	struct totem_ip_address	mn_node_addr;
+	unsigned int		mn_nodeid;
 	SaClmClusterNodeT	mn_node_info;
 	SaEvtEventIdT		mn_last_msg_id;
 	SaClmNodeIdT		mn_started;
@@ -832,8 +831,8 @@ static struct open_count* find_open_count(
 		}
 	}
 	log_printf(LOG_LEVEL_DEBUG, 
-			"find_open_count: node id 0x%x not found\n",
-			node_id);
+			"find_open_count: node id %s not found\n",
+			totempg_ifaces_print (node_id));
 	return 0;
 }
 
@@ -849,8 +848,8 @@ static void dump_chan_opens(struct event_svr_channel_instance *eci)
 		if (eci->esc_node_opens[i].oc_node_id == 0) {
 			break;
 		}
-		log_printf(LOG_LEVEL_NOTICE, "Node 0x%x, count %d\n",
-			eci->esc_node_opens[i].oc_node_id, 
+		log_printf(LOG_LEVEL_NOTICE, "Node %s, count %d\n",
+			totempg_ifaces_print (eci->esc_node_opens[i].oc_node_id), 
 			eci->esc_node_opens[i].oc_open_count);
 	}
 }
@@ -908,8 +907,8 @@ static int set_open_count(struct event_svr_channel_instance *eci,
 	oc = find_open_count(eci, node_id);
 	if (oc) {
 		log_printf(RECOVERY_DEBUG, 
-			"Set count: Chan %s for node 0x%x, was %d, now %d\n",
-			eci->esc_channel_name.value, node_id, 
+			"Set count: Chan %s for node %s, was %d, now %d\n",
+			eci->esc_channel_name.value, totempg_ifaces_print (node_id), 
 			oc->oc_open_count, open_count);
 
 		eci->esc_total_opens -= oc->oc_open_count;
@@ -1113,8 +1112,9 @@ static int remove_open_count(
 			break;
 		}
 
-		log_printf(RECOVERY_DEBUG, "roc: %x/%x, t %d, oc %d\n",
-			node_id, eci->esc_node_opens[i].oc_node_id,
+		log_printf(RECOVERY_DEBUG, "roc: %s/%s, t %d, oc %d\n",
+			totempg_ifaces_print (node_id),
+			totempg_ifaces_print (eci->esc_node_opens[i].oc_node_id),
 			eci->esc_total_opens, eci->esc_node_opens[i].oc_open_count);
 		
 		if (eci->esc_node_opens[i].oc_node_id == node_id) {
@@ -1240,19 +1240,19 @@ static SaAisErrorT evt_close_channel(SaNameT *cn, uint64_t unlink_id)
 #define NODE_HASH_SIZE 256
 static struct member_node_data *nl[NODE_HASH_SIZE] = {0};
 inline int 
-hash_sock_addr(struct totem_ip_address *addr)
+hash_sock_addr(unsigned int nodeid)
 {
-	return addr->nodeid & (NODE_HASH_SIZE - 1);
+	return nodeid & (NODE_HASH_SIZE - 1);
 }
 
-static struct member_node_data **lookup_node(struct totem_ip_address *addr)
+static struct member_node_data **lookup_node(unsigned int nodeid)
 {
-	int index = hash_sock_addr(addr);
+	int index = hash_sock_addr(nodeid);
 	struct member_node_data **nlp;
 
 	nlp = &nl[index];
 	for (nlp = &nl[index]; *nlp; nlp = &((*nlp)->mn_next)) {
-		if (totemip_equal(&(*nlp)->mn_node_addr, addr)) {
+		if ((*(nlp))->mn_nodeid == nodeid) {
 			break;
 		}
 	}
@@ -1261,11 +1261,11 @@ static struct member_node_data **lookup_node(struct totem_ip_address *addr)
 }
 
 static struct member_node_data *
-evt_find_node(struct totem_ip_address *addr)
+evt_find_node(unsigned int nodeid)
 {
 	struct member_node_data **nlp;
 
-	nlp = lookup_node(addr);
+	nlp = lookup_node(nodeid);
 
 	if (!nlp) {
 		log_printf(LOG_LEVEL_DEBUG, "find_node: Got NULL nlp?\n");
@@ -1276,13 +1276,15 @@ evt_find_node(struct totem_ip_address *addr)
 }
 
 static SaAisErrorT
-evt_add_node(struct totem_ip_address *addr, SaClmClusterNodeT *cn) 
+evt_add_node(
+	unsigned int nodeid,
+	SaClmClusterNodeT *cn) 
 {
 	struct member_node_data **nlp;
 	struct member_node_data *nl;
 	SaAisErrorT err = SA_AIS_ERR_EXIST;
 
-	nlp = lookup_node(addr);
+	nlp = lookup_node(nodeid);
 
 	if (!nlp) {
 		log_printf(LOG_LEVEL_DEBUG, "add_node: Got NULL nlp?\n");
@@ -1301,7 +1303,7 @@ evt_add_node(struct totem_ip_address *addr, SaClmClusterNodeT *cn)
 	if (nl) {
 		memset(nl, 0, sizeof(*nl));
 		err = SA_AIS_OK;
-		totemip_copy(&nl->mn_node_addr, addr);
+		nl->mn_nodeid = nodeid;
 		nl->mn_started = 1;
 	}
 	list_init(&nl->mn_entry);
@@ -1326,11 +1328,11 @@ static struct member_node_data* oldest_node()
 	int i;
 
 	for (i = 0; i < trans_member_count; i++) {
-		mn = evt_find_node(&trans_member_list[i]);
+		mn = evt_find_node(trans_member_list[i]);
 		if (!mn || (mn->mn_started == 0)) {
 			log_printf(LOG_LEVEL_ERROR, 
-				"Transitional config Node %s not active\n",
-				totemip_print(&trans_member_list[i]));
+				"Transitional config Node %d not active\n",
+				totempg_ifaces_print (trans_member_list[i]));
 			continue;
 		}
 		if ((oldest == NULL) || 
@@ -1354,26 +1356,29 @@ static struct member_node_data* oldest_node()
  * seen it.  It's probably a retained event being sent to 
  * a new node.
  */
-static int check_last_event(struct lib_event_data *evtpkt, 
-				struct totem_ip_address *addr)
+static int check_last_event(
+	struct lib_event_data *evtpkt, 
+	unsigned int nodeid)
 {
 	struct member_node_data *nd;
 	SaClmClusterNodeT *cn;
 
 
-	nd = evt_find_node(addr);
+	nd = evt_find_node(nodeid);
 	if (!nd) {
 		log_printf(LOG_LEVEL_DEBUG, 
-				"Node ID 0x%x not found for event %llx\n",
-				evtpkt->led_publisher_node_id, evtpkt->led_event_id);
-		cn = main_clm_get_by_nodeid(addr->nodeid);
+				"Node ID %s not found for event %llx\n",
+				totempg_ifaces_print (evtpkt->led_publisher_node_id),
+				evtpkt->led_event_id);
+		cn = main_clm_get_by_nodeid(nodeid);
 		if (!cn) {
 			log_printf(LOG_LEVEL_DEBUG, 
 					"Cluster Node 0x%x not found for event %llx\n",
-				evtpkt->led_publisher_node_id, evtpkt->led_event_id);
+				totempg_ifaces_print (evtpkt->led_publisher_node_id),
+				evtpkt->led_event_id);
 		} else {
-			evt_add_node(addr, cn);
-			nd = evt_find_node(addr);
+			evt_add_node(nodeid, cn);
+			nd = evt_find_node(nodeid);
 		}
 	}
 
@@ -2845,9 +2850,9 @@ static void remove_chan_open_info(SaClmNodeIdT node_id)
  */
 static void evt_conf_change(
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id)
 {
 	log_printf(RECOVERY_DEBUG, "Evt conf change %d\n", 
@@ -2877,7 +2882,7 @@ static void evt_conf_change(
 		}
 		if (left_list_entries) {
 			left_member_list = 
-				malloc(sizeof(struct totem_ip_address) * left_list_entries);
+				malloc(sizeof(unsigned int) * left_list_entries);
 			if (!left_member_list) {
 				/* 
 			 	 * ERROR: No recovery.
@@ -2887,7 +2892,7 @@ static void evt_conf_change(
 				assert(0);
 			}
 			memcpy(left_member_list, left_list, 
-					sizeof(struct totem_ip_address) * left_list_entries);
+					sizeof(unsigned int) * left_list_entries);
 		}
 
 		if (trans_member_list) {
@@ -2896,7 +2901,7 @@ static void evt_conf_change(
 		}
 		if (member_list_entries) {
 			trans_member_list = 
-				malloc(sizeof(struct totem_ip_address) * member_list_entries);
+				malloc(sizeof(unsigned int) * member_list_entries);
 
 			if (!trans_member_list) {
 				/* 
@@ -2907,7 +2912,7 @@ static void evt_conf_change(
 				assert(0);
 			}
 			memcpy(trans_member_list, member_list, 
-					sizeof(struct totem_ip_address) * member_list_entries);
+					sizeof(unsigned int) * member_list_entries);
 		}
 	}
 
@@ -2922,7 +2927,7 @@ static void evt_conf_change(
 		}
 		if (joined_list_entries) {
 			joined_member_list = 
-				malloc(sizeof(struct totem_ip_address) * joined_list_entries);
+				malloc(sizeof(unsigned int) * joined_list_entries);
 			if (!joined_member_list) {
 				/* 
 			 	 * ERROR: No recovery.
@@ -2932,7 +2937,7 @@ static void evt_conf_change(
 				assert(0);
 			}
 			memcpy(joined_member_list, joined_list, 
-					sizeof(struct totem_ip_address) * joined_list_entries);
+					sizeof(unsigned int) * joined_list_entries);
 		}
 
 
@@ -2942,7 +2947,7 @@ static void evt_conf_change(
 		}
 		if (member_list_entries) {
 			current_member_list = 
-				malloc(sizeof(struct totem_ip_address) * member_list_entries);
+				malloc(sizeof(unsigned int) * member_list_entries);
 
 			if (!current_member_list) {
 				/* 
@@ -2953,7 +2958,7 @@ static void evt_conf_change(
 				assert(0);
 			}
 			memcpy(current_member_list, member_list, 
-					sizeof(struct totem_ip_address) * member_list_entries);
+					sizeof(unsigned int) * member_list_entries);
 		}
 	}
 }
@@ -3137,7 +3142,7 @@ try_deliver_event(struct event_data *evt,
 /*
  * Receive the network event message and distribute it to local subscribers
  */
-static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr)
+static void evt_remote_evt(void *msg, unsigned int nodeid)
 {
 	/*
 	 * - retain events that have a retention time
@@ -3151,28 +3156,28 @@ static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr)
 	struct event_data *evt;
 	SaClmClusterNodeT *cn;
 
-	log_printf(LOG_LEVEL_DEBUG, "Remote event data received from %s\n",
-					totemip_print(source_addr));
+	log_printf(LOG_LEVEL_DEBUG, "Remote event data received from nodeid %s\n",
+			totempg_ifaces_print (nodeid));
 
 	/*
 	 * See where the message came from so that we can set the 
 	 * publishing node id in the message before delivery.
 	 */
-	cn = main_clm_get_by_nodeid(source_addr->nodeid);
+	cn = main_clm_get_by_nodeid(nodeid);
 	if (!cn) {
 			/*
 			 * Not sure how this can happen...
 			 */
-			log_printf(LOG_LEVEL_DEBUG, "No cluster node data for %s\n",
-							totemip_print(source_addr));
+			log_printf(LOG_LEVEL_DEBUG, "No cluster node data for nodeid %d\n",
+				totempg_ifaces_print (nodeid));
 			errno = ENXIO;
 			return;
 	}
-	log_printf(LOG_LEVEL_DEBUG, "Cluster node ID 0x%x name %s\n",
-					cn->nodeId, cn->nodeName.value);
+	log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
+					totempg_ifaces_print (cn->nodeId), cn->nodeName.value);
 
-	evtpkt->led_publisher_node_id = cn->nodeId;
-	totemip_copy(&evtpkt->led_addr, source_addr);
+	evtpkt->led_publisher_node_id = nodeid;
+	evtpkt->led_nodeid = nodeid;
 	evtpkt->led_receive_time = clust_time_now();
 
 	if (evtpkt->led_chan_unlink_id != EVT_CHAN_ACTIVE) {
@@ -3205,7 +3210,7 @@ static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr)
 		return;
 	}
 
-	if (check_last_event(evtpkt, source_addr)) {
+	if (check_last_event(evtpkt, nodeid)) {
 		return;
 	}
 
@@ -3240,7 +3245,7 @@ inline SaTimeT calc_retention_time(SaTimeT retention,
 /*
  * Receive a recovery network event message and save it in the retained list
  */
-static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr)
+static void evt_remote_recovery_evt(void *msg, unsigned int nodeid)
 {
 	/*
 	 * - calculate remaining retention time
@@ -3259,8 +3264,7 @@ static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_a
 	now = clust_time_now();
 
 	log_printf(RECOVERY_EVENT_DEBUG, 
-			"Remote recovery event data received from %s\n",
-					totemip_print(source_addr));
+			"Remote recovery event data received from nodeid %d\n", nodeid);
 
 	if (recovery_phase == evt_recovery_complete) {
 		log_printf(RECOVERY_EVENT_DEBUG, 
@@ -3293,23 +3297,23 @@ static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_a
 	 * If we haven't seen this event yet and it has remaining time, process
 	 * the event.
 	 */
-	if (!check_last_event(evtpkt, &evtpkt->led_addr) && 
-												evtpkt->led_retention_time) {
+	if (!check_last_event(evtpkt, evtpkt->led_nodeid) && 
+		evtpkt->led_retention_time) {
 		/*
 		 * See where the message came from so that we can set the 
 		 * publishing node id in the message before delivery.
 		 */
-		md = evt_find_node(&evtpkt->led_addr);
+		md = evt_find_node(evtpkt->led_nodeid);
 		if (!md) {
 				/*
 				 * Not sure how this can happen
 				 */
-				log_printf(LOG_LEVEL_NOTICE, "No node for %s\n",
-								totemip_print(&evtpkt->led_addr));
+				log_printf(LOG_LEVEL_NOTICE, "No node for nodeid %s\n",
+						totempg_ifaces_print (evtpkt->led_nodeid));
 				return;
 		}
-		log_printf(LOG_LEVEL_DEBUG, "Cluster node ID 0x%x name %s\n",
-						md->mn_node_info.nodeId, 
+		log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
+						totempg_ifaces_print (md->mn_node_info.nodeId), 
 						md->mn_node_info.nodeName.value);
 
 		log_printf(CHAN_UNLINK_DEBUG, 
@@ -3586,7 +3590,7 @@ convert_chan_packet(void *msg)
  * Used to communicate channel opens/closes, clear retention time,
  * config change updates...
  */
-static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
+static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 {
 	struct req_evt_chan_command *cpkt = msg;
 	unsigned int local_node = {SA_CLM_LOCAL_NODE_ID};
@@ -3598,17 +3602,17 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 	my_node = main_clm_get_by_nodeid(local_node);
 	log_printf(REMOTE_OP_DEBUG, "my node ID: 0x%x\n", my_node->nodeId);
 
-	mn = evt_find_node(source_addr);
+	mn = evt_find_node(nodeid);
 	if (mn == NULL) {
-		cn = main_clm_get_by_nodeid(source_addr->nodeid);
+		cn = main_clm_get_by_nodeid(nodeid);
 		if (cn == NULL) {
 			log_printf(LOG_LEVEL_WARNING, 
-				"Evt remote channel op: Node data for addr %s is NULL\n",
-					totemip_print(source_addr));
+				"Evt remote channel op: Node data for nodeid %d is NULL\n",
+				nodeid);
 			return;
 		} else {
-			evt_add_node(source_addr, cn);
-			mn = evt_find_node(source_addr);
+			evt_add_node(nodeid, cn);
+			mn = evt_find_node(nodeid);
 		}
 	}
 
@@ -3627,9 +3631,9 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 		struct open_chan_pending *ocp;
 		struct list_head *l, *nxt;
 
-		log_printf(CHAN_OPEN_DEBUG, "Opening channel %s for node 0x%x\n",
+		log_printf(CHAN_OPEN_DEBUG, "Opening channel %s for node %s\n",
 						cpkt->u.chc_chan.ocr_name.value,
-						mn->mn_node_info.nodeId);
+						totempg_ifaces_print (mn->mn_node_info.nodeId));
 		eci = find_channel(&cpkt->u.chc_chan.ocr_name, EVT_CHAN_ACTIVE);
 
 		if (!eci) {
@@ -3794,17 +3798,18 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 			log_level = RECOVERY_DEBUG;
 		}
 		log_printf(log_level, 
-			"Received Set event ID OP from %s to %llx for %x my addr %x base %llx\n",
-					totemip_print(source_addr), 
+			"Received Set event ID OP from nodeid %s to %llx for %x my addr %x base %llx\n",
+					nodeid, 
 					cpkt->u.chc_set_id.chc_last_id,
 					cpkt->u.chc_set_id.chc_nodeid,
-					my_node->nodeId,
+					totempg_ifaces_print (my_node->nodeId),
 					base_id);	
 		if (cpkt->u.chc_set_id.chc_nodeid == my_node->nodeId) {
 			if (cpkt->u.chc_set_id.chc_last_id >= base_id) {
 				log_printf(RECOVERY_DEBUG, 
-					"Set event ID from %s to %llx\n",
-					totemip_print(source_addr), cpkt->u.chc_set_id.chc_last_id);	
+					"Set event ID from nodeid %s to %llx\n",
+					totempg_ifaces_print (nodeid),
+					cpkt->u.chc_set_id.chc_last_id);	
 				base_id = cpkt->u.chc_set_id.chc_last_id + 1;
 			}
 		}
@@ -3819,8 +3824,8 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 	case EVT_OPEN_COUNT:
 		if (recovery_phase == evt_recovery_complete) {
 			log_printf(LOG_LEVEL_ERROR, 
-				"Evt open count msg from %s, but not in membership change\n",
-				totemip_print(source_addr));
+				"Evt open count msg from nodeid %s, but not in membership change\n",
+				totempg_ifaces_print (nodeid));
 		}
 
 		/*
@@ -3832,10 +3837,10 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 			processed_open_counts = 1;
 		}
 		log_printf(RECOVERY_DEBUG, 
-				"Open channel count %s is %d for node 0x%x\n",
+				"Open channel count %s is %d for node %s\n",
 				cpkt->u.chc_set_opens.chc_chan_name.value, 
 				cpkt->u.chc_set_opens.chc_open_count,
-				mn->mn_node_info.nodeId);
+				totempg_ifaces_print (mn->mn_node_info.nodeId));
 
 		eci = find_channel(&cpkt->u.chc_set_opens.chc_chan_name, 
 					EVT_CHAN_ACTIVE);
@@ -3850,9 +3855,9 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 		if (set_open_count(eci, mn->mn_node_info.nodeId, 
 									cpkt->u.chc_set_opens.chc_open_count)) {
 			log_printf(LOG_LEVEL_ERROR, 
-				"Error setting Open channel count %s for node 0x%x\n",
+				"Error setting Open channel count %s for node %s\n",
 				cpkt->u.chc_set_opens.chc_chan_name.value, 
-				mn->mn_node_info.nodeId);
+				totempg_ifaces_print (mn->mn_node_info.nodeId));
 		}
 		break;
 
@@ -3863,16 +3868,15 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 	case EVT_OPEN_COUNT_DONE: {
 		if (recovery_phase == evt_recovery_complete) {
 			log_printf(LOG_LEVEL_ERROR, 
-				"Evt config msg from %s, but not in membership change\n",
-				totemip_print(source_addr));
+				"Evt config msg from nodeid %s, but not in membership change\n",
+				totempg_ifaces_print (nodeid));
 		}
 		log_printf(RECOVERY_DEBUG, 
-			"Receive EVT_CONF_CHANGE_DONE from %s members %d checked in %d\n",
-				totemip_print(source_addr), total_member_count, checked_in+1);
+			"Receive EVT_CONF_CHANGE_DONE from nodeid %s members %d checked in %d\n",
+				totempg_ifaces_print (nodeid), total_member_count, checked_in+1);
 		if (!mn) {
 			log_printf(RECOVERY_DEBUG, 
-				"NO NODE DATA AVAILABLE FOR %s\n",
-					totemip_print(source_addr));
+				"NO NODE DATA AVAILABLE FOR nodeid %s\n", totempg_ifaces_print (nodeid));
 		}
 
 		if (++checked_in == total_member_count) {
@@ -3902,9 +3906,9 @@ static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr)
 	 */
 	case EVT_CONF_DONE: {
 		log_printf(RECOVERY_DEBUG, 
-				"Receive EVT_CONF_DONE from %s, members %d checked in %d\n", 
-				totemip_print(source_addr),
-					total_member_count, checked_in+1);
+				"Receive EVT_CONF_DONE from nodeid %s, members %d checked in %d\n", 
+				totempg_ifaces_print (nodeid),
+				total_member_count, checked_in+1);
 		if (++checked_in == total_member_count) {
 			/*
 			 * All recovery complete, carry on.
@@ -3935,7 +3939,7 @@ static void evt_sync_init(void)
 	struct member_node_data *md;
 	unsigned int my_node = {SA_CLM_LOCAL_NODE_ID};
 	int left_list_entries = left_member_count;
- 	struct totem_ip_address *left_list = left_member_list;
+ 	unsigned int *left_list = left_member_list;
 
 	log_printf(RECOVERY_DEBUG, "Evt synchronize initialization\n");
 
@@ -3944,7 +3948,8 @@ static void evt_sync_init(void)
 	 */
 	if (!my_node_id) {
 		cn = main_clm_get_by_nodeid(my_node);
-		log_printf(RECOVERY_DEBUG, "My node ID 0x%x\n", cn->nodeId);
+		log_printf(RECOVERY_DEBUG, "My node ID %s\n",
+			totempg_ifaces_print (cn->nodeId));
 		my_node_id = cn->nodeId;
 		set_event_id(my_node_id);
 	}
@@ -3953,17 +3958,17 @@ static void evt_sync_init(void)
 	 * account for nodes that left the membership
 	 */
 	while (left_list_entries--) {
-		md = evt_find_node(left_list);
+		md = evt_find_node(*left_list);
 		if (md == 0) {
 			log_printf(LOG_LEVEL_WARNING, 
 					"Can't find cluster node at %s\n",
-							totemip_print(&left_list[0]));
+							totempg_ifaces_print (*left_list));
 		/*
 		 * Mark this one as down.
 		 */
 		} else {
 			log_printf(RECOVERY_DEBUG, "cluster node at %s down\n",
-							totemip_print(&left_list[0]));
+							totempg_ifaces_print(*left_list));
 			md->mn_started = 0;
 			remove_chan_open_info(md->mn_node_info.nodeId);
 		}
@@ -4046,18 +4051,18 @@ static int evt_sync_process(void)
 			 * that we've seen from him.  He will set his base ID for
 			 * generating event and message IDs to the highest one seen.
 			 */
-			md = evt_find_node(add_list);
+			md = evt_find_node(*add_list);
 			if (md != NULL) {
 				log_printf(RECOVERY_DEBUG, 
 					"Send set evt ID %llx to %s\n",
-					md->mn_last_msg_id, totemip_print(add_list));
+					md->mn_last_msg_id, totempg_ifaces_print (*add_list));
 				md->mn_started = 1;
 				memset(&cpkt, 0, sizeof(cpkt));
 				cpkt.chc_head.id =
 					SERVICE_ID_MAKE (EVT_SERVICE, MESSAGE_REQ_EXEC_EVT_CHANCMD);
 				cpkt.chc_head.size = sizeof(cpkt);
 				cpkt.chc_op = EVT_SET_ID_OP;
-				cpkt.u.chc_set_id.chc_nodeid = add_list->nodeid;
+				cpkt.u.chc_set_id.chc_nodeid = *add_list;
 				cpkt.u.chc_set_id.chc_last_id = md->mn_last_msg_id;
 				chn_iovec.iov_base = &cpkt;
 				chn_iovec.iov_len = cpkt.chc_head.size;
@@ -4066,7 +4071,7 @@ static int evt_sync_process(void)
 				if (res != 0) {
 					log_printf(RECOVERY_DEBUG, 
 						"Unable to send event id to %s\n", 
-						totemip_print(add_list));
+						totempg_ifaces_print (*add_list));
 					/*
 					 * We'll try again later.
 					 */
@@ -4077,17 +4082,17 @@ static int evt_sync_process(void)
 				/*
 				 * Not seen before, add it to our list of nodes.
 				 */
-				cn = main_clm_get_by_nodeid(add_list->nodeid);
+				cn = main_clm_get_by_nodeid(*add_list);
 				if (!cn) {
 					/*
 					 * Error: shouldn't happen
 					 */
 					log_printf(LOG_LEVEL_ERROR,
 							"recovery error node: %s not found\n",
-							totemip_print(add_list));
+							totempg_ifaces_print (*add_list));
 					assert(0);
 				} else {
-					evt_add_node(add_list, cn);
+					evt_add_node(*add_list, cn);
 				}
 			}
 

+ 4 - 5
exec/ipc.c

@@ -668,7 +668,7 @@ error_exit:
 char delivery_data[MESSAGE_SIZE_MAX];
 
 static void deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
@@ -712,7 +712,7 @@ static void deliver_fn (
 	}
 
 	ais_service[service]->exec_service[fn_id].exec_handler_fn
-		(header, source_addr);
+		(header, nodeid);
 }
 
 static int poll_handler_libais_accept (
@@ -779,8 +779,7 @@ int message_source_is_local(struct message_source *source)
 	int ret = 0;
 
 	assert (source != NULL);
-	if ((totemip_localhost_check(&source->addr)
-	     ||(totemip_equal(&source->addr, my_ip)))) {
+	if (source->nodeid == my_ip->nodeid) {
 		ret = 1;
 	}
 	return ret;
@@ -791,7 +790,7 @@ void message_source_set (
 	void *conn)
 {
 	assert ((source != NULL) && (conn != NULL));
-	totemip_copy(&source->addr, this_ip);
+	source->nodeid = my_ip->nodeid;
 	source->conn = conn;
 }
 

+ 20 - 20
exec/lck.c

@@ -116,27 +116,27 @@ static int lck_lib_init_fn (void *conn);
 
 static void message_handler_req_exec_lck_resourceopen (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_lck_resourceclose (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_lck_resourcelock (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_lck_resourceunlock (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_lck_resourcelockorphan (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_lck_lockpurge (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_lib_lck_resourceopen (
 	void *conn,
@@ -190,11 +190,11 @@ static int recovery_abort = 0;
 
 
 static void lck_confchg_fn (
-		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
-		struct memb_ring_id *ring_id);
+	enum totem_configuration_type configuration_type,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
+	struct memb_ring_id *ring_id);
 
 struct lck_pd {
 	struct list_head resource_list;
@@ -417,9 +417,9 @@ static void lck_sync_abort (void)
 
 static void lck_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id) 
 {
 }
@@ -626,7 +626,7 @@ static int lck_lib_init_fn (void *conn)
 
 static void message_handler_req_exec_lck_resourceopen (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_resourceopen *req_exec_lck_resourceopen = (struct req_exec_lck_resourceopen *)message;
 	struct res_lib_lck_resourceopen res_lib_lck_resourceopen;
@@ -746,7 +746,7 @@ error_exit:
 
 static void message_handler_req_exec_lck_resourceclose (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_resourceclose *req_exec_lck_resourceclose = (struct req_exec_lck_resourceclose *)message;
 	struct res_lib_lck_resourceclose res_lib_lck_resourceclose;
@@ -1036,7 +1036,7 @@ void unlock_algorithm (
 
 static void message_handler_req_exec_lck_resourcelock (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_resourcelock *req_exec_lck_resourcelock = (struct req_exec_lck_resourcelock *)message;
 	struct resource *resource = 0;
@@ -1148,7 +1148,7 @@ error_exit:
 
 static void message_handler_req_exec_lck_resourceunlock (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_resourceunlock *req_exec_lck_resourceunlock = (struct req_exec_lck_resourceunlock *)message;
 	struct res_lib_lck_resourceunlock res_lib_lck_resourceunlock;
@@ -1203,7 +1203,7 @@ error_exit:
 
 static void message_handler_req_exec_lck_resourcelockorphan (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_resourcelockorphan *req_exec_lck_resourcelockorphan = (struct req_exec_lck_resourcelockorphan *)message;
 	struct resource *resource = 0;
@@ -1229,7 +1229,7 @@ static void message_handler_req_exec_lck_resourcelockorphan (
 
 static void message_handler_req_exec_lck_lockpurge (
 	void *msg,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_lck_lockpurge *req_exec_lck_lockpurge = (struct req_exec_lck_lockpurge *)msg;
 	struct res_lib_lck_lockpurge res_lib_lck_lockpurge;

+ 6 - 6
exec/main.c

@@ -167,9 +167,9 @@ static struct memb_ring_id aisexec_ring_id;
 
 static void confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	int i;
@@ -303,7 +303,7 @@ static void aisexec_mlockall (void)
 
 
 static void deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
@@ -347,7 +347,7 @@ static void deliver_fn (
 	}
 
 	ais_service[service]->exec_service[fn_id].exec_handler_fn
-		(header, source_addr);
+		(header, nodeid);
 }
 
 int main (int argc, char **argv)
@@ -434,7 +434,7 @@ int main (int argc, char **argv)
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 
-	res = totem_config_read (objdb, &totem_config, &error_string, 3);
+	res = totem_config_read (objdb, &totem_config, &error_string);
 	if (res == -1) {
 		log_printf (LOG_LEVEL_ERROR, error_string);
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);

+ 36 - 36
exec/msg.c

@@ -116,63 +116,63 @@ static int msg_lib_init_fn (void *conn);
 
 static void message_handler_req_exec_msg_queueopen (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queueclose (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuestatusget (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queueunlink (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegroupcreate (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegroupinsert (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegroupremove (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegroupdelete (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegrouptrack (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_queuegrouptrackstop (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_messagesend (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_messageget (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_messagecancel (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_messagesendreceive (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_exec_msg_messagereply (
 	void *message,
-	struct totem_ip_address *source_addr);
+	unsigned int nodeid);
 
 static void message_handler_req_lib_msg_queueopen (
 	void *conn,
@@ -257,9 +257,9 @@ void queue_release (struct message_queue *queue);
 
 static void msg_confchg_fn (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id);
 
 struct msg_pd {
@@ -604,9 +604,9 @@ static void msg_sync_abort (void)
 
 static void msg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id) 
 {
 }
@@ -727,7 +727,7 @@ static int msg_lib_init_fn (void *conn)
 
 static void message_handler_req_exec_msg_queueopen (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queueopen *req_exec_msg_queueopen = (struct req_exec_msg_queueopen *)message;
 	struct res_lib_msg_queueopen res_lib_msg_queueopen;
@@ -838,7 +838,7 @@ error_exit:
 
 static void message_handler_req_exec_msg_queueclose (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queueclose *req_exec_msg_queueclose = (struct req_exec_msg_queueclose *)message;
 	struct res_lib_msg_queueclose res_lib_msg_queueclose;
@@ -874,7 +874,7 @@ error_exit:
 
 static void message_handler_req_exec_msg_queuestatusget (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_queuestatusget *req_exec_msg_queuestatusget =
@@ -885,7 +885,7 @@ static void message_handler_req_exec_msg_queuestatusget (
 
 static void message_handler_req_exec_msg_queueunlink (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_queueunlink *req_exec_msg_queueunlink =
@@ -896,7 +896,7 @@ static void message_handler_req_exec_msg_queueunlink (
 
 static void message_handler_req_exec_msg_queuegroupcreate (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queuegroupcreate *req_exec_msg_queuegroupcreate =
 		(struct req_exec_msg_queuegroupcreate *)message;
@@ -938,7 +938,7 @@ error_exit:
 
 static void message_handler_req_exec_msg_queuegroupinsert (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queuegroupinsert *req_exec_msg_queuegroupinsert =
 		(struct req_exec_msg_queuegroupinsert *)message;
@@ -985,7 +985,7 @@ error_exit:
 
 static void message_handler_req_exec_msg_queuegroupremove (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queuegroupremove *req_exec_msg_queuegroupremove =
 		(struct req_exec_msg_queuegroupremove *)message;
@@ -1029,7 +1029,7 @@ error_exit:
 
 static void message_handler_req_exec_msg_queuegroupdelete (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 	struct req_exec_msg_queuegroupdelete *req_exec_msg_queuegroupdelete =
 		(struct req_exec_msg_queuegroupdelete *)message;
@@ -1060,7 +1060,7 @@ static void message_handler_req_exec_msg_queuegroupdelete (
 
 static void message_handler_req_exec_msg_queuegrouptrack (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_queuegrouptrack *req_exec_msg_queuegrouptrack =
@@ -1071,7 +1071,7 @@ static void message_handler_req_exec_msg_queuegrouptrack (
 
 static void message_handler_req_exec_msg_queuegrouptrackstop (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_queuegrouptrackstop *req_exec_msg_queuegrouptrackstop =
@@ -1082,7 +1082,7 @@ static void message_handler_req_exec_msg_queuegrouptrackstop (
 
 static void message_handler_req_exec_msg_messagesend (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_messagesend *req_exec_msg_messagesend =
@@ -1093,7 +1093,7 @@ static void message_handler_req_exec_msg_messagesend (
 
 static void message_handler_req_exec_msg_messageget (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_messageget *req_exec_msg_messageget =
@@ -1104,7 +1104,7 @@ static void message_handler_req_exec_msg_messageget (
 
 static void message_handler_req_exec_msg_messagecancel (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_messagecancel *req_exec_msg_messagecancel =
@@ -1115,7 +1115,7 @@ static void message_handler_req_exec_msg_messagecancel (
 
 static void message_handler_req_exec_msg_messagesendreceive (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_messagesendreceive *req_exec_msg_messagesendreceive =
@@ -1126,7 +1126,7 @@ static void message_handler_req_exec_msg_messagesendreceive (
 
 static void message_handler_req_exec_msg_messagereply (
 	void *message,
-	struct totem_ip_address *source_addr)
+	unsigned int nodeid)
 {
 #if 0
 	struct req_exec_msg_messagereply *req_exec_msg_messagereply =

+ 4 - 4
exec/service.h

@@ -53,7 +53,7 @@ struct openais_lib_handler {
 };
 
 struct openais_exec_handler {
-	void (*exec_handler_fn) (void *msg, struct totem_ip_address *source_addr);
+	void (*exec_handler_fn) (void *msg, unsigned int nodeid);
 	void (*exec_endian_convert_fn) (void *msg);
 };
 
@@ -72,9 +72,9 @@ struct openais_service_handler {
 	int exec_service_count;
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id);
 	void (*sync_init) (void);
 	int (*sync_process) (void);

+ 16 - 16
exec/sync.c

@@ -62,7 +62,7 @@
 #define MESSAGE_REQ_SYNC_BARRIER 0
 
 struct barrier_data {
-	struct totem_ip_address addr;
+	unsigned int nodeid;
 	int completed;
 };
 
@@ -101,20 +101,20 @@ static void sync_service_init (struct memb_ring_id *ring_id);
 static int sync_service_process (enum totem_callback_token_type type, void *data);
 
 static void sync_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required);
 
 static void sync_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id);
 
 static void sync_primary_callback_fn (
-	struct totem_ip_address *view_list,
+	unsigned int *view_list,
 	int view_list_entries,
 	int primary_designated,
 	struct memb_ring_id *ring_id);
@@ -326,7 +326,7 @@ int sync_register (
 }
 
 static void sync_primary_callback_fn (
-	struct totem_ip_address *view_list,
+	unsigned int *view_list,
 	int view_list_entries,
 	int primary_designated,
 	struct memb_ring_id *ring_id)
@@ -351,7 +351,7 @@ static void sync_primary_callback_fn (
 	sync_callback_loaded = 0;
 	memset (&barrier_data_confchg, 0, sizeof (barrier_data_confchg));
 	for (i = 0; i < view_list_entries; i++) {
-		totemip_copy(&barrier_data_confchg[i].addr, &view_list[i]);
+		barrier_data_confchg[i].nodeid = view_list[i];
 		barrier_data_confchg[i].completed = 0;
 	}
 	memcpy (barrier_data_process, barrier_data_confchg,
@@ -371,7 +371,7 @@ void sync_endian_convert (struct req_exec_sync_barrier_start *req_exec_sync_barr
 }
 
 static void sync_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
@@ -403,9 +403,9 @@ static void sync_deliver_fn (
 	 * Set completion for source_addr's address
 	 */
 	for (i = 0; i < barrier_data_confchg_entries; i++) {
-		if (totemip_equal(source_addr,  &barrier_data_process[i].addr)) {
+		if (nodeid == barrier_data_process[i].nodeid) {
 			barrier_data_process[i].completed = 1;
-			log_printf (LOG_LEVEL_DEBUG,"Barrier Start Recieved From %s\n", totemip_print(&barrier_data_process[i].addr));
+			log_printf (LOG_LEVEL_DEBUG,"Barrier Start Recieved From %d\n", barrier_data_process[i].nodeid);
 			break;
 		}
 	}
@@ -414,8 +414,8 @@ static void sync_deliver_fn (
 	 * Test if barrier is complete
 	 */
 	for (i = 0; i < barrier_data_confchg_entries; i++) {
-		log_printf (LOG_LEVEL_DEBUG,"Barrier completion status for %s  = %d. \n", 
-			totemip_print(&barrier_data_process[i].addr),
+		log_printf (LOG_LEVEL_DEBUG,"Barrier completion status for nodeid %d = %d. \n", 
+			barrier_data_process[i].nodeid,
 			barrier_data_process[i].completed);
 		if (barrier_data_process[i].completed == 0) {
 			barrier_completed = 0;
@@ -449,9 +449,9 @@ static void sync_deliver_fn (
 
 static void sync_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	sync_ring_id = ring_id;

+ 14 - 5
exec/totem.h

@@ -35,11 +35,12 @@
 #define TOTEM_H_DEFINED
 #include "totemip.h"
 
-#define MESSAGE_SIZE_MAX			256000
-#define PROCESSOR_COUNT_MAX			32
-#define FRAME_SIZE_MAX				9000
-#define TRANSMITS_ALLOWED			16
-#define SEND_THREADS_MAX			16
+#define MESSAGE_SIZE_MAX	256000
+#define PROCESSOR_COUNT_MAX	32
+#define FRAME_SIZE_MAX		9000
+#define TRANSMITS_ALLOWED	16
+#define SEND_THREADS_MAX	16
+#define INTERFACE_MAX		2
 
 /*
  * Array location of various timeouts as
@@ -117,6 +118,14 @@ struct totem_config {
 
 	unsigned int seqno_unchanged_const;
 
+	unsigned int rrp_token_expired_timeout;
+
+	unsigned int rrp_problem_count_timeout;
+
+	unsigned int rrp_problem_count_threshold;
+
+	char rrp_mode[64];
+
 	struct totem_logging_configuration totem_logging_configuration;
 
 	unsigned int secauth;

+ 60 - 23
exec/totemconfig.c

@@ -64,13 +64,16 @@
 #define JOIN_TIMEOUT				100
 #define CONSENSUS_TIMEOUT			200
 #define MERGE_TIMEOUT				200
-#define DOWNCHECK_TIMEOUT			1000
+#define DOWNCHECK_TIMEOUT			1000000
 #define FAIL_TO_RECV_CONST			50
 #define	SEQNO_UNCHANGED_CONST			30
 #define MINIMUM_TIMEOUT				(int)(1000/HZ)*3
 #define MAX_NETWORK_DELAY			50
 #define WINDOW_SIZE				50
 #define MAX_MESSAGES				17
+#define RRP_PROBLEM_COUNT_TIMEOUT		2000
+#define RRP_PROBLEM_COUNT_THRESHOLD_DEFAULT	10
+#define RRP_PROBLEM_COUNT_THRESHOLD_MIN		5
 
 static char error_string_response[512];
 
@@ -114,19 +117,17 @@ static inline void objdb_get_int (
 extern int totem_config_read (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string,
-	int interface_max)
+	char **error_string)
 {
 	int res = 0;
 	int parse_done = 0;
 	unsigned int object_totem_handle;
 	unsigned int object_interface_handle;
 	char *str;
-	char *error_reason = error_string_response;
 	unsigned int ringnumber = 0;
 
 	memset (totem_config, 0, sizeof (struct totem_config));
-	totem_config->interfaces = malloc (sizeof (struct totem_interface) * interface_max);
+	totem_config->interfaces = malloc (sizeof (struct totem_interface) * INTERFACE_MAX);
 	if (totem_config->interfaces == 0) {
 		parse_done = 1;
 		*error_string = "Out of memory trying to allocate ethernet interface storage area";
@@ -134,7 +135,7 @@ extern int totem_config_read (
 	}
 
 	memset (totem_config->interfaces, 0,
-		sizeof (struct totem_interface) * interface_max);
+		sizeof (struct totem_interface) * INTERFACE_MAX);
 
 	totem_config->secauth = 1;
 
@@ -164,6 +165,9 @@ extern int totem_config_read (
 				totem_config->secauth = 0;
 			}
 		}
+		if (!objdb_get_string (objdb, object_totem_handle, "rrp_mode", &str)) {
+			strcpy (totem_config->rrp_mode, str);
+		}
 
 		/*
 		 * Get interface node id
@@ -195,6 +199,12 @@ extern int totem_config_read (
 
 		objdb_get_int (objdb,object_totem_handle, "seqno_unchanged_const", &totem_config->seqno_unchanged_const);
 
+		objdb_get_int (objdb,object_totem_handle, "rrp_token_expired_timeout", &totem_config->rrp_token_expired_timeout);
+
+		objdb_get_int (objdb,object_totem_handle, "rrp_problem_count_timeout", &totem_config->rrp_problem_count_timeout);
+
+		objdb_get_int (objdb,object_totem_handle, "rrp_problem_count_threshold", &totem_config->rrp_problem_count_threshold);
+
 		objdb_get_int (objdb,object_totem_handle, "heartbeat_failures_allowed", &totem_config->heartbeat_failures_allowed);
 
 		objdb_get_int (objdb,object_totem_handle, "max_network_delay", &totem_config->max_network_delay);
@@ -210,13 +220,6 @@ extern int totem_config_read (
 		    strlen ("interface"),
 		    &object_interface_handle) == 0) {
 
-		if (interface_max == totem_config->interface_count) {
-			sprintf (error_reason,
-				 "%d is too many configured interfaces",
-				 totem_config->interface_count);
-			goto parse_error;
-		}
-
 		objdb_get_int (objdb, object_interface_handle, "ringnumber", &ringnumber);
 
 		/*
@@ -245,14 +248,6 @@ extern int totem_config_read (
 
 	return 0;
 
-parse_error:
-
-	sprintf (error_string_response,
-		 "parse error in config %s.\n",
-		 error_reason);
-
-	*error_string = error_string_response;
-
 	return (-1);
 }
 
@@ -261,8 +256,10 @@ int totem_config_validate (
 	char **error_string)
 {
 	static char local_error_reason[512];
+	char parse_error[512];
 	char *error_reason = local_error_reason;
 	int i;
+	unsigned int interface_max = INTERFACE_MAX;
 
 	if (totem_config->interface_count == 0) {
 		error_reason = "No interfaces defined";
@@ -423,6 +420,46 @@ int totem_config_validate (
 		goto parse_error;
 	}
 
+	if (totem_config->rrp_problem_count_timeout == 0) {
+		totem_config->rrp_problem_count_timeout = RRP_PROBLEM_COUNT_TIMEOUT;
+	}
+	if (totem_config->rrp_problem_count_timeout < MINIMUM_TIMEOUT) {
+		sprintf (local_error_reason, "The RRP problem count timeout parameter (%d ms) may not be less then (%d ms).",
+			totem_config->rrp_problem_count_timeout, MINIMUM_TIMEOUT);
+		goto parse_error;
+	}
+	if (totem_config->rrp_problem_count_threshold == 0) {
+		totem_config->rrp_problem_count_threshold = RRP_PROBLEM_COUNT_THRESHOLD_DEFAULT;
+	}
+	if (totem_config->rrp_problem_count_threshold < RRP_PROBLEM_COUNT_THRESHOLD_MIN) {
+		sprintf (local_error_reason, "The RRP problem count threshold (%d problem count) may not be less then (%d problem count).",
+			totem_config->rrp_problem_count_threshold, RRP_PROBLEM_COUNT_THRESHOLD_MIN);
+		goto parse_error;
+	}
+	if (totem_config->rrp_token_expired_timeout == 0) {
+		totem_config->rrp_token_expired_timeout =
+			totem_config->token_retransmit_timeout;
+	}
+		
+	if (totem_config->rrp_token_expired_timeout < MINIMUM_TIMEOUT) {
+		sprintf (local_error_reason, "The RRP token expired timeout parameter (%d ms) may not be less then (%d ms).",
+			totem_config->rrp_token_expired_timeout, MINIMUM_TIMEOUT);
+		goto parse_error;
+	}
+
+	if (strcmp (totem_config->rrp_mode, "none") == 0) {
+		interface_max = 1;
+	}
+	if (interface_max < totem_config->interface_count) {
+		sprintf (parse_error,
+			"%d is too many configured interfaces for the rrp_mode setting %s.",
+			totem_config->interface_count,
+			totem_config->rrp_mode);
+		error_reason = parse_error;
+		goto parse_error;
+	}
+
+
 	if (totem_config->fail_to_recv_const == 0) {
 		totem_config->fail_to_recv_const = FAIL_TO_RECV_CONST;
 	}
@@ -433,9 +470,9 @@ int totem_config_validate (
 		totem_config->net_mtu = 1500;
 	}
 
-	if ((256000 / totem_config->net_mtu) < totem_config->max_messages) {
+	if ((MESSAGE_SIZE_MAX / totem_config->net_mtu) < totem_config->max_messages) {
 		sprintf (local_error_reason, "The max_messages parameter (%d messages) may not be greater then (%d messages).",
-			totem_config->max_messages, 256000/totem_config->net_mtu);
+			totem_config->max_messages, MESSAGE_SIZE_MAX / totem_config->net_mtu);
 		goto parse_error;
 	}
 

+ 1 - 2
exec/totemconfig.h

@@ -45,8 +45,7 @@
 extern int totem_config_read (
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
-	char **error_string,
-	int interface_max);
+	char **error_string);
 	
 extern int totem_config_validate (
 	struct totem_config *totem_config,

+ 29 - 13
exec/totemmrp.c

@@ -60,32 +60,32 @@
 totemsrp_handle totemsrp_handle_in;
 
 void (*pg_deliver_fn) (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required) = 0;
 
 void (*pg_confchg_fn) (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id) = 0;
 
 void totemmrp_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
 {
-	pg_deliver_fn (source_addr, iovec, iov_len, endian_conversion_required);
+	pg_deliver_fn (nodeid, iovec, iov_len, endian_conversion_required);
 }
 
 void totemmrp_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	pg_confchg_fn (configuration_type,
@@ -103,15 +103,15 @@ int totemmrp_initialize (
 	struct totem_config *totem_config,
 
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id))
 {
 	int result;
@@ -171,3 +171,19 @@ void totemmrp_callback_token_destroy (
 void totemmrp_new_msg_signal (void) {
 	totemsrp_new_msg_signal (totemsrp_handle_in);
 }
+
+int totemmrp_interfaces_get (
+	unsigned int nodeid,
+	struct totem_ip_address *interfaces,
+	unsigned int *iface_count)
+{
+	int res;
+
+	res = totemsrp_interfaces_get (
+		totemsrp_handle_in,
+		nodeid,
+		interfaces,
+		iface_count);
+
+	return (res);
+}

+ 17 - 14
exec/totemmrp.h

@@ -37,8 +37,6 @@
 #include "totem.h"
 #include "aispoll.h"
 
-#define TOTEMMRP_PACKET_SIZE_MAX	1404
-
 /*
  * Totem Single Ring Protocol
  * depends on poll abstraction, POSIX, IPV4
@@ -46,7 +44,7 @@
 /*
  * Initialize the logger
  */
-void totemmrp_log_printf_init (
+extern void totemmrp_log_printf_init (
 	void (*log_printf) (int , char *, ...),
 	int log_level_security,
 	int log_level_error,
@@ -57,28 +55,28 @@ void totemmrp_log_printf_init (
 /*
  * Initialize the group messaging interface
  */
-int totemmrp_initialize (
+extern int totemmrp_initialize (
 	poll_handle poll_handle,
 	struct totem_config *totem_config,
 
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 
-int totemmrp_finalize (void);
+extern int totemmrp_finalize (void);
 
 /*
  * Multicast a message
  */
-int totemmrp_mcast (
+extern int totemmrp_mcast (
 	struct iovec *iovec,
 	int iov_len,
 	int priority);
@@ -86,18 +84,23 @@ int totemmrp_mcast (
 /*
  * Return number of available messages that can be queued
  */
-int totemmrp_avail (void);
+extern int totemmrp_avail (void);
 
-int totemmrp_callback_token_create (
+extern int totemmrp_callback_token_create (
 	void **handle_out,
 	enum totem_callback_token_type type,
 	int delete,
 	int (*callback_fn) (enum totem_callback_token_type type, void *),
 	void *data);
 
-void totemmrp_callback_token_destroy (
+extern void totemmrp_callback_token_destroy (
 	void *handle_out);
 
-void totemmrp_new_msg_signal (void);
+extern void totemmrp_new_msg_signal (void);
+
+extern int totemmrp_interfaces_get (
+	unsigned int nodeid,
+	struct totem_ip_address *interfaces,
+	unsigned int *iface_count);
 
 #endif /* TOTEMMRP_H_DEFINED */

+ 67 - 7
exec/totemnet.c

@@ -117,7 +117,6 @@ struct totemnet_instance {
 
 	void (*totemnet_deliver_fn) (
 		void *context,
-		struct totem_ip_address *system_from,
 		void *msg,
 		int msg_len);
 
@@ -177,6 +176,8 @@ struct totemnet_instance {
 	int flushing;
 
 	struct totem_config *totem_config;
+
+	struct totem_ip_address token_target;
 };
 
 struct work_item {
@@ -612,7 +613,6 @@ static int net_deliver_fn (
 	struct iovec *iovec;
 	struct security_header *security_header;
 	struct sockaddr_storage system_from;
-	struct totem_ip_address from_address;
 	int bytes_received;
 	int res = 0;
 	unsigned char *msg_offset;
@@ -648,7 +648,6 @@ static int net_deliver_fn (
 		log_printf (instance->totemnet_log_level_security, "Received message is too short...  ignoring %d.\n", bytes_received);
 		return (0);
 	}
-	totemip_sockaddr_to_totemip_convert(&system_from, &from_address);
 
 	security_header = (struct security_header *)iovec->iov_base;
 
@@ -678,7 +677,6 @@ static int net_deliver_fn (
 	 */
 	instance->totemnet_deliver_fn (
 		instance->context,
-		&from_address,
 		msg_offset,
 		size_delv);
 		
@@ -1165,7 +1163,6 @@ int totemnet_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		struct totem_ip_address *system_from,
 		void *msg,
 		int msg_len),
 
@@ -1342,7 +1339,6 @@ error_exit:
 
 int totemnet_token_send (
 	totemnet_handle handle,
-	struct totem_ip_address *system_to,
 	struct iovec *iovec,
 	int iov_len)
 {
@@ -1356,7 +1352,7 @@ int totemnet_token_send (
 		goto error_exit;
 	}
 
-	ucast_sendmsg (instance, system_to, iovec, iov_len);
+	ucast_sendmsg (instance, &instance->token_target, iovec, iov_len);
 
 	hdb_handle_put (&totemnet_instance_database, handle);
 
@@ -1447,3 +1443,67 @@ extern void totemnet_net_mtu_adjust (struct totem_config *totem_config)
 		totem_config->net_mtu -= UDPIP_HEADER_SIZE;
 	}
 }
+
+char *totemnet_iface_print (totemnet_handle handle)  {
+	struct totemnet_instance *instance;
+	int res = 0;
+	char *ret_char;
+
+	res = hdb_handle_get (&totemnet_instance_database, handle,
+		(void *)&instance);
+	if (res != 0) {
+		ret_char = "Invalid totemnet handle";
+		goto error_exit;
+	}
+	
+	ret_char = (char *)totemip_print (&instance->my_id);
+
+	hdb_handle_put (&totemnet_instance_database, handle);
+error_exit:
+	return (ret_char);
+}
+
+int totemnet_iface_get (
+	totemnet_handle handle,
+	struct totem_ip_address *addr)
+{
+	struct totemnet_instance *instance;
+	unsigned int res;
+
+	res = hdb_handle_get (&totemnet_instance_database, handle,
+		(void *)&instance);
+	if (res != 0) {
+		goto error_exit;
+	}
+	
+	memcpy (addr, &instance->my_id, sizeof (struct totem_ip_address));
+
+	hdb_handle_put (&totemnet_instance_database, handle);
+
+error_exit:
+	return (res);
+}
+
+int totemnet_token_target_set (
+	totemnet_handle handle,
+	struct totem_ip_address *token_target)
+{
+	struct totemnet_instance *instance;
+	unsigned int res;
+
+	res = hdb_handle_get (&totemnet_instance_database, handle,
+		(void *)&instance);
+	if (res != 0) {
+		goto error_exit;
+	}
+	
+	memcpy (&instance->token_target, token_target,
+		sizeof (struct totem_ip_address));
+
+	hdb_handle_put (&totemnet_instance_database, handle);
+
+error_exit:
+	return (res);
+}
+
+

+ 10 - 2
exec/totemnet.h

@@ -61,7 +61,6 @@ extern int totemnet_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		struct totem_ip_address *system_from,
 		void *msg,
 		int msg_len),
 
@@ -75,7 +74,6 @@ extern int totemnet_processor_count_set (
 
 extern int totemnet_token_send (
 	totemnet_handle handle,
-	struct totem_ip_address *system_to,
 	struct iovec *iovec,
 	int iov_len);
 
@@ -99,4 +97,14 @@ extern int totemnet_finalize (totemnet_handle handle);
 
 extern void totemnet_net_mtu_adjust (struct totem_config *totem_config);
 
+extern char *totemnet_iface_print (totemnet_handle handle);
+
+extern int totemnet_iface_get (
+	totemnet_handle handle,
+	struct totem_ip_address *addr);
+
+extern int totemnet_token_target_set (
+	totemnet_handle handle,
+	struct totem_ip_address *token_target);
+
 #endif /* TOTEMNET_H_DEFINED */

+ 65 - 26
exec/totempg.c

@@ -153,7 +153,7 @@ static void (*totempg_log_printf) (char *file, int line, int level, char *format
 struct totem_config *totempg_totem_config;
 
 struct assembly {
-	struct totem_ip_address addr;
+	unsigned int nodeid;
 	unsigned char data[MESSAGE_SIZE_MAX];
 	int index;
 	unsigned char last_frag_num;
@@ -183,16 +183,16 @@ static struct iovec iov_delv;
 static unsigned int totempg_max_handle = 0;
 struct totempg_group_instance {
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required);
 
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id);
 
 	struct totempg_group *groups;
@@ -220,12 +220,12 @@ static pthread_mutex_t mcast_msg_mutex = PTHREAD_MUTEX_INITIALIZER;
 #define log_printf(level, format, args...) \
     totempg_log_printf (__FILE__, __LINE__, level, format, ##args)
 
-static struct assembly *find_assembly (struct totem_ip_address *addr)
+static struct assembly *find_assembly (unsigned int nodeid)
 {
 	int i;
 
 	for (i = 0; i < assembly_list_entries; i++) {
-		if (totemip_equal(addr, &assembly_list[i]->addr)) {
+		if (nodeid == assembly_list[i]->nodeid) {
 			return (assembly_list[i]);
 		}
 	}
@@ -234,9 +234,9 @@ static struct assembly *find_assembly (struct totem_ip_address *addr)
 
 static inline void app_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	int i;
@@ -322,7 +322,7 @@ static inline int group_matches (
 	
 
 static inline void app_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	unsigned int iov_len,
 	int endian_conversion_required)
@@ -346,7 +346,7 @@ static inline void app_deliver_fn (
 				stripped_iovec.iov_len = iovec->iov_len - adjust_iovec;
 				stripped_iovec.iov_base = (char *)iovec->iov_base + adjust_iovec;
 				instance->deliver_fn (
-					source_addr,
+					nodeid,
 					&stripped_iovec,
 					iov_len,
 					endian_conversion_required);
@@ -358,9 +358,9 @@ static inline void app_deliver_fn (
 }
 static void totempg_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	int i;
@@ -374,7 +374,7 @@ static void totempg_confchg_fn (
 	 */
 	for (i = 0; i < left_list_entries; i++) {
 		for (j = 0; j < assembly_list_entries; j++) {
-			if (totemip_equal(&left_list[i], &assembly_list[j]->addr)) {
+			if (left_list[i] == assembly_list[j]->nodeid) {
 				assembly_list[j]->index = 0;
 			}
 		}
@@ -386,7 +386,7 @@ static void totempg_confchg_fn (
 	for (i = 0; i < member_list_entries; i++) {
 		found = 0;
 		for (j = 0; j < assembly_list_entries; j++) {
-			if (totemip_equal(&member_list[i], &assembly_list[j]->addr)) {
+			if (member_list[i] == assembly_list[j]->nodeid) {
 				found = 1; 
 				break;
 			}
@@ -395,8 +395,8 @@ static void totempg_confchg_fn (
 			assembly_list[assembly_list_entries] =
 				malloc (sizeof (struct assembly));
 			assert (assembly_list[assembly_list_entries]); // TODO
-			totemip_copy(&assembly_list[assembly_list_entries]->addr, 
-				     &member_list[i]);
+			assembly_list[assembly_list_entries]->nodeid =
+				member_list[i];
 			assembly_list[assembly_list_entries]->index = 0;
 			assembly_list_entries += 1;
 		}
@@ -410,7 +410,7 @@ static void totempg_confchg_fn (
 }
 
 static void totempg_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
@@ -426,7 +426,7 @@ static void totempg_deliver_fn (
 	int continuation;
 	int start;
 
-	assembly = find_assembly (source_addr);
+	assembly = find_assembly (nodeid);
 	assert (assembly);
 
 	/*
@@ -541,7 +541,7 @@ static void totempg_deliver_fn (
 	}
 
 	for  (i = start; i < msg_count; i++) {
-		app_deliver_fn(source_addr, &iov_delv, 1,
+		app_deliver_fn(nodeid, &iov_delv, 1,
 			endian_conversion_required);
 		assembly->index += msg_lens[i];
 		iov_delv.iov_base = &assembly->data[assembly->index];
@@ -865,16 +865,16 @@ int totempg_groups_initialize (
 	totempg_groups_handle *handle,
 
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
 
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id))
 {
 	struct totempg_group_instance *instance;
@@ -1134,3 +1134,42 @@ error_exit:
 	return (res);
 }
 
+int totempg_ifaces_get (
+	unsigned int nodeid,
+	struct totem_ip_address *interfaces,
+	unsigned int *iface_count)
+{
+	int res;
+
+	res = totemmrp_interfaces_get (
+		nodeid,
+		interfaces,
+		iface_count);
+
+	return (res);
+}
+
+char *totempg_ifaces_print (unsigned int nodeid)
+{
+	static char iface_string[256 * INTERFACE_MAX];
+	char one_iface[32];
+	struct totem_ip_address interfaces[INTERFACE_MAX];
+	unsigned int iface_count;
+	unsigned int i;
+	int res;
+
+	iface_string[0] = '\0';
+
+	res = totempg_ifaces_get (nodeid, interfaces, &iface_count);
+	if (res == -1) {
+		return ("no interface found for nodeid");
+	}
+
+	for (i = 0; i < iface_count; i++) {
+		sprintf (one_iface, "r(%d) ip(%s) ",
+			i, totemip_print (&interfaces[i]));
+		strcat (iface_string, one_iface);
+	}
+	return (iface_string);
+}
+

+ 23 - 16
exec/totempg.h

@@ -58,65 +58,65 @@ struct totempg_group {
 /*
  * Initialize the totem process groups abstraction
  */
-int totempg_initialize (
+extern int totempg_initialize (
 	poll_handle poll_handle,
 	struct totem_config *totem_config
 );
 
-void totempg_finalize (void);
+extern void totempg_finalize (void);
 
-int totempg_callback_token_create (void **handle_out,
+extern int totempg_callback_token_create (void **handle_out,
 	enum totem_callback_token_type type,
 	int delete,
 	int (*callback_fn) (enum totem_callback_token_type type, void *),
 	void *data);
 
-void totempg_callback_token_destroy (void *handle);
+extern void totempg_callback_token_destroy (void *handle);
 
 /*
  * Initialize a groups instance
  */
-int totempg_groups_initialize (
+extern int totempg_groups_initialize (
 	totempg_groups_handle *handle,
 
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
 
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 
-int totempg_groups_finalize (
+extern int totempg_groups_finalize (
 	totempg_groups_handle handle);
 
-int totempg_groups_join (
+extern int totempg_groups_join (
 	totempg_groups_handle handle,
 	struct totempg_group *groups,
 	int gruop_cnt);
 
-int totempg_groups_leave (
+extern int totempg_groups_leave (
 	totempg_groups_handle handle,
 	struct totempg_group *groups,
 	int gruop_cnt);
 
-int totempg_groups_mcast_joined (
+extern int totempg_groups_mcast_joined (
 	totempg_groups_handle handle,
 	struct iovec *iovec,
 	int iov_len,
 	int guarantee);
 
-int totempg_groups_send_ok_joined (
+extern int totempg_groups_send_ok_joined (
 	totempg_groups_handle handle,
 	struct iovec *iovec,
 	int iov_len);
 	
-int totempg_groups_mcast_groups (
+extern int totempg_groups_mcast_groups (
 	totempg_groups_handle handle,
 	int guarantee,
 	struct totempg_group *groups,
@@ -124,11 +124,18 @@ int totempg_groups_mcast_groups (
 	struct iovec *iovec,
 	int iov_len);
 
-int totempg_groups_send_ok_groups (
+extern int totempg_groups_send_ok_groups (
 	totempg_groups_handle handle,
 	struct totempg_group *groups,
 	int groups_cnt,
 	struct iovec *iovec,
 	int iov_len);
 	
+extern int totempg_ifaces_get (
+	unsigned int nodeid,
+        struct totem_ip_address *interfaces,
+        unsigned int *iface_count);
+
+extern char *totempg_ifaces_print (unsigned int nodeid);
+
 #endif /* TOTEMPG_H_DEFINED */

Plik diff jest za duży
+ 671 - 84
exec/totemrrp.c


+ 16 - 4
exec/totemrrp.h

@@ -61,18 +61,21 @@ extern int totemrrp_initialize (
 
 	void (*deliver_fn) (
 		void *context,
-		struct totem_ip_address *system_from,
 		void *msg,
 		int msg_len),
 
 	void (*iface_change_fn) (
 		void *context,
-		struct totem_ip_address *iface_addr),
+		struct totem_ip_address *iface_addr,
+		unsigned int iface_no),
 
 	void (*token_seqid_get) (
 		void *msg,
 		unsigned int *seqid,
-		unsigned int *token_is));
+		unsigned int *token_is),
+
+	unsigned int (*msgs_missing) (void));
+
 
 extern int totemrrp_processor_count_set (
 	totemrrp_handle handle,
@@ -80,7 +83,6 @@ extern int totemrrp_processor_count_set (
 
 extern int totemrrp_token_send (
 	totemrrp_handle handle,
-	struct totem_ip_address *system_to,
 	struct iovec *iovec,
 	unsigned int iov_len);
 
@@ -98,8 +100,18 @@ extern int totemrrp_recv_flush (totemrrp_handle handle);
 
 extern int totemrrp_send_flush (totemrrp_handle handle);
 
+extern int totemrrp_token_target_set (
+	totemrrp_handle handle,
+	struct totem_ip_address *target,
+	unsigned int iface_no);
+
 extern int totemrrp_iface_check (totemrrp_handle handle);
 
 extern int totemrrp_finalize (totemrrp_handle handle);
 
+extern int totemrrp_interfaces_get (
+	totemrrp_handle handle,
+	struct totem_ip_address *interfaces,
+	unsigned int *iface_count);
+
 #endif /* TOTEMRRP_H_DEFINED */

Plik diff jest za duży
+ 251 - 122
exec/totemsrp.c


+ 10 - 4
exec/totemsrp.h

@@ -53,15 +53,15 @@ int totemsrp_initialize (
 	struct totem_config *totem_config,
 
 	void (*deliver_fn) (
-		struct totem_ip_address *source_addr,
+		unsigned int nodeid,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
-		struct totem_ip_address *member_list, int member_list_entries,
-		struct totem_ip_address *left_list, int left_list_entries,
-		struct totem_ip_address *joined_list, int joined_list_entries,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 
 void totemsrp_finalize (totemsrp_handle handle);
@@ -96,4 +96,10 @@ int totemsrp_new_msg_signal (totemsrp_handle handle);
 
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 
+extern int totemsrp_interfaces_get (
+	totemsrp_handle handle,
+	unsigned int nodeid,
+	struct totem_ip_address *interfaces,
+	unsigned int *iface_count);
+
 #endif /* TOTEMSRP_H_DEFINED */

+ 1 - 1
exec/vsf.h

@@ -41,7 +41,7 @@ struct openais_vsf_iface_ver0 {
 	 */
 	int (*init) (
 	    void (*primary_callback_fn) (
-		struct totem_ip_address *view_list,
+		unsigned int *view_list,
 		int view_list_entries,
 		int primary_designated,
 		struct memb_ring_id *ring_id));

+ 19 - 17
exec/vsf_ykd.c

@@ -75,7 +75,7 @@ struct ykd_header {
 };
 
 struct ykd_session {
-	struct totem_ip_address member_list[PROCESSOR_COUNT_MAX];
+	unsigned int member_list[PROCESSOR_COUNT_MAX];
 	int member_list_entries;
 	int session_id;
 };
@@ -95,7 +95,7 @@ struct ykd_state {
 };
 
 struct state_received {
-	struct totem_ip_address addr;
+	unsigned int nodeid;
 	int received;
 	struct ykd_state ykd_state;
 };
@@ -114,7 +114,7 @@ static int state_received_process_entries;
 
 static enum ykd_mode ykd_mode;
 
-static struct totem_ip_address view_list[PROCESSOR_COUNT_MAX];
+static unsigned int view_list[PROCESSOR_COUNT_MAX];
 
 static int view_list_entries;
 
@@ -135,7 +135,7 @@ static void *ykd_attempt_send_callback_token_handle = 0;
 static void *ykd_state_send_callback_token_handle = 0;
 
 static void (*ykd_primary_callback_fn) (
-	struct totem_ip_address *view_list,
+	unsigned int *view_list,
 	int view_list_entries,
 	int primary_designated,
 	struct memb_ring_id *ring_id) = NULL;
@@ -244,7 +244,7 @@ static void compute (void)
 }
 
 static int subquorum (
-	struct totem_ip_address *member_list,
+	unsigned int *member_list,
 	int member_list_entries,
 	struct ykd_session *session)
 {
@@ -254,7 +254,7 @@ static int subquorum (
 
 	for (i = 0; i < member_list_entries; i++) {
 		for (j = 0; j < session->member_list_entries; j++) {
-			if (totemip_equal (&member_list[i], &session->member_list[j])) {
+			if (member_list[i] == session->member_list[j]) {
 				intersections += 1;
 			}
 		}
@@ -303,7 +303,7 @@ static void ykd_session_endian_convert (struct ykd_session *ykd_session)
 	ykd_session->member_list_entries = swab32 (ykd_session->member_list_entries);
 	ykd_session->session_id = swab32 (ykd_session->session_id);
 	for (i = 0; i < ykd_session->member_list_entries; i++) {
-		totemip_copy_endian_convert (&ykd_session->member_list[i], &ykd_session->member_list[i]);
+// TODO		totemip_copy_endian_convert (&ykd_session->member_list[i], &ykd_session->member_list[i]);
 	}
 }
 
@@ -326,7 +326,7 @@ static void ykd_state_endian_convert (struct ykd_state *ykd_state)
 }
 
 static void ykd_deliver_fn (
-	struct totem_ip_address *source_addr,
+	unsigned int nodeid,
 	struct iovec *iovec,
 	int iov_len,
 	int endian_conversion_required)
@@ -339,6 +339,7 @@ static void ykd_deliver_fn (
 	/*
 	 * If this is a localhost address, this node is always primary
 	 */
+#ifdef TODO
 	if (totemip_localhost_check (source_addr)) {
 		log_printf (LOG_LEVEL_NOTICE,
 			"This processor is within the primary component.\n");
@@ -351,6 +352,7 @@ static void ykd_deliver_fn (
 				&ykd_ring_id);
 		return;
 	}
+#endif
 	if (endian_conversion_required) {
 		ykd_state_endian_convert ((struct ykd_state *)msg_state);
 	}
@@ -359,7 +361,7 @@ static void ykd_deliver_fn (
 	 * Set completion for source_addr's address
 	 */
 	for (state_position = 0; state_position < state_received_confchg_entries; state_position++) {
-		if (totemip_equal(source_addr, &state_received_process[state_position].addr)) {
+		if (nodeid == state_received_process[state_position].nodeid) {
 			/*
 			 * State position contains the address of the state to modify
 			 * This may be used later by the other algorithms
@@ -402,7 +404,7 @@ static void ykd_deliver_fn (
 				if (decide ()) {
 					ykd_state.session_id = session_id_max + 1;
 					memcpy (ykd_state.ambiguous_sessions[ykd_state.ambiguous_sessions_entries].member_list,
-						view_list, sizeof (struct totem_ip_address) * view_list_entries);
+						view_list, sizeof (unsigned int) * view_list_entries);
 						ykd_state.ambiguous_sessions[ykd_state.ambiguous_sessions_entries].member_list_entries = view_list_entries;
 						ykd_state.ambiguous_sessions_entries += 1;
 					ykd_attempt_send();
@@ -434,9 +436,9 @@ static void ykd_deliver_fn (
 int first_run = 1;
 static void ykd_confchg_fn (
 	enum totem_configuration_type configuration_type,
-	struct totem_ip_address *member_list, int member_list_entries,
-	struct totem_ip_address *left_list, int left_list_entries,
-	struct totem_ip_address *joined_list, int joined_list_entries,
+	unsigned int *member_list, int member_list_entries,
+	unsigned int *left_list, int left_list_entries,
+	unsigned int *joined_list, int joined_list_entries,
 	struct memb_ring_id *ring_id)
 {
 	int i;
@@ -448,13 +450,13 @@ static void ykd_confchg_fn (
 	memcpy (&ykd_ring_id, ring_id, sizeof (struct memb_ring_id));
 
 	if (first_run) {
-		totemip_copy (&ykd_state.last_primary.member_list[0], this_ip);
+		ykd_state.last_primary.member_list[0] = this_ip->nodeid;
 		ykd_state.last_primary.member_list_entries = 1;
 		ykd_state.last_primary.session_id = 0;
 		first_run = 0;
 	}
 	memcpy (view_list, member_list,
-		member_list_entries * sizeof (struct totem_ip_address));
+		member_list_entries * sizeof (unsigned int));
 	view_list_entries = member_list_entries;
 
 	ykd_mode = YKD_MODE_SENDSTATE;
@@ -469,7 +471,7 @@ static void ykd_confchg_fn (
 
 	memset (&state_received_confchg, 0, sizeof (state_received_confchg));
 	for (i = 0; i < member_list_entries; i++) {
-		totemip_copy(&state_received_confchg[i].addr, &member_list[i]);
+		state_received_confchg[i].nodeid = member_list[i];
 		state_received_confchg[i].received = 0;
 	}
 	memcpy (state_received_process, state_received_confchg,
@@ -488,7 +490,7 @@ struct totempg_group ykd_group = {
 
 static int ykd_init (
 	void (*primary_callback_fn) (
-		struct totem_ip_address *view_list,
+		unsigned int *view_list,
 		int view_list_entries,
 		int primary_designated,
 		struct memb_ring_id *ring_id))

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików