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

The entire tree builds properly and all services have been ported to the
new coroapi.h include header.

The services shipped with corosync are CPG, CFG, CONFDB, and EVS.


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

Steven Dake 17 лет назад
Родитель
Сommit
742d4d82eb

+ 7 - 0
corosync/exec/main.c

@@ -470,6 +470,13 @@ int main_mcast (
 	return (totempg_groups_mcast_joined (openais_group_handle, iovec, iov_len, guarantee));
 	return (totempg_groups_mcast_joined (openais_group_handle, iovec, iov_len, guarantee));
 }
 }
 
 
+extern int main_send_ok (
+        struct iovec *iovec,
+        int iov_len)
+{
+	return (totempg_groups_send_ok_joined (openais_group_handle, iovec, iov_len));
+}
+
 int main (int argc, char **argv)
 int main (int argc, char **argv)
 {
 {
 	char *error_string;
 	char *error_string;

+ 4 - 0
corosync/exec/main.h

@@ -70,4 +70,8 @@ extern int main_mcast (
 	int iov_len,
 	int iov_len,
 	unsigned int guarantee);
 	unsigned int guarantee);
 
 
+extern int main_send_ok (
+        struct iovec *iovec,
+        int iov_len);
+
 #endif /* AIS_EXEC_H_DEFINED */
 #endif /* AIS_EXEC_H_DEFINED */

+ 5 - 9
corosync/exec/service.c

@@ -71,8 +71,8 @@ static struct corosync_api_v1 corosync_api_v1 = {
 	.ipc_private_data_get = openais_conn_private_data_get,
 	.ipc_private_data_get = openais_conn_private_data_get,
 	.ipc_response_send = NULL,
 	.ipc_response_send = NULL,
 	.ipc_dispatch_send = NULL,
 	.ipc_dispatch_send = NULL,
-	.conn_send_response = openais_conn_send_response,
-	.conn_partner_get = openais_conn_partner_get,
+	.ipc_conn_send_response = openais_conn_send_response,
+	.ipc_conn_partner_get = openais_conn_partner_get,
 	.ipc_refcnt_inc =  openais_ipc_flow_control_local_increment,
 	.ipc_refcnt_inc =  openais_ipc_flow_control_local_increment,
 	.ipc_refcnt_dec = openais_ipc_flow_control_local_decrement,
 	.ipc_refcnt_dec = openais_ipc_flow_control_local_decrement,
 	.ipc_fc_create = openais_ipc_flow_control_create,
 	.ipc_fc_create = openais_ipc_flow_control_create,
@@ -80,21 +80,20 @@ static struct corosync_api_v1 corosync_api_v1 = {
 	.totem_nodeid_get = totempg_my_nodeid_get,
 	.totem_nodeid_get = totempg_my_nodeid_get,
 	.totem_ring_reenable = totempg_ring_reenable,
 	.totem_ring_reenable = totempg_ring_reenable,
 	.totem_mcast = main_mcast,
 	.totem_mcast = main_mcast,
-	.service_link_and_init = openais_service_link_and_init,
-	.service_unlink_and_exit = openais_service_unlink_and_exit,
+	.totem_send_ok = main_send_ok,
 	.totem_ifaces_get = totempg_ifaces_get,
 	.totem_ifaces_get = totempg_ifaces_get,
 	.totem_ifaces_print = totempg_ifaces_print,
 	.totem_ifaces_print = totempg_ifaces_print,
 	.totem_ip_print = totemip_print,
 	.totem_ip_print = totemip_print,
+	.service_link_and_init = openais_service_link_and_init,
+	.service_unlink_and_exit = openais_service_unlink_and_exit,
 	.error_memory_failure = NULL
 	.error_memory_failure = NULL
 };
 };
 
 
 static struct default_service default_services[] = {
 static struct default_service default_services[] = {
-/*
 	{
 	{
 		.name			 = "corosync_evs",
 		.name			 = "corosync_evs",
 		.ver			 = 0,
 		.ver			 = 0,
 	},
 	},
-*/
 	{
 	{
 
 
 		.name			 = "corosync_cfg",
 		.name			 = "corosync_cfg",
@@ -104,19 +103,16 @@ static struct default_service default_services[] = {
 		.name			 = "corosync_cpg",
 		.name			 = "corosync_cpg",
 		.ver			 = 0,
 		.ver			 = 0,
 	},
 	},
-/*
 	{
 	{
 		.name			 = "corosync_confdb",
 		.name			 = "corosync_confdb",
 		.ver			 = 0,
 		.ver			 = 0,
 	},
 	},
-*/
 };
 };
 
 
 struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 
 
 static unsigned int object_internal_configuration_handle;
 static unsigned int object_internal_configuration_handle;
 
 
-
 static unsigned int default_services_requested (struct objdb_iface_ver0 *objdb)
 static unsigned int default_services_requested (struct objdb_iface_ver0 *objdb)
 {
 {
 	unsigned int object_service_handle;
 	unsigned int object_service_handle;

+ 222 - 0
corosync/include/coroapi.h

@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2008 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 COROAPI_H_DEFINED
+#define COROAPI_H_DEFINED
+
+#include "../exec/objdb.h"
+
+typedef void * corosync_timer_handle_t;
+
+#define TOTEMIP_ADDRLEN (sizeof(struct in6_addr))
+
+#define PROCESSOR_COUNT_MAX 384
+#define INTERFACE_MAX 2
+
+#define TOTEM_AGREED	0
+#define TOTEM_SAFE	1
+
+#if !defined(TOTEM_IP_ADDRESS)
+struct totem_ip_address {
+	unsigned int   nodeid;
+	unsigned short family;
+	unsigned char  addr[TOTEMIP_ADDRLEN];
+} __attribute__((packed));
+#endif
+
+#if !defined(MEMB_RING_ID)
+struct memb_ring_id {
+	struct totem_ip_address rep;
+	unsigned long long seq;
+} __attribute__((packed));
+#endif
+
+#if !defined(TOTEM_CONFIGURATION_TYPE)
+enum totem_configuration_type {
+	TOTEM_CONFIGURATION_REGULAR,
+	TOTEM_CONFIGURATION_TRANSITIONAL
+};
+#endif
+
+enum corosync_lib_flow_control {
+	COROSYNC_LIB_FLOW_CONTROL_REQUIRED = 1,
+	COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED = 2
+};
+
+#if !defined (COROSYNC_FLOW_CONTROL_STATE)
+enum corosync_flow_control_state {
+	COROSYNC_FLOW_CONTROL_STATE_DISABLED,
+	COROSYNC_FLOW_CONTROL_STATE_ENABLED
+};
+#endif
+
+struct corosync_api_v1 {
+	int (*timer_add_duration) (
+		unsigned long long nanoseconds_in_future,
+		void *data,
+		void (*timer_nf) (void *data),
+		corosync_timer_handle_t *handle);
+
+	int (*timer_add_absolute) (
+		unsigned long long nanoseconds_from_epoch,
+		void *data,
+		void (*timer_fn) (void *data),
+		corosync_timer_handle_t *handle);
+	
+	void (*timer_delete) (
+		corosync_timer_handle_t timer_handle);
+
+	unsigned long long (*timer_time_get) (void);
+
+	void (*ipc_source_set) (mar_message_source_t *source, void *conn);
+
+	int (*ipc_source_is_local) (mar_message_source_t *source);
+
+	void *(*ipc_private_data_get) (void *conn);
+
+	int (*ipc_response_send) (void *conn, void *msg, int mlen);
+
+	int (*ipc_dispatch_send) (void *conn, void *msg, int mlen);
+
+	/*
+	 * DEPRECATED
+	 */
+	int (*ipc_conn_send_response) (void *conn, void *msg, int mlen);
+
+	/*
+	 * DEPRECATED
+	 */
+	void *(*ipc_conn_partner_get) (void *conn);
+
+	void (*ipc_fc_create) (
+		void *conn,
+		unsigned int service,
+		char *id,
+		int id_len,
+		void (*flow_control_state_set_fn)
+			(void *context,
+				enum corosync_flow_control_state flow_control_state_set),
+		void *context);
+
+	void (*ipc_fc_destroy) (
+		void *conn,
+		unsigned int service,
+		unsigned char *id,
+		int id_len);
+
+	void (*ipc_refcnt_inc) (void *conn);
+
+	void (*ipc_refcnt_dec) (void *conn);
+
+	int (*totem_nodeid_get) (void);
+
+	int (*totem_ring_reenable) (void);
+
+	int (*totem_mcast) (struct iovec *iovec, int iov_len, unsigned int gaurantee);
+
+	int (*totem_send_ok) (struct iovec *iovec, int iov_len);
+
+	unsigned int (*service_link_and_init) (
+		struct objdb_iface_ver0 *objdb,
+		char *service_name,
+		unsigned int service_ver);
+
+	unsigned int (*service_unlink_and_exit) (
+		struct objdb_iface_ver0 *objdb,
+		char *service_name,
+		unsigned int service_ver);
+
+	int (*totem_ifaces_get) (
+		unsigned int nodeid,
+		struct totem_ip_address *interfaces,
+		char ***status,
+		unsigned int *iface_count);
+
+	char *(*totem_ifaces_print) (unsigned int nodeid);
+
+	char *(*totem_ip_print) (struct totem_ip_address *addr);
+
+	void (*error_memory_failure) (void);
+};
+
+#define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
+
+#define SERVICE_HANDLER_MAXIMUM_COUNT 64
+
+struct corosync_lib_handler {
+	void (*lib_handler_fn) (void *conn, void *msg);
+	int response_size;
+	int response_id;
+	enum corosync_lib_flow_control flow_control;
+};
+
+struct corosync_exec_handler {
+	void (*exec_handler_fn) (void *msg, unsigned int nodeid);
+	void (*exec_endian_convert_fn) (void *msg);
+};
+
+struct corosync_service_engine_iface_ver0 {
+        struct corosync_service_engine *(*corosync_get_service_engine_ver0) (void);
+};
+
+struct corosync_service_engine {
+	char *name;
+	unsigned short id;
+	unsigned int private_data_size;
+	enum corosync_lib_flow_control flow_control;
+	int (*exec_init_fn) (struct objdb_iface_ver0 *, struct corosync_api_v1 *);
+	int (*exec_exit_fn) (struct objdb_iface_ver0 *);
+	void (*exec_dump_fn) (void);
+	int (*lib_init_fn) (void *conn);
+	int (*lib_exit_fn) (void *conn);
+	struct corosync_lib_handler *lib_engine;
+	int lib_engine_count;
+	struct corosync_exec_handler *exec_engine;
+	int exec_engine_count;
+	int (*config_init_fn) (struct objdb_iface_ver0 *);
+	void (*confchg_fn) (
+		enum totem_configuration_type configuration_type,
+		unsigned int *member_list, int member_list_entries,
+		unsigned int *left_list, int left_list_entries,
+		unsigned int *joined_list, int joined_list_entries,
+		struct memb_ring_id *ring_id);
+	void (*sync_init) (void);
+	int (*sync_process) (void);
+	void (*sync_activate) (void);
+	void (*sync_abort) (void);
+};
+
+typedef void *corosync_timer_handle;
+
+#endif /* COROAPI_H_DEFINED */
+	

+ 1 - 1
corosync/services/Makefile

@@ -55,7 +55,7 @@ LCR_OBJS = evs.o cfg.o cpg.o confdb.o $(AMF_OBJS)
 
 
 override CFLAGS += -fPIC
 override CFLAGS += -fPIC
 
 
-all: service_evs.lcrso ervice_cfg.lcrso service_cpg.lcrso service_confdb.lcrso
+all: service_evs.lcrso service_cfg.lcrso service_cpg.lcrso service_confdb.lcrso
 
 
 ifeq (${OPENAIS_COMPAT}, DARWIN)
 ifeq (${OPENAIS_COMPAT}, DARWIN)
 
 

+ 7 - 7
corosync/services/cfg.c

@@ -199,10 +199,10 @@ static struct objdb_iface_ver0 *my_objdb;
 /*
 /*
  * Dynamic Loader definition
  * Dynamic Loader definition
  */
  */
-static struct corosync_service_engine *cfg_get_handler_ver0 (void);
+static struct corosync_service_engine *cfg_get_service_engine_ver0 (void);
 
 
 static struct corosync_service_engine_iface_ver0 cfg_service_engine_iface = {
 static struct corosync_service_engine_iface_ver0 cfg_service_engine_iface = {
-	.corosync_get_service_engine_ver0	= cfg_get_handler_ver0
+	.corosync_get_service_engine_ver0	= cfg_get_service_engine_ver0
 };
 };
 
 
 static struct lcr_iface corosync_cfg_ver0[1] = {
 static struct lcr_iface corosync_cfg_ver0[1] = {
@@ -224,7 +224,7 @@ static struct lcr_comp cfg_comp_ver0 = {
 	.ifaces					= corosync_cfg_ver0
 	.ifaces					= corosync_cfg_ver0
 };
 };
 
 
-static struct corosync_service_engine *cfg_get_handler_ver0 (void)
+static struct corosync_service_engine *cfg_get_service_engine_ver0 (void)
 {
 {
 	return (&cfg_service_engine);
 	return (&cfg_service_engine);
 }
 }
@@ -291,7 +291,7 @@ static void message_handler_req_exec_cfg_ringreenable (
 		res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
 		res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
 		res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
 		res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
 		res_lib_cfg_ringreenable.header.error = SA_AIS_OK;
 		res_lib_cfg_ringreenable.header.error = SA_AIS_OK;
-		api->conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_cfg_ringreenable->source.conn,
 			req_exec_cfg_ringreenable->source.conn,
 			&res_lib_cfg_ringreenable,
 			&res_lib_cfg_ringreenable,
 			sizeof (struct res_lib_cfg_ringreenable));
 			sizeof (struct res_lib_cfg_ringreenable));
@@ -335,7 +335,7 @@ static void message_handler_req_lib_cfg_ringstatusget (
 		strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
 		strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
 			totem_ip_string);
 			totem_ip_string);
 	}
 	}
-	api->conn_send_response (
+	api->ipc_conn_send_response (
 		conn,
 		conn,
 		&res_lib_cfg_ringstatusget,
 		&res_lib_cfg_ringstatusget,
 		sizeof (struct res_lib_cfg_ringstatusget));
 		sizeof (struct res_lib_cfg_ringstatusget));
@@ -419,7 +419,7 @@ static void message_handler_req_lib_cfg_serviceload (
 	res_lib_cfg_serviceload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
 	res_lib_cfg_serviceload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
 	res_lib_cfg_serviceload.header.size = sizeof (struct res_lib_cfg_serviceload);
 	res_lib_cfg_serviceload.header.size = sizeof (struct res_lib_cfg_serviceload);
 	res_lib_cfg_serviceload.header.error = SA_AIS_OK;
 	res_lib_cfg_serviceload.header.error = SA_AIS_OK;
-	api->conn_send_response (
+	api->ipc_conn_send_response (
 		conn,
 		conn,
 		&res_lib_cfg_serviceload,
 		&res_lib_cfg_serviceload,
 		sizeof (struct res_lib_cfg_serviceload));
 		sizeof (struct res_lib_cfg_serviceload));
@@ -442,7 +442,7 @@ static void message_handler_req_lib_cfg_serviceunload (
 	res_lib_cfg_serviceunload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
 	res_lib_cfg_serviceunload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
 	res_lib_cfg_serviceunload.header.size = sizeof (struct res_lib_cfg_serviceunload);
 	res_lib_cfg_serviceunload.header.size = sizeof (struct res_lib_cfg_serviceunload);
 	res_lib_cfg_serviceunload.header.error = SA_AIS_OK;
 	res_lib_cfg_serviceunload.header.error = SA_AIS_OK;
-	api->conn_send_response (
+	api->ipc_conn_send_response (
 		conn,
 		conn,
 		&res_lib_cfg_serviceunload,
 		&res_lib_cfg_serviceunload,
 		sizeof (struct res_lib_cfg_serviceunload));
 		sizeof (struct res_lib_cfg_serviceunload));

+ 52 - 50
corosync/services/confdb.c

@@ -43,19 +43,18 @@
 #include "../include/ipc_confdb.h"
 #include "../include/ipc_confdb.h"
 #include "../include/mar_gen.h"
 #include "../include/mar_gen.h"
 #include "../lcr/lcr_comp.h"
 #include "../lcr/lcr_comp.h"
-#include "main.h"
-#include "flow.h"
-#include "ipc.h"
-#include "objdb.h"
-#include "service.h"
-#include "ipc.h"
-#include "logsys.h"
+#include "../exec/logsys.h"
+#include "../include/coroapi.h"
 
 
 LOGSYS_DECLARE_SUBSYS ("CONFDB", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("CONFDB", LOG_INFO);
 
 
 static struct objdb_iface_ver0 *global_objdb;
 static struct objdb_iface_ver0 *global_objdb;
 
 
-static int confdb_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static struct corosync_api_v1 *api;
+
+static int confdb_exec_init_fn (
+	struct objdb_iface_ver0 *objdb,
+	struct corosync_api_v1 *corosync_api);
 
 
 static int confdb_lib_init_fn (void *conn);
 static int confdb_lib_init_fn (void *conn);
 static int confdb_lib_exit_fn (void *conn);
 static int confdb_lib_exit_fn (void *conn);
@@ -82,113 +81,113 @@ static void message_handler_req_lib_confdb_track_stop (void *conn, void *message
 /*
 /*
  * Library Handler Definition
  * Library Handler Definition
  */
  */
-static struct openais_lib_handler confdb_lib_service[] =
+static struct corosync_lib_handler confdb_lib_engine[] =
 {
 {
 	{ /* 0 */
 	{ /* 0 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_create,
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_create,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_CREATE,
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_CREATE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 1 */
 	{ /* 1 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_destroy,
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_destroy,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_DESTROY,
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_DESTROY,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 2 */
 	{ /* 2 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_find,
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_find,
 		.response_size				= sizeof (struct res_lib_confdb_object_find),
 		.response_size				= sizeof (struct res_lib_confdb_object_find),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_FIND,
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_FIND,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 3 */
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_create,
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_create,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_CREATE,
 		.response_id				= MESSAGE_RES_CONFDB_KEY_CREATE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 4 */
 	{ /* 4 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_get,
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_get,
 		.response_size				= sizeof (struct res_lib_confdb_key_get),
 		.response_size				= sizeof (struct res_lib_confdb_key_get),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_GET,
 		.response_id				= MESSAGE_RES_CONFDB_KEY_GET,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 5 */
 	{ /* 5 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_replace,
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_replace,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_REPLACE,
 		.response_id				= MESSAGE_RES_CONFDB_KEY_REPLACE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 6 */
 	{ /* 6 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_delete,
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_delete,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_DELETE,
 		.response_id				= MESSAGE_RES_CONFDB_KEY_DELETE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 7 */
 	{ /* 7 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_iter,
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_iter,
 		.response_size				= sizeof (struct res_lib_confdb_object_iter),
 		.response_size				= sizeof (struct res_lib_confdb_object_iter),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_ITER,
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_ITER,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 8 */
 	{ /* 8 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_parent_get,
 		.lib_handler_fn				= message_handler_req_lib_confdb_object_parent_get,
 		.response_size				= sizeof (struct res_lib_confdb_object_parent_get),
 		.response_size				= sizeof (struct res_lib_confdb_object_parent_get),
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_PARENT_GET,
 		.response_id				= MESSAGE_RES_CONFDB_OBJECT_PARENT_GET,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 9 */
 	{ /* 9 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_iter,
 		.lib_handler_fn				= message_handler_req_lib_confdb_key_iter,
 		.response_size				= sizeof (struct res_lib_confdb_key_iter),
 		.response_size				= sizeof (struct res_lib_confdb_key_iter),
 		.response_id				= MESSAGE_RES_CONFDB_KEY_ITER,
 		.response_id				= MESSAGE_RES_CONFDB_KEY_ITER,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 10 */
 	{ /* 10 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_start,
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_start,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_START,
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_START,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 11 */
 	{ /* 11 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_stop,
 		.lib_handler_fn				= message_handler_req_lib_confdb_track_stop,
 		.response_size				= sizeof (mar_res_header_t),
 		.response_size				= sizeof (mar_res_header_t),
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_START,
 		.response_id				= MESSAGE_RES_CONFDB_TRACK_START,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 12 */
 	{ /* 12 */
 		.lib_handler_fn				= message_handler_req_lib_confdb_write,
 		.lib_handler_fn				= message_handler_req_lib_confdb_write,
 		.response_size				= sizeof (struct res_lib_confdb_write),
 		.response_size				= sizeof (struct res_lib_confdb_write),
 		.response_id				= MESSAGE_RES_CONFDB_WRITE,
 		.response_id				= MESSAGE_RES_CONFDB_WRITE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 };
 };
 
 
 
 
-struct openais_service_handler confdb_service_handler = {
-	.name				        = "openais cluster config database access v1.01",
+struct corosync_service_engine confdb_service_engine = {
+	.name				        = "corosync cluster config database access v1.01",
 	.id					= CONFDB_SERVICE,
 	.id					= CONFDB_SERVICE,
 	.private_data_size			= 0,
 	.private_data_size			= 0,
-	.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED,
+	.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED,
 	.lib_init_fn				= confdb_lib_init_fn,
 	.lib_init_fn				= confdb_lib_init_fn,
 	.lib_exit_fn				= confdb_lib_exit_fn,
 	.lib_exit_fn				= confdb_lib_exit_fn,
-	.lib_service				= confdb_lib_service,
-	.lib_service_count			= sizeof (confdb_lib_service) / sizeof (struct openais_lib_handler),
+	.lib_engine				= confdb_lib_engine,
+	.lib_engine_count			= sizeof (confdb_lib_engine) / sizeof (struct corosync_lib_handler),
 	.exec_init_fn				= confdb_exec_init_fn,
 	.exec_init_fn				= confdb_exec_init_fn,
 };
 };
 
 
 /*
 /*
  * Dynamic loader definition
  * Dynamic loader definition
  */
  */
-static struct openais_service_handler *confdb_get_service_handler_ver0 (void);
+static struct corosync_service_engine *confdb_get_service_engine_ver0 (void);
 
 
-static struct openais_service_handler_iface_ver0 confdb_service_handler_iface = {
-	.openais_get_service_handler_ver0		= confdb_get_service_handler_ver0
+static struct corosync_service_engine_iface_ver0 confdb_service_engine_iface = {
+	.corosync_get_service_engine_ver0		= confdb_get_service_engine_ver0
 };
 };
 
 
-static struct lcr_iface openais_confdb_ver0[1] = {
+static struct lcr_iface corosync_confdb_ver0[1] = {
 	{
 	{
-		.name				= "openais_confdb",
+		.name				= "corosync_confdb",
 		.version			= 0,
 		.version			= 0,
 		.versions_replace		= 0,
 		.versions_replace		= 0,
 		.versions_replace_count         = 0,
 		.versions_replace_count         = 0,
@@ -202,23 +201,26 @@ static struct lcr_iface openais_confdb_ver0[1] = {
 
 
 static struct lcr_comp confdb_comp_ver0 = {
 static struct lcr_comp confdb_comp_ver0 = {
 	.iface_count			= 1,
 	.iface_count			= 1,
-	.ifaces			        = openais_confdb_ver0
+	.ifaces			        = corosync_confdb_ver0
 };
 };
 
 
 
 
-static struct openais_service_handler *confdb_get_service_handler_ver0 (void)
+static struct corosync_service_engine *confdb_get_service_engine_ver0 (void)
 {
 {
-	return (&confdb_service_handler);
+	return (&confdb_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void confdb_comp_register (void) {
 __attribute__ ((constructor)) static void confdb_comp_register (void) {
-        lcr_interfaces_set (&openais_confdb_ver0[0], &confdb_service_handler_iface);
+        lcr_interfaces_set (&corosync_confdb_ver0[0], &confdb_service_engine_iface);
 
 
 	lcr_component_register (&confdb_comp_ver0);
 	lcr_component_register (&confdb_comp_ver0);
 }
 }
 
 
-static int confdb_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int confdb_exec_init_fn (
+	struct objdb_iface_ver0 *objdb,
+	struct corosync_api_v1 *corosync_api)
 {
 {
+	api = corosync_api;
 	global_objdb = objdb;
 	global_objdb = objdb;
 	return 0;
 	return 0;
 }
 }
@@ -253,7 +255,7 @@ static void message_handler_req_lib_confdb_object_create (void *conn, void *mess
 	res_lib_confdb_object_create.header.size = sizeof(res_lib_confdb_object_create);
 	res_lib_confdb_object_create.header.size = sizeof(res_lib_confdb_object_create);
 	res_lib_confdb_object_create.header.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res_lib_confdb_object_create.header.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res_lib_confdb_object_create.header.error = ret;
 	res_lib_confdb_object_create.header.error = ret;
-	openais_conn_send_response(conn, &res_lib_confdb_object_create, sizeof(res_lib_confdb_object_create));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_object_create, sizeof(res_lib_confdb_object_create));
 }
 }
 
 
 static void message_handler_req_lib_confdb_object_destroy (void *conn, void *message)
 static void message_handler_req_lib_confdb_object_destroy (void *conn, void *message)
@@ -268,7 +270,7 @@ static void message_handler_req_lib_confdb_object_destroy (void *conn, void *mes
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res.error = ret;
 	res.error = ret;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 
 
@@ -288,7 +290,7 @@ static void message_handler_req_lib_confdb_key_create (void *conn, void *message
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_KEY_CREATE;
 	res.id = MESSAGE_RES_CONFDB_KEY_CREATE;
 	res.error = ret;
 	res.error = ret;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 static void message_handler_req_lib_confdb_key_get (void *conn, void *message)
 static void message_handler_req_lib_confdb_key_get (void *conn, void *message)
@@ -313,7 +315,7 @@ static void message_handler_req_lib_confdb_key_get (void *conn, void *message)
 	res_lib_confdb_key_get.header.size = sizeof(res_lib_confdb_key_get);
 	res_lib_confdb_key_get.header.size = sizeof(res_lib_confdb_key_get);
 	res_lib_confdb_key_get.header.id = MESSAGE_RES_CONFDB_KEY_GET;
 	res_lib_confdb_key_get.header.id = MESSAGE_RES_CONFDB_KEY_GET;
 	res_lib_confdb_key_get.header.error = ret;
 	res_lib_confdb_key_get.header.error = ret;
-	openais_conn_send_response(conn, &res_lib_confdb_key_get, sizeof(res_lib_confdb_key_get));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_key_get, sizeof(res_lib_confdb_key_get));
 }
 }
 
 
 static void message_handler_req_lib_confdb_key_replace (void *conn, void *message)
 static void message_handler_req_lib_confdb_key_replace (void *conn, void *message)
@@ -334,7 +336,7 @@ static void message_handler_req_lib_confdb_key_replace (void *conn, void *messag
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_KEY_REPLACE;
 	res.id = MESSAGE_RES_CONFDB_KEY_REPLACE;
 	res.error = ret;
 	res.error = ret;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 static void message_handler_req_lib_confdb_key_delete (void *conn, void *message)
 static void message_handler_req_lib_confdb_key_delete (void *conn, void *message)
@@ -353,7 +355,7 @@ static void message_handler_req_lib_confdb_key_delete (void *conn, void *message
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_KEY_DELETE;
 	res.id = MESSAGE_RES_CONFDB_KEY_DELETE;
 	res.error = ret;
 	res.error = ret;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 static void message_handler_req_lib_confdb_object_parent_get (void *conn, void *message)
 static void message_handler_req_lib_confdb_object_parent_get (void *conn, void *message)
@@ -371,7 +373,7 @@ static void message_handler_req_lib_confdb_object_parent_get (void *conn, void *
 	res_lib_confdb_object_parent_get.header.size = sizeof(res_lib_confdb_object_parent_get);
 	res_lib_confdb_object_parent_get.header.size = sizeof(res_lib_confdb_object_parent_get);
 	res_lib_confdb_object_parent_get.header.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res_lib_confdb_object_parent_get.header.id = MESSAGE_RES_CONFDB_OBJECT_CREATE;
 	res_lib_confdb_object_parent_get.header.error = ret;
 	res_lib_confdb_object_parent_get.header.error = ret;
-	openais_conn_send_response(conn, &res_lib_confdb_object_parent_get, sizeof(res_lib_confdb_object_parent_get));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_object_parent_get, sizeof(res_lib_confdb_object_parent_get));
 }
 }
 
 
 
 
@@ -402,7 +404,7 @@ static void message_handler_req_lib_confdb_key_iter (void *conn, void *message)
 	res_lib_confdb_key_iter.header.id = MESSAGE_RES_CONFDB_KEY_ITER;
 	res_lib_confdb_key_iter.header.id = MESSAGE_RES_CONFDB_KEY_ITER;
 	res_lib_confdb_key_iter.header.error = ret;
 	res_lib_confdb_key_iter.header.error = ret;
 
 
-	openais_conn_send_response(conn, &res_lib_confdb_key_iter, sizeof(res_lib_confdb_key_iter));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_key_iter, sizeof(res_lib_confdb_key_iter));
 }
 }
 
 
 static void message_handler_req_lib_confdb_object_iter (void *conn, void *message)
 static void message_handler_req_lib_confdb_object_iter (void *conn, void *message)
@@ -427,7 +429,7 @@ static void message_handler_req_lib_confdb_object_iter (void *conn, void *messag
 	res_lib_confdb_object_iter.header.id = MESSAGE_RES_CONFDB_OBJECT_ITER;
 	res_lib_confdb_object_iter.header.id = MESSAGE_RES_CONFDB_OBJECT_ITER;
 	res_lib_confdb_object_iter.header.error = ret;
 	res_lib_confdb_object_iter.header.error = ret;
 
 
-	openais_conn_send_response(conn, &res_lib_confdb_object_iter, sizeof(res_lib_confdb_object_iter));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_object_iter, sizeof(res_lib_confdb_object_iter));
 }
 }
 
 
 static void message_handler_req_lib_confdb_object_find (void *conn, void *message)
 static void message_handler_req_lib_confdb_object_find (void *conn, void *message)
@@ -448,7 +450,7 @@ static void message_handler_req_lib_confdb_object_find (void *conn, void *messag
 	res_lib_confdb_object_find.header.id = MESSAGE_RES_CONFDB_OBJECT_FIND;
 	res_lib_confdb_object_find.header.id = MESSAGE_RES_CONFDB_OBJECT_FIND;
 	res_lib_confdb_object_find.header.error = ret;
 	res_lib_confdb_object_find.header.error = ret;
 
 
-	openais_conn_send_response(conn, &res_lib_confdb_object_find, sizeof(res_lib_confdb_object_find));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_object_find, sizeof(res_lib_confdb_object_find));
 }
 }
 
 
 static void message_handler_req_lib_confdb_write (void *conn, void *message)
 static void message_handler_req_lib_confdb_write (void *conn, void *message)
@@ -469,7 +471,7 @@ static void message_handler_req_lib_confdb_write (void *conn, void *message)
 	} else
 	} else
 		res_lib_confdb_write.error.length = 0;
 		res_lib_confdb_write.error.length = 0;
 
 
-	openais_conn_send_response(conn, &res_lib_confdb_write, sizeof(res_lib_confdb_write));
+	api->ipc_conn_send_response(conn, &res_lib_confdb_write, sizeof(res_lib_confdb_write));
 }
 }
 
 
 /* TODO: when we have notification in the objdb. */
 /* TODO: when we have notification in the objdb. */
@@ -480,7 +482,7 @@ static void message_handler_req_lib_confdb_track_start (void *conn, void *messag
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_TRACK_START;
 	res.id = MESSAGE_RES_CONFDB_TRACK_START;
 	res.error = SA_AIS_ERR_NOT_SUPPORTED;
 	res.error = SA_AIS_ERR_NOT_SUPPORTED;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 static void message_handler_req_lib_confdb_track_stop (void *conn, void *message)
 static void message_handler_req_lib_confdb_track_stop (void *conn, void *message)
@@ -490,7 +492,7 @@ static void message_handler_req_lib_confdb_track_stop (void *conn, void *message
 	res.size = sizeof(res);
 	res.size = sizeof(res);
 	res.id = MESSAGE_RES_CONFDB_TRACK_STOP;
 	res.id = MESSAGE_RES_CONFDB_TRACK_STOP;
 	res.error = SA_AIS_ERR_NOT_SUPPORTED;
 	res.error = SA_AIS_ERR_NOT_SUPPORTED;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 
 

+ 16 - 16
corosync/services/cpg.c

@@ -441,14 +441,14 @@ static int notify_lib_joinlist(
 	}
 	}
 
 
 	if (conn) {
 	if (conn) {
-		api->conn_send_response(conn, buf, size);
+		api->ipc_conn_send_response(conn, buf, size);
 	}
 	}
 	else {
 	else {
 		/* Send it to all listeners */
 		/* Send it to all listeners */
 		for (iter = gi->members.next, tmp=iter->next; iter != &gi->members; iter = tmp, tmp=iter->next) {
 		for (iter = gi->members.next, tmp=iter->next; iter != &gi->members; iter = tmp, tmp=iter->next) {
 			struct process_info *pi = list_entry(iter, struct process_info, list);
 			struct process_info *pi = list_entry(iter, struct process_info, list);
 			if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
 			if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
-				if (api->conn_send_response(pi->trackerconn, buf, size) == -1) {
+				if (api->ipc_conn_send_response(pi->trackerconn, buf, size) == -1) {
 					// Error ??
 					// Error ??
 				}
 				}
 			}
 			}
@@ -595,7 +595,7 @@ static void send_group_list_callbacks(int num_groups, void *conn)
 					retgi++;
 					retgi++;
 				}
 				}
 			}
 			}
-			api->conn_send_response(conn, buf, size);
+			api->ipc_conn_send_response(conn, buf, size);
 		}
 		}
 	}
 	}
 	if (buf)
 	if (buf)
@@ -1000,7 +1000,7 @@ static void message_handler_req_exec_cpg_mcast (
 	for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
 	for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
 		struct process_info *pi = list_entry(iter, struct process_info, list);
 		struct process_info *pi = list_entry(iter, struct process_info, list);
 		if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
 		if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
-			api->conn_send_response(
+			api->ipc_conn_send_response(
 				pi->trackerconn,
 				pi->trackerconn,
 				buf,
 				buf,
 				res_lib_cpg_mcast->header.size);
 				res_lib_cpg_mcast->header.size);
@@ -1127,7 +1127,7 @@ join_err:
 	res_lib_cpg_join.header.size = sizeof(res_lib_cpg_join);
 	res_lib_cpg_join.header.size = sizeof(res_lib_cpg_join);
 	res_lib_cpg_join.header.id = MESSAGE_RES_CPG_JOIN;
 	res_lib_cpg_join.header.id = MESSAGE_RES_CPG_JOIN;
 	res_lib_cpg_join.header.error = error;
 	res_lib_cpg_join.header.error = error;
-	api->conn_send_response(conn, &res_lib_cpg_join, sizeof(res_lib_cpg_join));
+	api->ipc_conn_send_response(conn, &res_lib_cpg_join, sizeof(res_lib_cpg_join));
 }
 }
 
 
 /* Leave message from the library */
 /* Leave message from the library */
@@ -1162,7 +1162,7 @@ leave_ret:
 	res_lib_cpg_leave.header.size = sizeof(res_lib_cpg_leave);
 	res_lib_cpg_leave.header.size = sizeof(res_lib_cpg_leave);
 	res_lib_cpg_leave.header.id = MESSAGE_RES_CPG_LEAVE;
 	res_lib_cpg_leave.header.id = MESSAGE_RES_CPG_LEAVE;
 	res_lib_cpg_leave.header.error = error;
 	res_lib_cpg_leave.header.error = error;
-	api->conn_send_response(conn, &res_lib_cpg_leave, sizeof(res_lib_cpg_leave));
+	api->ipc_conn_send_response(conn, &res_lib_cpg_leave, sizeof(res_lib_cpg_leave));
 }
 }
 
 
 /* Mcast message from the library */
 /* Mcast message from the library */
@@ -1185,7 +1185,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
 		res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
 		res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
 		res_lib_cpg_mcast.header.error = SA_AIS_ERR_ACCESS; /* TODO Better error code ?? */
 		res_lib_cpg_mcast.header.error = SA_AIS_ERR_ACCESS; /* TODO Better error code ?? */
 		res_lib_cpg_mcast.flow_control_state = CPG_FLOW_CONTROL_DISABLED;
 		res_lib_cpg_mcast.flow_control_state = CPG_FLOW_CONTROL_DISABLED;
-		api->conn_send_response(conn, &res_lib_cpg_mcast,
+		api->ipc_conn_send_response(conn, &res_lib_cpg_mcast,
 			sizeof(res_lib_cpg_mcast));
 			sizeof(res_lib_cpg_mcast));
 		return;
 		return;
 	}
 	}
@@ -1212,7 +1212,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
 	res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
 	res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
 	res_lib_cpg_mcast.header.error = SA_AIS_OK;
 	res_lib_cpg_mcast.header.error = SA_AIS_OK;
 	res_lib_cpg_mcast.flow_control_state = pi->flow_control_state;
 	res_lib_cpg_mcast.flow_control_state = pi->flow_control_state;
-	api->conn_send_response(conn, &res_lib_cpg_mcast,
+	api->ipc_conn_send_response(conn, &res_lib_cpg_mcast,
 		sizeof(res_lib_cpg_mcast));
 		sizeof(res_lib_cpg_mcast));
 }
 }
 
 
