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

Reworking of include file dependencies.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2119 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 лет назад
Родитель
Сommit
8126cf7458

+ 1 - 1
exec/Makefile.am

@@ -38,7 +38,7 @@ INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include
 TOTEM_SRC		= coropoll.c totemip.c totemnet.c totemrrp.c \
 			  totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
 LOGSYS_SRC		= wthread.c logsys.c
-COROIPCS_SRC		= coroipcs.c coroipcs.h
+COROIPCS_SRC		= coroipcs.c
 
 LCRSO_SRC		= objdb.c vsf_ykd.c coroparse.c quorum.c vsf_quorum.c
 LCRSO_OBJS		= $(LCRSO_SRC:%.c=%.o)

+ 3 - 1
exec/apidef.c

@@ -38,6 +38,8 @@
 #include <string.h>
 #include <assert.h>
 
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/swab.h>
 #include <corosync/totem/totem.h>
 #include "util.h"
@@ -46,7 +48,7 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totemip.h>
 #include "main.h"
-#include "coroipcs.h"
+#include <corosync/coroipcs.h>
 #include "sync.h"
 #include "quorum.h"
 #include <corosync/engine/coroapi.h>

+ 13 - 12
exec/coroipcs.c

@@ -69,8 +69,9 @@
 #include <corosync/corotypes.h>
 #include <corosync/list.h>
 
-#include "coroipcs.h"
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcs.h>
+#include <corosync/coroipc_ipc.h>
 
 #ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL 0
@@ -430,7 +431,7 @@ static inline int conn_info_destroy (struct conn_info *conn_info)
 }
 
 struct res_overlay {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	char buf[4096];
 };
 
