Просмотр исходного кода

32/64/mixed endian support for checkpoint service.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1074 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 19 лет назад
Родитель
Сommit
01afe82393
44 измененных файлов с 1291 добавлено и 796 удалено
  1. 5 0
      TODO
  2. 9 9
      exec/Makefile
  3. 4 3
      exec/amf.c
  4. 2 2
      exec/amf.h
  5. 1 0
      exec/amfcomp.c
  6. 1 1
      exec/amfutil.c
  7. 267 204
      exec/ckpt.c
  8. 7 2
      exec/clm.c
  9. 17 15
      exec/cpg.c
  10. 1 0
      exec/evs.c
  11. 1 0
      exec/evt.c
  12. 15 14
      exec/ipc.c
  13. 2 2
      exec/ipc.h
  14. 24 23
      exec/lck.c
  15. 3 3
      exec/main.c
  16. 0 10
      exec/main.h
  17. 33 32
      exec/msg.c
  18. 1 1
      exec/print.c
  19. 1 1
      exec/sync.c
  20. 14 0
      exec/util.c
  21. 7 5
      exec/util.h
  22. 35 35
      include/ipc_amf.h
  23. 8 8
      include/ipc_cfg.h
  24. 137 143
      include/ipc_ckpt.h
  25. 9 9
      include/ipc_clm.h
  26. 12 12
      include/ipc_cpg.h
  27. 13 13
      include/ipc_evs.h
  28. 17 17
      include/ipc_evt.h
  29. 46 40
      include/ipc_gen.h
  30. 17 17
      include/ipc_lck.h
  31. 35 35
      include/ipc_msg.h
  32. 294 0
      include/mar_ckpt.h
  33. 102 2
      include/mar_gen.h
  34. 0 0
      include/swab.h
  35. 4 4
      lib/amf.c
  36. 93 82
      lib/ckpt.c
  37. 4 4
      lib/clm.c
  38. 9 9
      lib/cpg.c
  39. 4 4
      lib/evs.c
  40. 5 5
      lib/evt.c
  41. 8 8
      lib/lck.c
  42. 4 4
      lib/msg.c
  43. 8 13
      lib/util.c
  44. 12 5
      test/testckpt.c

+ 5 - 0
TODO

@@ -31,6 +31,7 @@ Totem
 
 YKD Virtual Synchrony Filter
 ----------------------------
+* P1 32/64 bit cross-endian must be working.
 * P2 Scale to 128 processors.
 
 LCR
@@ -104,3 +105,7 @@ Extended Virtual Synchrony Passthrough Interface
 IPC
 ---
 * There are no TODOs for the IPC system.
+
+SYNC
+----
+* P1 32/64 bit cross-endian must be working.

+ 9 - 9
exec/Makefile

@@ -262,19 +262,19 @@ totemconfig.o: totemconfig.c
 # DO NOT DELETE
 
 aispoll.o: aispoll.h ../include/list.h ../include/hdb.h tlist.h
-totemip.o: totemip.h swab.h
+totemip.o: totemip.h ../include/swab.h
 totemnet.o: aispoll.h totemnet.h totem.h totemip.h wthread.h
 totemnet.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemnet.o: ../include/hdb.h swab.h crypto.h
+totemnet.o: ../include/hdb.h ../include/swab.h crypto.h
 totemrrp.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemrrp.o: ../include/hdb.h swab.h aispoll.h totemnet.h totem.h totemip.h
+totemrrp.o: ../include/hdb.h ../include/swab.h aispoll.h totemnet.h totem.h totemip.h
 totemrrp.o: totemrrp.h
 totemsrp.o: aispoll.h totemsrp.h totem.h totemip.h totemrrp.h wthread.h
 totemsrp.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemsrp.o: ../include/hdb.h swab.h crypto.h
+totemsrp.o: ../include/hdb.h ../include/swab.h crypto.h
 totemmrp.o: totem.h totemip.h totemsrp.h aispoll.h
 totempg.o: ../include/hdb.h totempg.h aispoll.h totemsrp.h totem.h totemip.h
-totempg.o: totemmrp.h swab.h
+totempg.o: totemmrp.h ../include/swab.h
 tlist.o: ../include/list.h tlist.h
 crypto.o: crypto.h
 wthread.o: wthread.h ../include/queue.h
@@ -290,7 +290,7 @@ clm.o: ../include/ipc_clm.h ../include/saClm.h ../include/ipc_gen.h
 clm.o: ../include/mar_clm.h ../include/mar_gen.h ../include/mar_gen.h
 clm.o: ../include/mar_clm.h ../include/list.h ../include/queue.h
 clm.o: ../lcr/lcr_comp.h aispoll.h totempg.h totemsrp.h main.h mainconfig.h
-clm.o: objdb.h mempool.h service.h swab.h print.h
+clm.o: objdb.h mempool.h service.h ../include/swab.h print.h
 ckpt.o: ../include/saAis.h ../include/saCkpt.h ../include/ipc_ckpt.h
 ckpt.o: ../include/saAis.h ../include/saCkpt.h ../include/ipc_gen.h
 ckpt.o: ../include/list.h ../include/queue.h ../include/hdb.h
@@ -302,7 +302,7 @@ evt.o: ../include/saEvt.h ../include/saClm.h ../include/ipc_gen.h
 evt.o: ../include/list.h ../include/queue.h ../lcr/lcr_comp.h util.h
 evt.o: ../include/saAis.h service.h totem.h totemip.h objdb.h aispoll.h
 evt.o: mempool.h main.h ../include/saClm.h ../include/ipc_gen.h
-evt.o: ../exec/totemip.h mainconfig.h totemsrp.h totempg.h swab.h print.h
+evt.o: ../exec/totemip.h mainconfig.h totemsrp.h totempg.h ../include/swab.h print.h
 lck.o: service.h totem.h totemip.h objdb.h ../include/saAis.h
 lck.o: ../include/saLck.h ../include/ipc_lck.h ../include/saAis.h
 lck.o: ../include/saLck.h ../include/ipc_gen.h ../include/list.h
@@ -325,13 +325,13 @@ cpg.o: ../include/saAis.h ../include/saClm.h ../include/saAis.h
 cpg.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_cpg.h
 cpg.o: ../include/ipc_gen.h ../include/list.h ../include/queue.h
 cpg.o: ../lcr/lcr_comp.h aispoll.h totempg.h totemsrp.h totem.h totemip.h
-cpg.o: main.h mainconfig.h objdb.h mempool.h service.h jhash.h swab.h print.h
+cpg.o: main.h mainconfig.h objdb.h mempool.h service.h jhash.h ../include/swab.h print.h
 aisparser.o: ../lcr/lcr_comp.h objdb.h config.h mempool.h ../include/list.h
 aisparser.o: util.h ../include/saAis.h
 vsf_ykd.o: main.h ../include/saAis.h ../include/saClm.h ../include/saAis.h
 vsf_ykd.o: ../include/queue.h ../include/ipc_gen.h ../exec/totemip.h
 vsf_ykd.o: mainconfig.h ../include/list.h aispoll.h totemsrp.h totem.h
-vsf_ykd.o: totemip.h totempg.h objdb.h print.h swab.h vsf.h ../lcr/lcr_comp.h
+vsf_ykd.o: totemip.h totempg.h objdb.h print.h ../include/swab.h vsf.h ../lcr/lcr_comp.h
 amf.o: ../include/saAis.h ../include/saAmf.h ../include/saAis.h
 amf.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_amf.h
 amf.o: ../include/ipc_gen.h ../include/ais_amf.h ../include/list.h

+ 4 - 3
exec/amf.c

@@ -91,6 +91,7 @@
 #include "util.h"
 #include "amf.h"
 #include "main.h"
+#include "ipc.h"
 #include "service.h"
 #include "objdb.h"
 #include "print.h"
@@ -321,13 +322,13 @@ __attribute__ ((constructor)) static void register_this_component (void)
 }
 
 struct req_exec_amf_comp_register {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaNameT proxyCompName;
 };
 
 struct req_exec_amf_comp_error_report {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT reportingComponent;
 	SaNameT erroneousComponent;
 	SaTimeT errorDetectionTime;
@@ -336,7 +337,7 @@ struct req_exec_amf_comp_error_report {
 };
 
 struct req_exec_amf_response {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaAisErrorT error;
 };

+ 2 - 2
exec/amf.h

@@ -390,12 +390,12 @@ enum amf_message_req_types {
 };
 
 struct req_exec_amf_clc_cleanup_completed {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 };
 
 struct req_exec_amf_healthcheck_tmo {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaAmfHealthcheckKeyT safHealthcheckKey;
 };

+ 1 - 0
exec/amfcomp.c

@@ -137,6 +137,7 @@
 #include "totempg.h"
 #include "aispoll.h"
 #include "main.h"
+#include "ipc.h"
 #include "service.h"
 #include "util.h"
 #include "amf.h"

+ 1 - 1
exec/amfutil.c

@@ -858,7 +858,7 @@ int amf_config_read (struct amf_cluster *cluster, char **error_string)
 			} else {
 				value = rm_beginning_ws (line);
 				attribute->value = realloc (attribute->value, 
-										   sizeof (SaStringT) * csi_attr_cnt + 1);
+										   sizeof (SaStringT) * (csi_attr_cnt + 1));
 				attribute->value[csi_attr_cnt - 1] = malloc (strlen (value) + 1);
 				strcpy (attribute->value[csi_attr_cnt - 1], value);
 				attribute->value[csi_attr_cnt] = NULL;

Разница между файлами не показана из-за своего большого размера
+ 267 - 204
exec/ckpt.c


+ 7 - 2
exec/clm.c

@@ -68,9 +68,10 @@
 #include "aispoll.h"
 #include "totempg.h"
 #include "main.h"
+#include "ipc.h"
 #include "mempool.h"
 #include "service.h"