@@ -1226,7 +1226,7 @@ static void message_handler_req_lib_cpg_membership (void *conn, void *message)
 		res.size = sizeof(res);
 		res.size = sizeof(res);
 		res.id = MESSAGE_RES_CPG_MEMBERSHIP;
 		res.id = MESSAGE_RES_CPG_MEMBERSHIP;
 		res.error = SA_AIS_ERR_ACCESS; /* TODO Better error code */
 		res.error = SA_AIS_ERR_ACCESS; /* TODO Better error code */
-		api->conn_send_response(conn, &res, sizeof(res));
+		api->ipc_conn_send_response(conn, &res, sizeof(res));
 		return;
 		return;
 	}
 	}
 
 
@@ -1252,7 +1252,7 @@ static void message_handler_req_lib_cpg_trackstart (void *conn, void *message)
 	}
 	}
 
 
 	/* Find the partner connection and add us to it's process_info struct */
 	/* Find the partner connection and add us to it's process_info struct */
-	otherconn = api->conn_partner_get (conn);
+	otherconn = api->ipc_conn_partner_get (conn);
 	otherpi = (struct process_info *)api->ipc_private_data_get (conn);
 	otherpi = (struct process_info *)api->ipc_private_data_get (conn);
 	otherpi->trackerconn = conn;
 	otherpi->trackerconn = conn;
 
 