@@ -457,15 +458,15 @@ static void *serveraddr2void (uint64_t server_addr)
 
 static inline void zerocopy_operations_process (
 	struct conn_info *conn_info,
-	mar_req_header_t **header_out,
+	coroipc_request_header_t **header_out,
 	unsigned int *new_message)
 {
-	mar_req_header_t *header;
+	coroipc_request_header_t *header;
 
-	header = (mar_req_header_t *)conn_info->request_buffer;
+	header = (coroipc_request_header_t *)conn_info->request_buffer;
 	if (header->id == ZC_ALLOC_HEADER) {
 		mar_req_coroipcc_zc_alloc_t *hdr = (mar_req_coroipcc_zc_alloc_t *)header;
-		mar_res_header_t res_header;
+		coroipc_response_header_t res_header;
 		void *addr = NULL;
 		struct coroipcs_zc_header *zc_header;
 		unsigned int res;
@@ -476,7 +477,7 @@ static inline void zerocopy_operations_process (
 		zc_header = (struct coroipcs_zc_header *)addr;
 		zc_header->server_address = void2serveraddr(addr);
 
-		res_header.size = sizeof (mar_res_header_t);
+		res_header.size = sizeof (coroipc_response_header_t);
 		res_header.id = 0;
 		coroipcs_response_send (
 			conn_info, &res_header,
@@ -486,14 +487,14 @@ static inline void zerocopy_operations_process (
 	} else
 	if (header->id == ZC_FREE_HEADER) {
 		mar_req_coroipcc_zc_free_t *hdr = (mar_req_coroipcc_zc_free_t *)header;
-		mar_res_header_t res_header;
+		coroipc_response_header_t res_header;
 		void *addr = NULL;
 
 		addr = serveraddr2void (hdr->server_address);
 
 		zcb_by_addr_free (conn_info, addr);
 
-		res_header.size = sizeof (mar_res_header_t);
+		res_header.size = sizeof (coroipc_response_header_t);
 		res_header.id = 0;
 		coroipcs_response_send (
 			conn_info, &res_header,
@@ -505,7 +506,7 @@ static inline void zerocopy_operations_process (
 	if (header->id == ZC_EXECUTE_HEADER) {
 		mar_req_coroipcc_zc_execute_t *hdr = (mar_req_coroipcc_zc_execute_t *)header;
 
-		header = (mar_req_header_t *)(((char *)serveraddr2void(hdr->server_address) + sizeof (struct coroipcs_zc_header)));
+		header = (coroipc_request_header_t *)(((char *)serveraddr2void(hdr->server_address) + sizeof (struct coroipcs_zc_header)));
 	}
 	*header_out = header;
 	*new_message = 1;
@@ -516,7 +517,7 @@ static void *pthread_ipc_consumer (void *conn)
 	struct conn_info *conn_info = (struct conn_info *)conn;
 	struct sembuf sop;
 	int res;
-	mar_req_header_t *header;
+	coroipc_request_header_t *header;
 	struct res_overlay res_overlay;
 	int send_ok;
 	unsigned int new_message;

+ 8 - 6
exec/main.c

@@ -58,6 +58,8 @@
 
 #include <corosync/swab.h>
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/list.h>
 #include <corosync/queue.h>
 #include <corosync/lcr/lcr_ifact.h>
@@ -66,6 +68,7 @@
 #include <corosync/engine/objdb.h>
 #include <corosync/engine/config.h>
 #include <corosync/engine/logsys.h>
+#include <corosync/coroipcs.h>
 
 #include "quorum.h"
 #include "totemsrp.h"
@@ -75,7 +78,6 @@
 #include "main.h"
 #include "sync.h"
 #include "tlist.h"
-#include "coroipcs.h"
 #include "timer.h"
 #include "util.h"
 #include "apidef.h"
@@ -421,7 +423,7 @@ static void deliver_fn (
 	unsigned int iov_len,
 	int endian_conversion_required)
 {
-	mar_req_header_t *header;
+	coroipc_request_header_t *header;
 	int pos = 0;
 	int i;
 	int service;
@@ -438,9 +440,9 @@ static void deliver_fn (
 			pos += iovec[i].iov_len;
 			assert (pos < MESSAGE_SIZE_MAX);
 		}
-		header = (mar_req_header_t *)delivery_data;
+		header = (coroipc_request_header_t *)delivery_data;
 	} else {
-		header = (mar_req_header_t *)iovec[0].iov_base;
+		header = (coroipc_request_header_t *)iovec[0].iov_base;
 	}
 	if (endian_conversion_required) {
 		header->id = swab32 (header->id);
@@ -571,7 +573,7 @@ static int corosync_sending_allowed (
 	struct sending_allowed_private_data_struct *pd =
 		(struct sending_allowed_private_data_struct *)sending_allowed_private_data;
 	struct iovec reserve_iovec;
-	mar_req_header_t *header = (mar_req_header_t *)msg;
+	coroipc_request_header_t *header = (coroipc_request_header_t *)msg;
 	int sending_allowed;
 
 	reserve_iovec.iov_base = (char *)header;
@@ -662,7 +664,7 @@ static void corosync_poll_dispatch_modify (
 }
 
 struct coroipcs_init_state ipc_init_state = {
-	.socket_name			= IPC_SOCKET_NAME,
+	.socket_name			= COROSYNC_SOCKET_NAME,
 	.malloc				= malloc,
 	.free				= free,
 	.log_printf			= ipc_log_printf,

+ 1 - 1
exec/main.h

@@ -39,11 +39,11 @@
 #define FALSE 0
 #include <corosync/corotypes.h>
 #include <corosync/hdb.h>
-#include <corosync/ipc_gen.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/totempg.h>
 #include <corosync/engine/objdb.h>
 #include <corosync/engine/config.h>
+#include <corosync/mar_gen.h>
 
 extern struct totempg_group corosync_group;
 

+ 2 - 0
exec/objdb.c

@@ -43,6 +43,8 @@
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/objdb.h>
 #include <corosync/engine/config.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 
 #include "main.h"
 

+ 1 - 0
exec/quorum.c

@@ -52,6 +52,7 @@
 #include <arpa/inet.h>
 
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/swab.h>
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totem.h>

+ 2 - 1
exec/service.c

@@ -43,6 +43,8 @@
 #include <corosync/swab.h>
 #include <corosync/totem/totem.h>
 
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include "mainconfig.h"
 #include "util.h"
 #include <corosync/engine/logsys.h>
@@ -51,7 +53,6 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totemip.h>
 #include "main.h"
-#include "coroipcs.h"
 #include <corosync/engine/coroapi.h>
 #include "service.h"
 

+ 2 - 2
exec/sync.c

@@ -57,7 +57,7 @@
 #include <corosync/totem/totem.h>
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/engine/logsys.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
 #include "quorum.h"
 #include "sync.h"
 
@@ -128,7 +128,7 @@ static struct totempg_group sync_group = {
 static hdb_handle_t sync_group_handle;
 
 struct req_exec_sync_barrier_start {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	struct memb_ring_id ring_id;
 };
 

+ 1 - 0
exec/timer.c

@@ -60,6 +60,7 @@
 
 #include <corosync/swab.h>
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/list.h>
 #include <corosync/queue.h>
 #include <corosync/lcr/lcr_ifact.h>

+ 1 - 0
exec/util.c

@@ -45,6 +45,7 @@
 #include <corosync/corotypes.h>
 #include <corosync/list.h>
 #include <corosync/engine/logsys.h>
+#include <corosync/coroipc_types.h>
 #include "util.h"
 
 LOGSYS_DECLARE_SUBSYS ("MAIN");

+ 0 - 1
exec/util.h

@@ -36,7 +36,6 @@
 #define UTIL_H_DEFINED
 
 #include <sys/time.h>
-#include <corosync/mar_gen.h>
 #include <corosync/corotypes.h>
 
 /*

+ 12 - 8
exec/vsf_quorum.c

@@ -56,14 +56,18 @@
 #include <sched.h>
 #include <time.h>
 
-#include <corosync/engine/logsys.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/swab.h>
 #include <corosync/list.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
 #include <corosync/ipc_quorum.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/lcr/lcr_ifact.h>
+#include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
+#include <corosync/engine/logsys.h>
 #include <corosync/engine/quorum.h>
 
 LOGSYS_DECLARE_SUBSYS ("QUORUM");
@@ -148,13 +152,13 @@ static struct corosync_lib_handler quorum_lib_service[] =
 	},
 	{ /* 1 */
 		.lib_handler_fn				= message_handler_req_lib_quorum_trackstart,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_QUORUM_NOTIFICATION,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 2 */
 		.lib_handler_fn				= message_handler_req_lib_quorum_trackstop,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_QUORUM_TRACKSTOP,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	}
@@ -417,7 +421,7 @@ static void message_handler_req_lib_quorum_trackstart (void *conn,
 						       const void *msg)
 {
 	const struct req_lib_quorum_trackstart *req_lib_quorum_trackstart = msg;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	struct quorum_pd *quorum_pd = (struct quorum_pd *)corosync_api->ipc_private_data_get (conn);
 
 	log_printf(LOGSYS_LEVEL_DEBUG, "got trackstart request on %p\n", conn);
@@ -448,12 +452,12 @@ static void message_handler_req_lib_quorum_trackstart (void *conn,
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_QUORUM_TRACKSTART;
 	res.error = CS_OK;
-	corosync_api->ipc_response_send(conn, &res, sizeof(mar_res_header_t));
+	corosync_api->ipc_response_send(conn, &res, sizeof(coroipc_response_header_t));
 }
 
 static void message_handler_req_lib_quorum_trackstop (void *conn, const void *msg)
 {
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	struct quorum_pd *quorum_pd = (struct quorum_pd *)corosync_api->ipc_private_data_get (conn);
 
 	log_printf(LOGSYS_LEVEL_DEBUG, "got trackstop request on %p\n", conn);
@@ -471,5 +475,5 @@ static void message_handler_req_lib_quorum_trackstop (void *conn, const void *ms
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_QUORUM_TRACKSTOP;
 	res.error = CS_OK;
-	corosync_api->ipc_response_send(conn, &res, sizeof(mar_res_header_t));
+	corosync_api->ipc_response_send(conn, &res, sizeof(coroipc_response_header_t));
 }

+ 3 - 1
exec/vsf_ykd.c

@@ -58,7 +58,9 @@
 #include <time.h>
 
 #include <corosync/engine/logsys.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/engine/quorum.h>
 #include <corosync/swab.h>

+ 3 - 3
include/Makefile.am

@@ -31,11 +31,11 @@
 
 MAINTAINERCLEANFILES    = Makefile.in corosync/config.h.in
 
-CS_H			= hdb.h cs_config.h cpg.h cfg.h evs.h ipc_gen.h mar_gen.h swab.h 	\
-		  	coroipcc.h confdb.h list.h corotypes.h quorum.h votequorum.h
+CS_H			= hdb.h cs_config.h cpg.h cfg.h evs.h mar_gen.h swab.h 	\
+		  	coroipcc.h coroipcs.h coroipc_types.h corodefs.h confdb.h list.h corotypes.h quorum.h votequorum.h
 
 CS_INTERNAL_H		= ipc_cfg.h ipc_confdb.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h 	\
-			jhash.h mar_cpg.h pload.h queue.h quorum.h rmd.h sq.h ipc_votequorum.h
+			jhash.h mar_cpg.h pload.h queue.h quorum.h rmd.h sq.h ipc_votequorum.h coroipc_ipc.h
 
 LCR_H			= lcr_ckpt.h lcr_comp.h	lcr_ifact.h
 

+ 12 - 65
include/corosync/ipc_gen.h → include/corosync/coroipc_ipc.h

@@ -1,13 +1,12 @@
 /*
- * Copyright (c) 2002-2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2009 Red Hat, Inc.
+ * Copyright (c) 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
  * Author: Steven Dake (sdake@redhat.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:
  *
@@ -32,29 +31,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef IPC_GEN_H_DEFINED
-#define IPC_GEN_H_DEFINED
-
-#include <corosync/mar_gen.h>
-
-enum service_types {
-	EVS_SERVICE = 0,
-	CLM_SERVICE = 1,
-	AMF_SERVICE = 2,
-	CKPT_SERVICE = 3,
-	EVT_SERVICE = 4,
-	LCK_SERVICE = 5,
-	MSG_SERVICE = 6,
-	CFG_SERVICE = 7,
-	CPG_SERVICE = 8,
-	CONFDB_SERVICE = 10,
-	QUORUM_SERVICE = 11,
-	PLOAD_SERVICE = 12,
-	TMR_SERVICE = 13,
-	VOTEQUORUM_SERVICE = 14,
-};
-
-#define IPC_SOCKET_NAME "corosync.ipc"
+#ifndef COROIPC_IPC_H_DEFINED
+#define COROIPC_IPC_H_DEFINED
 
 enum req_init_types {
 	MESSAGE_REQ_RESPONSE_INIT = 0,
@@ -64,10 +42,6 @@ enum req_init_types {
 #define MESSAGE_REQ_CHANGE_EUID		1
 #define MESSAGE_REQ_OUTQ_FLUSH		2
 
-#define IPC_REQUEST_SIZE		8192*128
-#define IPC_RESPONSE_SIZE		8192*128
-#define IPC_DISPATCH_SIZE		8192*128
-
 struct control_buffer {
 	unsigned int read;
 	unsigned int write;
@@ -77,11 +51,6 @@ enum res_init_types {
 	MESSAGE_RES_INIT
 };
 
-typedef struct {
-	int size __attribute__((aligned(8)));
-	int id __attribute__((aligned(8)));
-} mar_req_header_t __attribute__((aligned(8)));
-
 typedef struct {
 	int service __attribute__((aligned(8)));
 	unsigned long long semkey __attribute__((aligned(8)));
@@ -99,51 +68,39 @@ typedef struct {
 	int error __attribute__((aligned(8)));
 } mar_res_setup_t __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);
-}
-
-typedef struct {
-	int size; __attribute__((aligned(8)))
-	int id __attribute__((aligned(8)));
-	cs_error_t error __attribute__((aligned(8)));
-} mar_res_header_t __attribute__((aligned(8)));
-
 typedef struct {
         uid_t euid __attribute__((aligned(8)));
         gid_t egid __attribute__((aligned(8)));
 } mar_req_priv_change __attribute__((aligned(8)));
 
 typedef struct {
-	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint64_t conn_info __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
+	uint64_t conn_info __attribute__((aligned(8)));
 } mar_res_lib_response_init_t __attribute__((aligned(8)));
 
 typedef struct {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 } mar_res_lib_dispatch_init_t __attribute__((aligned(8)));
 
 typedef struct {
-	mar_uint32_t nodeid __attribute__((aligned(8)));
+	uint32_t nodeid __attribute__((aligned(8)));
 	void *conn __attribute__((aligned(8)));
 } mar_message_source_t __attribute__((aligned(8)));
 
 typedef struct {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
         size_t map_size __attribute__((aligned(8)));
         char path_to_file[128] __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_alloc_t __attribute__((aligned(8)));
 
 typedef struct {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
         size_t map_size __attribute__((aligned(8)));
 	uint64_t server_address __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_free_t __attribute__((aligned(8)));
 
 typedef struct {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	uint64_t server_address __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_execute_t __attribute__((aligned(8)));
 
@@ -151,19 +108,9 @@ struct coroipcs_zc_header {
 	int map_size;
 	uint64_t server_address;
 };
-static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
-{
-	swab_mar_uint32_t (&to_swab->nodeid);
-	/*
-	 * if it is from a byteswapped machine, then we can safely
-	 * ignore its conn info data structure since this is only
-	 * local to the machine
-	 */
-	to_swab->conn = NULL;
-}
 
 #define ZC_ALLOC_HEADER		0xFFFFFFFF
 #define ZC_FREE_HEADER		0xFFFFFFFE
 #define ZC_EXECUTE_HEADER	0xFFFFFFFD
 
-#endif /* IPC_GEN_H_DEFINED */
+#endif /* COROIPC_IPC_H_DEFINED */

+ 51 - 0
include/corosync/coroipc_types.h

@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@redhat.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 COROIPC_TYPES_H_DEFINED
+#define COROIPC_TYPES_H_DEFINED
+
+#include <config.h>
+
+typedef struct {
+	int size __attribute__((aligned(8)));
+	int id __attribute__((aligned(8)));
+} coroipc_request_header_t __attribute__((aligned(8)));
+
+typedef struct {
+	int size __attribute__((aligned(8)));
+	int id __attribute__((aligned(8)));
+	cs_error_t error __attribute__((aligned(8)));
+} coroipc_response_header_t __attribute__((aligned(8)));
+
+#endif /* COROIPC_TYPES_H_DEFINED */

+ 3 - 4
include/corosync/coroipcc.h

@@ -33,8 +33,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef COROIPC_H_DEFINED
-#define COROIPC_H_DEFINED
+#ifndef COROIPCC_H_DEFINED
+#define COROIPCC_H_DEFINED
 
 #include <config.h>
 
@@ -42,7 +42,6 @@
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <corosync/corotypes.h>
-#include <corosync/ipc_gen.h>
 
 extern cs_error_t
 coroipcc_service_connect (
@@ -159,4 +158,4 @@ saHandleInstancePut (
 	struct saHandleDatabase *handleDatabase,
 	uint64_t handle);
 
-#endif /* COROIPC_H_DEFINED */
+#endif /* COROIPCC_H_DEFINED */

+ 0 - 0
exec/coroipcs.h → include/corosync/coroipcs.h


+ 0 - 1
include/corosync/engine/coroapi.h

@@ -216,7 +216,6 @@ typedef void (*sync_callback_fn_t) (
 
 #endif /* QUORUM_H_DEFINED */
 
-
 struct corosync_api_v1 {
 	/*
 	 * Object and configuration APIs

+ 30 - 32
include/corosync/ipc_cfg.h

@@ -32,13 +32,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef AIS_IPC_CFG_H_DEFINED
-#define AIS_IPC_CFG_H_DEFINED
+#ifndef IPC_CFG_H_DEFINED
+#define IPC_CFG_H_DEFINED
 
 #include <netinet/in.h>
 #include <corosync/corotypes.h>
-#include "ipc_gen.h"
-#include "cfg.h"
 
 enum req_lib_cfg_types {
 	MESSAGE_REQ_CFG_RINGSTATUSGET = 0,
@@ -74,135 +72,135 @@ enum res_lib_cfg_types {
 };
 
 struct req_lib_cfg_statetrack {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	uint8_t track_flags;
 	corosync_cfg_state_notification_t *notification_buffer_address;
 };
 
 struct res_lib_cfg_statetrack {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_cfg_statetrackstop {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 };
 
 struct res_lib_cfg_statetrackstop {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_cfg_administrativestateset {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	cs_name_t comp_name;
 	corosync_cfg_administrative_target_t administrative_target;
 	corosync_cfg_administrative_state_t administrative_state;
 };
 
 struct res_lib_cfg_administrativestateset {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_cfg_administrativestateget {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	cs_name_t comp_name;
 	corosync_cfg_administrative_target_t administrative_target;
 	corosync_cfg_administrative_state_t administrative_state;
 };
 
 struct res_lib_cfg_administrativestateget {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_ringstatusget {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cfg_ringstatusget {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t interface_count __attribute__((aligned(8)));
 	char interface_name[16][128] __attribute__((aligned(8)));
 	char interface_status[16][512] __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_ringreenable {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cfg_ringreenable {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_serviceload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	char service_name[256] __attribute__((aligned(8)));
 	unsigned int service_ver;
 };
 
 struct res_lib_cfg_serviceload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_serviceunload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	char service_name[256] __attribute__((aligned(8)));
 	unsigned int service_ver;
 };
 
 struct res_lib_cfg_serviceunload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_killnode {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int nodeid __attribute__((aligned(8)));
 	cs_name_t reason __attribute__((aligned(8)));
 };
 
 struct res_lib_cfg_killnode {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_tryshutdown {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int flags;
 };
 
 struct res_lib_cfg_tryshutdown {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cfg_replytoshutdown {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int response;
 };
 
 struct res_lib_cfg_replytoshutdown {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cfg_testshutdown {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	unsigned int flags;
 };
 
 struct req_lib_cfg_get_node_addrs {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int nodeid;
 };
 
 struct res_lib_cfg_get_node_addrs {
-        mar_res_header_t header __attribute__((aligned(8)));
+        coroipc_response_header_t header __attribute__((aligned(8)));
 	unsigned int family;
 	unsigned int num_addrs;
 	char addrs[TOTEMIP_ADDRLEN][0];
 };
 
 struct req_lib_cfg_local_get {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cfg_local_get {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t local_nodeid __attribute__((aligned(8)));
 };
 
@@ -226,4 +224,4 @@ typedef enum {
 } corosync_shutdown_flags_t;
 
 
-#endif /* AIS_IPC_CFG_H_DEFINED */
+#endif /* IPC_CFG_H_DEFINED */

+ 25 - 26
include/corosync/ipc_confdb.h

@@ -36,7 +36,6 @@
 
 #include <netinet/in.h>
 #include <corosync/corotypes.h>
-#include "ipc_gen.h"
 
 enum req_confdb_types {
 	MESSAGE_REQ_CONFDB_OBJECT_CREATE = 0,
@@ -83,48 +82,48 @@ enum res_confdb_types {
 
 
 struct req_lib_confdb_object_create {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_object_create {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_object_destroy {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_object_parent_get {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_object_parent_get {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 };
 
 
 struct req_lib_confdb_key_create {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_key_delete {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_key_replace {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t old_value __attribute__((aligned(8)));
@@ -132,81 +131,81 @@ struct req_lib_confdb_key_replace {
 };
 
 struct req_lib_confdb_object_find {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_object_find {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_object_iter {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_object_iter {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_key_iter {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_uint64_t next_entry __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_key_iter {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_key_get {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_object_find_destroy {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_key_get {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_key_incdec {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t value __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_write {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_name_t error __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_reload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_int32_t flush __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_reload {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_name_t error __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_key_change_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t change_type __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
@@ -216,20 +215,20 @@ struct res_lib_confdb_key_change_callback {
 };
 
 struct res_lib_confdb_object_create_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 };
 
 struct res_lib_confdb_object_destroy_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 };
 
 struct req_lib_confdb_object_track_start {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_uint32_t flags __attribute__((aligned(8)));
 };

+ 19 - 21
include/corosync/ipc_cpg.h

@@ -36,8 +36,6 @@
 
 #include <netinet/in.h>
 #include <corosync/corotypes.h>
-#include "ipc_gen.h"
-#include "mar_cpg.h"
 
 enum req_cpg_types {
 	MESSAGE_REQ_CPG_JOIN = 0,
@@ -75,58 +73,58 @@ enum lib_cpg_confchg_reason {
 };
 
 struct req_lib_cpg_join {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_join {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_trackstart {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_trackstart {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_trackstop {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_trackstop {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_local_get {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_local_get {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t local_nodeid __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_mcast {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t guarantee __attribute__((aligned(8)));
 	mar_uint32_t msglen __attribute__((aligned(8)));
 	mar_uint8_t message[] __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_mcast {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 /* Message from another node */
 struct res_lib_cpg_deliver_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t msglen __attribute__((aligned(8)));
 	mar_uint32_t nodeid __attribute__((aligned(8)));
@@ -135,17 +133,17 @@ struct res_lib_cpg_deliver_callback {
 };
 
 struct res_lib_cpg_flowcontrol_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t flow_control_state __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_membership {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 //	mar_cpg_name_t group_name __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_confchg_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t member_list_entries __attribute__((aligned(8)));
 	mar_uint32_t joined_list_entries __attribute__((aligned(8)));
@@ -156,26 +154,26 @@ struct res_lib_cpg_confchg_callback {
 };
 
 struct req_lib_cpg_leave {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_leave {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 struct req_lib_cpg_groups_get {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_groups_get {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t num_groups __attribute__((aligned(8)));
 };
 
 struct res_lib_cpg_groups_get_callback {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t group_num  __attribute__((aligned(8)));
 	mar_uint32_t total_groups  __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));

+ 13 - 14
include/corosync/ipc_evs.h

@@ -36,7 +36,6 @@
 
 #include <corosync/corotypes.h>
 #include "evs.h"
-#include "ipc_gen.h"
 
 enum req_lib_evs_types {
 	MESSAGE_REQ_EVS_JOIN = 0,
@@ -57,14 +56,14 @@ enum res_lib_evs_types {
 };
 
 struct res_evs_deliver_callback {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	unsigned int local_nodeid;
 	size_t msglen;
 	char msg[0];
 };
 
 struct res_evs_confchg_callback {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	size_t member_list_entries;
 	size_t left_list_entries;
 	size_t joined_list_entries;
@@ -74,38 +73,38 @@ struct res_evs_confchg_callback {
 };
 
 struct req_lib_evs_join {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	size_t group_entries;
 	struct evs_group groups[0];
 };
 
 struct res_lib_evs_join {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_evs_leave {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	size_t group_entries;
 	struct evs_group groups[0];
 };
 
 struct res_lib_evs_leave {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_evs_mcast_joined {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	evs_guarantee_t guarantee;
 	size_t msg_len;
 	char msg[0];
 };
 
 struct res_lib_evs_mcast_joined {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_evs_mcast_groups {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	evs_guarantee_t guarantee;
 	size_t msg_len;
 	size_t group_entries;
@@ -113,12 +112,12 @@ struct req_lib_evs_mcast_groups {
 };
 
 struct res_lib_evs_mcast_groups {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 
 struct req_exec_evs_mcast {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	size_t group_entries;
 	size_t msg_len;
 	struct evs_group groups[0];
@@ -126,11 +125,11 @@ struct req_exec_evs_mcast {
 };
 
 struct req_lib_evs_membership_get {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 };
 
 struct res_lib_evs_membership_get {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	unsigned int local_nodeid;
 	unsigned int member_list[PROCESSOR_COUNT_MAX];
 	size_t member_list_entries;

+ 11 - 6
include/corosync/ipc_pload.h

@@ -35,8 +35,13 @@
 #define IPC_PLOAD_H_DEFINED
 
 #include <corosync/corotypes.h>
-#include "pload.h"
-#include "ipc_gen.h"
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+
+#include <corosync/pload.h>
+#include <corosync/mar_gen.h>
+#include <corosync/ipc_pload.h>
 
 enum req_lib_evs_types {
 	MESSAGE_REQ_PLOAD_START = 0,
@@ -47,16 +52,16 @@ enum res_lib_evs_types {
 };
 
 struct res_lib_pload_start {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 	unsigned int dataset[1024];
 };
 
 struct res_lib_pload_mcast {
-	mar_res_header_t header;
+	coroipc_response_header_t header;
 };
 
 struct req_lib_pload_start {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	unsigned int msg_code;
 	unsigned int msg_size;
 	unsigned int msg_count;
@@ -64,7 +69,7 @@ struct req_lib_pload_start {
 };
 
 struct req_lib_pload_mcast {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	unsigned int code;
 };
 

+ 3 - 5
include/corosync/ipc_quorum.h

@@ -34,9 +34,7 @@
 #ifndef IPC_QUORUM_H_DEFINED
 #define IPC_QUORUM_H_DEFINED
 
-#include <netinet/in.h>
 #include <corosync/corotypes.h>
-#include "corosync/ipc_gen.h"
 
 enum req_quorum_types {
 	MESSAGE_REQ_QUORUM_GETQUORATE = 0,
@@ -52,18 +50,18 @@ enum res_quorum_types {
 };
 
 struct req_lib_quorum_trackstart {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int track_flags;
 };
 
 
 struct res_lib_quorum_getquorate {
-        mar_res_header_t header __attribute__((aligned(8)));
+        coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t quorate;
 };
 
 struct res_lib_quorum_notification {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_int32_t quorate __attribute__((aligned(8)));
 	mar_uint64_t ring_seq __attribute__((aligned(8)));
 	mar_uint32_t view_list_entries __attribute__((aligned(8)));

+ 12 - 15
include/corosync/ipc_votequorum.h

@@ -34,9 +34,6 @@
 #ifndef IPC_VOTEQUORUM_H_DEFINED
 #define IPC_VOTEQUORUM_H_DEFINED
 
-#include "corosync/corotypes.h"
-#include "corosync/ipc_gen.h"
-
 #define VOTEQUORUM_MAX_QDISK_NAME_LEN 255
 
 enum req_votequorum_types {
@@ -63,35 +60,35 @@ enum res_votequorum_types {
 };
 
 struct req_lib_votequorum_setvotes {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int votes;
 	int nodeid;
 };
 
 struct req_lib_votequorum_qdisk_register {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int votes;
 	char name[VOTEQUORUM_MAX_QDISK_NAME_LEN];
 };
 
 struct req_lib_votequorum_qdisk_poll {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	int state;
 };
 
 struct req_lib_votequorum_setexpected {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	unsigned int expected_votes;
 };
 
 struct req_lib_votequorum_trackstart {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	uint64_t context;
 	unsigned int track_flags;
 };
 
 struct req_lib_votequorum_general {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 #define VOTEQUORUM_REASON_KILL_REJECTED    1
@@ -99,12 +96,12 @@ struct req_lib_votequorum_general {
 #define VOTEQUORUM_REASON_KILL_REJOIN      3
 
 struct req_lib_votequorum_getinfo {
-        mar_req_header_t header __attribute__((aligned(8)));
+        coroipc_request_header_t header __attribute__((aligned(8)));
 	int nodeid;
 };
 
 struct res_lib_votequorum_status {
-        mar_res_header_t header __attribute__((aligned(8)));
+        coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
 #define VOTEQUORUM_INFO_FLAG_HASSTATE   1
@@ -113,7 +110,7 @@ struct res_lib_votequorum_status {
 #define VOTEQUORUM_INFO_FLAG_QUORATE    8
 
 struct res_lib_votequorum_getinfo {
-        mar_res_header_t header __attribute__((aligned(8)));
+        coroipc_response_header_t header __attribute__((aligned(8)));
 	int nodeid;
 	unsigned int votes;
 	unsigned int expected_votes;
@@ -124,7 +121,7 @@ struct res_lib_votequorum_getinfo {
 };
 
 struct res_lib_votequorum_qdisk_getinfo {
-        mar_res_header_t header __attribute__((aligned(8)));
+        coroipc_response_header_t header __attribute__((aligned(8)));
 	unsigned int votes;
 	unsigned int state;
 	char name[VOTEQUORUM_MAX_QDISK_NAME_LEN];
@@ -136,7 +133,7 @@ struct votequorum_node {
 };
 
 struct res_lib_votequorum_notification {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint32_t quorate __attribute__((aligned(8)));
 	mar_uint64_t context __attribute__((aligned(8)));
 	mar_uint32_t node_list_entries __attribute__((aligned(8)));
@@ -144,7 +141,7 @@ struct res_lib_votequorum_notification {
 };
 
 struct res_lib_votequorum_expectedvotes_notification {
-	mar_res_header_t header __attribute__((aligned(8)));
+	coroipc_response_header_t header __attribute__((aligned(8)));
 	mar_uint64_t context __attribute__((aligned(8)));
 	mar_uint32_t expected_votes __attribute__((aligned(8)));
 };

+ 25 - 3
include/corosync/mar_gen.h

@@ -32,8 +32,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef AIS_MAR_GEN_H_DEFINED
-#define AIS_MAR_GEN_H_DEFINED
+#ifndef MAR_GEN_H_DEFINED
+#define MAR_GEN_H_DEFINED
 
 #ifndef COROSYNC_SOLARIS
 #include <stdint.h>
@@ -177,4 +177,26 @@ 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 */
+
+static inline void swab_coroipc_request_header_t (coroipc_request_header_t *to_swab)
+{
+	swab_mar_int32_t (&to_swab->size);
+	swab_mar_int32_t (&to_swab->id);
+}
+
+typedef struct {
+	uint32_t nodeid __attribute__((aligned(8)));
+	void *conn __attribute__((aligned(8)));
+} mar_message_source_t __attribute__((aligned(8)));
+
+static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
+{
+	swab_mar_uint32_t (&to_swab->nodeid);
+	/*
+	 * if it is from a byteswapped machine, then we can safely
+	 * ignore its conn info data structure since this is only
+	 * local to the machine
+	 */
+	to_swab->conn = NULL;
+}
+#endif /* MAR_GEN_H_DEFINED */

+ 10 - 6
lib/cfg.c

@@ -48,13 +48,17 @@
 #include <sys/select.h>
 #include <sys/un.h>
 
+
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+
 #include <corosync/cfg.h>
-#include <corosync/totem/totemip.h>
 #include <corosync/mar_gen.h>
-#include <corosync/ipc_gen.h>
 #include <corosync/ipc_cfg.h>
-#include <corosync/coroipcc.h>
+
+#include <corosync/totem/totemip.h>
 
 /*
  * Data structure for instance data
@@ -106,7 +110,7 @@ corosync_cfg_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		CFG_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,
@@ -167,7 +171,7 @@ corosync_cfg_dispatch (
 	struct cfg_instance *cfg_instance;
 	struct res_lib_cfg_testshutdown *res_lib_cfg_testshutdown;
 	corosync_cfg_callbacks_t callbacks;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 
 	error = saHandleInstanceGet (&cfg_hdb, cfg_handle,
 		(void *)&cfg_instance);
@@ -789,7 +793,7 @@ cs_error_t corosync_cfg_local_get (
 		return (error);
 	}
 
-	req_lib_cfg_local_get.header.size = sizeof (mar_req_header_t);
+	req_lib_cfg_local_get.header.size = sizeof (coroipc_request_header_t);
 	req_lib_cfg_local_get.header.id = MESSAGE_REQ_CFG_LOCAL_GET;
 
 	iov.iov_base = &req_lib_cfg_local_get;

+ 25 - 21
lib/confdb.c

@@ -44,11 +44,15 @@
 #include <sys/types.h>
 #include <errno.h>
 
+
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+
+#include <corosync/mar_gen.h>
 #include <corosync/confdb.h>
 #include <corosync/ipc_confdb.h>
-#include <corosync/mar_gen.h>
-#include <corosync/coroipcc.h>
 #include <corosync/list.h>
 
 #include "sa-confdb.h"
@@ -158,7 +162,7 @@ cs_error_t confdb_initialize (
 	}
 	else {
 		error = coroipcc_service_connect (
-			IPC_SOCKET_NAME,
+			COROSYNC_SOCKET_NAME,
 			CONFDB_SERVICE,
 			IPC_REQUEST_SIZE,
 			IPC_RESPONSE_SIZE,
@@ -301,7 +305,7 @@ cs_error_t confdb_dispatch (
 	struct res_lib_confdb_key_change_callback *res_key_changed_pt;
 	struct res_lib_confdb_object_create_callback *res_object_created_pt;
 	struct res_lib_confdb_object_destroy_callback *res_object_destroyed_pt;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -490,7 +494,7 @@ cs_error_t confdb_object_destroy (
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
 	struct req_lib_confdb_object_destroy req_lib_confdb_object_destroy;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -519,7 +523,7 @@ cs_error_t confdb_object_destroy (
 		&iov,
 		1,
                 &res,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	pthread_mutex_unlock (&confdb_inst->response_mutex);
 	if (error != CS_OK) {
@@ -595,7 +599,7 @@ static cs_error_t do_find_destroy(
 	cs_error_t error;
 	struct iovec iov;
 	struct req_lib_confdb_object_find_destroy req_lib_confdb_object_find_destroy;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	if (!find_handle)
 		return CS_OK;
@@ -622,7 +626,7 @@ static cs_error_t do_find_destroy(
 		&iov,
 		1,
                 &res,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	pthread_mutex_unlock (&confdb_inst->response_mutex);
 	if (error != CS_OK) {
@@ -697,7 +701,7 @@ cs_error_t confdb_key_create (
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
 	struct req_lib_confdb_key_create req_lib_confdb_key_create;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -759,7 +763,7 @@ cs_error_t confdb_key_delete (
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
 	struct req_lib_confdb_key_delete req_lib_confdb_key_delete;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -1011,7 +1015,7 @@ cs_error_t confdb_key_replace (
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
 	struct req_lib_confdb_key_replace req_lib_confdb_key_replace;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -1402,7 +1406,7 @@ cs_error_t confdb_write (
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
-	mar_req_header_t req;
+	coroipc_request_header_t req;
 	struct res_lib_confdb_write res_lib_confdb_write;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
@@ -1419,11 +1423,11 @@ cs_error_t confdb_write (
 		goto error_exit;
 	}
 
-	req.size = sizeof (mar_req_header_t);
+	req.size = sizeof (coroipc_request_header_t);
 	req.id = MESSAGE_REQ_CONFDB_WRITE;
 
 	iov.iov_base = (char *)&req;
-	iov.iov_len = sizeof (mar_req_header_t);
+	iov.iov_len = sizeof (coroipc_request_header_t);
 
 	pthread_mutex_lock (&confdb_inst->response_mutex);
 
@@ -1524,7 +1528,7 @@ cs_error_t confdb_track_changes (
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
 	struct req_lib_confdb_object_track_start req;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -1551,7 +1555,7 @@ cs_error_t confdb_track_changes (
 		&iov,
 		1,
                 &res,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	pthread_mutex_unlock (&confdb_inst->response_mutex);
 	if (error != CS_OK) {
@@ -1571,8 +1575,8 @@ cs_error_t confdb_stop_track_changes (confdb_handle_t handle)
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct iovec iov;
-	mar_req_header_t req;
-	mar_res_header_t res;
+	coroipc_request_header_t req;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&confdb_handle_t_db, handle, (void *)&confdb_inst);
 	if (error != CS_OK) {
@@ -1584,11 +1588,11 @@ cs_error_t confdb_stop_track_changes (confdb_handle_t handle)
 		goto error_exit;
 	}
 
-	req.size = sizeof (mar_req_header_t);
+	req.size = sizeof (coroipc_request_header_t);
 	req.id = MESSAGE_REQ_CONFDB_TRACK_STOP;
 
 	iov.iov_base = (char *)&req;
-	iov.iov_len = sizeof (mar_req_header_t);
+	iov.iov_len = sizeof (coroipc_request_header_t);
 
 	pthread_mutex_lock (&confdb_inst->response_mutex);
 
@@ -1597,7 +1601,7 @@ cs_error_t confdb_stop_track_changes (confdb_handle_t handle)
 		&iov,
 		1,
                 &res,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	pthread_mutex_unlock (&confdb_inst->response_mutex);
 	if (error != CS_OK) {

+ 8 - 7
lib/coroipcc.c

@@ -59,7 +59,8 @@
 #include <sys/mman.h>
 
 #include <corosync/corotypes.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipc_ipc.h>
 #include <corosync/coroipcc.h>
 
 enum SA_HANDLE_STATE {
@@ -643,7 +644,7 @@ int
 coroipcc_dispatch_put (void *ipc_ctx)
 {
 	struct sembuf sop;
-	mar_res_header_t *header;
+	coroipc_response_header_t *header;
 	struct ipc_segment *ipc_segment = (struct ipc_segment *)ipc_ctx;
 	int res;
 	char *addr;
@@ -668,7 +669,7 @@ retry_semop:
 	addr = ipc_segment->dispatch_buffer;
 
 	read_idx = ipc_segment->control_buffer->read;
-	header = (mar_res_header_t *) &addr[read_idx];
+	header = (coroipc_response_header_t *) &addr[read_idx];
 	ipc_segment->control_buffer->read =
 		(read_idx + header->size) % ipc_segment->dispatch_size;
 	return (0);
@@ -872,7 +873,7 @@ coroipcc_zcb_alloc (
 	char path[128];
 	unsigned int res;
 	mar_req_coroipcc_zc_alloc_t req_coroipcc_zc_alloc;
-	mar_res_header_t res_coroipcs_zc_alloc;
+	coroipc_response_header_t res_coroipcs_zc_alloc;
 	size_t map_size;
 	struct iovec iovec;
 	struct coroipcs_zc_header *hdr;
@@ -895,7 +896,7 @@ coroipcc_zcb_alloc (
 		&iovec,
 		1,
 		&res_coroipcs_zc_alloc,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	hdr = (struct coroipcs_zc_header *)buf;
 	hdr->map_size = map_size;
@@ -909,7 +910,7 @@ coroipcc_zcb_free (
 	void *buffer)
 {
 	mar_req_coroipcc_zc_free_t req_coroipcc_zc_free;
-	mar_res_header_t res_coroipcs_zc_free;
+	coroipc_response_header_t res_coroipcs_zc_free;
 	struct iovec iovec;
 	unsigned int res;
 
@@ -928,7 +929,7 @@ coroipcc_zcb_free (
 		&iovec,
 		1,
 		&res_coroipcs_zc_free,
-		sizeof (mar_res_header_t));
+		sizeof (coroipc_response_header_t));
 
 	munmap (header, header->map_size);
 

+ 12 - 8
lib/cpg.c

@@ -48,10 +48,14 @@
 #include <errno.h>
 
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+
 #include <corosync/cpg.h>
-#include <corosync/ipc_cpg.h>
+#include <corosync/mar_gen.h>
 #include <corosync/mar_cpg.h>
-#include <corosync/coroipcc.h>
+#include <corosync/ipc_cpg.h>
 
 struct cpg_inst {
 	void *ipc_ctx;
@@ -103,7 +107,7 @@ cs_error_t cpg_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		CPG_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,
@@ -235,7 +239,7 @@ cs_error_t cpg_dispatch (
 	struct res_lib_cpg_confchg_callback *res_cpg_confchg_callback;
 	struct res_lib_cpg_deliver_callback *res_cpg_deliver_callback;
 	cpg_callbacks_t callbacks;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 	int ignore_dispatch = 0;
 	struct cpg_address member_list[CPG_MEMBERS_MAX];
 	struct cpg_address left_list[CPG_MEMBERS_MAX];
@@ -501,16 +505,16 @@ cs_error_t cpg_membership_get (
 		return (error);
 	}
 
-	req_lib_cpg_membership_get.header.size = sizeof (mar_req_header_t);
+	req_lib_cpg_membership_get.header.size = sizeof (coroipc_request_header_t);
 	req_lib_cpg_membership_get.header.id = MESSAGE_REQ_CPG_MEMBERSHIP;
 
 	iov.iov_base = &req_lib_cpg_membership_get;
-	iov.iov_len = sizeof (mar_req_header_t);
+	iov.iov_len = sizeof (coroipc_request_header_t);
 
 	pthread_mutex_lock (&cpg_inst->response_mutex);
 
 	error = coroipcc_msg_send_reply_receive (cpg_inst->ipc_ctx, &iov, 1,
-		&res_lib_cpg_membership_get, sizeof (mar_res_header_t));
+		&res_lib_cpg_membership_get, sizeof (coroipc_response_header_t));
 
 	pthread_mutex_unlock (&cpg_inst->response_mutex);
 
@@ -552,7 +556,7 @@ cs_error_t cpg_local_get (
 		return (error);
 	}
 
-	req_lib_cpg_local_get.header.size = sizeof (mar_req_header_t);
+	req_lib_cpg_local_get.header.size = sizeof (coroipc_request_header_t);
 	req_lib_cpg_local_get.header.id = MESSAGE_REQ_CPG_LOCAL_GET;
 
 	iov.iov_base = &req_lib_cpg_local_get;

+ 8 - 4
lib/evs.c

@@ -48,11 +48,15 @@
 #include <sys/socket.h>
 #include <errno.h>
 
-#include <corosync/totem/totem.h>
+
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+
 #include <corosync/evs.h>
+#include <corosync/mar_gen.h>
 #include <corosync/ipc_evs.h>
-#include <corosync/coroipcc.h>
 
 #undef MIN
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
@@ -111,7 +115,7 @@ evs_error_t evs_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		EVS_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,
@@ -204,7 +208,7 @@ evs_error_t evs_dispatch (
 	struct res_evs_confchg_callback *res_evs_confchg_callback;
 	struct res_evs_deliver_callback *res_evs_deliver_callback;
 	evs_callbacks_t callbacks;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 	int ignore_dispatch = 0;
 
 	error = saHandleInstanceGet (&evs_handle_t_db, handle, (void *)&evs_inst);

+ 1 - 1
lib/pload.c

@@ -102,7 +102,7 @@ unsigned int pload_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		PLOAD_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,

+ 14 - 10
lib/quorum.c

@@ -45,12 +45,16 @@
 #include <sys/socket.h>
 #include <errno.h>
 
+
 #include <corosync/corotypes.h>
-#include <corosync/mar_gen.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/coroipcc.h>
-#include "corosync/quorum.h"
-#include "corosync/ipc_quorum.h"
+#include <corosync/corodefs.h>
+
+#include <corosync/quorum.h>
+#include <corosync/mar_gen.h>
+#include <corosync/mar_cpg.h>
+#include <corosync/ipc_quorum.h>
 
 struct quorum_inst {
 	void *ipc_ctx;
@@ -93,7 +97,7 @@ cs_error_t quorum_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		QUORUM_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,
@@ -164,7 +168,7 @@ cs_error_t quorum_getquorate (
 	cs_error_t error;
 	struct quorum_inst *quorum_inst;
 	struct iovec iov;
-	mar_req_header_t req;
+	coroipc_request_header_t req;
 	struct res_lib_quorum_getquorate res_lib_quorum_getquorate;
 
 	error = saHandleInstanceGet (&quorum_handle_t_db, handle, (void *)&quorum_inst);
@@ -270,7 +274,7 @@ cs_error_t quorum_trackstart (
 	struct quorum_inst *quorum_inst;
 	struct iovec iov;
 	struct req_lib_quorum_trackstart req_lib_quorum_trackstart;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&quorum_handle_t_db, handle, (void *)&quorum_inst);
 	if (error != CS_OK) {
@@ -313,8 +317,8 @@ cs_error_t quorum_trackstop (
 	cs_error_t error;
 	struct quorum_inst *quorum_inst;
 	struct iovec iov;
-	mar_req_header_t req;
-	mar_res_header_t res;
+	coroipc_request_header_t req;
+	coroipc_response_header_t res;
 
 	error = saHandleInstanceGet (&quorum_handle_t_db, handle, (void *)&quorum_inst);
 	if (error != CS_OK) {
@@ -360,7 +364,7 @@ cs_error_t quorum_dispatch (
 	int dispatch_avail;
 	struct quorum_inst *quorum_inst;
 	quorum_callbacks_t callbacks;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 	struct res_lib_quorum_notification *res_lib_quorum_notification;
 
 	if (dispatch_types != CS_DISPATCH_ONE &&

+ 11 - 6
lib/votequorum.c

@@ -46,11 +46,16 @@
 #include <sys/socket.h>
 #include <errno.h>
 
-#include <corosync/mar_gen.h>
-#include <corosync/ipc_gen.h>
+
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/coroipcc.h>
-#include "corosync/votequorum.h"
-#include "corosync/ipc_votequorum.h"
+#include <corosync/corodefs.h>
+
+#include <corosync/votequorum.h>
+#include <corosync/mar_gen.h>
+#include <corosync/ipc_votequorum.h>
+#include <corosync/mar_gen.h>
 
 struct votequorum_inst {
 	void *ipc_ctx;
@@ -93,7 +98,7 @@ cs_error_t votequorum_initialize (
 	}
 
 	error = coroipcc_service_connect (
-		IPC_SOCKET_NAME,
+		COROSYNC_SOCKET_NAME,
 		VOTEQUORUM_SERVICE,
 		IPC_REQUEST_SIZE,
 		IPC_RESPONSE_SIZE,
@@ -743,7 +748,7 @@ cs_error_t votequorum_dispatch (
 	int dispatch_avail;
 	struct votequorum_inst *votequorum_inst;
 	votequorum_callbacks_t callbacks;
-	mar_res_header_t *dispatch_data;
+	coroipc_response_header_t *dispatch_data;
 	struct res_lib_votequorum_notification *res_lib_votequorum_notification;
 	struct res_lib_votequorum_expectedvotes_notification *res_lib_votequorum_expectedvotes_notification;
 

+ 5 - 4
services/cfg.c

@@ -51,16 +51,17 @@
 #include <string.h>
 
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
 #include <corosync/cfg.h>
 #include <corosync/list.h>
 #include <corosync/queue.h>
 #include <corosync/mar_gen.h>
-#include <corosync/ipc_gen.h>
 #include <corosync/totem/totemip.h>
 #include <corosync/ipc_cfg.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/logsys.h>
 #include <corosync/engine/coroapi.h>
+#include <corosync/corodefs.h>
 
 LOGSYS_DECLARE_SUBSYS ("CFG");
 
@@ -331,18 +332,18 @@ __attribute__ ((constructor)) static void register_this_component (void) {
 }
 
 struct req_exec_cfg_ringreenable {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
         mar_message_source_t source __attribute__((aligned(8)));
 };
 
 struct req_exec_cfg_killnode {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
         mar_uint32_t nodeid __attribute__((aligned(8)));
 	mar_name_t reason __attribute__((aligned(8)));
 };
 
 struct req_exec_cfg_shutdown {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 };
 
 /* IMPL */

+ 17 - 16
services/confdb.c

@@ -42,11 +42,12 @@
 #include <unistd.h>
 
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/cfg.h>
 #include <corosync/list.h>
 #include <corosync/queue.h>
 #include <corosync/mar_gen.h>
-#include <corosync/ipc_gen.h>
 #include <corosync/ipc_confdb.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/logsys.h>
@@ -138,13 +139,13 @@ static struct corosync_lib_handler confdb_lib_engine[] =
 {
 	{ /* 0 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_create,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_CREATE,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 1 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_destroy,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_DESTROY,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -156,7 +157,7 @@ static struct corosync_lib_handler confdb_lib_engine[] =
 	},
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_create,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_CREATE,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -168,13 +169,13 @@ static struct corosync_lib_handler confdb_lib_engine[] =
 	},
 	{ /* 5 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_replace,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_REPLACE,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 6 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_delete,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_DELETE,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -198,13 +199,13 @@ static struct corosync_lib_handler confdb_lib_engine[] =
 	},
 	{ /* 10 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_start,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_START,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	{ /* 11 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_stop,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_STOP,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -222,7 +223,7 @@ static struct corosync_lib_handler confdb_lib_engine[] =
 	},
 	{ /* 14 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_find_destroy,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_FIND_DESTROY,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -346,7 +347,7 @@ static void message_handler_req_lib_confdb_object_destroy (void *conn,
 {
 	const struct req_lib_confdb_object_destroy *req_lib_confdb_object_destroy
 	  = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	int ret = CS_OK;
 
 	if (api->object_destroy(req_lib_confdb_object_destroy->object_handle))
@@ -363,7 +364,7 @@ static void message_handler_req_lib_confdb_object_find_destroy (void *conn,
 {
 	const struct req_lib_confdb_object_find_destroy
 	  *req_lib_confdb_object_find_destroy = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	int ret = CS_OK;
 
 	if (api->object_find_destroy(req_lib_confdb_object_find_destroy->find_handle))
@@ -381,7 +382,7 @@ static void message_handler_req_lib_confdb_key_create (void *conn,
 {
 	const struct req_lib_confdb_key_create *req_lib_confdb_key_create
 	  = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	int ret = CS_OK;
 
 	if (api->object_key_create(req_lib_confdb_key_create->object_handle,
@@ -466,7 +467,7 @@ static void message_handler_req_lib_confdb_key_replace (void *conn,
 {
 	const struct req_lib_confdb_key_replace *req_lib_confdb_key_replace
 	  = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	int ret = CS_OK;
 
 	if (api->object_key_replace(req_lib_confdb_key_replace->object_handle,
@@ -487,7 +488,7 @@ static void message_handler_req_lib_confdb_key_delete (void *conn,
 {
 	const struct req_lib_confdb_key_delete *req_lib_confdb_key_delete
 	  = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 	int ret = CS_OK;
 
 	if (api->object_key_delete(req_lib_confdb_key_delete->object_handle,
@@ -736,7 +737,7 @@ static void message_handler_req_lib_confdb_track_start (void *conn,
 							const void *message)
 {
 	const struct req_lib_confdb_object_track_start *req = message;
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	api->object_track_start(req->object_handle,
 		req->flags,
@@ -754,7 +755,7 @@ static void message_handler_req_lib_confdb_track_start (void *conn,
 static void message_handler_req_lib_confdb_track_stop (void *conn,
 						       const void *message)
 {
-	mar_res_header_t res;
+	coroipc_response_header_t res;
 
 	api->object_track_stop(confdb_notify_lib_of_key_change,
 		confdb_notify_lib_of_new_object,

+ 19 - 17
services/cpg.c

@@ -55,11 +55,13 @@
 #include <arpa/inet.h>
 
 #include <corosync/corotypes.h>
-#include <corosync/cfg.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/list.h>
 #include <corosync/queue.h>
 #include <corosync/jhash.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
+#include <corosync/mar_cpg.h>
 #include <corosync/ipc_cpg.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/logsys.h>
@@ -212,7 +214,7 @@ static struct corosync_lib_handler cpg_lib_engine[] =
 	},
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_lib_cpg_membership,
-		.response_size				= sizeof (mar_res_header_t),
+		.response_size				= sizeof (coroipc_response_header_t),
 		.response_id				= MESSAGE_RES_CPG_MEMBERSHIP,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
@@ -328,14 +330,14 @@ __attribute__ ((constructor)) static void cpg_comp_register (void) {
 }
 
 struct req_exec_cpg_procjoin {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 	mar_uint32_t reason __attribute__((aligned(8)));
 };
 
 struct req_exec_cpg_mcast {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t msglen __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
@@ -344,7 +346,7 @@ struct req_exec_cpg_mcast {
 };
 
 struct req_exec_cpg_downlist {
-	mar_req_header_t header __attribute__((aligned(8)));
+	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_uint32_t left_nodes __attribute__((aligned(8)));
 	mar_uint32_t nodeids[PROCESSOR_COUNT_MAX]  __attribute__((aligned(8)));
 };
@@ -696,8 +698,8 @@ static void exec_cpg_procjoin_endian_convert (void *msg)
 static void exec_cpg_joinlist_endian_convert (void *msg_v)
 {
 	char *msg = msg_v;
-	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));
+	coroipc_response_header_t *res = (coroipc_response_header_t *)msg;
+	struct join_list_entry *jle = (struct join_list_entry *)(msg + sizeof(coroipc_response_header_t));
 
 	/* XXX shouldn't mar_res_header be swabbed? */
 
@@ -725,7 +727,7 @@ static void exec_cpg_mcast_endian_convert (void *msg)
 {
 	struct req_exec_cpg_mcast *req_exec_cpg_mcast = msg;
 
-	swab_mar_req_header_t (&req_exec_cpg_mcast->header);
+	swab_coroipc_request_header_t (&req_exec_cpg_mcast->header);
 	swab_mar_cpg_name_t (&req_exec_cpg_mcast->group_name);
 	req_exec_cpg_mcast->pid = swab32(req_exec_cpg_mcast->pid);
 	req_exec_cpg_mcast->msglen = swab32(req_exec_cpg_mcast->msglen);
@@ -883,8 +885,8 @@ static void message_handler_req_exec_cpg_joinlist (
 	unsigned int nodeid)
 {
 	const char *message = message_v;
-	const mar_res_header_t *res = (const mar_res_header_t *)message;
-	const struct join_list_entry *jle = (const struct join_list_entry *)(message + sizeof(mar_res_header_t));
+	const coroipc_response_header_t *res = (const coroipc_response_header_t *)message;
+	const struct join_list_entry *jle = (const struct join_list_entry *)(message + sizeof(coroipc_response_header_t));
 
 	log_printf(LOGSYS_LEVEL_NOTICE, "got joinlist message from node %d\n",
 		nodeid);
@@ -953,7 +955,7 @@ static int cpg_exec_send_joinlist(void)
 	struct list_head *iter;
 	struct list_head *iter2;
 	struct group_info *gi;
-	mar_res_header_t *res;
+	coroipc_response_header_t *res;
 	struct join_list_entry *jle;
 	struct iovec req_exec_cpg_iovec;
 
@@ -976,14 +978,14 @@ static int cpg_exec_send_joinlist(void)
 	if (!count)
 		return 0;
 
-	buf = alloca(sizeof(mar_res_header_t) + sizeof(struct join_list_entry) * count);
+	buf = alloca(sizeof(coroipc_response_header_t) + sizeof(struct join_list_entry) * count);
 	if (!buf) {
 		log_printf(LOGSYS_LEVEL_WARNING, "Unable to allocate joinlist buffer");
 		return -1;
 	}
 
-	jle = (struct join_list_entry *)(buf + sizeof(mar_res_header_t));
-	res = (mar_res_header_t *)buf;
+	jle = (struct join_list_entry *)(buf + sizeof(coroipc_response_header_t));
+	res = (coroipc_response_header_t *)buf;
 
 	for (i=0; i<GROUP_HASH_SIZE; i++) {
 		for (iter = group_lists[i].next; iter != &group_lists[i]; iter = iter->next) {
@@ -1002,7 +1004,7 @@ static int cpg_exec_send_joinlist(void)
 	}
 
 	res->id = SERVICE_ID_MAKE(CPG_SERVICE, MESSAGE_REQ_EXEC_CPG_JOINLIST);
-	res->size = sizeof(mar_res_header_t)+sizeof(struct join_list_entry) * count;
+	res->size = sizeof(coroipc_response_header_t)+sizeof(struct join_list_entry) * count;
 
 	req_exec_cpg_iovec.iov_base = buf;
 	req_exec_cpg_iovec.iov_len = res->size;
@@ -1144,7 +1146,7 @@ static void message_handler_req_lib_cpg_membership (void *conn,
 
 	log_printf(LOGSYS_LEVEL_DEBUG, "got membership request on %p\n", conn);
 	if (!pi->group) {
-		mar_res_header_t res;
+		coroipc_response_header_t res;
 		res.size = sizeof(res);
 		res.id = MESSAGE_RES_CPG_MEMBERSHIP;
 		res.error = CS_ERR_ACCESS; /* TODO Better error code */

+ 3 - 1
services/evs.c

@@ -53,7 +53,9 @@
 
 #include <corosync/swab.h>
 #include <corosync/corotypes.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/ipc_evs.h>

+ 5 - 3
services/pload.c

@@ -54,8 +54,10 @@
 
 #include <corosync/swab.h>
 #include <corosync/corotypes.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/lcr/lcr_comp.h>
+#include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/ipc_pload.h>
 #include <corosync/list.h>
@@ -113,7 +115,7 @@ static unsigned int msgs_sent = 0;
 static struct corosync_api_v1 *api;
 
 struct req_exec_pload_start {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	unsigned int msg_code;
 	unsigned int msg_count;
 	unsigned int msg_size;
@@ -121,7 +123,7 @@ struct req_exec_pload_start {
 };
 
 struct req_exec_pload_mcast {
-	mar_req_header_t header;
+	coroipc_request_header_t header;
 	unsigned int msg_code;
 };
 

+ 5 - 1
services/testquorum.c

@@ -56,8 +56,12 @@
 #include <sched.h>
 #include <time.h>
 
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/engine/logsys.h>
-#include <corosync/ipc_gen.h>
+
+#include <corosync/mar_gen.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/coroapi.h>
 

+ 3 - 1
services/votequorum.c

@@ -57,11 +57,13 @@
 #include <arpa/inet.h>
 
 #include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/corodefs.h>
 #include <corosync/cfg.h>
 #include <corosync/list.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/logsys.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/engine/quorum.h>
 #include <corosync/ipc_votequorum.h>