-#include "swab.h"
+#include "../include/swab.h"
 #include "print.h"
 
 enum clm_message_req_types {
@@ -257,7 +258,7 @@ __attribute__ ((constructor)) static void clm_comp_register (void) {
 }
 
 struct req_exec_clm_nodejoin {
-	struct req_header header __attribute__((aligned(8)));
+	mar_req_header_t header __attribute__((aligned(8)));
 	mar_clm_cluster_node_t cluster_node __attribute__((aligned(8)));
 };
 
@@ -306,7 +307,11 @@ static int clm_exec_init_fn (struct objdb_iface_ver0 *objdb)
 		if ( sysctl(mib, 2, &boot_time, &size, NULL, 0) == -1 )
 			boot_time.tv_sec = time (NULL);
 		 /* (currenttime (s) - uptime (s)) * 1 billion (ns) / 1 (s) */
+<<<<<<< .mine
+		my_cluster_node.boot_timestamp = ((SaTimeT)boot_time.tv_sec) * 1000000000;
+=======
 		my_cluster_node.boot_timestmap = ((SaTimeT)boot_time.tv_sec) * 1000000000;
+>>>>>>> .r1070
 #else /* defined(CTL_KERN) && defined(KERN_BOOTTIME) */
 	#warning "no bootime support"
 #endif

+ 17 - 15
exec/cpg.c

@@ -59,10 +59,12 @@
 #include "totempg.h"
 #include "totemip.h"
 #include "main.h"
+#include "ipc.h"
 #include "mempool.h"
 #include "service.h"
 #include "jhash.h"
 #include "swab.h"
+#include "ipc.h"
 #include "print.h"
 
 #define GROUP_HASH_SIZE 32
@@ -182,13 +184,13 @@ static struct openais_lib_handler cpg_lib_service[] =
 	},
 	{ /* 2 */
 		.lib_handler_fn				= message_handler_req_lib_cpg_mcast,
-		.response_size				= sizeof (struct res_header),
+		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CPG_MCAST,
 		.flow_control				= OPENAIS_FLOW_CONTROL_REQUIRED
 	},
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_lib_cpg_membership,
-		.response_size				= sizeof (struct res_header),
+		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CPG_MEMBERSHIP,
 		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -282,14 +284,14 @@ __attribute__ ((constructor)) static void cpg_comp_register (void) {
 }
 
 struct req_exec_cpg_procjoin {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	uint32_t pid;
 	uint32_t reason;
 };
 
 struct req_exec_cpg_mcast {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	uint32_t msglen;
 	uint32_t pid;
@@ -591,8 +593,8 @@ static void exec_cpg_procjoin_endian_convert (void *msg)
 
 static void exec_cpg_joinlist_endian_convert (void *msg)
 {
-	struct res_header *res = (struct res_header *)msg;
-	struct join_list_entry *jle = (struct join_list_entry *)(msg + sizeof(struct res_header));
+	mar_res_header_t *res = (mar_res_header_t *)msg;
+	struct join_list_entry *jle = (struct join_list_entry *)(msg + sizeof(mar_res_header_t));
 
 	while ((void*)jle < msg + res->size) {
 		jle->pid = swab32(jle->pid);
@@ -726,8 +728,8 @@ static void message_handler_req_exec_cpg_joinlist (
 	void *message,
 	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));
+	mar_res_header_t *res = (mar_res_header_t *)message;
+	struct join_list_entry *jle = (struct join_list_entry *)(message + sizeof(mar_res_header_t));
 
 	log_printf(LOG_LEVEL_NOTICE, "got joinlist message from node %x\n",
 		nodeid);
@@ -790,7 +792,7 @@ static void cpg_exec_send_joinlist(void)
 	struct list_head *iter;
 	struct list_head *iter2;
 	struct group_info *gi;
-	struct res_header *res;
+	mar_res_header_t *res;
 	struct join_list_entry *jle;
 	struct iovec req_exec_cpg_iovec;
 
@@ -813,14 +815,14 @@ static void cpg_exec_send_joinlist(void)
 	if (!count)
 		return;
 
-	buf = alloca(sizeof(struct res_header) + sizeof(struct join_list_entry) * count);
+	buf = alloca(sizeof(mar_res_header_t) + sizeof(struct join_list_entry) * count);
 	if (!buf) {
 		log_printf(LOG_LEVEL_WARNING, "Unable to allocate joinlist buffer");
 		return;
 	}
 
-	jle = (struct join_list_entry *)(buf + sizeof(struct res_header));
-	res = (struct res_header *)buf;
+	jle = (struct join_list_entry *)(buf + sizeof(mar_res_header_t));
+	res = (mar_res_header_t *)buf;
 
 	for (i=0; i<GROUP_HASH_SIZE; i++) {
 		for (iter = group_lists[i].next; iter != &group_lists[i]; iter = iter->next) {
@@ -839,7 +841,7 @@ static void cpg_exec_send_joinlist(void)
 	}
 
 	res->id = SERVICE_ID_MAKE(CPG_SERVICE, MESSAGE_REQ_EXEC_CPG_JOINLIST);
-	res->size = sizeof(struct res_header)+sizeof(struct join_list_entry) * count;
+	res->size = sizeof(mar_res_header_t)+sizeof(struct join_list_entry) * count;
 
 	req_exec_cpg_iovec.iov_base = buf;
 	req_exec_cpg_iovec.iov_len = res->size;
@@ -932,7 +934,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
 	struct group_info *gi = pi->group;
 	struct iovec req_exec_cpg_iovec[2];
 	struct req_exec_cpg_mcast req_exec_cpg_mcast;
-	struct res_header res;
+	mar_res_header_t res;
 	int msglen = req_lib_cpg_mcast->msglen;
 	int result;
 
@@ -973,7 +975,7 @@ static void message_handler_req_lib_cpg_membership (void *conn, void *message)
 
 	log_printf(LOG_LEVEL_DEBUG, "got membership request on %p\n", conn);
 	if (!pi->group) {
-		struct res_header res;
+		mar_res_header_t res;
 		res.size = sizeof(res);
 		res.id = MESSAGE_RES_CPG_MEMBERSHIP;
 		res.error = SA_AIS_ERR_ACCESS; /* TODO Better error code */

+ 1 - 0
exec/evs.c

@@ -58,6 +58,7 @@
 #include "aispoll.h"
 #include "totempg.h"
 #include "main.h"
+#include "ipc.h"
 #include "mempool.h"
 #include "service.h"
 #include "print.h"

+ 1 - 0
exec/evt.c

@@ -58,6 +58,7 @@
 #include "aispoll.h"
 #include "mempool.h"
 #include "main.h"
+#include "ipc.h"
 #include "totempg.h"
 #include "swab.h"
 #include "print.h"

+ 15 - 14
exec/ipc.c

@@ -66,6 +66,7 @@
 #include "mainconfig.h"
 #include "totemconfig.h"
 #include "main.h"
+#include "ipc.h"
 #include "service.h"
 #include "sync.h"
 #include "swab.h"
@@ -151,17 +152,17 @@ static int response_init_send_response (
 	void *message)
 {
 	SaAisErrorT error = SA_AIS_ERR_ACCESS;
-	struct req_lib_response_init *req_lib_response_init = (struct req_lib_response_init *)message;
-	struct res_lib_response_init res_lib_response_init;
+	mar_req_lib_response_init_t *req_lib_response_init = (mar_req_lib_response_init_t *)message;
+	mar_res_lib_response_init_t res_lib_response_init;
 
 	if (conn_info->authenticated) {
 		conn_info->service = req_lib_response_init->resdis_header.service;
 		error = SA_AIS_OK;
 	}
-	res_lib_response_init.header.size = sizeof (struct res_lib_response_init);
+	res_lib_response_init.header.size = sizeof (mar_res_lib_response_init_t);
 	res_lib_response_init.header.id = MESSAGE_RES_INIT;
 	res_lib_response_init.header.error = error;
-	res_lib_response_init.conn_info = (unsigned long)conn_info;
+	res_lib_response_init.conn_info = conn_info;
 
 	openais_conn_send_response (
 		conn_info,
@@ -180,8 +181,8 @@ static int dispatch_init_send_response (
 	void *message)
 {
 	SaAisErrorT error = SA_AIS_ERR_ACCESS;
-	struct req_lib_dispatch_init *req_lib_dispatch_init = (struct req_lib_dispatch_init *)message;
-	struct res_lib_dispatch_init res_lib_dispatch_init;
+	mar_req_lib_dispatch_init_t *req_lib_dispatch_init = (mar_req_lib_dispatch_init_t *)message;
+	mar_res_lib_dispatch_init_t res_lib_dispatch_init;
 	struct conn_info *msg_conn_info;
 
 	if (conn_info->authenticated) {
@@ -215,7 +216,7 @@ static int dispatch_init_send_response (
 			}
 		}
 
-	res_lib_dispatch_init.header.size = sizeof (struct res_lib_dispatch_init);
+	res_lib_dispatch_init.header.size = sizeof (mar_res_lib_dispatch_init_t);
 	res_lib_dispatch_init.header.id = MESSAGE_RES_INIT;
 	res_lib_dispatch_init.header.error = error;
 
@@ -493,14 +494,14 @@ retry_sendmsg:
 
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute((aligned(8)));
 	char buf[4096];
 };
 
 static int libais_deliver (struct conn_info *conn_info)
 {
 	int res;
-	struct req_header *header;
+	mar_req_header_t *header;
 	int service;
 	struct msghdr msg_recv;
 	struct iovec iov_recv;
@@ -580,13 +581,13 @@ retry_recv:
 #endif
 	/*
 	 * Dispatch all messages received in recvmsg that can be dispatched
-	 * sizeof (struct req_header) needed at minimum to do any processing
+	 * sizeof (mar_req_header_t) needed at minimum to do any processing
 	 */
 	conn_info->inb_inuse += res;
 	conn_info->inb_start += res;
 
-	while (conn_info->inb_inuse >= sizeof (struct req_header) && res != -1) {
-		header = (struct req_header *)&conn_info->inb[conn_info->inb_start - conn_info->inb_inuse];
+	while (conn_info->inb_inuse >= sizeof (mar_req_header_t) && res != -1) {
+		header = (mar_req_header_t *)&conn_info->inb[conn_info->inb_start - conn_info->inb_inuse];
 
 		if (header->size > conn_info->inb_inuse) {
 			break;
@@ -728,7 +729,7 @@ retry_accept:
  * Exported functions
  */
 
-int message_source_is_local(struct message_source *source)
+int message_source_is_local(mar_message_source_t *source)
 {
 	int ret = 0;
 
@@ -740,7 +741,7 @@ int message_source_is_local(struct message_source *source)
 }
 
 void message_source_set (
-	struct message_source *source,
+	mar_message_source_t *source,
 	void *conn)
 {
 	assert ((source != NULL) && (conn != NULL));

+ 2 - 2
exec/ipc.h

@@ -37,9 +37,9 @@
 
 #include "tlist.h"
 
-extern void message_source_set (struct message_source *source, void *conn);
+extern void message_source_set (mar_message_source_t *source, void *conn);
 
-extern int message_source_is_local (struct message_source *source);
+extern int message_source_is_local (mar_message_source_t *source);
 
 extern void *openais_conn_partner_get (void *conn);
 

+ 24 - 23
exec/lck.c

@@ -57,6 +57,7 @@
 #include "mempool.h"
 #include "util.h"
 #include "main.h"
+#include "ipc.h"
 #include "totempg.h"
 #include "print.h"
 
@@ -81,8 +82,8 @@ struct resource_lock {
 	struct resource *resource;
 	int async_call;
 	SaInvocationT invocation;
-	struct message_source callback_source;
-	struct message_source response_source;
+	mar_message_source_t callback_source;
+	mar_message_source_t response_source;
 	struct list_head list; /* locked resource lock list */
 	struct list_head resource_list; /* resource locks on a resource */
 	struct list_head resource_cleanup_list; /* cleanup data for resource locks */
@@ -342,8 +343,8 @@ __attribute__ ((constructor)) static void register_this_component (void) {
  * All data types used for executive messages
  */
 struct req_exec_lck_resourceopen {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT resource_name;
 	SaLckResourceHandleT resource_handle;
 	SaInvocationT invocation;
@@ -354,25 +355,25 @@ struct req_exec_lck_resourceopen {
 };
 
 struct req_exec_lck_resourceclose {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT lockResourceName;
 	SaLckResourceHandleT resource_handle;
 };
 
 struct req_exec_lck_resourcelock {
-	struct req_header header;
+	mar_req_header_t header;
 	SaLckResourceHandleT resource_handle;
 	SaInvocationT invocation;
 	int async_call;
 	SaAisErrorT fail_with_error;
-	struct message_source source;
+	mar_message_source_t source;
 	struct req_lib_lck_resourcelock req_lib_lck_resourcelock;
 };
 
 struct req_exec_lck_resourceunlock {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT resource_name;
 	SaLckLockIdT lock_id;
 	SaInvocationT invocation;
@@ -381,15 +382,15 @@ struct req_exec_lck_resourceunlock {
 };
 
 struct req_exec_lck_resourcelockorphan {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT resource_name;
 	SaLckLockIdT lock_id;
 };
 
 struct req_exec_lck_lockpurge {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	struct req_lib_lck_lockpurge req_lib_lck_lockpurge;
 };
 
@@ -445,7 +446,7 @@ static struct resource *resource_find (SaNameT *name)
 
 static struct resource_lock *resource_lock_find (
 	struct resource *resource,
-	struct message_source *source,
+	mar_message_source_t *source,
 	SaLckLockIdT lock_id)
 {
 	struct list_head *list;
@@ -458,7 +459,7 @@ static struct resource_lock *resource_lock_find (
 		resource_lock = list_entry (list, struct resource_lock, resource_list);
 
 		if ((memcmp (&resource_lock->callback_source,
-			source, sizeof (struct message_source)) == 0) &&
+			source, sizeof (mar_message_source_t)) == 0) &&
 			(lock_id == resource_lock->lock_id)) {
 
 			return (resource_lock);
@@ -523,7 +524,7 @@ void resource_lock_orphan (struct resource_lock *resource_lock)
 
 	memcpy (&req_exec_lck_resourcelockorphan.source,
 		&resource_lock->callback_source,
-		sizeof (struct message_source));
+		sizeof (mar_message_source_t));
 
 	memcpy (&req_exec_lck_resourcelockorphan.resource_name,
 		&resource_lock->resource->name,
@@ -716,7 +717,7 @@ error_exit:
 			res_lib_lck_resourceopenasync.invocation = req_exec_lck_resourceopen->invocation;
 			memcpy (&res_lib_lck_resourceopenasync.source,
 				&req_exec_lck_resourceopen->source,
-				sizeof (struct message_source));
+				sizeof (mar_message_source_t));
 
 			openais_conn_send_response (
 				req_exec_lck_resourceopen->source.conn,
@@ -735,7 +736,7 @@ error_exit:
 			res_lib_lck_resourceopen.header.error = error;
 			memcpy (&res_lib_lck_resourceopen.source,
 				&req_exec_lck_resourceopen->source,
-				sizeof (struct message_source));
+				sizeof (mar_message_source_t));
 
 			openais_conn_send_response (req_exec_lck_resourceopen->source.conn,
 				&res_lib_lck_resourceopen,
@@ -821,7 +822,7 @@ void waiter_notification_list_send (struct list_head *list_notify_head)
 }
 
 void resource_lock_async_deliver (
-	struct message_source *source,
+	mar_message_source_t *source,
 	struct resource_lock *resource_lock,
 	SaAisErrorT error)
 {
@@ -845,7 +846,7 @@ void resource_lock_async_deliver (
 }
 
 void lock_response_deliver (
-	struct message_source *source,
+	mar_message_source_t *source,
 	struct resource_lock *resource_lock,
 	SaAisErrorT error)
 {
@@ -1093,7 +1094,7 @@ static void message_handler_req_exec_lck_resourcelock (
 	 */
 	memcpy (&resource_lock->callback_source,
 		&req_exec_lck_resourcelock->req_lib_lck_resourcelock.source,
-		sizeof (struct message_source));
+		sizeof (mar_message_source_t));
 
 	lock_algorithm (resource, resource_lock);
 
@@ -1125,7 +1126,7 @@ static void message_handler_req_exec_lck_resourcelock (
 		} else {
 			memcpy (&resource_lock->response_source,
 				&req_exec_lck_resourcelock->source,
-				sizeof (struct message_source));
+				sizeof (mar_message_source_t));
 		}
 
 		/*

+ 3 - 3
exec/main.c

@@ -317,7 +317,7 @@ static void deliver_fn (
 	int iov_len,
 	int endian_conversion_required)
 {
-	struct req_header *header;
+	mar_req_header_t *header;
 	int pos = 0;
 	int i;
 	int service;
@@ -334,9 +334,9 @@ static void deliver_fn (
 			pos += iovec[i].iov_len;
 			assert (pos < MESSAGE_SIZE_MAX);
 		}
-		header = (struct req_header *)delivery_data;
+		header = (mar_req_header_t *)delivery_data;
 	} else {
-		header = (struct req_header *)iovec[0].iov_base;
+		header = (mar_req_header_t *)iovec[0].iov_base;
 	}
 	if (endian_conversion_required) {
 		header->id = swab32 (header->id);

+ 0 - 10
exec/main.h

@@ -60,16 +60,6 @@ extern totempg_groups_handle openais_group_handle;
 
 poll_handle aisexec_poll_handle;
 
-extern int message_source_is_local(struct message_source *source);
-
-extern void message_source_set(struct message_source *source, void *conn);
-
 extern SaClmClusterNodeT *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
-extern void *openais_conn_partner_get (void *conn);
-
-extern void *openais_conn_private_data_get (void *conn);
-
-extern int openais_conn_send_response (void *conn, void *msg, int mlen);
-
 #endif /* AIS_EXEC_H_DEFINED */

+ 33 - 32
exec/msg.c

@@ -57,6 +57,7 @@
 #include "mempool.h"
 #include "util.h"
 #include "main.h"
+#include "ipc.h"
 #include "totempg.h"
 #include "print.h"
 
@@ -491,8 +492,8 @@ __attribute__ ((constructor)) static void register_this_component (void) {
  * All data types used for executive messages
  */
 struct req_exec_msg_queueopen {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	int async_call;
 	SaNameT queue_name;
 	SaInvocationT invocation;
@@ -503,79 +504,79 @@ struct req_exec_msg_queueopen {
 };
 
 struct req_exec_msg_queueclose {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 
 struct req_exec_msg_queuestatusget {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 
 struct req_exec_msg_queueunlink {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 
 struct req_exec_msg_queuegroupcreate {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_queuegroupinsert {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_queuegroupremove {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_queuegroupdelete {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_queuegrouptrack {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_queuegrouptrackstop {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_group_name;
 };
 struct req_exec_msg_messagesend {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT destination;
 	int async_call;
 };
 struct req_exec_msg_messageget {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 struct req_exec_msg_messagecancel {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 struct req_exec_msg_messagesendreceive {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 };
 struct req_exec_msg_messagereply {
-	struct req_header header;
-	struct message_source source;
+	mar_req_header_t header;
+	mar_message_source_t source;
 	SaNameT queue_name;
 	int async_call;
 };
@@ -807,7 +808,7 @@ error_exit:
 			res_lib_msg_queueopenasync.invocation = req_exec_msg_queueopen->invocation;
 			memcpy (&res_lib_msg_queueopenasync.source,
 				&req_exec_msg_queueopen->source,
-				sizeof (struct message_source));
+				sizeof (mar_message_source_t));
 
 			openais_conn_send_response (
 				req_exec_msg_queueopen->source.conn,
@@ -826,7 +827,7 @@ error_exit:
 			res_lib_msg_queueopen.header.error = error;
 			memcpy (&res_lib_msg_queueopen.source,
 				&req_exec_msg_queueopen->source,
-				sizeof (struct message_source));
+				sizeof (mar_message_source_t));
 
 			openais_conn_send_response (
 				req_exec_msg_queueopen->source.conn,

+ 1 - 1
exec/print.c

@@ -319,7 +319,7 @@ void log_flush(void)
 
 	while (entry) {
 		internal_log_printf(entry->file, entry->line,
-							entry->level, entry->str);
+			entry->level, entry->str);
 		tmp = entry;
 		entry = entry->next;
 		free(tmp);

+ 1 - 1
exec/sync.c

@@ -127,7 +127,7 @@ static struct totempg_group sync_group = {
 static totempg_groups_handle sync_group_handle;
 
 struct req_exec_sync_barrier_start {
-	struct req_header header;
+	mar_req_header_t header;
 	struct memb_ring_id ring_id;
 };
 

+ 14 - 0
exec/util.c

@@ -56,6 +56,15 @@ int name_match(SaNameT *name1, SaNameT *name2)
 	return 0;
 }
 
+int mar_name_match(mar_name_t *name1, mar_name_t *name2) 
+{
+	if (name1->length == name2->length) {
+		return ((strncmp ((char *)name1->value, (char *)name2->value,
+			name1->length)) == 0);
+	} 
+	return 0;
+}
+
 /*
  * Get the time of day and convert to nanoseconds
  */
@@ -96,6 +105,11 @@ char *getSaNameT (SaNameT *name)
 	}
 	return (ret_name);
 #endif
+// TODO
+	return ((char *)name->value);
+}
+
+char *get_mar_name_t (mar_name_t *name) {
 	return ((char *)name->value);
 }
 

+ 7 - 5
exec/util.h

@@ -35,13 +35,9 @@
 #ifndef UTIL_H_DEFINED
 #define UTIL_H_DEFINED
 #include <sys/time.h>
+#include "../include/mar_gen.h"
 #include "../include/saAis.h"
 
-/*
- * Compare two names.  returns non-zero on match.
- */
-extern int name_match(SaNameT *name1, SaNameT *name2);
-
 /*
  * Get the time of day and convert to nanoseconds
  */
@@ -65,9 +61,15 @@ enum e_ais_done {
 	AIS_DONE_OUT_OF_MEMORY = -15,
 };
 
+/*
+ * Compare two names.  returns non-zero on match.
+ */
+extern int name_match(SaNameT *name1, SaNameT *name2);
+extern int mar_name_match(mar_name_t *name1, mar_name_t *name2);
 void openais_exit_error (enum e_ais_done err);
 extern char *getSaNameT (SaNameT *name);
 extern char *strstr_rs (const char *haystack, const char *needle);
 extern void setSaNameT (SaNameT *name, char *str);
+char *get_mar_name_t (mar_name_t *name);
 extern int SaNameTisEqual (SaNameT *str1, char *str2);
 #endif /* UTIL_H_DEFINED */

+ 35 - 35
include/ipc_amf.h

@@ -78,27 +78,27 @@ enum res_lib_amf_types {
 };
 
 struct req_lib_amf_componentregister {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaNameT proxyCompName;
 } __attribute__((packed));
 
 struct res_lib_amf_componentregister {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_componentunregister {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaNameT proxyCompName;
 };
 
 struct res_lib_amf_componentunregister {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_pmstart {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaUint64T processId;
 	SaInt32T descendentsTreeDepth;
@@ -107,11 +107,11 @@ struct req_lib_amf_pmstart {
 };
 
 struct res_lib_amf_pmstart {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_pmstop {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaAmfPmStopQualifierT stopQualifier;
 	SaUint64T processId;
@@ -119,11 +119,11 @@ struct req_lib_amf_pmstop {
 };
 
 struct res_lib_amf_pmstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_healthcheckstart {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaAmfHealthcheckKeyT healthcheckKey;
 	SaAmfHealthcheckInvocationT invocationType;
@@ -131,74 +131,74 @@ struct req_lib_amf_healthcheckstart {
 };
 
 struct res_lib_amf_healthcheckstart {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_healthcheckconfirm {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaAmfHealthcheckKeyT healthcheckKey;
 	SaAisErrorT healthcheckResult;
 };
 
 struct res_lib_amf_healthcheckconfirm {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_healthcheckstop {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaAmfHealthcheckKeyT healthcheckKey;
 };
 
 struct res_lib_amf_healthcheckstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_hastateget {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	SaNameT csiName;
 };
 
 struct res_lib_amf_hastateget {
-	struct res_header header;
+	mar_res_header_t header;
 	SaAmfHAStateT haState;
 };
 
 struct req_lib_amf_csiquiescingcomplete {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaAisErrorT error;
 };
 
 struct res_lib_amf_csiquiescingcomplete {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_protectiongrouptrack {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT csiName;
 	SaUint8T trackFlags;
 	SaAmfProtectionGroupNotificationT *notificationBufferAddress;
 };
 
 struct res_lib_amf_protectiongrouptrack {
-	struct res_header header;
+	mar_res_header_t header;
 };
 	
 
 struct req_lib_amf_protectiongrouptrackstop {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT csiName;
 };
 
 struct res_lib_amf_protectiongrouptrackstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_componenterrorreport {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT reportingComponent;
 	SaNameT erroneousComponent;
 	SaTimeT errorDetectionTime;
@@ -207,29 +207,29 @@ struct req_lib_amf_componenterrorreport {
 };
 
 struct res_lib_amf_componenterrorreport {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_componenterrorclear {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 };
 
 struct res_lib_amf_componenterrorclear {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_amf_response {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaAisErrorT error;
 };
 
 struct res_lib_amf_response {
-	struct res_header header;
+	mar_res_header_t header;
 };
 struct res_lib_amf_healthcheckcallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaNameT compName;
 	SaAmfHealthcheckKeyT key;
@@ -238,7 +238,7 @@ struct res_lib_amf_healthcheckcallback {
 #ifdef COMPILE_OUT
 
 struct res_lib_amf_componentterminatecallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaNameT compName;
 };
@@ -247,7 +247,7 @@ struct res_lib_amf_componentterminatecallback {
 #endif
 
 /* struct res_lib_amf_csisetcallback {        */
-/*         struct res_header header;          */
+/*         mar_res_header_t header;          */
 /*         SaInvocationT invocation;          */
 /*         SaNameT compName;                  */
 /*         SaAmfHAStateT haState;             */
@@ -255,7 +255,7 @@ struct res_lib_amf_componentterminatecallback {
 /* };                                         */
 
 struct res_lib_amf_csisetcallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaNameT compName;
 	SaAmfHAStateT haState;
@@ -267,7 +267,7 @@ struct res_lib_amf_csisetcallback {
 };
 
 struct res_lib_amf_csiremovecallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaNameT compName;
 	SaNameT csiName;
@@ -275,7 +275,7 @@ struct res_lib_amf_csiremovecallback {
 };
 
 struct res_lib_amf_componentterminatecallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaNameT compName;
 };
@@ -283,7 +283,7 @@ struct res_lib_amf_componentterminatecallback {
 
 #ifdef COMPILE_OUT
 struct res_lib_amf_protectiongrouptrackcallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaNameT csiName;
 	SaAmfProtectionGroupNotificationT *notificationBufferAddress;
 	SaUint32T numberOfItems;

+ 8 - 8
include/ipc_cfg.h

@@ -54,43 +54,43 @@ enum res_lib_cfg_types {
 };
 
 struct req_lib_cfg_statetrackstart {
-	struct req_header header;
+	mar_req_header_t header;
 	SaUint8T trackFlags;
 	OpenaisCfgStateNotificationT *notificationBufferAddress;
 };
 
 struct res_lib_cfg_statetrackstart {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cfg_statetrackstop {
-	struct req_header header;
+	mar_req_header_t header;
 };
 
 struct res_lib_cfg_statetrackstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cfg_administrativestateset {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	OpenaisCfgAdministrativeTargetT administrativeTarget;
 	OpenaisCfgAdministrativeStateT administrativeState;
 };
 
 struct res_lib_cfg_administrativestateset {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cfg_administrativestateget {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT compName;
 	OpenaisCfgAdministrativeTargetT administrativeTarget;
 	OpenaisCfgAdministrativeStateT administrativeState;
 };
 
 struct res_lib_cfg_administrativestateget {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 typedef enum {

+ 137 - 143
include/ipc_ckpt.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
+ * Copyright (c) 2006 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -37,26 +38,26 @@
 #include "saAis.h"
 #include "saCkpt.h"
 #include "ipc_gen.h"
+#include "mar_ckpt.h"
 
 enum req_lib_ckpt_checkpoint_types {
 	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN = 0,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPENASYNC = 1,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTCLOSE = 2,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTUNLINK = 3,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET = 4,
-	MESSAGE_REQ_CKPT_ACTIVEREPLICASET = 5,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET = 6,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONCREATE = 7,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONDELETE = 8,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONEXPIRATIONTIMESET = 9,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONWRITE = 10,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONOVERWRITE = 11,
-	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONREAD = 12,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE = 13,
-	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC = 14,
-	MESSAGE_REQ_CKPT_SECTIONITERATIONINITIALIZE = 15,
-	MESSAGE_REQ_CKPT_SECTIONITERATIONFINALIZE = 16,
-	MESSAGE_REQ_CKPT_SECTIONITERATIONNEXT = 17
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTCLOSE = 1,
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTUNLINK = 2,
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET = 3,
+	MESSAGE_REQ_CKPT_ACTIVEREPLICASET = 4,
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET = 5,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONCREATE = 6,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONDELETE = 7,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONEXPIRATIONTIMESET = 8,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONWRITE = 9,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONOVERWRITE = 10,
+	MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONREAD = 11,
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE = 12,
+	MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC = 13,
+	MESSAGE_REQ_CKPT_SECTIONITERATIONINITIALIZE = 14,
+	MESSAGE_REQ_CKPT_SECTIONITERATIONFINALIZE = 15,
+	MESSAGE_REQ_CKPT_SECTIONITERATIONNEXT = 16
 };
 
 enum res_lib_ckpt_checkpoint_types {
@@ -81,198 +82,191 @@ enum res_lib_ckpt_checkpoint_types {
 };
 
 struct req_lib_ckpt_checkpointopen {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaCkptCheckpointCreationAttributesT checkpointCreationAttributes;
-	int checkpointCreationAttributesSet;
-	SaCkptCheckpointOpenFlagsT checkpointOpenFlags;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_ckpt_checkpoint_creation_attributes_t checkpoint_creation_attributes __attribute__((aligned(8)));
+	int checkpoint_creation_attributes_set __attribute__((aligned(8)));
+	mar_ckpt_checkpoint_open_flags_t checkpoint_open_flags __attribute__((aligned(8)));
+	mar_ckpt_checkpoint_handle_t checkpoint_handle __attribute__((aligned(8)));
+	SaAisErrorT fail_with_error __attribute__((aligned(8)));
+	mar_invocation_t invocation __attribute__((aligned(8)));
+	mar_uint32_t async_call __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointopen {
-	struct res_header header;
-};
-
-struct req_lib_ckpt_checkpointopenasync {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaCkptCheckpointCreationAttributesT checkpointCreationAttributes;
-	int checkpointCreationAttributesSet;
-	SaCkptCheckpointOpenFlagsT checkpointOpenFlags;
-	SaInvocationT invocation;
-	SaCkptCheckpointHandleT checkpointHandle;
-	SaAisErrorT fail_with_error;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointopenasync {
-	struct res_header header;
-	SaCkptCheckpointHandleT checkpointHandle;
-	SaInvocationT invocation;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	mar_ckpt_checkpoint_handle_t checkpoint_handle __attribute__((aligned(8)));
+	mar_invocation_t invocation __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointclose {
-	struct req_header header;
-	SaNameT checkpointName;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointclose {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointunlink {
-	struct req_header header;
-	SaNameT checkpointName;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointunlink {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointretentiondurationset {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaTimeT retentionDuration;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_time_t retention_duration __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 struct res_lib_ckpt_checkpointretentiondurationset {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_activereplicaset {
-	struct req_header header;
-	SaNameT checkpointName;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_activereplicaset {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointstatusget {
-	struct req_header header;
-	SaNameT checkpointName;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointstatusget {
-	struct res_header header;
-	SaCkptCheckpointDescriptorT checkpointDescriptor;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	mar_ckpt_checkpoint_descriptor_t checkpoint_descriptor __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectioncreate {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-	SaTimeT expirationTime;
-	SaUint32T initialDataSize;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+	mar_time_t expiration_time __attribute__((aligned(8)));
+	mar_uint32_t initial_data_size __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectioncreate {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectiondelete {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectiondelete {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectionexpirationtimeset {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-	SaTimeT expirationTime;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+	mar_time_t expiration_time __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectionexpirationtimeset {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectioniterationinitialize {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaCkptSectionsChosenT sectionsChosen;
-	SaTimeT expirationTime;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_ckpt_sections_chosen_t sections_chosen __attribute__((aligned(8)));
+	mar_time_t expiration_time __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectioniterationinitialize {
-	struct res_header header;
-	unsigned int iteration_handle;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	unsigned int iteration_handle __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectioniterationfinalize {
-	struct req_header header;
-	unsigned int iteration_handle;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	unsigned int iteration_handle __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectioniterationfinalize {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectioniterationnext {
-	struct req_header header;
-	unsigned int iteration_handle;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	unsigned int iteration_handle __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectioniterationnext {
-	struct res_header header;
-	SaCkptSectionDescriptorT sectionDescriptor;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	mar_ckpt_section_descriptor_t section_descriptor __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectionwrite {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-	SaOffsetT dataOffset;
-	SaOffsetT dataSize;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+	mar_offset_t data_offset __attribute__((aligned(8)));
+	mar_offset_t data_size __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectionwrite {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_sectionoverwrite {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-	SaUint32T dataSize;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+	mar_uint32_t data_size __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectionoverwrite {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 	
 struct req_lib_ckpt_sectionread {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaUint32T idLen;
-	SaOffsetT dataOffset;
-	SaOffsetT dataSize;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_uint32_t id_len __attribute__((aligned(8)));
+	mar_offset_t data_offset __attribute__((aligned(8)));
+	mar_offset_t data_size __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_sectionread {
-	struct res_header header;
-	SaSizeT dataRead;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	mar_size_t data_read __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointsynchronize {
-	struct req_header header;
-	SaNameT checkpointName;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointsynchronize {
-	struct res_header header;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct req_lib_ckpt_checkpointsynchronizeasync {
-	struct req_header header;
-	SaNameT checkpointName;
-	SaInvocationT invocation;
-};
+	mar_req_header_t header __attribute__((aligned(8)));
+	mar_name_t checkpoint_name __attribute__((aligned(8)));
+	mar_invocation_t invocation __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 struct res_lib_ckpt_checkpointsynchronizeasync {
-	struct res_header header;
-	SaInvocationT invocation;
-};
+	mar_res_header_t header __attribute__((aligned(8)));
+	mar_invocation_t invocation __attribute__((aligned(8)));
+} __attribute__((aligned(8)));
 
 #endif /* IPC_CKPT_H_DEFINED */

+ 9 - 9
include/ipc_clm.h

@@ -57,53 +57,53 @@ enum res_clm_types {
 };
 
 struct req_lib_clm_clustertrack {
-	struct req_header header __attribute__((aligned(8)));
+	mar_req_header_t header __attribute__((aligned(8)));
 	unsigned char track_flags __attribute__((aligned(8)));
 	int return_in_callback __attribute__((aligned(8)));
 };
 
 struct res_lib_clm_clustertrack {
-	struct res_header header __attribute__((aligned(8)));
+	mar_res_header_t header __attribute__((aligned(8)));
 	unsigned long long view __attribute__((aligned(8)));
 	unsigned int number_of_items __attribute__((aligned(8)));
 	mar_clm_cluster_notification_t notification[PROCESSOR_COUNT_MAX] __attribute__((aligned(8)));
 };
 
 struct req_lib_clm_trackstop {
-	struct req_header header __attribute__((aligned(8)));
+	mar_req_header_t header __attribute__((aligned(8)));
 	unsigned long long data_read __attribute__((aligned(8)));
 	SaAisErrorT error __attribute__((aligned(8)));
 };
 
 struct res_lib_clm_trackstop {
-	struct res_header header __attribute__((aligned(8)));
+	mar_res_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_clm_nodeget {
-	struct req_header header __attribute__((aligned(8)));
+	mar_req_header_t header __attribute__((aligned(8)));
 	unsigned long long invocation __attribute__((aligned(8)));
 	unsigned int node_id __attribute__((aligned(8)));
 };
 
 struct res_clm_nodeget {
-	struct res_header header __attribute__((aligned(8)));
+	mar_res_header_t header __attribute__((aligned(8)));
 	unsigned long long invocation __attribute__((aligned(8)));
 	mar_clm_cluster_node_t cluster_node __attribute__((aligned(8)));
 	int valid __attribute__((aligned(8)));
 };
 
 struct req_lib_clm_nodegetasync {
-	struct req_header header __attribute__((aligned(8)));
+	mar_req_header_t header __attribute__((aligned(8)));
 	unsigned long long invocation __attribute__((aligned(8)));
 	unsigned int node_id __attribute__((aligned(8)));
 };
 
 struct res_clm_nodegetasync {
-	struct res_header header __attribute__((aligned(8)));
+	mar_res_header_t header __attribute__((aligned(8)));
 };
 
 struct res_clm_nodegetcallback {
-	struct res_header header __attribute__((aligned(8)));
+	mar_res_header_t header __attribute__((aligned(8)));
 	SaInvocationT invocation __attribute__((aligned(8)));
 	mar_clm_cluster_node_t cluster_node __attribute__((aligned(8)));
 };

+ 12 - 12
include/ipc_cpg.h

@@ -75,37 +75,37 @@ struct cpg_name {
 #endif
 
 struct req_lib_cpg_join {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	pid_t pid;
 };
 
 struct res_lib_cpg_join {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cpg_trackstart {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	pid_t pid;
 };
 
 struct res_lib_cpg_trackstart {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cpg_trackstop {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	pid_t pid;
 };
 
 struct res_lib_cpg_trackstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_cpg_mcast {
-	struct res_header header;
+	mar_res_header_t header;
 	uint32_t guarantee;
 	uint32_t msglen;
 	char message[];
@@ -113,7 +113,7 @@ struct req_lib_cpg_mcast {
 
 /* Message from another node */
 struct res_lib_cpg_deliver_callback {
-	struct res_header header;
+	mar_res_header_t header;
 	struct cpg_name group_name;
 	uint32_t msglen;
 	uint32_t nodeid;
@@ -130,12 +130,12 @@ struct cpg_groupinfo {
 
 
 struct req_lib_cpg_membership {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 };
 
 struct res_lib_cpg_confchg_callback {
-	struct res_header header;
+	mar_res_header_t header;
 	struct cpg_name group_name;
 	uint32_t member_list_entries;
 	uint32_t joined_list_entries;
@@ -146,13 +146,13 @@ struct res_lib_cpg_confchg_callback {
 };
 
 struct req_lib_cpg_leave {
-	struct req_header header;
+	mar_req_header_t header;
 	struct cpg_name group_name;
 	pid_t pid;
 };
 
 struct res_lib_cpg_leave {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 

+ 13 - 13
include/ipc_evs.h

@@ -58,14 +58,14 @@ enum res_lib_evs_types {
 };
 
 struct res_evs_deliver_callback {
-	struct res_header header;
+	mar_res_header_t header;
 	unsigned int local_nodeid;
 	int msglen;
 	char msg[0];
 };
 
 struct res_evs_confchg_callback {
-	struct res_header header;
+	mar_res_header_t header;
 	int member_list_entries;
 	int left_list_entries;
 	int joined_list_entries;
@@ -75,38 +75,38 @@ struct res_evs_confchg_callback {
 };
 
 struct req_lib_evs_join {
-	struct res_header header;
+	mar_res_header_t header;
 	int group_entries;
 	struct evs_group groups[0];
 };
 
 struct res_lib_evs_join {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_evs_leave {
-	struct res_header header;
+	mar_res_header_t header;
 	int group_entries;
 	struct evs_group groups[0];
 };
 
 struct res_lib_evs_leave {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_evs_mcast_joined {
-	struct res_header header;
+	mar_res_header_t header;
 	evs_guarantee_t guarantee;
 	int msg_len;
 	char msg[0];
 };
 
 struct res_lib_evs_mcast_joined {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_evs_mcast_groups {
-	struct res_header header;
+	mar_res_header_t header;
 	evs_guarantee_t guarantee;
 	int msg_len;
 	int group_entries;
@@ -114,12 +114,12 @@ struct req_lib_evs_mcast_groups {
 };
 
 struct res_lib_evs_mcast_groups {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 
 struct req_exec_evs_mcast {
-	struct req_header header;
+	mar_req_header_t header;
 	int group_entries;
 	int msg_len;
 	struct evs_group groups[0];
@@ -127,11 +127,11 @@ struct req_exec_evs_mcast {
 };
 
 struct req_lib_evs_membership_get {
-	struct req_header header;
+	mar_req_header_t header;
 };
 
 struct res_lib_evs_membership_get {
-	struct res_header header;
+	mar_res_header_t header;
 	unsigned int local_nodeid;
 	unsigned int member_list[PROCESSOR_COUNT_MAX];
 	int member_list_entries;

+ 17 - 17
include/ipc_evt.h

@@ -79,7 +79,7 @@ enum res_evt_types {
  */
 struct req_evt_channel_open {
 
-	struct req_header		ico_head;
+	mar_req_header_t		ico_head;
 	SaUint8T				ico_open_flag;
 	SaNameT					ico_channel_name;
 	SaEvtChannelHandleT		ico_c_handle;
@@ -103,7 +103,7 @@ struct req_evt_channel_open {
  */
 struct res_evt_channel_open {
 
-	struct res_header	ico_head;
+	mar_res_header_t	ico_head;
 	uint32_t			ico_channel_handle;/* svr chan handle */
 
 };
@@ -120,7 +120,7 @@ struct res_evt_channel_open {
  * 						to the particular open.
  */
 struct res_evt_open_chan_async {
-	struct res_header	ica_head;
+	mar_res_header_t	ica_head;
 	SaEvtChannelHandleT	ica_c_handle;
 	uint32_t			ica_channel_handle;
 	SaInvocationT		ica_invocation;
@@ -137,7 +137,7 @@ struct res_evt_open_chan_async {
  */
 struct req_evt_channel_close {
 
-	struct req_header		icc_head;
+	mar_req_header_t		icc_head;
 	uint32_t				icc_channel_handle;
 };
 
@@ -148,7 +148,7 @@ struct req_evt_channel_close {
  *
  */
 struct res_evt_channel_close {
-	struct res_header	icc_head;
+	mar_res_header_t	icc_head;
 };
 
 /*
@@ -160,7 +160,7 @@ struct res_evt_channel_close {
  */
 struct req_evt_channel_unlink {
 
-	struct req_header		iuc_head;
+	mar_req_header_t		iuc_head;
 	SaNameT					iuc_channel_name;
 };
 
@@ -171,7 +171,7 @@ struct req_evt_channel_unlink {
  *
  */
 struct res_evt_channel_unlink {
-	struct res_header	iuc_head;
+	mar_res_header_t	iuc_head;
 };
 
 /* 
@@ -187,7 +187,7 @@ struct res_evt_channel_unlink {
  */
 struct req_evt_event_subscribe {
 
-	struct req_header		ics_head;
+	mar_req_header_t		ics_head;
 	uint32_t				ics_channel_handle;
 	SaEvtSubscriptionIdT	ics_sub_id;
 	uint32_t				ics_filter_size;
@@ -204,7 +204,7 @@ struct req_evt_event_subscribe {
  *
  */
 struct res_evt_event_subscribe {
-	struct res_header	ics_head;
+	mar_res_header_t	ics_head;
 };
 
 /*
@@ -217,7 +217,7 @@ struct res_evt_event_subscribe {
  */
 struct req_evt_event_unsubscribe {
 
-	struct req_header		icu_head;
+	mar_req_header_t		icu_head;
 	uint32_t				icu_channel_handle;
 	SaEvtSubscriptionIdT	icu_sub_id;
 };
@@ -231,7 +231,7 @@ struct req_evt_event_unsubscribe {
  *
  */
 struct res_evt_event_unsubscribe {
-	struct res_header	icu_head;
+	mar_res_header_t	icu_head;
 
 };
 
@@ -242,7 +242,7 @@ struct res_evt_event_unsubscribe {
  * evd_head:		Request Head
  */
 struct res_evt_event_data {
-		struct res_header	evd_head;
+		mar_res_header_t	evd_head;
 };
 
 /*
@@ -272,7 +272,7 @@ struct res_evt_event_data {
  * led_body:				Pattern and user data
  */
 struct lib_event_data {
-	struct res_header		led_head;
+	mar_res_header_t		led_head;
 	unsigned int			led_nodeid;
 	SaTimeT					led_receive_time;
 	uint32_t				led_svr_channel_handle;
@@ -303,7 +303,7 @@ struct lib_event_data {
  */
 struct res_evt_event_publish {
 
-	struct res_header	iep_head;
+	mar_res_header_t	iep_head;
 	SaEvtEventIdT		iep_event_id;
 };
 
@@ -319,7 +319,7 @@ struct res_evt_event_publish {
  */
 struct req_evt_event_clear_retentiontime {
 
-	struct req_header	iec_head;
+	mar_req_header_t	iec_head;
 	SaEvtEventIdT		iec_event_id;
 	uint32_t			iec_channel_handle;
 
@@ -333,7 +333,7 @@ struct req_evt_event_clear_retentiontime {
  *
  */
 struct res_evt_event_clear_retentiontime {
-	struct res_header	iec_head;
+	mar_res_header_t	iec_head;
 };
 
 
@@ -396,7 +396,7 @@ struct open_chan_req {
  * u:			union of operation options.
  */
 struct req_evt_chan_command {
-	struct req_header 	chc_head;
+	mar_req_header_t 	chc_head;
 	int 				chc_op;
 	union {
 		struct open_chan_req	chc_chan;

+ 46 - 40
include/ipc_gen.h

@@ -34,8 +34,7 @@
 #ifndef IPC_GEN_H_DEFINED
 #define IPC_GEN_H_DEFINED
 
-#include <netinet/in.h>
-#include "../exec/totemip.h"
+#include "mar_gen.h"
 
 enum service_types {
 	EVS_SERVICE = 0,
@@ -58,52 +57,59 @@ enum res_init_types {
 	MESSAGE_RES_INIT
 };
 
-struct req_header {
-	int size;
-	int id;
-} __attribute__((aligned(8)));
+typedef struct {
+	int size __attribute__((aligned(8)));
+	int id __attribute__((aligned(8)));
+} mar_req_header_t __attribute__((aligned(8)));
 
-struct res_header {
-	int size;
-	int id;
-	SaAisErrorT error;
-} __attribute__((aligned(8)));
+static inline void swab_mar_req_header_t (mar_req_header_t *to_swab)
+{
+	swab_mar_int32_t (&to_swab->size);
+	swab_mar_int32_t (&to_swab->id);
+}
 
-struct req_lib_resdis_init {
-	int size;
-	int id;
-	int service;
-} __attribute__((aligned(8)));
+typedef struct {
+	int size; __attribute((aligned(8))) 
+	int id __attribute((aligned(8)));
+	SaAisErrorT error __attribute((aligned(8)));
+} mar_res_header_t __attribute__((aligned(8)));
 
-struct req_lib_response_init {
-	struct req_lib_resdis_init resdis_header;
-} __attribute__((aligned(8)));
+typedef struct {
+	int size __attribute((aligned(8)));
+	int id __attribute((aligned(8)));
+	int service __attribute((aligned(8)));
+} mar_req_lib_resdis_init_t __attribute__((aligned(8)));
 
-struct req_lib_dispatch_init {
-	struct req_lib_resdis_init resdis_header;
-	unsigned long conn_info;
-} __attribute__((aligned(8)));
+typedef struct {
+	mar_req_lib_resdis_init_t resdis_header __attribute__((aligned(8)));
+} mar_req_lib_response_init_t __attribute__((aligned(8)));
 
-struct req_lib_init {
-	struct res_header header;
-} __attribute__((aligned(8)));
+typedef struct {
+	mar_req_lib_resdis_init_t resdis_header __attribute__((aligned(8)));
+	void *conn_info __attribute__((aligned(8)));
+} mar_req_lib_dispatch_init_t __attribute__((aligned(8)));
 
-struct res_lib_init {
-	struct res_header header;
-} __attribute__((aligned(8)));
+typedef struct {
+	mar_res_header_t header __attribute__((aligned(8)));
+	void *conn_info __attribute__((aligned(8)));
+} mar_res_lib_response_init_t __attribute__((aligned(8)));
 
-struct res_lib_response_init {
-	struct res_header header;
-	unsigned long conn_info;
-} __attribute__((aligned(8)));
+typedef struct {
+	mar_res_header_t header __attribute__((aligned(8)));
+} mar_res_lib_dispatch_init_t __attribute__((aligned(8)));
 
-struct res_lib_dispatch_init {
-	struct res_header header;
-} __attribute__((aligned(8)));
+typedef struct {
+	mar_uint32_t nodeid __attribute__((aligned(8)));
+	void *conn __attribute__((aligned(8)));
+} mar_message_source_t __attribute__((aligned(8)));
 
-struct message_source {
-	unsigned int nodeid;
-	void *conn;
-} __attribute__((aligned(8)));
+/*
+ * TODO this isn't right
+ */
+static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
+{
+	swab_mar_uint32_t (&to_swab->nodeid);
+// TODO need to swab conn in some way
+}
 
 #endif /* IPC_GEN_H_DEFINED */

+ 17 - 17
include/ipc_lck.h

@@ -62,7 +62,7 @@ enum res_lib_lck_resource_types {
 };
 
 struct req_lib_lck_resourceopen {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaNameT lockResourceName;
 	SaLckResourceOpenFlagsT resourceOpenFlags;
@@ -72,30 +72,30 @@ struct req_lib_lck_resourceopen {
 };
 
 struct res_lib_lck_resourceopen {
-	struct res_header header;
+	mar_res_header_t header;
 	SaLckResourceHandleT resourceHandle;
-	struct message_source source;
+	mar_message_source_t source;
 };
 
 struct res_lib_lck_resourceopenasync {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaLckResourceHandleT resourceHandle;
-	struct message_source source;
+	mar_message_source_t source;
 };
 
 struct req_lib_lck_resourceclose {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT lockResourceName;
 	SaLckResourceHandleT resourceHandle;
 };
 
 struct res_lib_lck_resourceclose {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_lck_resourcelock {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT lockResourceName;
 	SaInvocationT invocation;
 	SaLckLockModeT lockMode;
@@ -104,18 +104,18 @@ struct req_lib_lck_resourcelock {
 	SaTimeT timeout;
 	SaLckLockIdT lockId;
 	int async_call;
-	struct message_source source;
+	mar_message_source_t source;
 	SaLckResourceHandleT resourceHandle;
 };
 
 struct res_lib_lck_resourcelock {
-	struct res_header header;
+	mar_res_header_t header;
 	SaLckLockStatusT lockStatus;
 	void *resource_lock;
 };
 
 struct res_lib_lck_resourcelockasync {
-	struct res_header header;
+	mar_res_header_t header;
 	SaLckLockStatusT lockStatus;
 	SaLckLockIdT lockId;
 	void *resource_lock;
@@ -124,7 +124,7 @@ struct res_lib_lck_resourcelockasync {
 };
 
 struct req_lib_lck_resourceunlock {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT lockResourceName;
 	SaLckLockIdT lockId;
 	SaInvocationT invocation;
@@ -134,25 +134,25 @@ struct req_lib_lck_resourceunlock {
 };
 
 struct res_lib_lck_resourceunlock {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct res_lib_lck_resourceunlockasync {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 };
 
 struct req_lib_lck_lockpurge {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT lockResourceName;
 };
 
 struct res_lib_lck_lockpurge {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct res_lib_lck_lockwaitercallback {
-	struct res_header header;
+	mar_res_header_t header;
 	SaLckWaiterSignalT waiter_signal;
 	SaLckLockIdT lock_id;
 	SaLckLockModeT mode_held;

+ 35 - 35
include/ipc_msg.h

@@ -79,7 +79,7 @@ enum res_lib_msg_queue_types {
 };
 
 struct req_lib_msg_queueopen {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaNameT queueName;
 	SaMsgQueueCreationAttributesT creationAttributes;
@@ -91,107 +91,107 @@ struct req_lib_msg_queueopen {
 };
 
 struct res_lib_msg_queueopen {
-	struct res_header header;
+	mar_res_header_t header;
 	SaMsgQueueHandleT queueHandle;
-	struct message_source source;
+	mar_message_source_t source;
 };
 
 struct res_lib_msg_queueopenasync {
-	struct res_header header;
+	mar_res_header_t header;
 	SaInvocationT invocation;
 	SaMsgQueueHandleT queueHandle;
-	struct message_source source;
+	mar_message_source_t source;
 };
 
 struct req_lib_msg_queueclose {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueName;
 	SaMsgQueueHandleT queueHandle;
 };
 
 struct res_lib_msg_queueclose {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuestatusget {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueName;
 };
 
 struct res_lib_msg_queuestatusget {
-	struct res_header header;
+	mar_res_header_t header;
 	SaMsgQueueStatusT queueStatus;
 };
 
 struct req_lib_msg_queueunlink {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueName;
 };
 
 struct res_lib_msg_queueunlink {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuegroupcreate {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 	SaMsgQueueGroupPolicyT queueGroupPolicy;
 };
 
 struct res_lib_msg_queuegroupcreate {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuegroupinsert {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 	SaNameT queueName;
 };
 
 struct res_lib_msg_queuegroupinsert {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuegroupremove {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 	SaNameT queueName;
 };
 
 struct res_lib_msg_queuegroupremove {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuegroupdelete {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 };
 
 struct res_lib_msg_queuegroupdelete {
-	struct res_header header;
+	mar_res_header_t header;
 };
 	
 struct req_lib_msg_queuegrouptrack {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 	SaUint8T trackFlags;
 };
 
 struct res_lib_msg_queuegrouptrack {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_queuegrouptrackstop {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueGroupName;
 };
 
 struct res_lib_msg_queuegrouptrackstop {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_messagesend {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaNameT destination;
 	SaMsgMessageT message;
@@ -201,37 +201,37 @@ struct req_lib_msg_messagesend {
 };
 
 struct res_lib_msg_messagesend {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct res_lib_msg_messagesendasync {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_messageget {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueName;
 	SaTimeT timeout;
 };
 
 struct res_lib_msg_messageget {
-	struct res_header header;
+	mar_res_header_t header;
 	SaTimeT sendTime;
 	SaMsgSenderIdT senderId;
 	SaMsgMessageT message;
 };
 
 struct req_lib_msg_messagecancel {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT queueName;
 };
 
 struct res_lib_msg_messagecancel {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct req_lib_msg_messagesendreceive {
-	struct req_header header;
+	mar_req_header_t header;
 	SaNameT destination;
 	SaTimeT timeout;
 	SaNameT queueName;
@@ -239,13 +239,13 @@ struct req_lib_msg_messagesendreceive {
 };
 
 struct res_lib_msg_messagesendreceive {
-	struct res_header header;
+	mar_res_header_t header;
 	SaTimeT replySendTime;
 	SaMsgMessageT receiveMessage;
 };
 
 struct req_lib_msg_messagereply {
-	struct req_header header;
+	mar_req_header_t header;
 	SaInvocationT invocation;
 	SaNameT queueName;
 	SaNameT senderId;
@@ -256,11 +256,11 @@ struct req_lib_msg_messagereply {
 };
 
 struct res_lib_msg_messagereply {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 struct res_lib_msg_messagereplyasync {
-	struct res_header header;
+	mar_res_header_t header;
 };
 
 #endif /* IPC_MSG_H_DEFINED */

+ 294 - 0
include/mar_ckpt.h

@@ -0,0 +1,294 @@
+/*
+ * Copyright (C) 2006 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@mvista.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AIS_MAR_CKPT_H_DEFINED
+#define AIS_MAR_CKPT_H_DEFINED
+
+#include "saAis.h"
+#include "saCkpt.h"
+#include "mar_gen.h"
+
+typedef mar_uint64_t mar_ckpt_checkpoint_handle_t;
+
+static inline void swab_mar_ckpt_checkpoint_handle_t (
+	mar_ckpt_checkpoint_handle_t *to_swab)
+{
+	swab_mar_uint64_t (to_swab);
+}
+
+typedef mar_uint32_t mar_ckpt_checkpoint_creation_flags_t;
+
+static inline void swab_mar_ckpt_checkpoint_creation_flags_t (
+	mar_ckpt_checkpoint_creation_flags_t *to_swab)
+{
+	swab_mar_uint32_t (to_swab);
+}
+
+/*
+ * Marshalling the SaCkptCheckpointCreationAttributesT data structure
+ */
+typedef struct {
+	mar_ckpt_checkpoint_creation_flags_t creation_flags __attribute__((aligned(8)));
+	mar_size_t checkpoint_size __attribute__((aligned(8)));
+	mar_time_t retention_duration __attribute__((aligned(8)));
+	mar_uint32_t max_sections __attribute__((aligned(8)));
+	mar_size_t max_section_size __attribute__((aligned(8)));
+	mar_size_t max_section_id_size __attribute__((aligned(8)));
+} mar_ckpt_checkpoint_creation_attributes_t;
+
+static inline void swab_mar_ckpt_checkpoint_creation_attributes_t (
+	mar_ckpt_checkpoint_creation_attributes_t *to_swab)
+{
+	swab_mar_ckpt_checkpoint_creation_flags_t (&to_swab->creation_flags);
+	swab_mar_size_t (&to_swab->checkpoint_size);
+	swab_mar_time_t (&to_swab->retention_duration);
+	swab_mar_uint32_t (&to_swab->max_sections);
+	swab_mar_size_t (&to_swab->max_section_size);
+	swab_mar_size_t (&to_swab->max_section_id_size);
+}
+
+static inline void marshall_from_mar_ckpt_checkpoint_creation_attributes_t (
+	SaCkptCheckpointCreationAttributesT *dest,
+	mar_ckpt_checkpoint_creation_attributes_t *src)
+{
+	dest->creationFlags = src->creation_flags;
+	dest->checkpointSize = src->checkpoint_size;
+	dest->retentionDuration = src->retention_duration;
+	dest->maxSections = src->max_sections;
+	dest->maxSectionSize = src->max_section_size;
+	dest->maxSectionIdSize = src->max_section_id_size;
+}
+
+static inline void marshall_to_mar_ckpt_checkpoint_creation_attributes_t (
+	mar_ckpt_checkpoint_creation_attributes_t *dest,
+	SaCkptCheckpointCreationAttributesT *src)
+{
+	memset (dest, 0, sizeof (mar_ckpt_checkpoint_creation_attributes_t));
+	dest->creation_flags = src->creationFlags;
+	dest->checkpoint_size = src->checkpointSize;
+	dest->retention_duration = src->retentionDuration;
+	dest->max_sections = src->maxSections;
+	dest->max_section_size = src->maxSectionSize;
+	dest->max_section_id_size = src->maxSectionIdSize;
+}
+	
+#define MAR_CKPT_CHECKPOINT_READ	0x1
+#define MAR_CKPT_CHECKPOINT_WRITE	0x2
+#define MAR_CKPT_CHECKPOINT_CREATE	0x4
+
+typedef mar_uint32_t mar_ckpt_checkpoint_open_flags_t;
+
+static inline void swab_mar_ckpt_checkpoint_open_flags_t (mar_ckpt_checkpoint_open_flags_t *to_swab)
+{
+	swab_mar_uint32_t (to_swab);
+}
+
+#define MAR_CKPT_DEFAULT_SECTION_ID	{ 0, 0 }
+#define MAR_CKPT_GENERATED_SECTION_ID	{ 0, 0 }
+
+/*
+ * Marshalling the SaCkptSectionIdT data structure
+ */
+typedef struct {
+	mar_uint16_t id_len __attribute__((aligned(8)));
+	mar_uint8_t *id __attribute__((aligned(8)));
+} mar_ckpt_section_id_t;
+
+static inline void swab_mar_ckpt_section_id_t (mar_ckpt_section_id_t *to_swab)
+{
+	swab_mar_uint16_t (&to_swab->id_len);
+}
+
+static inline void marshall_from_mar_ckpt_section_id_t (
+	SaCkptSectionIdT *dest,
+	mar_ckpt_section_id_t *src)
+{
+	dest->idLen = src->id_len;
+	dest->id = src->id;
+}
+
+static inline void marshall_to_mar_ckpt_section_id_t (
+	mar_ckpt_section_id_t *dest,
+	SaCkptSectionIdT *src)
+{
+	memset (dest, 0, sizeof (mar_ckpt_section_id_t));
+	dest->id_len = src->idLen;
+	dest->id = src->id;
+}
+
+/*
+ * Marshalling the SaCkptSectionCreationAttributesT data structure
+ */
+typedef struct {
+	mar_ckpt_section_id_t *section_id __attribute__((aligned(8)));
+	mar_time_t expiration_time __attribute__((aligned(8)));
+} mar_ckpt_section_creation_attributes_t;
+
+static inline void swab_mar_ckpt_section_creation_attributes_t (
+	mar_ckpt_section_creation_attributes_t *to_swab)
+{
+	swab_mar_ckpt_section_id_t (to_swab->section_id);
+	swab_mar_time_t (&to_swab->expiration_time);
+}
+
+static inline void marshall_from_mar_ckpt_section_creation_attributes_t (
+	SaCkptSectionCreationAttributesT *dest,
+	mar_ckpt_section_creation_attributes_t *src)
+{
+	marshall_from_mar_ckpt_section_id_t (dest->sectionId, src->section_id);
+	dest->expirationTime = src->expiration_time;
+}
+
+static inline void marshall_to_mar_ckpt_section_creation_attributes_t (
+	mar_ckpt_section_creation_attributes_t *dest,
+	SaCkptSectionCreationAttributesT *src)
+{
+	memset (dest, 0, sizeof (mar_ckpt_section_creation_attributes_t));
+	marshall_to_mar_ckpt_section_id_t (dest->section_id, src->sectionId);
+	dest->expiration_time = src->expirationTime;
+}
+
+typedef mar_uint32_t mar_ckpt_section_state_t;
+#define	MAR_CKPT_SECTION_VALID 1
+#define	MAR_CKPT_SECTION_CORRUPTED 2
+
+static inline void swab_mar_ckpt_section_state_t (
+	mar_ckpt_section_state_t *to_swab)
+{
+	swab_mar_uint32_t (to_swab);
+}
+
+/*
+ * Marshalling the SaCkptSectionDescriptorT data structure
+ */
+typedef struct {
+	mar_ckpt_section_id_t section_id __attribute__((aligned(8)));
+	mar_time_t expiration_time __attribute__((aligned(8)));
+	mar_size_t section_size __attribute__((aligned(8)));
+	mar_ckpt_section_state_t section_state __attribute__((aligned(8)));
+	mar_time_t last_update __attribute__((aligned(8)));
+} mar_ckpt_section_descriptor_t;
+
+static inline void swab_mar_ckpt_section_descriptor_t (
+	mar_ckpt_section_descriptor_t *to_swab)
+{
+	swab_mar_ckpt_section_id_t (&to_swab->section_id);
+	swab_mar_time_t (&to_swab->expiration_time);
+	swab_mar_size_t (&to_swab->section_size);
+	swab_mar_ckpt_section_state_t (&to_swab->section_state);
+	swab_mar_time_t (&to_swab->last_update);
+}
+static inline void marshall_from_mar_ckpt_section_descriptor_t (
+	SaCkptSectionDescriptorT *dest,
+	mar_ckpt_section_descriptor_t *src)
+{
+	marshall_from_mar_ckpt_section_id_t (&dest->sectionId, &src->section_id);
+	dest->expirationTime = src->expiration_time;
+	dest->sectionSize = src->section_size;
+	dest->sectionState = src->section_state;
+	dest->lastUpdate = src->last_update;
+}
+
+static inline void marshall_to_mar_ckpt_section_descriptor_t (
+	mar_ckpt_section_descriptor_t *dest,
+	SaCkptSectionDescriptorT *src)
+{
+	memset (dest, 0, sizeof (mar_ckpt_section_descriptor_t));
+	marshall_to_mar_ckpt_section_id_t (&dest->section_id, &src->sectionId);
+	dest->expiration_time = src->expirationTime;
+	dest->section_size = src->sectionSize;
+	dest->section_state = src->sectionState;
+	dest->last_update = src->lastUpdate;
+}
+
+typedef enum {
+	MAR_CKPT_SECTIONS_FOREVER = 1,
+	MAR_CKPT_SECTIONS_LEQ_EXPIRATION_TIME = 2,
+	MAR_CKPT_SECTIONS_GEQ_EXPIRATION_TIME = 3,
+	MAR_CKPT_SECTIONS_CORRUPTED = 4,
+	MAR_CKPT_SECTIONS_ANY = 5
+} mar_ckpt_sections_chosen_t;
+
+typedef mar_uint64_t mar_offset_t;
+
+static inline void swab_mar_offset_t (
+	mar_offset_t *to_swab)
+{
+	swab_mar_uint64_t (to_swab);
+}
+
+/*
+ * Marshalling the SaCkptIOVectorElementT (not needed)
+ */
+typedef struct {
+	mar_ckpt_section_id_t section_id __attribute__((aligned(8)));
+	void *data_buffer __attribute__((aligned(8)));
+	mar_size_t data_size __attribute__((aligned(8)));
+	mar_offset_t data_offset __attribute__((aligned(8)));
+	mar_size_t read_size __attribute__((aligned(8)));
+} mar_ckpt_io_vector_element_t;
+
+/*
+ * Marshalling the SaCkptCheckpointDescriptorT 
+ */
+typedef struct {
+	mar_ckpt_checkpoint_creation_attributes_t checkpoint_creation_attributes __attribute__((aligned(8)));
+	mar_uint32_t number_of_sections __attribute__((aligned(8)));
+	mar_uint32_t memory_used __attribute__((aligned(8)));
+} mar_ckpt_checkpoint_descriptor_t;
+
+static inline void marshall_from_mar_ckpt_checkpoint_descriptor_t (
+	SaCkptCheckpointDescriptorT *dest,
+	mar_ckpt_checkpoint_descriptor_t *src)
+{
+	marshall_from_mar_ckpt_checkpoint_creation_attributes_t (
+		&dest->checkpointCreationAttributes,
+		&src->checkpoint_creation_attributes);
+	dest->numberOfSections = src->number_of_sections;
+	dest->memoryUsed = src->memory_used;
+}
+
+static inline void marshall_to_mar_ckpt_checkpoint_descriptor_t (
+	mar_ckpt_checkpoint_descriptor_t *dest,
+	SaCkptCheckpointDescriptorT *src)
+{
+	memset (dest, 0, sizeof (mar_ckpt_checkpoint_descriptor_t));
+	marshall_to_mar_ckpt_checkpoint_creation_attributes_t (
+		&dest->checkpoint_creation_attributes,
+		&src->checkpointCreationAttributes);
+	dest->number_of_sections = src->numberOfSections;
+	dest->memory_used = src->memoryUsed;
+}
+
+#endif /* AIS_MAR_CKPT_H_DEFINED */

+ 102 - 2
include/mar_gen.h

@@ -35,13 +35,72 @@
 #ifndef AIS_MAR_GEN_H_DEFINED
 #define AIS_MAR_GEN_H_DEFINED
 
+#include <stdint.h>
+#include <string.h>
+
 #include "saAis.h"
+#include "swab.h"
+
+typedef int8_t mar_int8_t;
+typedef int16_t mar_int16_t;
+typedef int32_t mar_int32_t;
+typedef int64_t mar_int64_t;
+
+typedef uint8_t mar_uint8_t;
+typedef uint16_t mar_uint16_t;
+typedef uint32_t mar_uint32_t;
+typedef uint64_t mar_uint64_t;
+
+static inline void swab_mar_int8_t (mar_int8_t *to_swab)
+{
+	return;
+}
+
+static inline void swab_mar_int16_t (mar_int16_t *to_swab)
+{
+	*to_swab = swab16 (*to_swab);
+}
+
+static inline void swab_mar_int32_t (mar_int32_t *to_swab)
+{
+	*to_swab = swab32 (*to_swab);
+}
+
+static inline void swab_mar_int64_t (mar_int64_t *to_swab)
+{
+	*to_swab = swab64 (*to_swab);
+}
+
+static inline void swab_mar_uint8_t (mar_uint8_t *to_swab)
+{
+	return;
+}
+
+static inline void swab_mar_uint16_t (mar_uint16_t *to_swab)
+{
+	*to_swab = swab16 (*to_swab);
+}
+
+static inline void swab_mar_uint32_t (mar_uint32_t *to_swab)
+{
+	*to_swab = swab32 (*to_swab);
+}
+
+static inline void swab_mar_uint64_t (mar_uint64_t *to_swab)
+{
+	*to_swab = swab64 (*to_swab);
+}
 
 typedef struct {
-	unsigned short length;
-	unsigned char value[SA_MAX_NAME_LENGTH];
+	mar_uint16_t length __attribute__((aligned(8)));
+	mar_uint8_t value[SA_MAX_NAME_LENGTH] __attribute__((aligned(8)));
 } mar_name_t;
 
+static inline void swab_mar_name_t (mar_name_t *to_swab)
+{
+	swab_mar_uint16_t (&to_swab->length);
+}
+
 static inline void marshall_from_mar_name_t (
 	SaNameT *dest,
 	mar_name_t *src)
@@ -58,4 +117,45 @@ static inline void marshall_to_mar_name_t (
 	memcpy (dest->value, src->value, SA_MAX_NAME_LENGTH);
 }
 
+typedef enum {
+	MAR_FALSE = 0,
+	MAR_TRUE = 1
+} mar_bool_t;
+
+typedef mar_uint64_t mar_time_t;
+
+static inline void swab_mar_time_t (mar_time_t *to_swab)
+{
+	swab_mar_uint64_t (to_swab);
+}
+
+#define MAR_TIME_END ((SaTimeT)0x7fffffffffffffffull)
+#define MAR_TIME_BEGIN            0x0ULL
+#define MAR_TIME_UNKNOWN          0x8000000000000000ULL
+
+#define MAR_TIME_ONE_MICROSECOND 1000ULL
+#define MAR_TIME_ONE_MILLISECOND 1000000ULL
+#define MAR_TIME_ONE_SECOND      1000000000ULL
+#define MAR_TIME_ONE_MINUTE      60000000000ULL
+#define MAR_TIME_ONE_HOUR        3600000000000ULL
+#define MAR_TIME_ONE_DAY         86400000000000ULL
+#define MAR_TIME_MAX             SA_TIME_END
+
+#define MAR_TRACK_CURRENT 0x01
+#define MAR_TRACK_CHANGES 0x02
+#define MAR_TRACK_CHANGES_ONLY 0x04
+
+typedef mar_uint64_t mar_invocation_t;
+
+static inline void swab_mar_invocation_t (mar_invocation_t *to_swab)
+{
+	swab_mar_uint64_t (to_swab);
+}
+
+typedef mar_uint64_t mar_size_t;
+
+static inline void swab_mar_size_t (mar_size_t *to_swab)
+{
+	swab_mar_uint64_t (to_swab);
+}
 #endif /* AIS_MAR_GEN_TYPES_H_DEFINED */

+ 0 - 0
exec/swab.h → include/swab.h


+ 4 - 4
lib/amf.c

@@ -53,7 +53,7 @@
 
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[4096];
 };
 
@@ -256,16 +256,16 @@ saAmfDispatch (
 			 * Queue empty, read response from socket
 			 */ 
 			error = saRecvRetry (amfInstance->dispatch_fd, &dispatch_data.header,
-				sizeof (struct res_header));
+				sizeof (mar_res_header_t));
 
 			if (error != SA_AIS_OK) {
 
 				goto error_unlock;
 			}
-			if (dispatch_data.header.size > sizeof (struct res_header)) {
+			if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 
 				error = saRecvRetry (amfInstance->dispatch_fd, &dispatch_data.data,
-					dispatch_data.header.size - sizeof (struct res_header));
+					dispatch_data.header.size - sizeof (mar_res_header_t));
 
 				if (error != SA_AIS_OK) {
 

+ 93 - 82
lib/ckpt.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2002-2004 MontaVista Software, Inc.
+ * Copyright (c) 2006 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -48,13 +49,15 @@
 #include "../include/saAis.h"
 #include "../include/list.h"
 #include "../include/saCkpt.h"
+#include "../include/mar_gen.h"
+#include "../include/mar_ckpt.h"
 #include "../include/ipc_gen.h"
 #include "../include/ipc_ckpt.h"
 
 #include "util.h"
 
 struct message_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[4096];
 };
 
@@ -399,13 +402,13 @@ saCkptDispatch (
 		}
 		
 		memset(&dispatch_data,0, sizeof(struct message_overlay));
-		error = saRecvRetry (ckptInstance->dispatch_fd, &dispatch_data.header, sizeof (struct res_header));
+		error = saRecvRetry (ckptInstance->dispatch_fd, &dispatch_data.header, sizeof (mar_res_header_t));
 		if (error != SA_AIS_OK) {
 			goto error_unlock;
 		}
-		if (dispatch_data.header.size > sizeof (struct res_header)) {
+		if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 			error = saRecvRetry (ckptInstance->dispatch_fd, &dispatch_data.data,
-				dispatch_data.header.size - sizeof (struct res_header));
+				dispatch_data.header.size - sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}
@@ -435,7 +438,7 @@ saCkptDispatch (
 			 */
 			if (res_lib_ckpt_checkpointopenasync->header.error == SA_AIS_OK) {
 				error = saHandleInstanceGet (&checkpointHandleDatabase,
-					res_lib_ckpt_checkpointopenasync->checkpointHandle,
+					res_lib_ckpt_checkpointopenasync->checkpoint_handle,
 					(void *)&ckptCheckpointInstance);
 
 					assert (error == SA_AIS_OK); /* should only be valid handles here */
@@ -449,10 +452,10 @@ saCkptDispatch (
 
 				callbacks.saCkptCheckpointOpenCallback(
 					res_lib_ckpt_checkpointopenasync->invocation,
-					res_lib_ckpt_checkpointopenasync->checkpointHandle,
+					res_lib_ckpt_checkpointopenasync->checkpoint_handle,
 					res_lib_ckpt_checkpointopenasync->header.error);
 				saHandleInstancePut (&checkpointHandleDatabase,
-					res_lib_ckpt_checkpointopenasync->checkpointHandle);
+					res_lib_ckpt_checkpointopenasync->checkpoint_handle);
 			} else {
 				/*
 				 * open failed with error
@@ -618,16 +621,20 @@ saCkptCheckpointOpen (
 
 	req_lib_ckpt_checkpointopen.header.size = sizeof (struct req_lib_ckpt_checkpointopen);
 	req_lib_ckpt_checkpointopen.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN;
-	memcpy (&req_lib_ckpt_checkpointopen.checkpointName, checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
+		(SaNameT *)checkpointName);
 	memcpy (&ckptCheckpointInstance->checkpointName, checkpointName, sizeof (SaNameT));
-	req_lib_ckpt_checkpointopen.checkpointCreationAttributesSet = 0;
+	req_lib_ckpt_checkpointopen.async_call = 0;
+	req_lib_ckpt_checkpointopen.invocation = 0;
+	req_lib_ckpt_checkpointopen.fail_with_error = SA_AIS_OK;
+	req_lib_ckpt_checkpointopen.checkpoint_creation_attributes_set = 0;
 	if (checkpointCreationAttributes) {
-		memcpy (&req_lib_ckpt_checkpointopen.checkpointCreationAttributes,
-			checkpointCreationAttributes,
-			sizeof (SaCkptCheckpointCreationAttributesT));
-		req_lib_ckpt_checkpointopen.checkpointCreationAttributesSet = 1;
+		marshall_to_mar_ckpt_checkpoint_creation_attributes_t (
+			&req_lib_ckpt_checkpointopen.checkpoint_creation_attributes,
+			(SaCkptCheckpointCreationAttributesT *)checkpointCreationAttributes);
+		req_lib_ckpt_checkpointopen.checkpoint_creation_attributes_set = 1;
 	}
-	req_lib_ckpt_checkpointopen.checkpointOpenFlags = checkpointOpenFlags;
+	req_lib_ckpt_checkpointopen.checkpoint_open_flags = checkpointOpenFlags;
 
 	error = saSendRetry (ckptCheckpointInstance->response_fd, &req_lib_ckpt_checkpointopen,
 		sizeof (struct req_lib_ckpt_checkpointopen));
@@ -679,7 +686,7 @@ saCkptCheckpointOpenAsync (
 	struct ckptInstance *ckptInstance;
 	SaCkptCheckpointHandleT checkpointHandle;
 	SaAisErrorT error;
-	struct req_lib_ckpt_checkpointopenasync req_lib_ckpt_checkpointopenasync;
+	struct req_lib_ckpt_checkpointopen req_lib_ckpt_checkpointopen;
 	struct res_lib_ckpt_checkpointopenasync res_lib_ckpt_checkpointopenasync;
 	SaAisErrorT failWithError = SA_AIS_OK;
 
@@ -737,27 +744,29 @@ saCkptCheckpointOpenAsync (
 	if (failWithError == SA_AIS_OK) {
 		memcpy (&ckptCheckpointInstance->checkpointName, checkpointName,
 			sizeof (SaNameT));
-		memcpy (&req_lib_ckpt_checkpointopenasync.checkpointName,
-			checkpointName, sizeof (SaNameT));
+		marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
+			(SaNameT *)checkpointName);
 	}
 
-	req_lib_ckpt_checkpointopenasync.header.size = sizeof (struct req_lib_ckpt_checkpointopenasync);
-	req_lib_ckpt_checkpointopenasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPENASYNC;
-	req_lib_ckpt_checkpointopenasync.invocation = invocation;
-	req_lib_ckpt_checkpointopenasync.fail_with_error = failWithError;
-	req_lib_ckpt_checkpointopenasync.checkpointCreationAttributesSet = 0;
+	req_lib_ckpt_checkpointopen.header.size = sizeof (struct req_lib_ckpt_checkpointopen);
+	req_lib_ckpt_checkpointopen.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN;
+	req_lib_ckpt_checkpointopen.async_call = 1;
+	req_lib_ckpt_checkpointopen.invocation = invocation;
+	req_lib_ckpt_checkpointopen.fail_with_error = failWithError;
+	req_lib_ckpt_checkpointopen.checkpoint_creation_attributes_set = 0;
 	if (checkpointCreationAttributes) {
-		memcpy (&req_lib_ckpt_checkpointopenasync.checkpointCreationAttributes,
-			checkpointCreationAttributes,
-			sizeof (SaCkptCheckpointCreationAttributesT));
-		req_lib_ckpt_checkpointopenasync.checkpointCreationAttributesSet = 1;
+		marshall_to_mar_ckpt_checkpoint_creation_attributes_t (
+			&req_lib_ckpt_checkpointopen.checkpoint_creation_attributes,
+			(SaCkptCheckpointCreationAttributesT *)checkpointCreationAttributes);
+		req_lib_ckpt_checkpointopen.checkpoint_creation_attributes_set = 1;
 	}
 	
-	req_lib_ckpt_checkpointopenasync.checkpointOpenFlags = checkpointOpenFlags;
-	req_lib_ckpt_checkpointopenasync.checkpointHandle = checkpointHandle;
+	req_lib_ckpt_checkpointopen.checkpoint_open_flags = checkpointOpenFlags;
+	req_lib_ckpt_checkpointopen.checkpoint_handle = checkpointHandle;
 
-	error = saSendRetry (ckptInstance->response_fd, &req_lib_ckpt_checkpointopenasync,
-		sizeof (struct req_lib_ckpt_checkpointopenasync));
+	error = saSendRetry (ckptInstance->response_fd,
+		&req_lib_ckpt_checkpointopen,
+		sizeof (struct req_lib_ckpt_checkpointopen));
 	
 	if (error != SA_AIS_OK) {
 		goto error_put_destroy;
@@ -810,8 +819,8 @@ saCkptCheckpointClose (
 
 	req_lib_ckpt_checkpointclose.header.size = sizeof (struct req_lib_ckpt_checkpointclose);
 	req_lib_ckpt_checkpointclose.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTCLOSE;
-	memcpy (&req_lib_ckpt_checkpointclose.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointclose.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	error = saSendRetry (ckptCheckpointInstance->response_fd, &req_lib_ckpt_checkpointclose,
 		sizeof (struct req_lib_ckpt_checkpointclose));
@@ -857,8 +866,8 @@ saCkptCheckpointUnlink (
 
 	req_lib_ckpt_checkpointunlink.header.size = sizeof (struct req_lib_ckpt_checkpointunlink);
 	req_lib_ckpt_checkpointunlink.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTUNLINK;
-	memcpy (&req_lib_ckpt_checkpointunlink.checkpointName, checkpointName, sizeof (SaNameT));
-
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointunlink.checkpoint_name,
+		(SaNameT *)checkpointName);
 
 	error = saSendRetry (ckptInstance->response_fd, &req_lib_ckpt_checkpointunlink,
 		sizeof (struct req_lib_ckpt_checkpointunlink));
@@ -897,9 +906,9 @@ saCkptCheckpointRetentionDurationSet (
 	req_lib_ckpt_checkpointretentiondurationset.header.size = sizeof (struct req_lib_ckpt_checkpointretentiondurationset);
 	req_lib_ckpt_checkpointretentiondurationset.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET;
 
-	req_lib_ckpt_checkpointretentiondurationset.retentionDuration = retentionDuration;
-	memcpy (&req_lib_ckpt_checkpointretentiondurationset.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	req_lib_ckpt_checkpointretentiondurationset.retention_duration = retentionDuration;
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointretentiondurationset.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -942,8 +951,8 @@ saCkptActiveReplicaSet (
 
 	req_lib_ckpt_activereplicaset.header.size = sizeof (struct req_lib_ckpt_activereplicaset);
 	req_lib_ckpt_activereplicaset.header.id = MESSAGE_REQ_CKPT_ACTIVEREPLICASET;
-	memcpy (&req_lib_ckpt_activereplicaset.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_activereplicaset.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -987,8 +996,8 @@ saCkptCheckpointStatusGet (
 	req_lib_ckpt_checkpointstatusget.header.size = sizeof (struct req_lib_ckpt_checkpointstatusget);
 	req_lib_ckpt_checkpointstatusget.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET;
 
-	memcpy (&req_lib_ckpt_checkpointstatusget.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointstatusget.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -1007,9 +1016,9 @@ saCkptCheckpointStatusGet (
 
 	pthread_mutex_unlock (&ckptCheckpointInstance->response_mutex);
 
-	memcpy (checkpointStatus,
-		&res_lib_ckpt_checkpointstatusget.checkpointDescriptor,
-		sizeof (SaCkptCheckpointDescriptorT));
+	marshall_from_mar_ckpt_checkpoint_descriptor_t (
+		checkpointStatus,
+		&res_lib_ckpt_checkpointstatusget.checkpoint_descriptor);
 
 error_exit:
 	saHandleInstancePut (&checkpointHandleDatabase, checkpointHandle);
@@ -1053,12 +1062,12 @@ saCkptSectionCreate (
 		initialDataSize; 
 
 	req_lib_ckpt_sectioncreate.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONCREATE;
-	req_lib_ckpt_sectioncreate.idLen = sectionCreationAttributes->sectionId->idLen;
-	req_lib_ckpt_sectioncreate.expirationTime = sectionCreationAttributes->expirationTime;
-	req_lib_ckpt_sectioncreate.initialDataSize = initialDataSize;
+	req_lib_ckpt_sectioncreate.id_len = sectionCreationAttributes->sectionId->idLen;
+	req_lib_ckpt_sectioncreate.expiration_time = sectionCreationAttributes->expirationTime;
+	req_lib_ckpt_sectioncreate.initial_data_size = initialDataSize;
 
-	memcpy (&req_lib_ckpt_sectioncreate.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_sectioncreate.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -1125,10 +1134,11 @@ saCkptSectionDelete (
 
 	req_lib_ckpt_sectiondelete.header.size = sizeof (struct req_lib_ckpt_sectiondelete) + sectionId->idLen; 
 	req_lib_ckpt_sectiondelete.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONDELETE;
-	req_lib_ckpt_sectiondelete.idLen = sectionId->idLen;
+	req_lib_ckpt_sectiondelete.id_len = sectionId->idLen;
 
-	memcpy (&req_lib_ckpt_sectiondelete.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (
+		&req_lib_ckpt_sectiondelete.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	error = saSendRetry (ckptCheckpointInstance->response_fd, &req_lib_ckpt_sectiondelete,
 		sizeof (struct req_lib_ckpt_sectiondelete));
@@ -1185,11 +1195,11 @@ saCkptSectionExpirationTimeSet (
 
 	req_lib_ckpt_sectionexpirationtimeset.header.size = sizeof (struct req_lib_ckpt_sectionexpirationtimeset) + sectionId->idLen; 
 	req_lib_ckpt_sectionexpirationtimeset.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONEXPIRATIONTIMESET;
-	req_lib_ckpt_sectionexpirationtimeset.idLen = sectionId->idLen;
-	req_lib_ckpt_sectionexpirationtimeset.expirationTime = expirationTime;
+	req_lib_ckpt_sectionexpirationtimeset.id_len = sectionId->idLen;
+	req_lib_ckpt_sectionexpirationtimeset.expiration_time = expirationTime;
 
-	memcpy (&req_lib_ckpt_sectionexpirationtimeset.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_sectionexpirationtimeset.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -1286,10 +1296,11 @@ saCkptSectionIterationInitialize (
 
 	req_lib_ckpt_sectioniterationinitialize.header.size = sizeof (struct req_lib_ckpt_sectioniterationinitialize); 
 	req_lib_ckpt_sectioniterationinitialize.header.id = MESSAGE_REQ_CKPT_SECTIONITERATIONINITIALIZE;
-	req_lib_ckpt_sectioniterationinitialize.sectionsChosen = sectionsChosen;
-	req_lib_ckpt_sectioniterationinitialize.expirationTime = expirationTime;
-	memcpy (&req_lib_ckpt_sectioniterationinitialize.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	req_lib_ckpt_sectioniterationinitialize.sections_chosen = sectionsChosen;
+	req_lib_ckpt_sectioniterationinitialize.expiration_time = expirationTime;
+	marshall_to_mar_name_t (
+		&req_lib_ckpt_sectioniterationinitialize.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptSectionIterationInstance->response_mutex);
 
@@ -1380,9 +1391,9 @@ saCkptSectionIterationNext (
 		goto error_put_unlock;
 	}
 
-	memcpy (sectionDescriptor,
-		&res_lib_ckpt_sectioniterationnext.sectionDescriptor,
-		sizeof (SaCkptSectionDescriptorT));
+	marshall_from_mar_ckpt_section_descriptor_t (
+		sectionDescriptor,
+		&res_lib_ckpt_sectioniterationnext.section_descriptor);
 
 	sectionDescriptor->sectionId.id = &iteratorSectionIdListEntry->data[0];
 	
@@ -1504,12 +1515,12 @@ saCkptCheckpointWrite (
 
 		req_lib_ckpt_sectionwrite.header.size = sizeof (struct req_lib_ckpt_sectionwrite) + ioVector[i].sectionId.idLen + ioVector[i].dataSize; 
 
-		req_lib_ckpt_sectionwrite.dataOffset = ioVector[i].dataOffset;
-		req_lib_ckpt_sectionwrite.dataSize = ioVector[i].dataSize;
-		req_lib_ckpt_sectionwrite.idLen = ioVector[i].sectionId.idLen;
+		req_lib_ckpt_sectionwrite.data_offset = ioVector[i].dataOffset;
+		req_lib_ckpt_sectionwrite.data_size = ioVector[i].dataSize;
+		req_lib_ckpt_sectionwrite.id_len = ioVector[i].sectionId.idLen;
 
-		memcpy (&req_lib_ckpt_sectionwrite.checkpointName,
-			&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+		marshall_to_mar_name_t (&req_lib_ckpt_sectionwrite.checkpoint_name,
+			&ckptCheckpointInstance->checkpointName);
 
 		iov_len = 0;
 /* TODO check for zero length stuff */
@@ -1592,10 +1603,10 @@ saCkptSectionOverwrite (
 
 	req_lib_ckpt_sectionoverwrite.header.size = sizeof (struct req_lib_ckpt_sectionoverwrite) + sectionId->idLen + dataSize; 
 	req_lib_ckpt_sectionoverwrite.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONOVERWRITE;
-	req_lib_ckpt_sectionoverwrite.idLen = sectionId->idLen;
-	req_lib_ckpt_sectionoverwrite.dataSize = dataSize;
-	memcpy (&req_lib_ckpt_sectionoverwrite.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	req_lib_ckpt_sectionoverwrite.id_len = sectionId->idLen;
+	req_lib_ckpt_sectionoverwrite.data_size = dataSize;
+	marshall_to_mar_name_t (&req_lib_ckpt_sectionoverwrite.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 	
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -1666,12 +1677,12 @@ saCkptCheckpointRead (
 		req_lib_ckpt_sectionread.header.size = sizeof (struct req_lib_ckpt_sectionread) +
 			ioVector[i].sectionId.idLen;
 
-		req_lib_ckpt_sectionread.idLen = ioVector[i].sectionId.idLen;
-		req_lib_ckpt_sectionread.dataOffset = ioVector[i].dataOffset;
-		req_lib_ckpt_sectionread.dataSize = ioVector[i].dataSize;
+		req_lib_ckpt_sectionread.id_len = ioVector[i].sectionId.idLen;
+		req_lib_ckpt_sectionread.data_offset = ioVector[i].dataOffset;
+		req_lib_ckpt_sectionread.data_size = ioVector[i].dataSize;
 
-		memcpy (&req_lib_ckpt_sectionread.checkpointName,
-			&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+		marshall_to_mar_name_t (&req_lib_ckpt_sectionread.checkpoint_name,
+			&ckptCheckpointInstance->checkpointName);
 
 		iov[0].iov_base = (char *)&req_lib_ckpt_sectionread;
 		iov[0].iov_len = sizeof (struct req_lib_ckpt_sectionread);
@@ -1719,7 +1730,7 @@ saCkptCheckpointRead (
 		/*
 		 * Report back bytes of data read
 		 */
-		ioVector[i].readSize = res_lib_ckpt_sectionread.dataRead;
+		ioVector[i].readSize = res_lib_ckpt_sectionread.data_read;
 	}
 
 error_exit:
@@ -1760,8 +1771,8 @@ saCkptCheckpointSynchronize (
 
 	req_lib_ckpt_checkpointsynchronize.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronize); 
 	req_lib_ckpt_checkpointsynchronize.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE;
-	memcpy (&req_lib_ckpt_checkpointsynchronize.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointsynchronize.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);
 
@@ -1823,8 +1834,8 @@ saCkptCheckpointSynchronizeAsync (
 
 	req_lib_ckpt_checkpointsynchronizeasync.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronizeasync); 
 	req_lib_ckpt_checkpointsynchronizeasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC;
-	memcpy (&req_lib_ckpt_checkpointsynchronizeasync.checkpointName,
-		&ckptCheckpointInstance->checkpointName, sizeof (SaNameT));
+	marshall_to_mar_name_t (&req_lib_ckpt_checkpointsynchronizeasync.checkpoint_name,
+		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_checkpointsynchronizeasync.invocation = invocation;
 
 	pthread_mutex_lock (&ckptCheckpointInstance->response_mutex);

+ 4 - 4
lib/clm.c

@@ -55,7 +55,7 @@
 #include "util.h"
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header;
 	char data[512000];
 };
 
@@ -337,13 +337,13 @@ saClmDispatch (
 
 		if (ufds.revents & POLLIN) {
 			error = saRecvRetry (clmInstance->dispatch_fd, &dispatch_data.header,
-				sizeof (struct res_header));
+				sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}
-			if (dispatch_data.header.size > sizeof (struct res_header)) {
+			if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 				error = saRecvRetry (clmInstance->dispatch_fd, &dispatch_data.data,
-					dispatch_data.header.size - sizeof (struct res_header));
+					dispatch_data.header.size - sizeof (mar_res_header_t));
 				if (error != SA_AIS_OK) {
 					goto error_unlock;
 				}

+ 9 - 9
lib/cpg.c

@@ -189,7 +189,7 @@ cpg_error_t cpg_fd_get (
 }
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[512000];
 };
 
@@ -266,13 +266,13 @@ cpg_error_t cpg_dispatch (
 			 * Queue empty, read response from socket
 			 */
 			error = saRecvRetry (cpg_inst->dispatch_fd, &dispatch_data.header,
-				sizeof (struct res_header));
+				sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}
-			if (dispatch_data.header.size > sizeof (struct res_header)) {
+			if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 				error = saRecvRetry (cpg_inst->dispatch_fd, &dispatch_data.data,
-					dispatch_data.header.size - sizeof (struct res_header));
+					dispatch_data.header.size - sizeof (mar_res_header_t));
 
 				if (error != SA_AIS_OK) {
 					goto error_unlock;
@@ -464,7 +464,7 @@ cpg_error_t cpg_mcast_joined (
 	struct cpg_inst *cpg_inst;
 	struct iovec iov[64];
 	struct req_lib_cpg_mcast req_lib_cpg_mcast;
-	struct res_header res_lib_cpg_mcast;
+	mar_res_header_t res_lib_cpg_mcast;
 	int msg_len = 0;
 
 	error = saHandleInstanceGet (&cpg_handle_t_db, handle, (void *)&cpg_inst);
@@ -490,7 +490,7 @@ cpg_error_t cpg_mcast_joined (
 	pthread_mutex_lock (&cpg_inst->response_mutex);
 
 	error = saSendMsgReceiveReply (cpg_inst->response_fd, iov, iov_len + 1,
-		&res_lib_cpg_mcast, sizeof (struct res_header));
+		&res_lib_cpg_mcast, sizeof (mar_res_header_t));
 
 	pthread_mutex_unlock (&cpg_inst->response_mutex);
 
@@ -523,17 +523,17 @@ cpg_error_t cpg_membership_get (
 		return (error);
 	}
 
-	req_lib_cpg_membership_get.header.size = sizeof (struct req_header);
+	req_lib_cpg_membership_get.header.size = sizeof (mar_req_header_t);
 	req_lib_cpg_membership_get.header.id = MESSAGE_REQ_CPG_MEMBERSHIP;
 	memcpy(&req_lib_cpg_membership_get.group_name, group_name, sizeof(struct cpg_name));
 
 	iov.iov_base = &req_lib_cpg_membership_get;
-	iov.iov_len = sizeof (struct req_header);
+	iov.iov_len = sizeof (mar_req_header_t);
 
 	pthread_mutex_lock (&cpg_inst->response_mutex);
 
 	error = saSendMsgReceiveReply (cpg_inst->response_fd, &iov, 1,
-		&res_lib_cpg_membership_get, sizeof (struct res_header));
+		&res_lib_cpg_membership_get, sizeof (mar_res_header_t));
 
 	pthread_mutex_unlock (&cpg_inst->response_mutex);
 

+ 4 - 4
lib/evs.c

@@ -61,7 +61,7 @@ struct evs_inst {
 };
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[512000];
 };
 
@@ -272,13 +272,13 @@ evs_error_t evs_dispatch (
 			 * Queue empty, read response from socket
 			 */
 			error = saRecvRetry (evs_inst->dispatch_fd, &dispatch_data.header,
-				sizeof (struct res_header));
+				sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}
-			if (dispatch_data.header.size > sizeof (struct res_header)) {
+			if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 				error = saRecvRetry (evs_inst->dispatch_fd, &dispatch_data.data,
-					dispatch_data.header.size - sizeof (struct res_header));
+					dispatch_data.header.size - sizeof (mar_res_header_t));
 
 				if (error != SA_AIS_OK) {
 					goto error_unlock;

+ 5 - 5
lib/evt.c

@@ -91,7 +91,7 @@ struct saHandleDatabase event_handle_db = {
 };
 
 struct res_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[MESSAGE_SIZE_MAX];
 };
 
@@ -300,7 +300,7 @@ static void eventHandleInstanceDestructor(void *instance)
 static SaAisErrorT evt_recv_event(int fd, struct lib_event_data **msg)
 {
 	SaAisErrorT error;
-	struct res_header hdr;
+	mar_res_header_t hdr;
 	void *data;
 
 	error = saRecvRetry(fd, &hdr, sizeof(hdr));
@@ -673,14 +673,14 @@ saEvtDispatch(
 
 			if (ufds.revents & POLLIN) {
 				error = saRecvRetry (evti->ei_dispatch_fd, &dispatch_data.header,
-					sizeof (struct res_header));
+					sizeof (mar_res_header_t));
 
 				if (error != SA_AIS_OK) {
 					goto dispatch_unlock;
 				}
-				if (dispatch_data.header.size > sizeof (struct res_header)) {
+				if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 					error = saRecvRetry (evti->ei_dispatch_fd, &dispatch_data.data,
-						dispatch_data.header.size - sizeof (struct res_header));
+						dispatch_data.header.size - sizeof (mar_res_header_t));
 					if (error != SA_AIS_OK) {
 						goto dispatch_unlock;
 					}

+ 8 - 8
lib/lck.c

@@ -54,7 +54,7 @@
 #include "util.h"
 
 struct message_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[4096];
 };
 
@@ -79,7 +79,7 @@ struct lckResourceInstance {
 	SaLckResourceOpenFlagsT resourceOpenFlags;
 	SaNameT lockResourceName;
 	struct list_head list;
-	struct message_source source;
+	mar_message_source_t source;
 	pthread_mutex_t *response_mutex;
 };
 
@@ -401,13 +401,13 @@ saLckDispatch (
 		}
 		
 		memset(&dispatch_data,0, sizeof(struct message_overlay));
-		error = saRecvRetry (lckInstance->dispatch_fd, &dispatch_data.header, sizeof (struct res_header));
+		error = saRecvRetry (lckInstance->dispatch_fd, &dispatch_data.header, sizeof (mar_res_header_t));
 		if (error != SA_AIS_OK) {
 			goto error_unlock;
 		}
-		if (dispatch_data.header.size > sizeof (struct res_header)) {
+		if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 			error = saRecvRetry (lckInstance->dispatch_fd, &dispatch_data.data,
-				dispatch_data.header.size - sizeof (struct res_header));
+				dispatch_data.header.size - sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}
@@ -678,7 +678,7 @@ saLckResourceOpen (
 
 	memcpy (&lckResourceInstance->source,
 		&res_lib_lck_resourceopen.source,
-		sizeof (struct message_source));
+		sizeof (mar_message_source_t));
 
 	saHandleInstancePut (&lckResourceHandleDatabase, *lckResourceHandle);
 
@@ -873,7 +873,7 @@ saLckResourceLock (
 
 	memcpy (&req_lib_lck_resourcelock.source,
 		&lckResourceInstance->source,
-		sizeof (struct message_source));
+		sizeof (mar_message_source_t));
 
 	/*
 	 * no mutex needed here since its a new connection
@@ -966,7 +966,7 @@ saLckResourceLockAsync (
 
 	memcpy (&req_lib_lck_resourcelock.source,
 		&lckResourceInstance->source,
-		sizeof (struct message_source));
+		sizeof (mar_message_source_t));
 
 	/*
 	 * no mutex needed here since its a new connection

+ 4 - 4
lib/msg.c

@@ -54,7 +54,7 @@
 #include "util.h"
 
 struct message_overlay {
-	struct res_header header;
+	mar_res_header_t header __attribute__((aligned(8)));
 	char data[4096];
 };
 
@@ -347,13 +347,13 @@ saMsgDispatch (
 		}
 		
 		memset(&dispatch_data,0, sizeof(struct message_overlay));
-		error = saRecvRetry (msgInstance->dispatch_fd, &dispatch_data.header, sizeof (struct res_header));
+		error = saRecvRetry (msgInstance->dispatch_fd, &dispatch_data.header, sizeof (mar_res_header_t));
 		if (error != SA_AIS_OK) {
 			goto error_unlock;
 		}
-		if (dispatch_data.header.size > sizeof (struct res_header)) {
+		if (dispatch_data.header.size > sizeof (mar_res_header_t)) {
 			error = saRecvRetry (msgInstance->dispatch_fd, &dispatch_data.data,
-				dispatch_data.header.size - sizeof (struct res_header));
+				dispatch_data.header.size - sizeof (mar_res_header_t));
 			if (error != SA_AIS_OK) {
 				goto error_unlock;
 			}

+ 8 - 13
lib/util.c

@@ -99,10 +99,10 @@ saServiceConnectTwo (
 	int callbackFD;
 	int result;
 	struct sockaddr_un address;
-	struct req_lib_response_init req_lib_response_init;
-	struct res_lib_response_init res_lib_response_init;
-	struct req_lib_dispatch_init req_lib_dispatch_init;
-	struct res_lib_dispatch_init res_lib_dispatch_init;
+	mar_req_lib_response_init_t req_lib_response_init;
+	mar_res_lib_response_init_t res_lib_response_init;
+	mar_req_lib_dispatch_init_t req_lib_dispatch_init;
+	mar_res_lib_dispatch_init_t res_lib_dispatch_init;
 	SaAisErrorT error;
 	gid_t egid;
 
@@ -140,12 +140,12 @@ saServiceConnectTwo (
 	req_lib_response_init.resdis_header.service = service;
 
 	error = saSendRetry (responseFD, &req_lib_response_init,
-		sizeof (struct req_lib_response_init));
+		sizeof (mar_req_lib_response_init_t));
 	if (error != SA_AIS_OK) {
 		goto error_exit;
 	}
 	error = saRecvRetry (responseFD, &res_lib_response_init,
-		sizeof (struct res_lib_response_init));
+		sizeof (mar_res_lib_response_init_t));
 	if (error != SA_AIS_OK) {
 		goto error_exit;
 	}
@@ -182,12 +182,12 @@ saServiceConnectTwo (
 	req_lib_dispatch_init.conn_info = res_lib_response_init.conn_info;
 
 	error = saSendRetry (callbackFD, &req_lib_dispatch_init,
-		sizeof (struct req_lib_dispatch_init));
+		sizeof (mar_req_lib_dispatch_init_t));
 	if (error != SA_AIS_OK) {
 		goto error_exit_two;
 	}
 	error = saRecvRetry (callbackFD, &res_lib_dispatch_init,
-		sizeof (struct res_lib_dispatch_init));
+		sizeof (mar_res_lib_dispatch_init_t));
 	if (error != SA_AIS_OK) {
 		goto error_exit_two;
 	}
@@ -255,11 +255,6 @@ error_exit:
 	return (error);
 }
 
-struct res_overlay {
-	struct res_header header;
-	char payload[0];
-};
-
 SaAisErrorT
 saSendRetry (
 	int s,

+ 12 - 5
test/testckpt.c

@@ -381,7 +381,7 @@ int main (void) {
 		
 	error = saCkptSectionDelete (checkpointHandle,
 		&sectionId1);
-	printf ("%s: deleting checkpoint handle\n",
+	printf ("%s: deleting section handle\n",
 		get_test_output (error, SA_AIS_OK));
 		
 	error = saCkptSectionCreate (checkpointHandle,
@@ -392,10 +392,17 @@ int main (void) {
 		get_test_output (error, SA_AIS_OK));
 
 	error = saCkptSectionCreate (checkpointHandle,
-									&sectionCreationAttributes2,
-									"Initial Data #2",
-									strlen ("Initial Data #2") + 1);
-	printf ("%s: creating section 2 \n",
+		&sectionCreationAttributes2,
+		"Initial Data #2",
+		strlen ("Initial Data #2") + 1);
+	printf ("%s: creating section 2 for first time\n",
+		get_test_output (error, SA_AIS_OK));
+
+	error = saCkptSectionCreate (checkpointHandle,
+		&sectionCreationAttributes2,
+		"Initial Data #2",
+		strlen ("Initial Data #2") + 1);
+	printf ("%s: creating section 2 for second time\n",
 		get_test_output (error, SA_AIS_ERR_EXIST));
 
 	error = saCkptSectionExpirationTimeSet (checkpointHandle,

Некоторые файлы не были показаны из-за большого количества измененных файлов