@@ -1260,7 +1260,7 @@ tstart_ret:
 	res_lib_cpg_trackstart.header.size = sizeof(res_lib_cpg_trackstart);
 	res_lib_cpg_trackstart.header.size = sizeof(res_lib_cpg_trackstart);
 	res_lib_cpg_trackstart.header.id = MESSAGE_RES_CPG_TRACKSTART;
 	res_lib_cpg_trackstart.header.id = MESSAGE_RES_CPG_TRACKSTART;
 	res_lib_cpg_trackstart.header.error = SA_AIS_OK;
 	res_lib_cpg_trackstart.header.error = SA_AIS_OK;
-	api->conn_send_response(conn, &res_lib_cpg_trackstart, sizeof(res_lib_cpg_trackstart));
+	api->ipc_conn_send_response(conn, &res_lib_cpg_trackstart, sizeof(res_lib_cpg_trackstart));
 }
 }
 
 
 static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
 static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
@@ -1281,7 +1281,7 @@ static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
 	}
 	}
 
 
 	/* Find the partner connection and add us to it's process_info struct */
 	/* Find the partner connection and add us to it's process_info struct */
-	otherconn = api->conn_partner_get (conn);
+	otherconn = api->ipc_conn_partner_get (conn);
 	otherpi = (struct process_info *)api->ipc_private_data_get (conn);
 	otherpi = (struct process_info *)api->ipc_private_data_get (conn);
 	otherpi->trackerconn = NULL;
 	otherpi->trackerconn = NULL;
 
 
@@ -1289,7 +1289,7 @@ tstop_ret:
 	res_lib_cpg_trackstop.header.size = sizeof(res_lib_cpg_trackstop);
 	res_lib_cpg_trackstop.header.size = sizeof(res_lib_cpg_trackstop);
 	res_lib_cpg_trackstop.header.id = MESSAGE_RES_CPG_TRACKSTOP;
 	res_lib_cpg_trackstop.header.id = MESSAGE_RES_CPG_TRACKSTOP;
 	res_lib_cpg_trackstop.header.error = SA_AIS_OK;
 	res_lib_cpg_trackstop.header.error = SA_AIS_OK;
-	api->conn_send_response(conn, &res_lib_cpg_trackstop.header, sizeof(res_lib_cpg_trackstop));
+	api->ipc_conn_send_response(conn, &res_lib_cpg_trackstop.header, sizeof(res_lib_cpg_trackstop));
 }
 }
 
 
 static void message_handler_req_lib_cpg_local_get (void *conn, void *message)
 static void message_handler_req_lib_cpg_local_get (void *conn, void *message)
@@ -1301,7 +1301,7 @@ static void message_handler_req_lib_cpg_local_get (void *conn, void *message)
 	res_lib_cpg_local_get.header.error = SA_AIS_OK;
 	res_lib_cpg_local_get.header.error = SA_AIS_OK;
 	res_lib_cpg_local_get.local_nodeid = api->totem_nodeid_get ();
 	res_lib_cpg_local_get.local_nodeid = api->totem_nodeid_get ();
 
 
-	api->conn_send_response(conn, &res_lib_cpg_local_get,
+	api->ipc_conn_send_response(conn, &res_lib_cpg_local_get,
 		sizeof(res_lib_cpg_local_get));
 		sizeof(res_lib_cpg_local_get));
 }
 }
 
 
@@ -1314,11 +1314,11 @@ static void message_handler_req_lib_cpg_groups_get (void *conn, void *message)
 	res_lib_cpg_groups_get.header.error = SA_AIS_OK;
 	res_lib_cpg_groups_get.header.error = SA_AIS_OK;
 	res_lib_cpg_groups_get.num_groups = count_groups();
 	res_lib_cpg_groups_get.num_groups = count_groups();
 
 
-	api->conn_send_response(conn, &res_lib_cpg_groups_get,
+	api->ipc_conn_send_response(conn, &res_lib_cpg_groups_get,
 		sizeof(res_lib_cpg_groups_get));
 		sizeof(res_lib_cpg_groups_get));
 
 
 	/* Now do the callbacks for each group */
 	/* Now do the callbacks for each group */
 	send_group_list_callbacks(res_lib_cpg_groups_get.num_groups,
 	send_group_list_callbacks(res_lib_cpg_groups_get.num_groups,
-		api->conn_partner_get (conn));
+		api->ipc_conn_partner_get (conn));
 }
 }
 
 

+ 53 - 54
corosync/services/evs.c

@@ -49,22 +49,13 @@
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
 #include "swab.h"
 #include "swab.h"
-#include "totem.h"
 #include "../include/saAis.h"
 #include "../include/saAis.h"
 #include "../include/ipc_gen.h"
 #include "../include/ipc_gen.h"
+#include "../lcr/lcr_comp.h"
+#include "../include/coroapi.h"
 #include "../include/ipc_evs.h"
 #include "../include/ipc_evs.h"
 #include "../include/list.h"
 #include "../include/list.h"
-#include "../include/queue.h"
-#include "../lcr/lcr_comp.h"
-#include "totempg.h"
-#include "main.h"
-#include "tlist.h"
-#include "flow.h"
-#include "ipc.h"
-#include "mempool.h"
-#include "objdb.h"
-#include "service.h"
-#include "logsys.h"
+#include "../exec/logsys.h"
 
 
 LOGSYS_DECLARE_SUBSYS ("EVS", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("EVS", LOG_INFO);
 
 
@@ -75,7 +66,10 @@ enum evs_exec_message_req_types {
 /*
 /*
  * Service Interfaces required by service_message_handler struct
  * Service Interfaces required by service_message_handler struct
  */
  */
-static int evs_exec_init_fn(struct objdb_iface_ver0 *objdb);
+static int evs_exec_init_fn (
+	struct objdb_iface_ver0 *objdb,
+	struct corosync_api_v1 *corosync_api);
+
 static void evs_confchg_fn (
 static void evs_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
 	unsigned int *member_list, int member_list_entries,
 	unsigned int *member_list, int member_list_entries,
@@ -103,41 +97,43 @@ struct evs_pd {
 	void *conn;
 	void *conn;
 };
 };
 	
 	
-static struct openais_lib_handler evs_lib_service[] =
+static struct corosync_api_v1 *api;
+
+static struct corosync_lib_handler evs_lib_engine[] =
 {
 {
 	{ /* 0 */
 	{ /* 0 */
 		.lib_handler_fn				= message_handler_req_evs_join,
 		.lib_handler_fn				= message_handler_req_evs_join,
 		.response_size				= sizeof (struct res_lib_evs_join),
 		.response_size				= sizeof (struct res_lib_evs_join),
 		.response_id				= MESSAGE_RES_EVS_JOIN,
 		.response_id				= MESSAGE_RES_EVS_JOIN,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 1 */
 	{ /* 1 */
 		.lib_handler_fn				= message_handler_req_evs_leave,
 		.lib_handler_fn				= message_handler_req_evs_leave,
 		.response_size				= sizeof (struct res_lib_evs_leave),
 		.response_size				= sizeof (struct res_lib_evs_leave),
 		.response_id				= MESSAGE_RES_EVS_LEAVE,
 		.response_id				= MESSAGE_RES_EVS_LEAVE,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 2 */
 	{ /* 2 */
 		.lib_handler_fn				= message_handler_req_evs_mcast_joined,
 		.lib_handler_fn				= message_handler_req_evs_mcast_joined,
 		.response_size				= sizeof (struct res_lib_evs_mcast_joined),
 		.response_size				= sizeof (struct res_lib_evs_mcast_joined),
 		.response_id				= MESSAGE_RES_EVS_MCAST_JOINED,
 		.response_id				= MESSAGE_RES_EVS_MCAST_JOINED,
-		.flow_control				= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 3 */
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_evs_mcast_groups,
 		.lib_handler_fn				= message_handler_req_evs_mcast_groups,
 		.response_size				= sizeof (struct res_lib_evs_mcast_groups),
 		.response_size				= sizeof (struct res_lib_evs_mcast_groups),
 		.response_id				= MESSAGE_RES_EVS_MCAST_GROUPS,
 		.response_id				= MESSAGE_RES_EVS_MCAST_GROUPS,
-		.flow_control				= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 4 */
 	{ /* 4 */
 		.lib_handler_fn				= message_handler_req_evs_membership_get,
 		.lib_handler_fn				= message_handler_req_evs_membership_get,
 		.response_size				= sizeof (struct res_lib_evs_membership_get),
 		.response_size				= sizeof (struct res_lib_evs_membership_get),
 		.response_id				= MESSAGE_RES_EVS_MEMBERSHIP_GET,
 		.response_id				= MESSAGE_RES_EVS_MEMBERSHIP_GET,
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	}
 	}
 };
 };
 
 
-static struct openais_exec_handler evs_exec_service[] =
+static struct corosync_exec_handler evs_exec_engine[] =
 {
 {
 	{
 	{
 		.exec_handler_fn 	= message_handler_req_exec_mcast,
 		.exec_handler_fn 	= message_handler_req_exec_mcast,
@@ -145,17 +141,17 @@ static struct openais_exec_handler evs_exec_service[] =
 	}
 	}
 };
 };
 
 
-struct openais_service_handler evs_service_handler = {
-	.name			= "openais extended virtual synchrony service",
+struct corosync_service_engine evs_service_engine = {
+	.name			= "corosync extended virtual synchrony service",
 	.id			= EVS_SERVICE,
 	.id			= EVS_SERVICE,
 	.private_data_size	= sizeof (struct evs_pd),
 	.private_data_size	= sizeof (struct evs_pd),
-	.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED, 
+	.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED, 
 	.lib_init_fn		= evs_lib_init_fn,
 	.lib_init_fn		= evs_lib_init_fn,
 	.lib_exit_fn		= evs_lib_exit_fn,
 	.lib_exit_fn		= evs_lib_exit_fn,
-	.lib_service		= evs_lib_service,
-	.lib_service_count	= sizeof (evs_lib_service) / sizeof (struct openais_lib_handler),
-	.exec_service		= evs_exec_service,
-	.exec_service_count	= sizeof (evs_exec_service) / sizeof (struct openais_exec_handler),
+	.lib_engine		= evs_lib_engine,
+	.lib_engine_count	= sizeof (evs_lib_engine) / sizeof (struct corosync_lib_handler),
+	.exec_engine		= evs_exec_engine,
+	.exec_engine_count	= sizeof (evs_exec_engine) / sizeof (struct corosync_exec_handler),
 	.confchg_fn		= evs_confchg_fn,
 	.confchg_fn		= evs_confchg_fn,
 	.exec_init_fn		= evs_exec_init_fn,
 	.exec_init_fn		= evs_exec_init_fn,
 	.exec_dump_fn		= NULL
 	.exec_dump_fn		= NULL
@@ -167,15 +163,15 @@ static DECLARE_LIST_INIT (confchg_notify);
  * Dynamic loading descriptor
  * Dynamic loading descriptor
  */
  */
 
 
-static struct openais_service_handler *evs_get_service_handler_ver0 (void);
+static struct corosync_service_engine *evs_get_service_engine_ver0 (void);
 
 
-static struct openais_service_handler_iface_ver0 evs_service_handler_iface = {
-	.openais_get_service_handler_ver0	= evs_get_service_handler_ver0
+static struct corosync_service_engine_iface_ver0 evs_service_engine_iface = {
+	.corosync_get_service_engine_ver0	= evs_get_service_engine_ver0
 };
 };
 
 
 static struct lcr_iface openais_evs_ver0[1] = {
 static struct lcr_iface openais_evs_ver0[1] = {
 	{
 	{
-		.name			= "openais_evs",
+		.name			= "corosync_evs",
 		.version		= 0,
 		.version		= 0,
 		.versions_replace	= 0,
 		.versions_replace	= 0,
 		.versions_replace_count = 0,
 		.versions_replace_count = 0,
@@ -192,20 +188,23 @@ static struct lcr_comp evs_comp_ver0 = {
 	.ifaces		= openais_evs_ver0
 	.ifaces		= openais_evs_ver0
 };
 };
 
 
-static struct openais_service_handler *evs_get_service_handler_ver0 (void)
+static struct corosync_service_engine *evs_get_service_engine_ver0 (void)
 {
 {
-	return (&evs_service_handler);
+	return (&evs_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void evs_comp_register (void) {
 __attribute__ ((constructor)) static void evs_comp_register (void) {
-	lcr_interfaces_set (&openais_evs_ver0[0], &evs_service_handler_iface);
+	lcr_interfaces_set (&openais_evs_ver0[0], &evs_service_engine_iface);
 
 
 	lcr_component_register (&evs_comp_ver0);
 	lcr_component_register (&evs_comp_ver0);
 }
 }
 
 
-static int evs_exec_init_fn(struct objdb_iface_ver0 *objdb)
+static int evs_exec_init_fn (
+	struct objdb_iface_ver0 *objdb,
+	struct corosync_api_v1 *corosync_api)
 {
 {
 	(void) objdb;
 	(void) objdb;
+	api = corosync_api;
 
 
 	return 0;
 	return 0;
 }
 }
@@ -246,7 +245,7 @@ static void evs_confchg_fn (
 	 */
 	 */
 	for (list = confchg_notify.next; list != &confchg_notify; list = list->next) {
 	for (list = confchg_notify.next; list != &confchg_notify; list = list->next) {
 		evs_pd = list_entry (list, struct evs_pd, list);
 		evs_pd = list_entry (list, struct evs_pd, list);
-		openais_conn_send_response (evs_pd->conn,
+		api->ipc_conn_send_response (evs_pd->conn,
 			&res_evs_confchg_callback,
 			&res_evs_confchg_callback,
 			sizeof (res_evs_confchg_callback));
 			sizeof (res_evs_confchg_callback));
 	}
 	}
@@ -254,7 +253,7 @@ static void evs_confchg_fn (
 
 
 static int evs_lib_init_fn (void *conn)
 static int evs_lib_init_fn (void *conn)
 {
 {
-	struct evs_pd *evs_pd = (struct evs_pd *)openais_conn_private_data_get (conn);
+	struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn);
 
 
 	log_printf (LOG_LEVEL_DEBUG, "Got request to initalize evs service.\n");
 	log_printf (LOG_LEVEL_DEBUG, "Got request to initalize evs service.\n");
 
 
@@ -264,7 +263,7 @@ static int evs_lib_init_fn (void *conn)
 	list_init (&evs_pd->list);
 	list_init (&evs_pd->list);
 	list_add (&evs_pd->list, &confchg_notify);
 	list_add (&evs_pd->list, &confchg_notify);
 
 
-	openais_conn_send_response (conn, &res_evs_confchg_callback,
+	api->ipc_conn_send_response (conn, &res_evs_confchg_callback,
 		sizeof (res_evs_confchg_callback));
 		sizeof (res_evs_confchg_callback));
 
 
 	return (0);
 	return (0);
@@ -272,7 +271,7 @@ static int evs_lib_init_fn (void *conn)
 
 
 static int evs_lib_exit_fn (void *conn)
 static int evs_lib_exit_fn (void *conn)
 {
 {
-    struct evs_pd *evs_pd = (struct evs_pd *)openais_conn_private_data_get (conn);
+    struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn);
 
 
 	list_del (&evs_pd->list);
 	list_del (&evs_pd->list);
 	return (0);
 	return (0);
@@ -284,7 +283,7 @@ static void message_handler_req_evs_join (void *conn, void *msg)
 	struct req_lib_evs_join *req_lib_evs_join = (struct req_lib_evs_join *)msg;
 	struct req_lib_evs_join *req_lib_evs_join = (struct req_lib_evs_join *)msg;
 	struct res_lib_evs_join res_lib_evs_join;
 	struct res_lib_evs_join res_lib_evs_join;
 	void *addr;
 	void *addr;
-	struct evs_pd *evs_pd = (struct evs_pd *)openais_conn_private_data_get (conn);
+	struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn);
 
 
 	if (req_lib_evs_join->group_entries > 50) {
 	if (req_lib_evs_join->group_entries > 50) {
 		error = EVS_ERR_TOO_MANY_GROUPS;
 		error = EVS_ERR_TOO_MANY_GROUPS;
@@ -310,7 +309,7 @@ exit_error:
 	res_lib_evs_join.header.id = MESSAGE_RES_EVS_JOIN;
 	res_lib_evs_join.header.id = MESSAGE_RES_EVS_JOIN;
 	res_lib_evs_join.header.error = error;
 	res_lib_evs_join.header.error = error;
 
 
-	openais_conn_send_response (conn, &res_lib_evs_join,
+	api->ipc_conn_send_response (conn, &res_lib_evs_join,
 		sizeof (struct res_lib_evs_join));
 		sizeof (struct res_lib_evs_join));
 }
 }
 
 
@@ -322,7 +321,7 @@ static void message_handler_req_evs_leave (void *conn, void *msg)
 	int error_index;
 	int error_index;
 	int i, j;
 	int i, j;
 	int found;
 	int found;
-	struct evs_pd *evs_pd = (struct evs_pd *)openais_conn_private_data_get (conn);
+	struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn);
 
 
 	for (i = 0; i < req_lib_evs_leave->group_entries; i++) {
 	for (i = 0; i < req_lib_evs_leave->group_entries; i++) {
 		found = 0;
 		found = 0;
@@ -356,7 +355,7 @@ static void message_handler_req_evs_leave (void *conn, void *msg)
 	res_lib_evs_leave.header.id = MESSAGE_RES_EVS_LEAVE;
 	res_lib_evs_leave.header.id = MESSAGE_RES_EVS_LEAVE;
 	res_lib_evs_leave.header.error = error;
 	res_lib_evs_leave.header.error = error;
 
 
-	openais_conn_send_response (conn, &res_lib_evs_leave,
+	api->ipc_conn_send_response (conn, &res_lib_evs_leave,
 		sizeof (struct res_lib_evs_leave));
 		sizeof (struct res_lib_evs_leave));
 }
 }
 
 
@@ -369,7 +368,7 @@ static void message_handler_req_evs_mcast_joined (void *conn, void *msg)
 	struct req_exec_evs_mcast req_exec_evs_mcast;
 	struct req_exec_evs_mcast req_exec_evs_mcast;
 	int send_ok = 0;
 	int send_ok = 0;
 	int res;
 	int res;
-	struct evs_pd *evs_pd = (struct evs_pd *)openais_conn_private_data_get (conn);
+	struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn);
 
 
 	req_exec_evs_mcast.header.size = sizeof (struct req_exec_evs_mcast) +
 	req_exec_evs_mcast.header.size = sizeof (struct req_exec_evs_mcast) +
 		evs_pd->group_entries * sizeof (struct evs_group) +
 		evs_pd->group_entries * sizeof (struct evs_group) +
@@ -387,9 +386,9 @@ static void message_handler_req_evs_mcast_joined (void *conn, void *msg)
 	req_exec_evs_mcast_iovec[2].iov_base = (char *)&req_lib_evs_mcast_joined->msg;
 	req_exec_evs_mcast_iovec[2].iov_base = (char *)&req_lib_evs_mcast_joined->msg;
 	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_joined->msg_len;
 	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_joined->msg_len;
 // TODO this doesn't seem to work for some reason	
 // TODO this doesn't seem to work for some reason	
-	send_ok = totempg_groups_send_ok_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3);
+	send_ok = api->totem_send_ok (req_exec_evs_mcast_iovec, 3);
 
 
-	res = totempg_groups_mcast_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3, TOTEMPG_AGREED);
+	res = api->totem_mcast (req_exec_evs_mcast_iovec, 3, TOTEM_AGREED);
 		// TODO
 		// TODO
 	if (res == 0) {
 	if (res == 0) {
 		error = EVS_OK;
 		error = EVS_OK;
@@ -399,7 +398,7 @@ static void message_handler_req_evs_mcast_joined (void *conn, void *msg)
 	res_lib_evs_mcast_joined.header.id = MESSAGE_RES_EVS_MCAST_JOINED;
 	res_lib_evs_mcast_joined.header.id = MESSAGE_RES_EVS_MCAST_JOINED;
 	res_lib_evs_mcast_joined.header.error = error;
 	res_lib_evs_mcast_joined.header.error = error;
 
 
-	openais_conn_send_response (conn, &res_lib_evs_mcast_joined,
+	api->ipc_conn_send_response (conn, &res_lib_evs_mcast_joined,
 		sizeof (struct res_lib_evs_mcast_joined));
 		sizeof (struct res_lib_evs_mcast_joined));
 }
 }
 
 
@@ -435,8 +434,8 @@ static void message_handler_req_evs_mcast_groups (void *conn, void *msg)
 	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_groups->msg_len;
 	req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_groups->msg_len;
 	
 	
 // TODO this is wacky
 // TODO this is wacky
-	send_ok = totempg_groups_send_ok_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3);
-	res = totempg_groups_mcast_joined (openais_group_handle, req_exec_evs_mcast_iovec, 3, TOTEMPG_AGREED);
+	send_ok = api->totem_send_ok (req_exec_evs_mcast_iovec, 3);
+	res = api->totem_mcast (req_exec_evs_mcast_iovec, 3, TOTEM_AGREED);
 	if (res == 0) {
 	if (res == 0) {
 		error = EVS_OK;
 		error = EVS_OK;
 	}
 	}
@@ -445,7 +444,7 @@ static void message_handler_req_evs_mcast_groups (void *conn, void *msg)
 	res_lib_evs_mcast_groups.header.id = MESSAGE_RES_EVS_MCAST_GROUPS;
 	res_lib_evs_mcast_groups.header.id = MESSAGE_RES_EVS_MCAST_GROUPS;
 	res_lib_evs_mcast_groups.header.error = error;
 	res_lib_evs_mcast_groups.header.error = error;
 
 
-	openais_conn_send_response (conn, &res_lib_evs_mcast_groups,
+	api->ipc_conn_send_response (conn, &res_lib_evs_mcast_groups,
 		sizeof (struct res_lib_evs_mcast_groups));
 		sizeof (struct res_lib_evs_mcast_groups));
 }
 }
 
 
@@ -456,7 +455,7 @@ static void message_handler_req_evs_membership_get (void *conn, void *msg)
 	res_lib_evs_membership_get.header.size = sizeof (struct res_lib_evs_membership_get);
 	res_lib_evs_membership_get.header.size = sizeof (struct res_lib_evs_membership_get);
 	res_lib_evs_membership_get.header.id = MESSAGE_RES_EVS_MEMBERSHIP_GET;
 	res_lib_evs_membership_get.header.id = MESSAGE_RES_EVS_MEMBERSHIP_GET;
 	res_lib_evs_membership_get.header.error = EVS_OK;
 	res_lib_evs_membership_get.header.error = EVS_OK;
-	res_lib_evs_membership_get.local_nodeid = totempg_my_nodeid_get ();
+	res_lib_evs_membership_get.local_nodeid = api->totem_nodeid_get ();
 	memcpy (&res_lib_evs_membership_get.member_list,
 	memcpy (&res_lib_evs_membership_get.member_list,
 		&res_evs_confchg_callback.member_list,
 		&res_evs_confchg_callback.member_list,
 		sizeof (res_lib_evs_membership_get.member_list));
 		sizeof (res_lib_evs_membership_get.member_list));
@@ -464,7 +463,7 @@ static void message_handler_req_evs_membership_get (void *conn, void *msg)
 	res_lib_evs_membership_get.member_list_entries =
 	res_lib_evs_membership_get.member_list_entries =
 		res_evs_confchg_callback.member_list_entries;
 		res_evs_confchg_callback.member_list_entries;
 
 
-	openais_conn_send_response (conn, &res_lib_evs_membership_get,
+	api->ipc_conn_send_response (conn, &res_lib_evs_membership_get,
 		sizeof (struct res_lib_evs_membership_get));
 		sizeof (struct res_lib_evs_membership_get));
 }
 }
 
 
@@ -519,9 +518,9 @@ static void message_handler_req_exec_mcast (
 
 
 		if (found) {
 		if (found) {
 			res_evs_deliver_callback.local_nodeid = nodeid;
 			res_evs_deliver_callback.local_nodeid = nodeid;
-			openais_conn_send_response (evs_pd->conn, &res_evs_deliver_callback,
+			api->ipc_conn_send_response (evs_pd->conn, &res_evs_deliver_callback,
 				sizeof (struct res_evs_deliver_callback));
 				sizeof (struct res_evs_deliver_callback));
-			openais_conn_send_response (evs_pd->conn, msg_addr,
+			api->ipc_conn_send_response (evs_pd->conn, msg_addr,
 				req_exec_evs_mcast->msg_len);
 				req_exec_evs_mcast->msg_len);
 		}
 		}
 	}
 	}

+ 1 - 1
corosync/test/testevs.c

@@ -172,7 +172,7 @@ try_again_two:
 	 */
 	 */
 	do {
 	do {
 		result = evs_dispatch (handle, EVS_DISPATCH_ALL);
 		result = evs_dispatch (handle, EVS_DISPATCH_ALL);
-	} while (deliveries < 900);
+	} while (deliveries < 500);
 
 
 	evs_fd_get (handle, &fd);
 	evs_fd_get (handle, &fd);