Browse Source

Building of all service engines now works properly.
Install works as well.


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

Steven Dake 17 năm trước cách đây
mục cha
commit
6905de914d

+ 5 - 57
openais/Makefile

@@ -52,11 +52,7 @@ endif
 
 
 include $(srcdir)Makefile.inc
 include $(srcdir)Makefile.inc
 
 
-SBINDIR=$(PREFIX)/sbin
 INCLUDEDIR=$(PREFIX)/include/openais
 INCLUDEDIR=$(PREFIX)/include/openais
-INCLUDEDIR_TOTEM=$(PREFIX)/include/openais/totem
-INCLUDEDIR_LCR=$(PREFIX)/include/openais/lcr
-INCLUDEDIR_SERVICE=$(PREFIX)/include/openais/service
 MANDIR=$(PREFIX)/share/man
 MANDIR=$(PREFIX)/share/man
 ETCDIR=/etc
 ETCDIR=/etc
 ARCH=$(shell uname -p)
 ARCH=$(shell uname -p)
@@ -80,9 +76,8 @@ SUBDIRS:=$(builddir)lcr $(builddir)lib $(builddir)exec $(builddir)test
 sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2)
 sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2)
 
 
 all: $(SUBDIRS)
 all: $(SUBDIRS)
-	@(cd $(builddir)lcr; echo ==== `pwd` ===;  $(call sub_make,lcr,all));
 	@(cd $(builddir)lib; echo ==== `pwd` ===;  $(call sub_make,lib,all));
 	@(cd $(builddir)lib; echo ==== `pwd` ===;  $(call sub_make,lib,all));
-	@(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,all));
+	@(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,all));
 	@(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,all));
 	@(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,all));
 
 
 # subdirs are not phony
 # subdirs are not phony
@@ -118,27 +113,18 @@ help:
  
  
 
 
 clean:
 clean:
-	(cd $(builddir)lcr; echo ==== `pwd` ===; $(call sub_make,lcr,clean));
 	(cd $(builddir)lib; echo ==== `pwd` ===; $(call sub_make,lib,clean));
 	(cd $(builddir)lib; echo ==== `pwd` ===; $(call sub_make,lib,clean));
-	(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,clean));
+	(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,clean));
 	(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean));
 	(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean));
 	rm -rf $(builddir)doc/api
 	rm -rf $(builddir)doc/api
 
 
-AIS_LIBS	= ais SaAmf SaClm SaCkpt SaEvt SaLck SaMsg evs cpg \
-		  cfg aisutil confdb
+AIS_LIBS	= SaAmf SaClm SaCkpt SaEvt SaLck SaMsg
 
 
 AIS_HEADERS	= saAis.h saAmf.h saClm.h saCkpt.h saEvt.h saEvt.h saLck.h \
 AIS_HEADERS	= saAis.h saAmf.h saClm.h saCkpt.h saEvt.h saEvt.h saLck.h \
-		  saMsg.h cpg.h cfg.h evs.h ipc_gen.h mar_gen.h swab.h 	   \
-		  ais_util.h confdb.h
-
-EXEC_LIBS	= totem_pg logsys
+		  saMsg.h
 
 
 install: all
 install: all
-	mkdir -p $(DESTDIR)$(SBINDIR)
 	mkdir -p $(DESTDIR)$(INCLUDEDIR)
 	mkdir -p $(DESTDIR)$(INCLUDEDIR)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_LCR)
-	mkdir -p $(DESTDIR)$(INCLUDEDIR_SERVICE)
 	mkdir -p $(DESTDIR)$(LIBDIR)
 	mkdir -p $(DESTDIR)$(LIBDIR)
 	mkdir -p $(DESTDIR)$(LCRSODIR)
 	mkdir -p $(DESTDIR)$(LCRSODIR)
 	mkdir -p $(DESTDIR)$(ETCDIR)/ais
 	mkdir -p $(DESTDIR)$(ETCDIR)/ais
@@ -147,23 +133,6 @@ install: all
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
 	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
 
 
-
-	for eLib in $(EXEC_LIBS); do					\
-	    ( cd $(builddir) ;						\
-	    ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so;		\
-	    ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so.2;		\
-	    $(CP) -a exec/lib$$eLib.so $(DESTDIR)$(LIBDIR);		\
-	    $(CP) -a exec/lib$$eLib.so.2 $(DESTDIR)$(LIBDIR);		\
-	    install -m 755 exec/lib$$eLib.so.2.* $(DESTDIR)$(LIBDIR);	\
-	    if [ "xYES" = "x$(STATICLIBS)" ]; then			\
-		install -m 755 exec/lib$$eLib.a $(DESTDIR)$(LIBDIR);	\
-		if [ ${OPENAIS_COMPAT} = "DARWIN" ]; then		\
-		    ranlib $(DESTDIR)$(LIBDIR)/lib$$eLib.a;		\
-		fi							\
-	    fi								\
-	    ) \
-	done
-
 	for aLib in $(AIS_LIBS); do					\
 	for aLib in $(AIS_LIBS); do					\
 	    ( cd $(builddir) ;                                          \
 	    ( cd $(builddir) ;                                          \
 	    ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so;			\
 	    ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so;			\
@@ -182,9 +151,7 @@ install: all
 
 
 	echo $(LIBDIR) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/openais-$(ARCH).conf"
 	echo $(LIBDIR) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/openais-$(ARCH).conf"
 
 
-	install -m 755 $(builddir)exec/*lcrso $(DESTDIR)$(LCRSODIR)
-	install -m 755 $(builddir)exec/aisexec $(DESTDIR)$(SBINDIR)
-	install -m 700 $(builddir)exec/keygen $(DESTDIR)$(SBINDIR)/ais-keygen
+	install -m 755 $(builddir)services/*lcrso $(DESTDIR)$(LCRSODIR)
 
 
 	if [ ! -f $(DESTDIR)$(ETCDIR)/ais/openais.conf ] ; then 	   \
 	if [ ! -f $(DESTDIR)$(ETCDIR)/ais/openais.conf ] ; then 	   \
 		install -m 644 $(srcdir)conf/openais.conf $(DESTDIR)$(ETCDIR)/ais ; \
 		install -m 644 $(srcdir)conf/openais.conf $(DESTDIR)$(ETCDIR)/ais ; \
@@ -197,24 +164,5 @@ install: all
 	    install -m 644 $(srcdir)include/$$aHeader $(DESTDIR)$(INCLUDEDIR);	\
 	    install -m 644 $(srcdir)include/$$aHeader $(DESTDIR)$(INCLUDEDIR);	\
 	done
 	done
 
 
-	install -m 644 $(srcdir)exec/aispoll.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)exec/totempg.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)exec/totem.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)exec/totemip.h $(DESTDIR)$(INCLUDEDIR_TOTEM)
-	install -m 644 $(srcdir)lcr/lcr_ckpt.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)lcr/lcr_comp.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)lcr/lcr_ifact.h $(DESTDIR)$(INCLUDEDIR_LCR)
-	install -m 644 $(srcdir)exec/service.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/timer.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/flow.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/ipc.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/objdb.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/logsys.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)exec/config.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)include/swab.h $(DESTDIR)$(INCLUDEDIR_SERVICE)
-	install -m 644 $(srcdir)man/*.3 $(DESTDIR)$(MANDIR)/man3
-	install -m 644 $(srcdir)man/*.5 $(DESTDIR)$(MANDIR)/man5
-	install -m 644 $(srcdir)man/*.8 $(DESTDIR)$(MANDIR)/man8
-
 doxygen:
 doxygen:
 	mkdir -p doc/api && doxygen
 	mkdir -p doc/api && doxygen

+ 1 - 1
openais/Makefile.inc

@@ -45,7 +45,7 @@ endif
 
 
 # default CFLAGS, LDFLAGS
 # default CFLAGS, LDFLAGS
 #
 #
-CFLAGS =
+CFLAGS = -DCOROSYNC_EXTERNAL_ENGINE
 LDFLAGS =
 LDFLAGS =
 DYFLAGS =
 DYFLAGS =
 
 

+ 197 - 0
openais/conf/amf.conf

@@ -0,0 +1,197 @@
+# AMF Example configuration file, please read README.amf
+# - Times in milliseconds
+# - clccli_path can be set on any level from application and down and will be
+# added to the CLI commands if they are not already specified with an absolute
+# path (begins with /).
+# WL - WorkLoad
+
+safAmfCluster = TEST_CLUSTER {
+	saAmfClusterStartupTimeout=3000
+	safAmfNode = AMF1 {
+		saAmfNodeSuFailOverProb=2000
+		saAmfNodeSuFailoverMax=2
+		saAmfNodeClmNode=balance
+	}
+#	safAmfNode = AMF2 {
+#		saAmfNodeSuFailOverProb=2000
+#		saAmfNodeSuFailoverMax=2
+#		saAmfNodeClmNode=p02
+#	}
+	safApp = APP-1 {
+		safSg = RAID {
+			saAmfSGRedundancyModel=nplusm	
+			saAmfSGNumPrefActiveSUs=1
+			saAmfSGMaxActiveSIsperSUs=2
+			saAmfSGNumPrefStandbySUs=1
+			saAmfSGMaxStandbySIsperSUs=2
+			saAmfSGCompRestartProb=100000
+			saAmfSGCompRestartMax=2
+			saAmfSGSuRestartProb=20000	
+			saAmfSGSuRestartMax=3
+			saAmfSGAutoAdjustProb=5000
+			safSu = SERVICE_X_1 {
+				saAmfSUHostedByNode=AMF1
+				saAmfSUNumComponents=1
+				safComp = A {
+					saAmfCompCategory=sa_aware
+					saAmfCompCapability=x_active_or_y_standby
+					saAmfCompNumMaxActiveCsi=1
+					saAmfCompNumMaxStandbyCsi=1
+					saAmfCompDefaultClcCliTimeout = 5000
+					saAmfCompDefaultCallbackTimeOut = 5000
+					saAmfCompInstantiateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompInstantiateCmdArgv= instantiate /tmp/aisexample/testamf1
+					saAmfCompTerminateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompTerminateCmdArgv = terminate
+					saAmfCompCleanupCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompCleanupCmdArgv = cleanup
+					saAmfCompCsTypes {
+						A
+					}
+					saAmfCompCmdEnv {
+						var1=val1
+						var2=val2
+					}
+					saAmfCompRecoveryOnError=component_restart
+					safHealthcheckKey = key1 {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+				}
+				safComp = B {
+					saAmfCompCategory=sa_aware
+					saAmfCompCapability=x_active_or_y_standby
+					saAmfCompNumMaxActiveCsi=1
+					saAmfCompNumMaxStandbyCsi=1
+					saAmfCompDefaultClcCliTimeout = 5000
+					saAmfCompDefaultCallbackTimeOut = 5000
+					saAmfCompInstantiateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompInstantiateCmdArgv= instantiate /tmp/aisexample/testamf1
+					saAmfCompTerminateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompTerminateCmdArgv = terminate
+					saAmfCompCleanupCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompCleanupCmdArgv = cleanup
+					saAmfCompCsTypes {
+						B
+					}
+					saAmfCompCmdEnv {
+						var1=val1
+						var2=val2
+					}
+					saAmfCompRecoveryOnError=component_restart
+					safHealthcheckKey = key1 {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+				}
+			}
+			safSu = SERVICE_X_2 {
+				clccli_path=/tmp/aisexample
+				saAmfSUHostedByNode=AMF1
+#				saAmfSUHostedByNode=AMF2
+				saAmfSUNumComponents=1
+				safComp = A {
+					saAmfCompCategory=sa_aware
+					saAmfCompCapability=x_active_or_y_standby
+					saAmfCompNumMaxActiveCsi=1
+					saAmfCompNumMaxStandbyCsi=1
+					saAmfCompDefaultClcCliTimeout = 5000
+					saAmfCompDefaultCallbackTimeOut = 5000
+					saAmfCompInstantiateCmd = clc_cli_script
+					saAmfCompInstantiateCmdArgv= instantiate
+					saAmfCompTerminateCmd = clc_cli_script
+					saAmfCompTerminateCmdArgv = terminate
+					saAmfCompCleanupCmd = clc_cli_script
+					saAmfCompCleanupCmdArgv = cleanup
+					saAmfCompCsTypes {
+						A
+					}
+					saAmfCompCmdEnv {
+						COMP_BINARY_PATH=/tmp/aisexample
+						COMP_BINARY_NAME=testamf1
+						var1=val1
+						var2=val2
+					}
+					saAmfCompRecoveryOnError=component_restart
+					safHealthcheckKey = amfInvoked {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+					safHealthcheckKey = compInvoked {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+				}
+				safComp = B {
+					saAmfCompCategory=sa_aware
+					saAmfCompCapability=x_active_or_y_standby
+					saAmfCompNumMaxActiveCsi=1
+					saAmfCompNumMaxStandbyCsi=1
+					saAmfCompDefaultClcCliTimeout = 500
+					saAmfCompDefaultCallbackTimeOut = 500
+					saAmfCompInstantiateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompInstantiateCmdArgv= instantiate /tmp/aisexample/testamf1
+					saAmfCompTerminateCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompTerminateCmdArgv = terminate
+					saAmfCompCleanupCmd = /tmp/aisexample/clc_cli_script
+					saAmfCompCleanupCmdArgv = cleanup
+					saAmfCompCsTypes {
+						B
+					}
+					saAmfCompCmdEnv {
+						var1=val1
+						var2=val2
+					}
+					saAmfCompRecoveryOnError=component_restart
+					safHealthcheckKey = amfInvoked {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+					safHealthcheckKey = compInvoked {
+						saAmfHealthcheckPeriod = 100
+						saAmfHealthcheckMaxDuration = 350
+					}
+				}
+			}
+		}
+		safSi = WL1 {
+			saAmfSINumCSIs=2
+			safCsi = WL1-1 {
+				saAmfCSTypeName = A
+			}
+			safCsi = WL1-2 {
+				saAmfCSTypeName = B
+				safCSIAttr = attr1 {
+					val1
+					val2
+				}
+				safCSIAttr = good_health_limit {
+					10
+				}
+			}
+		}
+		safSi = WL2 {
+			saAmfSINumCSIs=2
+			safCsi = WL2-1 {
+				saAmfCSTypeName = A
+			}
+			safCsi = WL2-2 {
+				saAmfCSTypeName = B
+				safCSIAttr = attr1 {
+					val1
+					val2
+				}
+				safCSIAttr = good_health_limit {
+					10
+				}
+			}
+		}
+		safCSType = A {
+			safAmfCSAttrName = attr1
+			safAmfCSAttrName = good_health_limit
+		}
+		safCSType = B {
+		}
+	}
+}
+

+ 31 - 0
openais/conf/openais.conf

@@ -0,0 +1,31 @@
+# Please read the openais.conf.5 manual page
+totem {
+	version: 2
+	secauth: off
+	threads: 0
+	interface {
+		ringnumber: 0
+		bindnetaddr: 192.168.1.1
+		mcastaddr: 226.94.1.1
+		mcastport: 5405
+	}
+}
+
+logging {
+	fileline: off
+	to_stderr: yes
+	to_file: yes
+	to_syslog: yes
+	logfile: /tmp/openais.log
+	debug: off
+	timestamp: on
+	logger {
+		ident: AMF
+		debug: off
+		tags: enter|leave|trace1|trace2|trace3|trace4|trace6
+	}
+}
+
+amf {
+	mode: disabled
+}

+ 1 - 1
openais/include/ipc_ckpt.h

@@ -37,7 +37,7 @@
 
 
 #include "saAis.h"
 #include "saAis.h"
 #include "saCkpt.h"
 #include "saCkpt.h"
-#include "ipc_gen.h"
+#include <corosync/ipc_gen.h>
 #include "mar_ckpt.h"
 #include "mar_ckpt.h"
 
 
 enum req_lib_ckpt_checkpoint_types {
 enum req_lib_ckpt_checkpoint_types {

+ 1 - 1
openais/include/ipc_clm.h

@@ -35,9 +35,9 @@
 #define IPC_CLM_H_DEFINED
 #define IPC_CLM_H_DEFINED
 
 
 #include <netinet/in.h>
 #include <netinet/in.h>
+#include <corosync/ipc_gen.h>
 #include "saAis.h"
 #include "saAis.h"
 #include "saClm.h"
 #include "saClm.h"
-#include "ipc_gen.h"
 #include "mar_clm.h"
 #include "mar_clm.h"
 
 
 enum req_clm_types {
 enum req_clm_types {

+ 1 - 1
openais/include/ipc_evt.h

@@ -35,10 +35,10 @@
 #define IPC_EVT_H_DEFINED
 #define IPC_EVT_H_DEFINED
 
 
 #include <netinet/in.h>
 #include <netinet/in.h>
+#include <corosync/ipc_gen.h>
 #include "saAis.h"
 #include "saAis.h"
 #include "saEvt.h"
 #include "saEvt.h"
 #include "saClm.h"
 #include "saClm.h"
-#include "ipc_gen.h"
 #include "mar_evt.h"
 #include "mar_evt.h"
 
 
 enum req_evt_types {
 enum req_evt_types {

+ 2 - 2
openais/include/ipc_lck.h

@@ -37,8 +37,8 @@
 
 
 #include "saAis.h"
 #include "saAis.h"
 #include "saLck.h"
 #include "saLck.h"
-#include "ipc_gen.h"
-#include "swab.h"
+#include <corosync/ipc_gen.h>
+#include <corosync/swab.h>
 
 
 enum req_lib_lck_resource_types {
 enum req_lib_lck_resource_types {
 	MESSAGE_REQ_LCK_RESOURCEOPEN = 0,
 	MESSAGE_REQ_LCK_RESOURCEOPEN = 0,

+ 1 - 1
openais/include/ipc_msg.h

@@ -37,7 +37,7 @@
 #include "saAis.h"
 #include "saAis.h"
 #include "saMsg.h"
 #include "saMsg.h"
 
 
-#include "ipc_gen.h"
+#include <corosync/ipc_gen.h>
 
 
 enum req_lib_msg_queue_types {
 enum req_lib_msg_queue_types {
 	MESSAGE_REQ_MSG_QUEUEOPEN = 0,
 	MESSAGE_REQ_MSG_QUEUEOPEN = 0,

+ 1 - 1
openais/include/mar_ckpt.h

@@ -35,9 +35,9 @@
 #ifndef AIS_MAR_CKPT_H_DEFINED
 #ifndef AIS_MAR_CKPT_H_DEFINED
 #define AIS_MAR_CKPT_H_DEFINED
 #define AIS_MAR_CKPT_H_DEFINED
 
 
+#include <corosync/mar_gen.h>
 #include "saAis.h"
 #include "saAis.h"
 #include "saCkpt.h"
 #include "saCkpt.h"
-#include "mar_gen.h"
 
 
 typedef mar_uint64_t mar_ckpt_checkpoint_handle_t;
 typedef mar_uint64_t mar_ckpt_checkpoint_handle_t;
 
 

+ 4 - 4
openais/include/mar_clm.h

@@ -36,16 +36,16 @@
 #ifndef AIS_MAR_CLM_H_DEFINED
 #ifndef AIS_MAR_CLM_H_DEFINED
 #define AIS_MAR_CLM_H_DEFINED
 #define AIS_MAR_CLM_H_DEFINED
 
 
-#include "swab.h"
+#include <corosync/engine/swab.h>
 #include "saAis.h"
 #include "saAis.h"
 #include "saClm.h"
 #include "saClm.h"
-#include "mar_gen.h"
+#include <corosync/mar_gen.h>
 
 
 #define MAR_CLM_MAX_ADDRESS_LENGTH 64
 #define MAR_CLM_MAX_ADDRESS_LENGTH 64
 
 
 typedef enum {
 typedef enum {
-		MAR_CLM_AF_INET = 1,
-		MAR_CLM_AF_INET6 = 2
+	MAR_CLM_AF_INET = 1,
+	MAR_CLM_AF_INET6 = 2
 } mar_clm_node_address_family_t;
 } mar_clm_node_address_family_t;
 
 
 /*
 /*

+ 1 - 1
openais/include/mar_evt.h

@@ -33,7 +33,7 @@
 #ifndef MAR_EVT_H_DEFINED
 #ifndef MAR_EVT_H_DEFINED
 #define MAR_EVT_H_DEFINED
 #define MAR_EVT_H_DEFINED
 
 
-#include "mar_gen.h"
+#include <corosync/mar_gen.h>
 
 
 typedef mar_uint64_t mar_evtchannelhandle_t;
 typedef mar_uint64_t mar_evtchannelhandle_t;
 
 

+ 9 - 9
openais/lib/ckpt.c

@@ -46,15 +46,15 @@
 #include <sys/select.h>
 #include <sys/select.h>
 #include <sys/un.h>
 #include <sys/un.h>
 
 
-#include <saAis.h>
-#include <list.h>
-#include <saCkpt.h>
-#include <mar_gen.h>
-#include <mar_ckpt.h>
-#include <ipc_gen.h>
-#include <ipc_ckpt.h>
-
-#include <ais_util.h>
+#include "../include/saAis.h"
+#include <corosync/mar_gen.h>
+#include <corosync/ipc_gen.h>
+#include <corosync/engine/list.h>
+#include "../include/saCkpt.h"
+#include "../include/ipc_ckpt.h"
+#include "../include/mar_ckpt.h"
+
+#include <corosync/ais_util.h>
 
 
 struct message_overlay {
 struct message_overlay {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));

+ 6 - 6
openais/lib/clm.c

@@ -45,16 +45,16 @@
 #include <sys/select.h>
 #include <sys/select.h>
 #include <sys/un.h>
 #include <sys/un.h>
 
 
-#include <swab.h>
-#include "../exec/totem.h"
+#define PROCESSOR_COUNT_MAX 384
+#include <corosync/swab.h>
+#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
 #include <saAis.h>
 #include <saAis.h>
 #include <saClm.h>
 #include <saClm.h>
-#include <ipc_gen.h>
 #include <ipc_clm.h>
 #include <ipc_clm.h>
-#include <mar_gen.h>
-#include <mar_clm.h>
+#include "../include/mar_clm.h"
 
 
-#include <ais_util.h>
+#include "util.h"
 
 
 struct res_overlay {
 struct res_overlay {
 	mar_res_header_t header;
 	mar_res_header_t header;

+ 5 - 4
openais/lib/evt.c

@@ -39,10 +39,11 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
-#include <ipc_evt.h>
-#include <ais_util.h>
-#include "../exec/totem.h"
-#include <list.h>
+#include <corosync/ais_util.h>
+#include <corosync/list.h>
+#include "../include/ipc_evt.h"
+
+#define MESSAGE_SIZE_MAX 1024*1024
 
 
 static void evtHandleInstanceDestructor(void *instance);
 static void evtHandleInstanceDestructor(void *instance);
 static void chanHandleInstanceDestructor(void *instance);
 static void chanHandleInstanceDestructor(void *instance);

+ 4 - 4
openais/lib/lck.c

@@ -46,12 +46,12 @@
 #include <sys/un.h>
 #include <sys/un.h>
 
 
 #include <saAis.h>
 #include <saAis.h>
-#include <list.h>
+#include <corosync/engine/list.h>
 #include <saLck.h>
 #include <saLck.h>
-#include <ipc_gen.h>
-#include <ipc_lck.h>
+#include <corosync/ipc_gen.h>
+#include "../include/ipc_lck.h"
 
 
-#include <ais_util.h>
+#include "util.h"
 
 
 struct message_overlay {
 struct message_overlay {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));

+ 28 - 0
openais/lib/libSaClm.versions

@@ -0,0 +1,28 @@
+# Version and symbol export for libSaClm.so
+
+OPENAIS_CLM_B.01.01 {
+	global:
+		saClmInitialize;
+		saClmSelectionObjectGet;
+		saClmDispatch;
+		saClmFinalize;
+		saClmClusterTrack;
+		saClmClusterTrackStop;
+		saClmClusterNodeGet;
+		saClmClusterNodeGetAsync;
+
+	local:
+		saHandleCreate;
+		saHandleDestroy;
+		saHandleInstanceGet;
+		saHandleInstancePut;
+		saPollRetry;
+		saRecvRetry;
+		saSendMsgReceiveReply;
+		saSendMsgRetry;
+		saSendReceiveReply;
+		saSendRetry;
+		saServiceConnect;
+		saVersionVerify;
+		clustTimeNow;
+};

+ 41 - 0
openais/lib/libSaMsg.versions

@@ -0,0 +1,41 @@
+# Version and symbol export for libSaMsg.so
+
+OPENAIS_MSG_B.01.01 {
+	global:
+		saMsgInitialize;
+		saMsgSelectionObjectGet;
+		saMsgDispatch;
+		saMsginalize;
+		saMsgQueueOpen;
+		saMsgQueueOpenAsync;
+		saMsgQueueClose;
+		saMsgQueueStatusGet;
+		saMsgQueueUnlink;
+		saMsgQueueGroupCreate;
+		saMsgQueueGroupInsert;
+		saMsgQueueGroupRemove;
+		saMsgQueueGroupDelete;
+		saMsgQueueGroupTrack;
+		saMsgQueueGroupTrackStop;
+		saMsgMessageSend;
+		saMsgMessageSendAsync;
+		saMsgMessageSendAsync;
+		saMsgMessageGet;
+		saMsgMessageCancel;
+		saMsgMessageReply;
+		saMsgMessageReplyAsync;
+	local:
+		saHandleCreate;
+		saHandleDestroy;
+		saHandleInstanceGet;
+		saHandleInstancePut;
+		saPollRetry;
+		saRecvRetry;
+		saSendMsgReceiveReply;
+		saSendMsgRetry;
+		saSendReceiveReply;
+		saSendRetry;
+		saServiceConnect;
+		saVersionVerify;
+		clustTimeNow;
+};

+ 5 - 4
openais/lib/msg.c

@@ -48,11 +48,12 @@
 #include <saAis.h>
 #include <saAis.h>
 #include <saMsg.h>
 #include <saMsg.h>
 
 
-#include <ipc_gen.h>
-#include <ipc_msg.h>
-#include <ais_util.h>
+#include <corosync/engine/list.h>
+#include <corosync/ipc_gen.h>
+
+#include "../include/ipc_msg.h"
+#include "util.h"
 
 
-#include <list.h>
 
 
 struct message_overlay {
 struct message_overlay {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));

+ 11 - 248
openais/services/Makefile

@@ -39,10 +39,6 @@ include $(srcdir)Makefile.inc
 override CFLAGS += -I$(srcdir)include
 override CFLAGS += -I$(srcdir)include
 LDFLAGS += -L./
 LDFLAGS += -L./
 
 
-ifeq (${BUILD_DYNAMIC}, 1) 
-	override LDFLAGS += ${DYFLAGS}
-endif
-
 ifeq (${OPENAIS_COMPAT}, LINUX) 
 ifeq (${OPENAIS_COMPAT}, LINUX) 
 	override LDFLAGS += -ldl
 	override LDFLAGS += -ldl
 endif
 endif
@@ -51,45 +47,19 @@ ifeq (${OPENAIS_COMPAT}, SOLARIS)
 	override LDFLAGS += -lnsl -lsocket -lrt
 	override LDFLAGS += -lnsl -lsocket -lrt
 endif
 endif
 
 
-# Totem objects
-TOTEM_SRC = aispoll.c totemip.c totemnet.c totemrrp.c totemsrp.c totemmrp.c totempg.c crypto.c wthread.c
-TOTEM_OBJS = aispoll.o totemip.o totemnet.o totemrrp.o totemsrp.o totemmrp.o totempg.o crypto.o wthread.o
-LOGSYS_SRC = wthread.c logsys.c
-LOGSYS_OBJS = wthread.o logsys.o
-
-EXEC_LIBS = libtotem_pg.a liblogsys.a
-
 # AMF objects
 # AMF objects
 AMF_SRC = amf.c amfutil.c amfnode.c amfcluster.c amfapp.c amfsg.c amfsu.c amfcomp.c amfsi.c
 AMF_SRC = amf.c amfutil.c amfnode.c amfcluster.c amfapp.c amfsg.c amfsu.c amfcomp.c amfsi.c
 AMF_OBJS = amf.o amfutil.o amfnode.o amfcluster.o amfapp.o amfsg.o amfsu.o amfcomp.o amfsi.o
 AMF_OBJS = amf.o amfutil.o amfnode.o amfcluster.o amfapp.o amfsg.o amfsu.o amfcomp.o amfsi.o
 
 
 # LCR objects
 # LCR objects
-LCR_SRC = evs.c clm.c ckpt.c evt.c lck.c msg.c cfg.c cpg.c aisparser.c vsf_ykd.c objdb.c confdb.c $(AMF_SRC)
-LCR_OBJS = evs.o clm.o ckpt.o evt.o lck.o msg.o cfg.o cpg.o aisparser.o vsf_ykd.o objdb.o confdb.o $(AMF_OBJS)
-
-# main executive objects
-MAIN_SRC = main.c mempool.c util.c sync.c service.c ipc.c flow.c timer.c \
-	totemconfig.c mainconfig.c
-MAIN_OBJS = main.o mempool.o util.o sync.o service.o ipc.o flow.o timer.o \
-	totemconfig.o mainconfig.o ../lcr/lcr_ifact.o
-
-ifeq (${BUILD_DYNAMIC}, 1) 
-#EXEC_OBJS = $(TOTEM_OBJS) $(LOGSYS_OBJS) $(MAIN_OBJS)
-EXEC_OBJS = $(MAIN_OBJS)
-override CFLAGS += -fPIC
+LCR_SRC = openaisparser.c clm.c ckpt.c evt.c lck.c msg.c cfg.c openaisparser.c $(AMF_SRC)
+LCR_OBJS = openaisparser.o clm.o ckpt.o evt.o lck.o msg.o cfg.o openaisparser.o $(AMF_OBJS)
 
 
-all:libtotem_pg.a libtotem_pg.so.2.0.0 liblogsys.a liblogsys.so.2.0.0 \
-	../lcr/lcr_ifact.o aisexec \
-	service_evs.lcrso service_clm.lcrso service_amf.lcrso \
-	service_ckpt.lcrso service_evt.lcrso service_lck.lcrso \
-	service_msg.lcrso service_cfg.lcrso service_cpg.lcrso \
-	service_confdb.lcrso \
-	objdb.lcrso aisparser.lcrso vsf_ykd.lcrso keygen openais-instantiate
-else
-EXEC_OBJS = $(MAIN_OBJS) $(LCR_OBJS)
-all: libtotem_pg.a liblogsys.a aisexec keygen openais-instantiate
-endif
+override CFLAGS += -fPIC
 
 
+all: openaisparser.lcrso service_clm.lcrso service_ckpt.lcrso \
+	service_evt.lcrso service_lck.lcrso service_msg.lcrso \
+	openais-instantiate
 
 
 ifeq (${OPENAIS_COMPAT}, DARWIN)
 ifeq (${OPENAIS_COMPAT}, DARWIN)
 
 
@@ -117,17 +87,8 @@ service_msg.lcrso: msg.o
 service_cfg.lcrso: cfg.o
 service_cfg.lcrso: cfg.o
 	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cfg.o -o $@
 	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cfg.o -o $@
 
 
-service_confdb.lcrso: confdb.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load confdb.o -o $@
-
-service_cpg.lcrso: cpg.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load cpg.o -o $@
-
-aisparser.lcrso: aisparser.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load aisparser.o -o $@
-
-objdb.lcrso: objdb.o
-	$(CC) -bundle -bundle_loader ./aisexec -bind_at_load objdb.o -o $@
+openaisparser.lcrso: openaisparser.o
+	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load openaisparser.o -o $@
 
 
 vsf_ykd.lcrso: vsf_ykd.o
 vsf_ykd.lcrso: vsf_ykd.o
 	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load vsf_ykd.o -o $@
 	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load vsf_ykd.o -o $@
@@ -135,9 +96,6 @@ vsf_ykd.lcrso: vsf_ykd.o
 
 
 else
 else
 
 
-service_evs.lcrso: evs.o
-	$(CC) -shared -Wl,-soname,service_evs.lcrso evs.o -o $@
-
 service_clm.lcrso: clm.o
 service_clm.lcrso: clm.o
 	$(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
 	$(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
 
 
@@ -159,47 +117,12 @@ service_msg.lcrso: msg.o
 service_cfg.lcrso: cfg.o
 service_cfg.lcrso: cfg.o
 	$(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
 	$(CC) -shared -Wl,-soname,service_cfg.lcrso cfg.o -o $@
 
 
-service_confdb.lcrso: confdb.o
-	$(CC) -shared -Wl,-soname,service_confdb.lcrso confdb.o -o $@
-
-service_cpg.lcrso: cpg.o
-	$(CC) -shared -Wl,-soname,service_cpg.lcrso cpg.o -o $@
-
-aisparser.lcrso: aisparser.o
-	$(CC) -shared -Wl,-soname,aisparser.lcrso aisparser.o -o $@
+openaisparser.lcrso: openaisparser.o
+	$(CC) -shared -Wl,-soname,openaisparser.lcrso openaisparser.o -o $@
 
 
 vsf_ykd.lcrso: vsf_ykd.o
 vsf_ykd.lcrso: vsf_ykd.o
 	$(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
 	$(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
 
 
-objdb.lcrso: objdb.o
-	$(CC) -shared -Wl,-soname,objdb.lcrso objdb.o -o $@
-
-endif
-
-aisexec: $(EXEC_OBJS) $(EXEC_LIBS)
-	$(CC) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec $(LDFLAGS)
-
-libtotem_pg.a: $(TOTEM_OBJS)
-	$(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
-
-liblogsys.a: $(LOGSYS_OBJS)
-	$(AR) -rc liblogsys.a $(LOGSYS_OBJS)
-
-ifeq (${OPENAIS_COMPAT}, DARWIN)
-
-libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
-	$(CC) $(LDFLAGS) -bundle -bind_at_load $(TOTEM_OBJS) -o $@
-
-liblogsys.so.2.0.0: $(LOGSYS_OBJS)
-	$(CC) $(LDFLAGS) -bundle -bind_at_load $(LOGSYS_OBJS) -o $@
-else
-
-libtotem_pg.so.2.0.0: $(TOTEM_OBJS)
-	$(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.2 $(TOTEM_OBJS) -o $@
-
-liblogsys.so.2.0.0: $(LIBLOGSYS_OBJS)
-	$(CC) -shared -Wl,-soname,liblogsys.so.2 $(LOGSYS_OBJS) -o $@ $(LDFLAGS)
-
 endif
 endif
 
 
 keygen: keygen.o
 keygen: keygen.o
@@ -219,9 +142,6 @@ depend:
 ../lcr/lcr_ifact.o: ../lcr/lcr_ifact.c
 ../lcr/lcr_ifact.o: ../lcr/lcr_ifact.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -DPREFIX='"$(PREFIX)"' -DLCRSODIR='"$(LCRSODIR)"' -I../lcr -c -o $@ ../lcr/lcr_ifact.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -DPREFIX='"$(PREFIX)"' -DLCRSODIR='"$(LCRSODIR)"' -I../lcr -c -o $@ ../lcr/lcr_ifact.c
 
 
-evs.o: evs.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
 clm.o: clm.c
 clm.o: clm.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
 
@@ -240,162 +160,5 @@ lck.o: lck.c
 msg.o: msg.c
 msg.o: msg.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
 
-cfg.o: cfg.c
+openaisparser.o: openaisparser.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-confdb.o: confdb.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-aisparser.o: aisparser.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-vsf_ykd.o: vsf_ykd.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cpg.o: cpg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-objdb.o: objdb.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# -fPIC rules required for lib totem
-aispoll.o: aispoll.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totempg.o: totempg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemsrp.o: totemsrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemrrp.o: totemrrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemip.o: totemip.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemnet.o: totemnet.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-wthread.o: wthread.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-crypto.o: crypto.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemmrp.o: totemmrp.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-totemconfig.o: totemconfig.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
-
-# DO NOT DELETE
-
-aispoll.o: aispoll.h ../include/list.h ../include/hdb.h tlist.h
-totemip.o: totemip.h ../include/swab.h
-totemnet.o: aispoll.h totemnet.h totem.h totemip.h wthread.h
-totemnet.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemnet.o: ../include/hdb.h ../include/swab.h crypto.h
-totemrrp.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemrrp.o: ../include/hdb.h ../include/swab.h aispoll.h totemnet.h totem.h totemip.h
-totemrrp.o: totemrrp.h
-totemsrp.o: aispoll.h totemsrp.h totem.h totemip.h totemrrp.h wthread.h
-totemsrp.o: ../include/queue.h ../include/sq.h ../include/list.h
-totemsrp.o: ../include/hdb.h ../include/swab.h crypto.h
-totemmrp.o: totem.h totemip.h totemsrp.h aispoll.h
-totempg.o: ../include/hdb.h totempg.h aispoll.h totemsrp.h totem.h totemip.h
-totempg.o: totemmrp.h ../include/swab.h
-tlist.o: ../include/list.h tlist.h
-crypto.o: crypto.h
-wthread.o: wthread.h ../include/queue.h
-evs.o: totem.h totemip.h ../include/saAis.h ../include/ipc_gen.h
-evs.o: ../exec/totemip.h ../include/ipc_evs.h ../include/saAis.h
-evs.o: ../include/evs.h ../include/ipc_gen.h ../include/list.h
-evs.o: ../include/queue.h ../lcr/lcr_comp.h aispoll.h totempg.h totemsrp.h
-evs.o: main.h ../include/saClm.h mainconfig.h objdb.h mempool.h service.h
-evs.o: logsys.h
-clm.o: totem.h totemip.h ../include/saAis.h ../include/saClm.h
-clm.o: ../include/saAis.h ../include/ipc_gen.h ../exec/totemip.h
-clm.o: ../include/ipc_clm.h ../include/saClm.h ../include/ipc_gen.h
-clm.o: ../include/mar_clm.h ../include/mar_gen.h ../include/mar_gen.h
-clm.o: ../include/mar_clm.h ../include/list.h ../include/queue.h
-clm.o: ../lcr/lcr_comp.h aispoll.h totempg.h totemsrp.h main.h mainconfig.h
-clm.o: objdb.h mempool.h service.h ../include/swab.h logsys.h
-ckpt.o: ../include/saAis.h ../include/saCkpt.h ../include/ipc_ckpt.h
-ckpt.o: ../include/saAis.h ../include/saCkpt.h ../include/ipc_gen.h
-ckpt.o: ../include/list.h ../include/queue.h ../include/hdb.h
-ckpt.o: ../lcr/lcr_comp.h aispoll.h service.h totem.h totemip.h objdb.h
-ckpt.o: mempool.h util.h main.h ../include/saClm.h ../include/ipc_gen.h
-ckpt.o: ../exec/totemip.h mainconfig.h totemsrp.h totempg.h logsys.h
-evt.o: ../include/hdb.h ../include/ipc_evt.h ../include/saAis.h
-evt.o: ../include/saEvt.h ../include/saClm.h ../include/ipc_gen.h
-evt.o: ../include/list.h ../include/queue.h ../lcr/lcr_comp.h util.h
-evt.o: ../include/saAis.h service.h totem.h totemip.h objdb.h aispoll.h
-evt.o: mempool.h main.h ../include/saClm.h ../include/ipc_gen.h
-evt.o: ../exec/totemip.h mainconfig.h totemsrp.h totempg.h ../include/swab.h logsys.h
-lck.o: service.h totem.h totemip.h objdb.h ../include/saAis.h
-lck.o: ../include/saLck.h ../include/ipc_lck.h ../include/saAis.h
-lck.o: ../include/saLck.h ../include/ipc_gen.h ../include/list.h
-lck.o: ../include/queue.h ../lcr/lcr_comp.h aispoll.h mempool.h util.h main.h
-lck.o: ../include/saClm.h ../include/ipc_gen.h ../exec/totemip.h mainconfig.h
-lck.o: totemsrp.h totempg.h logsys.h
-msg.o: ../include/saAis.h ../include/saMsg.h ../include/ipc_msg.h
-msg.o: ../include/saAis.h ../include/saMsg.h ../include/ipc_gen.h
-msg.o: ../include/list.h ../include/queue.h ../lcr/lcr_comp.h service.h
-msg.o: totem.h totemip.h objdb.h aispoll.h mempool.h util.h main.h
-msg.o: ../include/saClm.h ../include/ipc_gen.h ../exec/totemip.h mainconfig.h
-msg.o: totemsrp.h totempg.h logsys.h
-cfg.o: ../include/saAis.h ../include/cfg.h ../include/saAis.h
-cfg.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_cfg.h
-cfg.o: ../include/ipc_gen.h ../include/cfg.h ../include/list.h
-cfg.o: ../include/queue.h ../lcr/lcr_comp.h service.h totem.h totemip.h
-cfg.o: objdb.h totempg.h aispoll.h totemsrp.h mempool.h util.h logsys.h
-cfg.o: mainconfig.h
-cpg.o: ../include/saAis.h ../include/saClm.h ../include/saAis.h
-cpg.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_cpg.h
-cpg.o: ../include/ipc_gen.h ../include/list.h ../include/queue.h
-cpg.o: ../lcr/lcr_comp.h aispoll.h totempg.h totemsrp.h totem.h totemip.h
-cpg.o: main.h mainconfig.h objdb.h mempool.h service.h jhash.h ../include/swab.h logsys.h
-aisparser.o: ../lcr/lcr_comp.h objdb.h config.h mempool.h ../include/list.h
-aisparser.o: util.h ../include/saAis.h
-vsf_ykd.o: main.h ../include/saAis.h ../include/saClm.h ../include/saAis.h
-vsf_ykd.o: ../include/queue.h ../include/ipc_gen.h ../exec/totemip.h
-vsf_ykd.o: mainconfig.h ../include/list.h aispoll.h totemsrp.h totem.h
-vsf_ykd.o: totemip.h totempg.h objdb.h logsys.h ../include/swab.h vsf.h ../lcr/lcr_comp.h
-amf.o: ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amf.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_amf.h
-amf.o: ../include/ipc_gen.h ../include/saAmf.h ../include/list.h
-amf.o: ../lcr/lcr_comp.h totempg.h aispoll.h totemsrp.h totem.h totemip.h
-amf.o: mempool.h util.h amf.h objdb.h main.h ../include/saClm.h
-amf.o: ../include/queue.h mainconfig.h service.h logsys.h
-amfutil.o: ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amfutil.o: ../include/ipc_amf.h ../include/ipc_gen.h ../include/saAmf.h
-amfutil.o: ../include/list.h util.h amf.h ../include/ipc_gen.h
-amfutil.o: ../exec/totemip.h aispoll.h objdb.h totem.h totemip.h logsys.h
-amfutil.o: mainconfig.h totemsrp.h totempg.h
-amfcluster.o: logsys.h mainconfig.h ../include/saAis.h ../include/list.h
-amfcluster.o: aispoll.h totemsrp.h totem.h totemip.h totempg.h objdb.h amf.h
-amfcluster.o: ../include/saAmf.h ../include/saAis.h ../include/ipc_gen.h
-amfcluster.o: ../exec/totemip.h util.h main.h ../include/saClm.h
-amfcluster.o: ../include/queue.h
-amfapp.o: amf.h ../include/saAis.h ../include/saAmf.h
-amfapp.o: ../include/saAis.h ../include/list.h ../include/ipc_gen.h
-amfapp.o: ../exec/totemip.h aispoll.h objdb.h logsys.h mainconfig.h
-amfapp.o: totemsrp.h totem.h totemip.h totempg.h
-amfsg.o: amf.h ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amfsg.o: ../include/list.h ../include/ipc_gen.h ../exec/totemip.h aispoll.h
-amfsg.o: objdb.h logsys.h mainconfig.h totemsrp.h totem.h totemip.h totempg.h
-amfsg.o: main.h ../include/saClm.h ../include/queue.h
-amfsu.o: amf.h ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amfsu.o: ../include/list.h ../include/ipc_gen.h ../exec/totemip.h aispoll.h
-amfsu.o: objdb.h util.h logsys.h mainconfig.h totemsrp.h totem.h totemip.h
-amfsu.o: totempg.h main.h ../include/saClm.h ../include/queue.h
-amfcomp.o: ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amfcomp.o: ../include/ipc_gen.h ../exec/totemip.h ../include/ipc_amf.h
-amfcomp.o: ../include/ipc_gen.h ../include/saAmf.h totempg.h aispoll.h
-amfcomp.o: totemsrp.h totem.h totemip.h main.h ../include/saClm.h
-amfcomp.o: ../include/queue.h mainconfig.h ../include/list.h objdb.h
-amfcomp.o: service.h util.h amf.h logsys.h
-amfsi.o: amf.h ../include/saAis.h ../include/saAmf.h ../include/saAis.h
-amfsi.o: ../include/list.h ../include/ipc_gen.h ../exec/totemip.h aispoll.h
-amfsi.o: objdb.h logsys.h mainconfig.h totemsrp.h totem.h totemip.h totempg.h

+ 0 - 219
openais/services/aisparser.c

@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2006 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Patrick Caulfield (pcaulfie@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.
- */
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#include "../lcr/lcr_comp.h"
-#include "objdb.h"
-#include "config.h"
-#include "mempool.h"
-#include "util.h"
-
-static int read_config_file_into_objdb(
-	struct objdb_iface_ver0 *objdb,
-	char **error_string);
-static char error_string_response[512];
-
-
-static int aisparser_readconfig (struct objdb_iface_ver0 *objdb, char **error_string)
-{
-	if (read_config_file_into_objdb(objdb, error_string)) {
-		return -1;
-	}
-
-	return 0;
-}
-
-
-static char *remove_whitespace(char *string)
-{
-	char *start = string+strspn(string, " \t");
-	char *end = start+(strlen(start))-1;
-
-	while ((*end == ' ' || *end == '\t' || *end == ':' || *end == '{') && end > start)
-		end--;
-	if (end != start)
-		*(end+1) = '\0';
-
-	return start;
-}
-
-static int parse_section(FILE *fp,
-			 struct objdb_iface_ver0 *objdb,
-			 unsigned int parent_handle,
-			 char **error_string)
-{
-	char line[512];
-	int i;
-	char *loc;
-
-	while (fgets (line, 255, fp)) {
-		line[strlen(line) - 1] = '\0';
-		/*
-		 * Clear out white space and tabs
-		 */
-		for (i = strlen (line) - 1; i > -1; i--) {
-			if (line[i] == '\t' || line[i] == ' ') {
-				line[i] = '\0';
-			} else {
-				break;
-			}
-		}
-		/*
-		 * Clear out comments and empty lines
-		 */
-		if (line[0] == '#' || line[0] == '\0') {
-			continue;
-		}
-
-		/* New section ? */
-		if ((loc = strstr_rs (line, "{"))) {
-			unsigned int new_parent;
-			char *section = remove_whitespace(line);
-
-			loc--;
-			*loc = '\0';
-			objdb->object_create (parent_handle, &new_parent,
-					      section, strlen (section));
-			if (parse_section(fp, objdb, new_parent, error_string))
-				return -1;
-		}
-
-		/* New key/value */
-		if ((loc = strstr_rs (line, ":"))) {
-			char *key;
-			char *value;
-
-			*(loc-1) = '\0';
-			key = remove_whitespace(line);
-			value = remove_whitespace(loc);
-			objdb->object_key_create (parent_handle, key,
-				strlen (key),
-				value, strlen (value) + 1);
-		}
-
-		if ((loc = strstr_rs (line, "}"))) {
-			return 0;
-		}
-	}
-
-	if (parent_handle != OBJECT_PARENT_HANDLE) {
-		*error_string = "Missing closing brace";
-		return -1;
-	}
-
-	return 0;
-}
-
-
-
-/* Read config file and load into objdb */
-static int read_config_file_into_objdb(
-	struct objdb_iface_ver0 *objdb,
-	char **error_string)
-{
-	FILE *fp;
-	char *filename;
-	char *error_reason = error_string_response;
-	int res;
-
-	filename = getenv("OPENAIS_MAIN_CONFIG_FILE");
-	if (!filename)
-		filename = "/etc/ais/openais.conf";
-
-	fp = fopen (filename, "r");
-	if (fp == 0) {
-		sprintf (error_reason, "Can't read file %s reason = (%s)\n",
-			 filename, strerror (errno));
-		*error_string = error_reason;
-		return -1;
-	}
-
-	res = parse_section(fp, objdb, OBJECT_PARENT_HANDLE, error_string);
-
-	fclose(fp);
-
-	sprintf (error_reason, "Successfully read main configuration file '%s'.\n", filename);
-	*error_string = error_reason;
-
-	return res;
-}
-
-/*
- * Dynamic Loader definition
- */
-
-struct config_iface_ver0 aisparser_iface_ver0 = {
-	.config_readconfig        = aisparser_readconfig
-};
-
-struct lcr_iface openais_aisparser_ver0[1] = {
-	{
-		.name				= "aisparser",
-		.version			= 0,
-		.versions_replace		= 0,
-		.versions_replace_count		= 0,
-		.dependencies			= 0,
-		.dependency_count		= 0,
-		.constructor			= NULL,
-		.destructor			= NULL,
-		.interfaces			= NULL,
-	}
-};
-
-struct openais_service_handler *aisparser_get_handler_ver0 (void);
-
-struct lcr_comp aisparser_comp_ver0 = {
-	.iface_count				= 1,
-	.ifaces					= openais_aisparser_ver0
-};
-
-
-__attribute__ ((constructor)) static void aisparser_comp_register (void) {
-        lcr_interfaces_set (&openais_aisparser_ver0[0], &aisparser_iface_ver0);
-	lcr_component_register (&aisparser_comp_ver0);
-}
-
-

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 146 - 144
openais/services/ckpt.c


+ 57 - 62
openais/services/clm.c

@@ -57,26 +57,17 @@
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
-#include "swab.h"
-#include "totem.h"
-#include "../include/saAis.h"
+#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
+#include <corosync/engine/swab.h>
+#include <corosync/engine/list.h>
+#include <corosync/engine/coroapi.h>
+#include <corosync/engine/logsys.h>
+#include <corosync/saAis.h>
+#include <corosync/lcr/lcr_comp.h>
 #include "../include/saClm.h"
 #include "../include/saClm.h"
-#include "../include/ipc_gen.h"
 #include "../include/ipc_clm.h"
 #include "../include/ipc_clm.h"
-#include "../include/mar_gen.h"
 #include "../include/mar_clm.h"
 #include "../include/mar_clm.h"
-#include "../include/list.h"
-#include "../include/queue.h"
-#include "../lcr/lcr_comp.h"
-#include "totempg.h"
-#include "main.h"
-#include "flow.h"
-#include "tlist.h"
-#include "ipc.h"
-#include "mempool.h"
-#include "objdb.h"
-#include "service.h"
-#include "logsys.h"
 
 
 LOGSYS_DECLARE_SUBSYS ("CLM", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("CLM", LOG_INFO);
 
 
@@ -89,6 +80,8 @@ mar_clm_cluster_change_t my_cluster_node_last_change = SA_CLM_NODE_JOINED;
 
 
 mar_clm_cluster_node_t my_cluster_node;
 mar_clm_cluster_node_t my_cluster_node;
 
 
+static struct corosync_api_v1 *api;
+
 static mar_clm_cluster_node_t cluster_node_entries[PROCESSOR_COUNT_MAX];
 static mar_clm_cluster_node_t cluster_node_entries[PROCESSOR_COUNT_MAX];
 
 
 static int cluster_node_count = 0;
 static int cluster_node_count = 0;
@@ -140,9 +133,9 @@ static void clm_sync_activate (void);
 
 
 static void clm_sync_abort (void);
 static void clm_sync_abort (void);
 
 
-static int clm_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static int clm_exec_init_fn (struct corosync_api_v1 *corosync_api);
 
 
-static int clm_exec_exit_fn (struct objdb_iface_ver0 *objdb);
+static int clm_exec_exit_fn (void);
 
 
 static int clm_lib_init_fn (void *conn);
 static int clm_lib_init_fn (void *conn);
 
 
@@ -172,35 +165,35 @@ struct clm_pd {
 /*
 /*
  * Executive Handler Definition
  * Executive Handler Definition
  */
  */
-static struct openais_lib_handler clm_lib_service[] =
+static struct corosync_lib_handler clm_lib_engine[] =
 {
 {
 	{ /* 0 */
 	{ /* 0 */
 		.lib_handler_fn				= message_handler_req_lib_clm_clustertrack,
 		.lib_handler_fn				= message_handler_req_lib_clm_clustertrack,
 		.response_size				= sizeof (struct res_lib_clm_clustertrack),
 		.response_size				= sizeof (struct res_lib_clm_clustertrack),
 		.response_id				= MESSAGE_RES_CLM_TRACKSTART, // TODO RESPONSE
 		.response_id				= MESSAGE_RES_CLM_TRACKSTART, // TODO RESPONSE
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 1 */
 	{ /* 1 */
 		.lib_handler_fn				= message_handler_req_lib_clm_trackstop,
 		.lib_handler_fn				= message_handler_req_lib_clm_trackstop,
 		.response_size				= sizeof (struct res_lib_clm_trackstop),
 		.response_size				= sizeof (struct res_lib_clm_trackstop),
 		.response_id				= MESSAGE_RES_CLM_TRACKSTOP, // TODO RESPONSE
 		.response_id				= MESSAGE_RES_CLM_TRACKSTOP, // TODO RESPONSE
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 2 */
 	{ /* 2 */
 		.lib_handler_fn				= message_handler_req_lib_clm_nodeget,
 		.lib_handler_fn				= message_handler_req_lib_clm_nodeget,
 		.response_size				= sizeof (struct res_clm_nodeget),
 		.response_size				= sizeof (struct res_clm_nodeget),
 		.response_id				= MESSAGE_RES_CLM_NODEGET, // TODO RESPONSE
 		.response_id				= MESSAGE_RES_CLM_NODEGET, // TODO RESPONSE
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{ /* 3 */
 	{ /* 3 */
 		.lib_handler_fn				= message_handler_req_lib_clm_nodegetasync,
 		.lib_handler_fn				= message_handler_req_lib_clm_nodegetasync,
 		.response_size				= sizeof (struct res_clm_nodegetasync),
 		.response_size				= sizeof (struct res_clm_nodegetasync),
 		.response_id				= MESSAGE_RES_CLM_NODEGETCALLBACK, // TODO RESPONSE
 		.response_id				= MESSAGE_RES_CLM_NODEGETCALLBACK, // TODO RESPONSE
-		.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+		.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	}
 	}
 };
 };
 
 
-static struct openais_exec_handler clm_exec_service[] =
+static struct corosync_exec_handler clm_exec_engine[] =
 {
 {
 	{
 	{
 		.exec_handler_fn	= message_handler_req_exec_clm_nodejoin,
 		.exec_handler_fn	= message_handler_req_exec_clm_nodejoin,
@@ -208,20 +201,20 @@ static struct openais_exec_handler clm_exec_service[] =
 	}
 	}
 };
 };
 	
 	
-struct openais_service_handler clm_service_handler = {
+struct corosync_service_engine clm_service_engine = {
 	.name			= "openais cluster membership service B.01.01",
 	.name			= "openais cluster membership service B.01.01",
 	.id			= CLM_SERVICE,
 	.id			= CLM_SERVICE,
 	.private_data_size	= sizeof (struct clm_pd),
 	.private_data_size	= sizeof (struct clm_pd),
-	.flow_control		= OPENAIS_FLOW_CONTROL_NOT_REQUIRED, 
+	.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED, 
 	.lib_init_fn		= clm_lib_init_fn,
 	.lib_init_fn		= clm_lib_init_fn,
 	.lib_exit_fn		= clm_lib_exit_fn,
 	.lib_exit_fn		= clm_lib_exit_fn,
-	.lib_service		= clm_lib_service,
-	.lib_service_count	= sizeof (clm_lib_service) / sizeof (struct openais_lib_handler),
+	.lib_engine		= clm_lib_engine,
+	.lib_engine_count	= sizeof (clm_lib_engine) / sizeof (struct corosync_lib_handler),
 	.exec_init_fn		= clm_exec_init_fn,
 	.exec_init_fn		= clm_exec_init_fn,
 	.exec_exit_fn		= clm_exec_exit_fn,
 	.exec_exit_fn		= clm_exec_exit_fn,
 	.exec_dump_fn		= NULL,
 	.exec_dump_fn		= NULL,
-	.exec_service		= clm_exec_service,
-	.exec_service_count	= sizeof (clm_exec_service) / sizeof (struct openais_exec_handler),
+	.exec_engine		= clm_exec_engine,
+	.exec_engine_count	= sizeof (clm_exec_engine) / sizeof (struct corosync_exec_handler),
 	.confchg_fn		= clm_confchg_fn,
 	.confchg_fn		= clm_confchg_fn,
 	.sync_init		= clm_sync_init,
 	.sync_init		= clm_sync_init,
 	.sync_process		= clm_sync_process,
 	.sync_process		= clm_sync_process,
@@ -232,10 +225,10 @@ struct openais_service_handler clm_service_handler = {
 /*
 /*
  * Dynamic loader definition
  * Dynamic loader definition
  */
  */
-static struct openais_service_handler *clm_get_service_handler_ver0 (void);
+static struct corosync_service_engine *clm_get_service_engine_ver0 (void);
 
 
-static struct openais_service_handler_iface_ver0 clm_service_handler_iface = {
-	.openais_get_service_handler_ver0	= clm_get_service_handler_ver0
+static struct corosync_service_engine_iface_ver0 clm_service_engine_iface = {
+	.corosync_get_service_engine_ver0	= clm_get_service_engine_ver0
 };
 };
 
 
 static struct lcr_iface openais_clm_ver0[1] = {
 static struct lcr_iface openais_clm_ver0[1] = {
@@ -257,13 +250,13 @@ static struct lcr_comp clm_comp_ver0 = {
 	.ifaces				= openais_clm_ver0
 	.ifaces				= openais_clm_ver0
 };
 };
 
 
-static struct openais_service_handler *clm_get_service_handler_ver0 (void)
+static struct corosync_service_engine *clm_get_service_engine_ver0 (void)
 {
 {
-	return (&clm_service_handler);
+	return (&clm_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void clm_comp_register (void) {
 __attribute__ ((constructor)) static void clm_comp_register (void) {
-	lcr_interfaces_set (&openais_clm_ver0[0], &clm_service_handler_iface);
+	lcr_interfaces_set (&openais_clm_ver0[0], &clm_service_engine_iface);
 
 
 	lcr_component_register (&clm_comp_ver0);
 	lcr_component_register (&clm_comp_ver0);
 }
 }
@@ -280,22 +273,22 @@ static void my_cluster_node_load (void)
 	char **status;
 	char **status;
 	const char *iface_string;
 	const char *iface_string;
 
 
-	totempg_ifaces_get (
-		totempg_my_nodeid_get (),
+	api->totem_ifaces_get (
+		api->totem_nodeid_get (),
 		interfaces,
 		interfaces,
 		&status,
 		&status,
 		&iface_count);
 		&iface_count);
 
 
-	iface_string = totemip_print (&interfaces[0]);
+	iface_string = api->totem_ip_print (&interfaces[0]);
 
 
 	sprintf ((char *)my_cluster_node.node_address.value, "%s",
 	sprintf ((char *)my_cluster_node.node_address.value, "%s",
 		iface_string);
 		iface_string);
 	my_cluster_node.node_address.length =
 	my_cluster_node.node_address.length =
 		strlen ((char *)my_cluster_node.node_address.value);
 		strlen ((char *)my_cluster_node.node_address.value);
-	if (totempg_my_family_get () == AF_INET) {
+	if (api->totem_family_get () == AF_INET) {
 		my_cluster_node.node_address.family = SA_CLM_AF_INET;
 		my_cluster_node.node_address.family = SA_CLM_AF_INET;
 	} else
 	} else
-	if (totempg_my_family_get () == AF_INET6) {
+	if (api->totem_family_get () == AF_INET6) {
 		my_cluster_node.node_address.family = SA_CLM_AF_INET6;
 		my_cluster_node.node_address.family = SA_CLM_AF_INET6;
 	} else {
 	} else {
 		assert (0);
 		assert (0);
@@ -305,15 +298,17 @@ static void my_cluster_node_load (void)
 		(char *)my_cluster_node.node_address.value);
 		(char *)my_cluster_node.node_address.value);
 	my_cluster_node.node_name.length =
 	my_cluster_node.node_name.length =
 		my_cluster_node.node_address.length;
 		my_cluster_node.node_address.length;
-	my_cluster_node.node_id = totempg_my_nodeid_get ();
+	my_cluster_node.node_id = api->totem_nodeid_get ();
 	my_cluster_node.member = 1;
 	my_cluster_node.member = 1;
 
 
 	memcpy (&cluster_node_entries[0], &my_cluster_node,
 	memcpy (&cluster_node_entries[0], &my_cluster_node,
 		sizeof (mar_clm_cluster_node_t));
 		sizeof (mar_clm_cluster_node_t));
 }
 }
 
 
-static int clm_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int clm_exec_init_fn (struct corosync_api_v1 *corosync_api)
 {
 {
+	api = corosync_api;
+
 	memset (cluster_node_entries, 0,
 	memset (cluster_node_entries, 0,
 		sizeof (mar_clm_cluster_node_t) * PROCESSOR_COUNT_MAX);
 		sizeof (mar_clm_cluster_node_t) * PROCESSOR_COUNT_MAX);
 
 
@@ -354,18 +349,18 @@ static int clm_exec_init_fn (struct objdb_iface_ver0 *objdb)
 
 
 	cluster_node_count = 1;
 	cluster_node_count = 1;
 
 
-	main_clm_get_by_nodeid = clm_get_by_nodeid;
+//TODO	main_clm_get_by_nodeid = clm_get_by_nodeid;
 	return (0);
 	return (0);
 }
 }
 
 
-static int clm_exec_exit_fn (struct objdb_iface_ver0 *objdb)
+static int clm_exec_exit_fn (void)
 {
 {
 	return (0);
 	return (0);
 }
 }
 
 
 static int clm_lib_exit_fn (void *conn)
 static int clm_lib_exit_fn (void *conn)
 {
 {
-	struct clm_pd *clm_pd = (struct clm_pd *)openais_conn_private_data_get (conn);
+	struct clm_pd *clm_pd = (struct clm_pd *)api->ipc_private_data_get (conn);
 	/*
 	/*
 	 * Delete track entry if there is one
 	 * Delete track entry if there is one
 	 */
 	 */
@@ -434,7 +429,7 @@ static void library_notification_send (
 		/*
 		/*
 		 * Send notifications to all CLM listeners
 		 * Send notifications to all CLM listeners
 		 */
 		 */
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			clm_pd->conn,
 			clm_pd->conn,
 			&res_lib_clm_clustertrack,
 			&res_lib_clm_clustertrack,
 			sizeof (struct res_lib_clm_clustertrack));
 			sizeof (struct res_lib_clm_clustertrack));
@@ -517,7 +512,7 @@ static int clm_nodejoin_send (void)
 	req_exec_clm_iovec.iov_base = (char *)&req_exec_clm_nodejoin;
 	req_exec_clm_iovec.iov_base = (char *)&req_exec_clm_nodejoin;
 	req_exec_clm_iovec.iov_len = sizeof (req_exec_clm_nodejoin);
 	req_exec_clm_iovec.iov_len = sizeof (req_exec_clm_nodejoin);
 
 
-	result = totempg_groups_mcast_joined (openais_group_handle, &req_exec_clm_iovec, 1, TOTEMPG_AGREED);
+	result = api->totem_mcast (&req_exec_clm_iovec, 1, TOTEM_AGREED);
 
 
 	return (result);
 	return (result);
 }
 }
@@ -540,16 +535,16 @@ static void clm_confchg_fn (
 	log_printf (LOG_LEVEL_NOTICE, "CLM CONFIGURATION CHANGE\n");
 	log_printf (LOG_LEVEL_NOTICE, "CLM CONFIGURATION CHANGE\n");
 	log_printf (LOG_LEVEL_NOTICE, "New Configuration:\n");
 	log_printf (LOG_LEVEL_NOTICE, "New Configuration:\n");
 	for (i = 0; i < member_list_entries; i++) {
 	for (i = 0; i < member_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (member_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", api->totem_ifaces_print (member_list[i]));
 	}
 	}
 	log_printf (LOG_LEVEL_NOTICE, "Members Left:\n");
 	log_printf (LOG_LEVEL_NOTICE, "Members Left:\n");
 	for (i = 0; i < left_list_entries; i++) {
 	for (i = 0; i < left_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (left_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", api->totem_ifaces_print (left_list[i]));
 	}
 	}
 
 
 	log_printf (LOG_LEVEL_NOTICE, "Members Joined:\n");
 	log_printf (LOG_LEVEL_NOTICE, "Members Joined:\n");
 	for (i = 0; i < joined_list_entries; i++) {
 	for (i = 0; i < joined_list_entries; i++) {
-		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", totempg_ifaces_print (joined_list[i]));
+		log_printf (LOG_LEVEL_NOTICE, "\t%s\n", api->totem_ifaces_print (joined_list[i]));
 	}
 	}
 
 
 	for (i = 0; i < left_list_entries; i++) {
 	for (i = 0; i < left_list_entries; i++) {
@@ -646,7 +641,7 @@ static void message_handler_req_exec_clm_nodejoin (
 static int clm_lib_init_fn (void *conn)
 static int clm_lib_init_fn (void *conn)
 {
 {
 	log_printf (LOG_LEVEL_DEBUG, "Got request to initalize cluster membership service.\n");
 	log_printf (LOG_LEVEL_DEBUG, "Got request to initalize cluster membership service.\n");
-	struct clm_pd *clm_pd = (struct clm_pd *)openais_conn_private_data_get (conn);
+	struct clm_pd *clm_pd = (struct clm_pd *)api->ipc_private_data_get (conn);
 
 
 	list_init (&clm_pd->list);
 	list_init (&clm_pd->list);
 	clm_pd->conn = conn;
 	clm_pd->conn = conn;
@@ -658,7 +653,7 @@ static void message_handler_req_lib_clm_clustertrack (void *conn, void *msg)
 {
 {
 	struct req_lib_clm_clustertrack *req_lib_clm_clustertrack = (struct req_lib_clm_clustertrack *)msg;
 	struct req_lib_clm_clustertrack *req_lib_clm_clustertrack = (struct req_lib_clm_clustertrack *)msg;
 	struct res_lib_clm_clustertrack res_lib_clm_clustertrack;
 	struct res_lib_clm_clustertrack res_lib_clm_clustertrack;
-	struct clm_pd *clm_pd = (struct clm_pd *)openais_conn_private_data_get (conn);
+	struct clm_pd *clm_pd = (struct clm_pd *)api->ipc_private_data_get (conn);
 	int i;
 	int i;
 
 
 	res_lib_clm_clustertrack.header.size = sizeof (struct res_lib_clm_clustertrack);
 	res_lib_clm_clustertrack.header.size = sizeof (struct res_lib_clm_clustertrack);
@@ -694,14 +689,14 @@ static void message_handler_req_lib_clm_clustertrack (void *conn, void *msg)
 		list_add (&clm_pd->list, &library_notification_send_listhead);
 		list_add (&clm_pd->list, &library_notification_send_listhead);
 	}
 	}
 
 
-	openais_conn_send_response (conn, &res_lib_clm_clustertrack,
+	api->ipc_conn_send_response (conn, &res_lib_clm_clustertrack,
 		sizeof (struct res_lib_clm_clustertrack));
 		sizeof (struct res_lib_clm_clustertrack));
 
 
 	if (req_lib_clm_clustertrack->return_in_callback) {
 	if (req_lib_clm_clustertrack->return_in_callback) {
 		res_lib_clm_clustertrack.header.id = MESSAGE_RES_CLM_TRACKCALLBACK;
 		res_lib_clm_clustertrack.header.id = MESSAGE_RES_CLM_TRACKCALLBACK;
 
 
-		openais_conn_send_response (
-			openais_conn_partner_get (conn),
+		api->ipc_conn_send_response (
+			api->ipc_conn_partner_get (conn),
 			&res_lib_clm_clustertrack,
 			&res_lib_clm_clustertrack,
 			sizeof (struct res_lib_clm_clustertrack));
 			sizeof (struct res_lib_clm_clustertrack));
 	}
 	}
@@ -711,7 +706,7 @@ static void message_handler_req_lib_clm_clustertrack (void *conn, void *msg)
 static void message_handler_req_lib_clm_trackstop (void *conn, void *msg)
 static void message_handler_req_lib_clm_trackstop (void *conn, void *msg)
 {
 {
 	struct res_lib_clm_trackstop res_lib_clm_trackstop;
 	struct res_lib_clm_trackstop res_lib_clm_trackstop;
-	struct clm_pd *clm_pd = (struct clm_pd *)openais_conn_private_data_get (conn);
+	struct clm_pd *clm_pd = (struct clm_pd *)api->ipc_private_data_get (conn);
 
 
 	res_lib_clm_trackstop.header.size = sizeof (struct res_lib_clm_trackstop);
 	res_lib_clm_trackstop.header.size = sizeof (struct res_lib_clm_trackstop);
 	res_lib_clm_trackstop.header.id = MESSAGE_RES_CLM_TRACKSTOP;
 	res_lib_clm_trackstop.header.id = MESSAGE_RES_CLM_TRACKSTOP;
@@ -726,7 +721,7 @@ static void message_handler_req_lib_clm_trackstop (void *conn, void *msg)
 	list_del (&clm_pd->list);
 	list_del (&clm_pd->list);
 	list_init (&clm_pd->list);
 	list_init (&clm_pd->list);
 
 
-	openais_conn_send_response (conn, &res_lib_clm_trackstop,
+	api->ipc_conn_send_response (conn, &res_lib_clm_trackstop,
 		sizeof (struct res_lib_clm_trackstop));
 		sizeof (struct res_lib_clm_trackstop));
 }
 }
 
 
@@ -762,7 +757,7 @@ static void message_handler_req_lib_clm_nodeget (void *conn, void *msg)
 	if (valid) {
 	if (valid) {
 		memcpy (&res_clm_nodeget.cluster_node, cluster_node, sizeof (mar_clm_cluster_node_t));
 		memcpy (&res_clm_nodeget.cluster_node, cluster_node, sizeof (mar_clm_cluster_node_t));
 	}
 	}
-	openais_conn_send_response (conn, &res_clm_nodeget, sizeof (struct res_clm_nodeget));
+	api->ipc_conn_send_response (conn, &res_clm_nodeget, sizeof (struct res_clm_nodeget));
 }
 }
 
 
 static void message_handler_req_lib_clm_nodegetasync (void *conn, void *msg)
 static void message_handler_req_lib_clm_nodegetasync (void *conn, void *msg)
@@ -797,7 +792,7 @@ static void message_handler_req_lib_clm_nodegetasync (void *conn, void *msg)
 	res_clm_nodegetasync.header.id = MESSAGE_RES_CLM_NODEGETASYNC;
 	res_clm_nodegetasync.header.id = MESSAGE_RES_CLM_NODEGETASYNC;
 	res_clm_nodegetasync.header.error = SA_AIS_OK;
 	res_clm_nodegetasync.header.error = SA_AIS_OK;
 
 
-	openais_conn_send_response (conn, &res_clm_nodegetasync,
+	api->ipc_conn_send_response (conn, &res_clm_nodegetasync,
 		sizeof (struct res_clm_nodegetasync));
 		sizeof (struct res_clm_nodegetasync));
 
 
 	/*
 	/*
@@ -811,7 +806,7 @@ static void message_handler_req_lib_clm_nodegetasync (void *conn, void *msg)
 		memcpy (&res_clm_nodegetcallback.cluster_node, cluster_node,
 		memcpy (&res_clm_nodegetcallback.cluster_node, cluster_node,
 			sizeof (mar_clm_cluster_node_t));
 			sizeof (mar_clm_cluster_node_t));
 	}
 	}
-	openais_conn_send_response (openais_conn_partner_get (conn),
+	api->ipc_conn_send_response (api->ipc_conn_partner_get (conn),
 		&res_clm_nodegetcallback,
 		&res_clm_nodegetcallback,
 		sizeof (struct res_clm_nodegetcallback));
 		sizeof (struct res_clm_nodegetcallback));
 }
 }

+ 146 - 138
openais/services/evt.c

@@ -49,25 +49,17 @@
 #include <sys/socket.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
-#include "../include/hdb.h"
+#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
+#include <corosync/hdb.h>
+#include <corosync/engine/swab.h>
+#include <corosync/engine/list.h>
+#include <corosync/engine/coroapi.h>
+#include <corosync/engine/logsys.h>
+#include <corosync/saAis.h>
+#include <corosync/lcr/lcr_comp.h>
+#include "../include/saEvt.h"
 #include "../include/ipc_evt.h"
 #include "../include/ipc_evt.h"
-#include "../include/list.h"
-#include "../include/queue.h"
-#include "../lcr/lcr_comp.h"
-#include "util.h"
-#include "objdb.h"
-#include "totem.h"
-#include "service.h"
-#include "mempool.h"
-#include "main.h"
-#include "flow.h"
-#include "tlist.h"
-#include "ipc.h"
-#include "totempg.h"
-#include "swab.h"
-#include "logsys.h"
-#include "tlist.h"
-#include "timer.h"
 
 
 LOGSYS_DECLARE_SUBSYS ("EVT", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("EVT", LOG_INFO);
 /*
 /*
@@ -124,7 +116,7 @@ static void evt_conf_change(
 
 
 static int evt_lib_init(void *conn);
 static int evt_lib_init(void *conn);
 static int evt_lib_exit(void *conn);
 static int evt_lib_exit(void *conn);
-static int evt_exec_init(struct objdb_iface_ver0 *objdb);
+static int evt_exec_init(struct corosync_api_v1 *);
 
 
 /*
 /*
  * Recovery sync functions
  * Recovery sync functions
@@ -137,60 +129,62 @@ static void evt_sync_abort(void);
 static void convert_event(void *msg);
 static void convert_event(void *msg);
 static void convert_chan_packet(void *msg);
 static void convert_chan_packet(void *msg);
 
 
-static struct openais_lib_handler evt_lib_service[] = {
+struct corosync_api_v1 *api;
+
+static struct corosync_lib_handler evt_lib_engine[] = {
 	{
 	{
 	.lib_handler_fn =		lib_evt_open_channel,
 	.lib_handler_fn =		lib_evt_open_channel,
 	.response_size =		sizeof(struct res_evt_channel_open),
 	.response_size =		sizeof(struct res_evt_channel_open),
 	.response_id =			MESSAGE_RES_EVT_OPEN_CHANNEL,
 	.response_id =			MESSAGE_RES_EVT_OPEN_CHANNEL,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_open_channel_async,
 	.lib_handler_fn =		lib_evt_open_channel_async,
 	.response_size =		sizeof(struct res_evt_channel_open),
 	.response_size =		sizeof(struct res_evt_channel_open),
 	.response_id =			MESSAGE_RES_EVT_OPEN_CHANNEL,
 	.response_id =			MESSAGE_RES_EVT_OPEN_CHANNEL,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_close_channel,
 	.lib_handler_fn =		lib_evt_close_channel,
 	.response_size =		sizeof(struct res_evt_channel_close),
 	.response_size =		sizeof(struct res_evt_channel_close),
 	.response_id =			MESSAGE_RES_EVT_CLOSE_CHANNEL,
 	.response_id =			MESSAGE_RES_EVT_CLOSE_CHANNEL,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_unlink_channel,
 	.lib_handler_fn =		lib_evt_unlink_channel,
 	.response_size =		sizeof(struct res_evt_channel_unlink),
 	.response_size =		sizeof(struct res_evt_channel_unlink),
 	.response_id =			MESSAGE_RES_EVT_UNLINK_CHANNEL,
 	.response_id =			MESSAGE_RES_EVT_UNLINK_CHANNEL,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_event_subscribe,
 	.lib_handler_fn =		lib_evt_event_subscribe,
 	.response_size =		sizeof(struct res_evt_event_subscribe),
 	.response_size =		sizeof(struct res_evt_event_subscribe),
 	.response_id =			MESSAGE_RES_EVT_SUBSCRIBE,
 	.response_id =			MESSAGE_RES_EVT_SUBSCRIBE,
-	.flow_control =			OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_event_unsubscribe,
 	.lib_handler_fn =		lib_evt_event_unsubscribe,
 	.response_size =		sizeof(struct res_evt_event_unsubscribe),
 	.response_size =		sizeof(struct res_evt_event_unsubscribe),
 	.response_id =			MESSAGE_RES_EVT_UNSUBSCRIBE,
 	.response_id =			MESSAGE_RES_EVT_UNSUBSCRIBE,
-	.flow_control =			OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_event_publish,
 	.lib_handler_fn =		lib_evt_event_publish,
 	.response_size =		sizeof(struct res_evt_event_publish),
 	.response_size =		sizeof(struct res_evt_event_publish),
 	.response_id =			MESSAGE_RES_EVT_PUBLISH,
 	.response_id =			MESSAGE_RES_EVT_PUBLISH,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_event_clear_retentiontime,
 	.lib_handler_fn =		lib_evt_event_clear_retentiontime,
 	.response_size =		sizeof(struct res_evt_event_clear_retentiontime),
 	.response_size =		sizeof(struct res_evt_event_clear_retentiontime),
 	.response_id =			MESSAGE_RES_EVT_CLEAR_RETENTIONTIME,
 	.response_id =			MESSAGE_RES_EVT_CLEAR_RETENTIONTIME,
-	.flow_control =			OPENAIS_FLOW_CONTROL_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{
 	{
 	.lib_handler_fn =		lib_evt_event_data_get,
 	.lib_handler_fn =		lib_evt_event_data_get,
 	.response_size =		sizeof(struct lib_event_data),
 	.response_size =		sizeof(struct lib_event_data),
 	.response_id =			MESSAGE_RES_EVT_EVENT_DATA,
 	.response_id =			MESSAGE_RES_EVT_EVENT_DATA,
-	.flow_control =			OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+	.flow_control =			COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
 	},
 };
 };
 
 
@@ -199,7 +193,7 @@ static void evt_remote_evt(void *msg, unsigned int nodeid);
 static void evt_remote_recovery_evt(void *msg, unsigned int nodeid);
 static void evt_remote_recovery_evt(void *msg, unsigned int nodeid);
 static void evt_remote_chan_op(void *msg, unsigned int nodeid);
 static void evt_remote_chan_op(void *msg, unsigned int nodeid);
 
 
-static struct openais_exec_handler evt_exec_service[] = {
+static struct corosync_exec_handler evt_exec_engine[] = {
 	{
 	{
 		.exec_handler_fn		= evt_remote_evt,
 		.exec_handler_fn		= evt_remote_evt,
 		.exec_endian_convert_fn = convert_event
 		.exec_endian_convert_fn = convert_event
@@ -214,18 +208,18 @@ static struct openais_exec_handler evt_exec_service[] = {
 	}
 	}
 };
 };
 
 
-struct openais_service_handler evt_service_handler = {
+struct corosync_service_engine evt_service_engine = {
 	.name						= "openais event service B.01.01",
 	.name						= "openais event service B.01.01",
 	.id							= EVT_SERVICE,
 	.id							= EVT_SERVICE,
 	.private_data_size			= sizeof (struct libevt_pd),
 	.private_data_size			= sizeof (struct libevt_pd),
-	.flow_control				= OPENAIS_FLOW_CONTROL_NOT_REQUIRED,
+	.flow_control				= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED,
 	.lib_init_fn				= evt_lib_init,
 	.lib_init_fn				= evt_lib_init,
 	.lib_exit_fn				= evt_lib_exit,
 	.lib_exit_fn				= evt_lib_exit,
-	.lib_service				= evt_lib_service,
-	.lib_service_count			= sizeof(evt_lib_service) / sizeof(struct openais_lib_handler),
+	.lib_engine					= evt_lib_engine,
+	.lib_engine_count			= sizeof(evt_lib_engine) / sizeof(struct corosync_lib_handler),
 	.exec_init_fn				= evt_exec_init,
 	.exec_init_fn				= evt_exec_init,
-	.exec_service				= evt_exec_service,
-	.exec_service_count		= sizeof(evt_exec_service) / sizeof(struct openais_exec_handler),
+	.exec_engine				= evt_exec_engine,
+	.exec_engine_count			= sizeof(evt_exec_engine) / sizeof(struct corosync_exec_handler),
 	.exec_dump_fn				= NULL,
 	.exec_dump_fn				= NULL,
 	.confchg_fn					= evt_conf_change,
 	.confchg_fn					= evt_conf_change,
 	.sync_init					= evt_sync_init,
 	.sync_init					= evt_sync_init,
@@ -234,10 +228,10 @@ struct openais_service_handler evt_service_handler = {
 	.sync_abort					= evt_sync_abort
 	.sync_abort					= evt_sync_abort
 };
 };
 
 
-static struct openais_service_handler *evt_get_handler_ver0(void);
+static struct corosync_service_engine *evt_get_engine_ver0(void);
 
 
-static struct openais_service_handler_iface_ver0 evt_service_handler_iface = {
-	.openais_get_service_handler_ver0		= evt_get_handler_ver0
+static struct corosync_service_engine_iface_ver0 evt_service_engine_iface = {
+	.corosync_get_service_engine_ver0		= evt_get_engine_ver0
 };
 };
 
 
 static struct lcr_iface openais_evt_ver0[1] = {
 static struct lcr_iface openais_evt_ver0[1] = {
@@ -259,13 +253,13 @@ static struct lcr_comp evt_comp_ver0 = {
 	.ifaces					= openais_evt_ver0
 	.ifaces					= openais_evt_ver0
 };
 };
 
 
-static struct openais_service_handler *evt_get_handler_ver0(void)
+static struct corosync_service_engine *evt_get_engine_ver0(void)
 {
 {
-	return (&evt_service_handler);
+	return (&evt_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void evt_comp_register (void) {
 __attribute__ ((constructor)) static void evt_comp_register (void) {
-	lcr_interfaces_set (&openais_evt_ver0[0], &evt_service_handler_iface);
+	lcr_interfaces_set (&openais_evt_ver0[0], &evt_service_engine_iface);
 
 
 	lcr_component_register (&evt_comp_ver0);
 	lcr_component_register (&evt_comp_ver0);
 }
 }
@@ -457,7 +451,7 @@ struct open_chan_pending {
 	mar_name_t			ocp_chan_name;
 	mar_name_t			ocp_chan_name;
 	void				*ocp_conn;
 	void				*ocp_conn;
 	mar_evtchannelopenflags_t	ocp_open_flag;
 	mar_evtchannelopenflags_t	ocp_open_flag;
-	timer_handle		ocp_timer_handle;
+	corosync_timer_handle_t		ocp_timer_handle;
 	uint64_t			ocp_c_handle;
 	uint64_t			ocp_c_handle;
 	uint64_t			ocp_serial_no;
 	uint64_t			ocp_serial_no;
 	struct list_head	ocp_entry;
 	struct list_head	ocp_entry;
@@ -625,7 +619,7 @@ struct event_svr_channel_instance {
 struct event_data {
 struct event_data {
 	uint32_t							ed_ref_count;
 	uint32_t							ed_ref_count;
 	struct list_head					ed_retained;
 	struct list_head					ed_retained;
-	timer_handle						ed_timer_handle;
+	corosync_timer_handle_t						ed_timer_handle;
 	struct event_svr_channel_open		**ed_delivered;
 	struct event_svr_channel_open		**ed_delivered;
 	uint32_t							ed_delivered_count;
 	uint32_t							ed_delivered_count;
 	uint32_t							ed_delivered_next;
 	uint32_t							ed_delivered_next;
@@ -767,9 +761,21 @@ static SaAisErrorT evtfilt_to_aisfilt(struct req_evt_event_subscribe *req,
 	return SA_AIS_OK;
 	return SA_AIS_OK;
 }
 }
 
 
-/*
- * Free up filter data
- */
+SaTimeT clust_time_now(void)
+{
+	struct timeval tv;
+	SaTimeT time_now;
+
+	if (gettimeofday(&tv, 0)) {
+		return 0ULL;
+	}
+
+	time_now = (SaTimeT)(tv.tv_sec) * 1000000000ULL;
+	time_now += (SaTimeT)(tv.tv_usec) * 1000ULL;
+
+	return time_now;
+}
+
 static void free_filters(mar_evt_event_filter_array_t *fp)
 static void free_filters(mar_evt_event_filter_array_t *fp)
 {
 {
 	int i;
 	int i;
@@ -913,7 +919,7 @@ static struct open_count* find_open_count(
 	}
 	}
 	log_printf(LOG_LEVEL_DEBUG,
 	log_printf(LOG_LEVEL_DEBUG,
 			"find_open_count: node id %s not found\n",
 			"find_open_count: node id %s not found\n",
-			totempg_ifaces_print (node_id));
+			api->totem_ifaces_print (node_id));
 	return 0;
 	return 0;
 }
 }
 
 
@@ -930,7 +936,7 @@ static void dump_chan_opens(struct event_svr_channel_instance *eci)
 			break;
 			break;
 		}
 		}
 		log_printf(LOG_LEVEL_NOTICE, "Node %s, count %d\n",
 		log_printf(LOG_LEVEL_NOTICE, "Node %s, count %d\n",
-			totempg_ifaces_print (eci->esc_node_opens[i].oc_node_id),
+			api->totem_ifaces_print (eci->esc_node_opens[i].oc_node_id),
 			eci->esc_node_opens[i].oc_open_count);
 			eci->esc_node_opens[i].oc_open_count);
 	}
 	}
 }
 }
@@ -989,7 +995,7 @@ static int set_open_count(struct event_svr_channel_instance *eci,
 	if (oc) {
 	if (oc) {
 		log_printf(RECOVERY_DEBUG,
 		log_printf(RECOVERY_DEBUG,
 			"Set count: Chan %s for node %s, was %d, now %d\n",
 			"Set count: Chan %s for node %s, was %d, now %d\n",
-			eci->esc_channel_name.value, totempg_ifaces_print (node_id),
+			eci->esc_channel_name.value, api->totem_ifaces_print (node_id),
 			oc->oc_open_count, open_count);
 			oc->oc_open_count, open_count);
 
 
 		eci->esc_total_opens -= oc->oc_open_count;
 		eci->esc_total_opens -= oc->oc_open_count;
@@ -1159,7 +1165,7 @@ static void unlink_channel(struct event_svr_channel_instance *eci,
 		edp = list_entry(l, struct event_data, ed_retained);
 		edp = list_entry(l, struct event_data, ed_retained);
 		if ((edp->ed_my_chan == eci) &&
 		if ((edp->ed_my_chan == eci) &&
 				(edp->ed_event.led_chan_unlink_id == EVT_CHAN_ACTIVE)) {
 				(edp->ed_event.led_chan_unlink_id == EVT_CHAN_ACTIVE)) {
-			openais_timer_delete(edp->ed_timer_handle);
+			api->timer_delete(edp->ed_timer_handle);
 			edp->ed_event.led_retention_time = 0;
 			edp->ed_event.led_retention_time = 0;
 			list_del(&edp->ed_retained);
 			list_del(&edp->ed_retained);
 			list_init(&edp->ed_retained);
 			list_init(&edp->ed_retained);
@@ -1194,8 +1200,8 @@ static int remove_open_count(
 		}
 		}
 
 
 		log_printf(RECOVERY_DEBUG, "roc: %s/%s, t %d, oc %d\n",
 		log_printf(RECOVERY_DEBUG, "roc: %s/%s, t %d, oc %d\n",
-			totempg_ifaces_print (node_id),
-			totempg_ifaces_print (eci->esc_node_opens[i].oc_node_id),
+			api->totem_ifaces_print (node_id),
+			api->totem_ifaces_print (eci->esc_node_opens[i].oc_node_id),
 			eci->esc_total_opens, eci->esc_node_opens[i].oc_open_count);
 			eci->esc_total_opens, eci->esc_node_opens[i].oc_open_count);
 
 
 		if (eci->esc_node_opens[i].oc_node_id == node_id) {
 		if (eci->esc_node_opens[i].oc_node_id == node_id) {
@@ -1262,8 +1268,7 @@ static SaAisErrorT evt_open_channel(mar_name_t *cn, SaUint8T flgs)
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_len = cpkt.chc_head.size;
 	chn_iovec.iov_len = cpkt.chc_head.size;
 	log_printf(CHAN_OPEN_DEBUG, "evt_open_channel: Send open mcast\n");
 	log_printf(CHAN_OPEN_DEBUG, "evt_open_channel: Send open mcast\n");
-	res = totempg_groups_mcast_joined(openais_group_handle,
-			&chn_iovec, 1, TOTEMPG_AGREED);
+	res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 	log_printf(CHAN_OPEN_DEBUG, "evt_open_channel: Open mcast result: %d\n",
 	log_printf(CHAN_OPEN_DEBUG, "evt_open_channel: Open mcast result: %d\n",
 				res);
 				res);
 	if (res != 0) {
 	if (res != 0) {
@@ -1300,8 +1305,7 @@ static SaAisErrorT evt_close_channel(mar_name_t *cn, uint64_t unlink_id)
 	cpkt.u.chcu.chcu_unlink_id = unlink_id;
 	cpkt.u.chcu.chcu_unlink_id = unlink_id;
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_len = cpkt.chc_head.size;
 	chn_iovec.iov_len = cpkt.chc_head.size;
-	res = totempg_groups_mcast_joined(openais_group_handle,
-			&chn_iovec, 1, TOTEMPG_AGREED);
+	res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 	if (res != 0) {
 	if (res != 0) {
 			ret = SA_AIS_ERR_LIBRARY;
 			ret = SA_AIS_ERR_LIBRARY;
 	}
 	}
@@ -1413,7 +1417,7 @@ static struct member_node_data* oldest_node()
 		if (!mn || (mn->mn_started == 0)) {
 		if (!mn || (mn->mn_started == 0)) {
 			log_printf(LOG_LEVEL_ERROR,
 			log_printf(LOG_LEVEL_ERROR,
 				"Transitional config Node %s not active\n",
 				"Transitional config Node %s not active\n",
-				totempg_ifaces_print (trans_member_list[i]));
+				api->totem_ifaces_print (trans_member_list[i]));
 			continue;
 			continue;
 		}
 		}
 		if ((oldest == NULL) ||
 		if ((oldest == NULL) ||
@@ -1444,18 +1448,18 @@ static int check_last_event(
 	struct member_node_data *nd;
 	struct member_node_data *nd;
 	SaClmClusterNodeT *cn;
 	SaClmClusterNodeT *cn;
 
 
-
+#ifdef TODO
 	nd = evt_find_node(nodeid);
 	nd = evt_find_node(nodeid);
 	if (!nd) {
 	if (!nd) {
 		log_printf(LOG_LEVEL_DEBUG,
 		log_printf(LOG_LEVEL_DEBUG,
 				"Node ID %s not found for event %llx\n",
 				"Node ID %s not found for event %llx\n",
-				totempg_ifaces_print (evtpkt->led_publisher_node_id),
+				api->totem_ifaces_print (evtpkt->led_publisher_node_id),
 				(unsigned long long)evtpkt->led_event_id);
 				(unsigned long long)evtpkt->led_event_id);
 		cn = main_clm_get_by_nodeid(nodeid);
 		cn = main_clm_get_by_nodeid(nodeid);
 		if (!cn) {
 		if (!cn) {
 			log_printf(LOG_LEVEL_DEBUG,
 			log_printf(LOG_LEVEL_DEBUG,
 					"Cluster Node 0x%s not found for event %llx\n",
 					"Cluster Node 0x%s not found for event %llx\n",
-				totempg_ifaces_print (evtpkt->led_publisher_node_id),
+				api->totem_ifaces_print (evtpkt->led_publisher_node_id),
 				(unsigned long long)evtpkt->led_event_id);
 				(unsigned long long)evtpkt->led_event_id);
 		} else {
 		} else {
 			evt_add_node(nodeid, cn);
 			evt_add_node(nodeid, cn);
@@ -1471,6 +1475,7 @@ static int check_last_event(
 		nd->mn_last_msg_id = evtpkt->led_msg_id;
 		nd->mn_last_msg_id = evtpkt->led_msg_id;
 		return 0;
 		return 0;
 	}
 	}
+	#endif
 	return 1;
 	return 1;
 }
 }
 
 
@@ -1580,7 +1585,7 @@ clear_retention_time(mar_evteventid_t event_id)
 		log_printf(RETENTION_TIME_DEBUG,
 		log_printf(RETENTION_TIME_DEBUG,
 							"Clear retention time for Event ID %llx\n",
 							"Clear retention time for Event ID %llx\n",
 				(unsigned long long)edp->ed_event.led_event_id);
 				(unsigned long long)edp->ed_event.led_event_id);
-		openais_timer_delete(edp->ed_timer_handle);
+		api->timer_delete(edp->ed_timer_handle);
 		edp->ed_event.led_retention_time = 0;
 		edp->ed_event.led_retention_time = 0;
 		list_del(&edp->ed_retained);
 		list_del(&edp->ed_retained);
 		list_init(&edp->ed_retained);
 		list_init(&edp->ed_retained);
@@ -1782,7 +1787,7 @@ filter_undelivered_events(struct event_svr_channel_open *op_chan)
 	struct list_head *l1, *l2;
 	struct list_head *l1, *l2;
 	int i;
 	int i;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(op_chan->eco_conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(op_chan->eco_conn);
 	eci = op_chan->eco_channel;
 	eci = op_chan->eco_channel;
 
 
 	/*
 	/*
@@ -1860,13 +1865,13 @@ static void __notify_event(void	*conn)
 	struct res_evt_event_data res;
 	struct res_evt_event_data res;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 	log_printf(LOG_LEVEL_DEBUG, "DELIVER: notify\n");
 	log_printf(LOG_LEVEL_DEBUG, "DELIVER: notify\n");
 	if (esip->esi_nevents != 0) {
 	if (esip->esi_nevents != 0) {
 		res.evd_head.size = sizeof(res);
 		res.evd_head.size = sizeof(res);
 		res.evd_head.id = MESSAGE_RES_EVT_AVAILABLE;
 		res.evd_head.id = MESSAGE_RES_EVT_AVAILABLE;
 		res.evd_head.error = SA_AIS_OK;
 		res.evd_head.error = SA_AIS_OK;
-		openais_conn_send_response(openais_conn_partner_get(conn),
+		api->ipc_conn_send_response(api->ipc_conn_partner_get(conn),
 				&res, sizeof(res));
 				&res, sizeof(res));
 	}
 	}
 
 
@@ -1875,7 +1880,7 @@ inline void notify_event(void *conn)
 {
 {
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 	/*
 	/*
 	 * Give the library a kick if there aren't already
 	 * Give the library a kick if there aren't already
@@ -1902,7 +1907,7 @@ deliver_event(struct event_data *evt,
 	int i;
 	int i;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(eco->eco_conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(eco->eco_conn);
 
 
 	if (evt_prio > SA_EVT_LOWEST_PRIORITY) {
 	if (evt_prio > SA_EVT_LOWEST_PRIORITY) {
 		evt_prio = SA_EVT_LOWEST_PRIORITY;
 		evt_prio = SA_EVT_LOWEST_PRIORITY;
@@ -2116,7 +2121,7 @@ static void retain_event(struct event_data *evt)
 	evt->ed_my_chan->esc_retained_count++;
 	evt->ed_my_chan->esc_retained_count++;
 	list_add_tail(&evt->ed_retained, &retained_list);
 	list_add_tail(&evt->ed_retained, &retained_list);
 
 
-	ret = openais_timer_add_duration (
+	ret = api->timer_add_duration (
 		evt->ed_event.led_retention_time,
 		evt->ed_event.led_retention_time,
 		evt,
 		evt,
 		event_retention_timeout,
 		event_retention_timeout,
@@ -2180,7 +2185,7 @@ static int evt_lib_init(void *conn)
 	struct libevt_pd *libevt_pd;
 	struct libevt_pd *libevt_pd;
 	int i;
 	int i;
 
 
-	libevt_pd = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	libevt_pd = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 
 
 	log_printf(LOG_LEVEL_DEBUG, "saEvtInitialize request.\n");
 	log_printf(LOG_LEVEL_DEBUG, "saEvtInitialize request.\n");
@@ -2260,7 +2265,7 @@ static void lib_evt_open_channel(void *conn, void *message)
 	ocp->ocp_serial_no = open_serial_no;
 	ocp->ocp_serial_no = open_serial_no;
 	list_init(&ocp->ocp_entry);
 	list_init(&ocp->ocp_entry);
 	list_add_tail(&ocp->ocp_entry, &open_pending);
 	list_add_tail(&ocp->ocp_entry, &open_pending);
-	ret = openais_timer_add_duration (
+	ret = api->timer_add_duration (
 		req->ico_timeout,
 		req->ico_timeout,
 		ocp,
 		ocp,
 		chan_open_timeout,
 		chan_open_timeout,
@@ -2277,7 +2282,7 @@ open_return:
 	res.ico_head.size = sizeof(res);
 	res.ico_head.size = sizeof(res);
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.error = error;
 	res.ico_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2334,7 +2339,7 @@ open_return:
 	res.ico_head.size = sizeof(res);
 	res.ico_head.size = sizeof(res);
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.error = error;
 	res.ico_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 
 
@@ -2401,7 +2406,7 @@ static void lib_evt_close_channel(void *conn, void *message)
 	void *ptr;
 	void *ptr;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 	req = message;
 	req = message;
 
 
@@ -2427,7 +2432,7 @@ chan_close_done:
 	res.icc_head.size = sizeof(res);
 	res.icc_head.size = sizeof(res);
 	res.icc_head.id = MESSAGE_RES_EVT_CLOSE_CHANNEL;
 	res.icc_head.id = MESSAGE_RES_EVT_CLOSE_CHANNEL;
 	res.icc_head.error = ((ret == 0) ? SA_AIS_OK : SA_AIS_ERR_BAD_HANDLE);
 	res.icc_head.error = ((ret == 0) ? SA_AIS_OK : SA_AIS_ERR_BAD_HANDLE);
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2486,8 +2491,7 @@ static void lib_evt_unlink_channel(void *conn, void *message)
 	cpkt.u.chcu.chcu_unlink_id = ucp->ucp_unlink_id;
 	cpkt.u.chcu.chcu_unlink_id = ucp->ucp_unlink_id;
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_base = (char *)&cpkt;
 	chn_iovec.iov_len = cpkt.chc_head.size;
 	chn_iovec.iov_len = cpkt.chc_head.size;
-	if (totempg_groups_mcast_joined(openais_group_handle,
-								&chn_iovec, 1, TOTEMPG_AGREED) == 0) {
+	if (api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED) == 0) {
 		return;
 		return;
 	}
 	}
 
 
@@ -2499,7 +2503,7 @@ evt_unlink_err:
 	res.iuc_head.size = sizeof(res);
 	res.iuc_head.size = sizeof(res);
 	res.iuc_head.id = MESSAGE_RES_EVT_UNLINK_CHANNEL;
 	res.iuc_head.id = MESSAGE_RES_EVT_UNLINK_CHANNEL;
 	res.iuc_head.error = error;
 	res.iuc_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2539,7 +2543,7 @@ static void lib_evt_event_subscribe(void *conn, void *message)
 	int i;
 	int i;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 	req = message;
 	req = message;
 
 
@@ -2603,7 +2607,7 @@ static void lib_evt_event_subscribe(void *conn, void *message)
 	res.ics_head.size = sizeof(res);
 	res.ics_head.size = sizeof(res);
 	res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE;
 	res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE;
 	res.ics_head.error = error;
 	res.ics_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 
 
 	/*
 	/*
 	 * See if an existing event with a retention time
 	 * See if an existing event with a retention time
@@ -2636,7 +2640,7 @@ subr_done:
 	res.ics_head.size = sizeof(res);
 	res.ics_head.size = sizeof(res);
 	res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE;
 	res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE;
 	res.ics_head.error = error;
 	res.ics_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2654,7 +2658,7 @@ static void lib_evt_event_unsubscribe(void *conn, void *message)
 	void *ptr;
 	void *ptr;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 	req = message;
 	req = message;
 
 
@@ -2703,7 +2707,7 @@ unsubr_done:
 	res.icu_head.size = sizeof(res);
 	res.icu_head.size = sizeof(res);
 	res.icu_head.id = MESSAGE_RES_EVT_UNSUBSCRIBE;
 	res.icu_head.id = MESSAGE_RES_EVT_UNSUBSCRIBE;
 	res.icu_head.error = error;
 	res.icu_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2724,7 +2728,7 @@ static void lib_evt_event_publish(void *conn, void *message)
 	unsigned int ret;
 	unsigned int ret;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 
 
 	req = message;
 	req = message;
@@ -2764,7 +2768,7 @@ static void lib_evt_event_publish(void *conn, void *message)
 	 */
 	 */
 	pub_iovec.iov_base = (char *)req;
 	pub_iovec.iov_base = (char *)req;
 	pub_iovec.iov_len = req->led_head.size;
 	pub_iovec.iov_len = req->led_head.size;
-	result = totempg_groups_mcast_joined(openais_group_handle, &pub_iovec, 1, TOTEMPG_AGREED);
+	result = api->totem_mcast (&pub_iovec, 1, TOTEM_AGREED);
 	if (result != 0) {
 	if (result != 0) {
 			error = SA_AIS_ERR_LIBRARY;
 			error = SA_AIS_ERR_LIBRARY;
 	}
 	}
@@ -2775,7 +2779,7 @@ pub_done:
 	res.iep_head.id = MESSAGE_RES_EVT_PUBLISH;
 	res.iep_head.id = MESSAGE_RES_EVT_PUBLISH;
 	res.iep_head.error = error;
 	res.iep_head.error = error;
 	res.iep_event_id = event_id;
 	res.iep_event_id = event_id;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -2823,8 +2827,7 @@ static void lib_evt_event_clear_retentiontime(void *conn, void *message)
 	cpkt.u.chc_event_id = req->iec_event_id;
 	cpkt.u.chc_event_id = req->iec_event_id;
 	rtn_iovec.iov_base = (char *)&cpkt;
 	rtn_iovec.iov_base = (char *)&cpkt;
 	rtn_iovec.iov_len = cpkt.chc_head.size;
 	rtn_iovec.iov_len = cpkt.chc_head.size;
-	ret = totempg_groups_mcast_joined(openais_group_handle,
-			&rtn_iovec, 1, TOTEMPG_AGREED);
+	ret = api->totem_mcast (&rtn_iovec, 1, TOTEM_AGREED);
 	if (ret == 0) {
 	if (ret == 0) {
 		// TODO this should really assert
 		// TODO this should really assert
 		return;
 		return;
@@ -2839,7 +2842,7 @@ evt_ret_clr_err:
 	res.iec_head.size = sizeof(res);
 	res.iec_head.size = sizeof(res);
 	res.iec_head.id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME;
 	res.iec_head.id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME;
 	res.iec_head.error = error;
 	res.iec_head.error = error;
-	openais_conn_send_response(conn, &res, sizeof(res));
+	api->ipc_conn_send_response(conn, &res, sizeof(res));
 
 
 }
 }
 
 
@@ -2854,7 +2857,7 @@ static void lib_evt_event_data_get(void *conn, void *message)
 	int i;
 	int i;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(conn);
 
 
 
 
 	/*
 	/*
@@ -2878,7 +2881,7 @@ static void lib_evt_event_data_get(void *conn, void *message)
 			edp->ed_event.led_head.id = MESSAGE_RES_EVT_EVENT_DATA;
 			edp->ed_event.led_head.id = MESSAGE_RES_EVT_EVENT_DATA;
 			edp->ed_event.led_head.error = SA_AIS_OK;
 			edp->ed_event.led_head.error = SA_AIS_OK;
 			free(cel);
 			free(cel);
-			openais_conn_send_response(conn, &edp->ed_event,
+			api->ipc_conn_send_response(conn, &edp->ed_event,
 											edp->ed_event.led_head.size);
 											edp->ed_event.led_head.size);
 			free_event_data(edp);
 			free_event_data(edp);
 			goto data_get_done;
 			goto data_get_done;
@@ -2888,7 +2891,7 @@ static void lib_evt_event_data_get(void *conn, void *message)
 	res.led_head.size = sizeof(res.led_head);
 	res.led_head.size = sizeof(res.led_head);
 	res.led_head.id = MESSAGE_RES_EVT_EVENT_DATA;
 	res.led_head.id = MESSAGE_RES_EVT_EVENT_DATA;
 	res.led_head.error = SA_AIS_ERR_NOT_EXIST;
 	res.led_head.error = SA_AIS_ERR_NOT_EXIST;
-	openais_conn_send_response(conn, &res, res.led_head.size);
+	api->ipc_conn_send_response(conn, &res, res.led_head.size);
 
 
 	/*
 	/*
 	 * See if there are any events that the app doesn't know about
 	 * See if there are any events that the app doesn't know about
@@ -3050,7 +3053,7 @@ static int evt_lib_exit(void *conn)
 	struct unlink_chan_pending *ucp;
 	struct unlink_chan_pending *ucp;
 	struct retention_time_clear_pending *rtc;
 	struct retention_time_clear_pending *rtc;
 	struct libevt_pd *esip =
 	struct libevt_pd *esip =
-		openais_conn_private_data_get(openais_conn_partner_get(conn));
+		api->ipc_private_data_get(api->ipc_conn_partner_get(conn));
 
 
 	log_printf(LOG_LEVEL_DEBUG, "saEvtFinalize (Event exit request)\n");
 	log_printf(LOG_LEVEL_DEBUG, "saEvtFinalize (Event exit request)\n");
 	log_printf(LOG_LEVEL_DEBUG, "saEvtFinalize %d evts on list\n",
 	log_printf(LOG_LEVEL_DEBUG, "saEvtFinalize %d evts on list\n",
@@ -3072,7 +3075,7 @@ static int evt_lib_exit(void *conn)
 	for (l = open_pending.next; l != &open_pending; l = nxt) {
 	for (l = open_pending.next; l != &open_pending; l = nxt) {
 		nxt = l->next;
 		nxt = l->next;
 		ocp = list_entry(l, struct open_chan_pending, ocp_entry);
 		ocp = list_entry(l, struct open_chan_pending, ocp_entry);
-		if (esip == openais_conn_private_data_get(ocp->ocp_conn)) {
+		if (esip == api->ipc_private_data_get(ocp->ocp_conn)) {
 			list_del(&ocp->ocp_entry);
 			list_del(&ocp->ocp_entry);
 			free(ocp);
 			free(ocp);
 		}
 		}
@@ -3081,7 +3084,7 @@ static int evt_lib_exit(void *conn)
 	for (l = unlink_pending.next; l != &unlink_pending; l = nxt) {
 	for (l = unlink_pending.next; l != &unlink_pending; l = nxt) {
 		nxt = l->next;
 		nxt = l->next;
 		ucp = list_entry(l, struct unlink_chan_pending, ucp_entry);
 		ucp = list_entry(l, struct unlink_chan_pending, ucp_entry);
-		if (esip == openais_conn_private_data_get(ucp->ucp_conn)) {
+		if (esip == api->ipc_private_data_get(ucp->ucp_conn)) {
 			list_del(&ucp->ucp_entry);
 			list_del(&ucp->ucp_entry);
 			free(ucp);
 			free(ucp);
 		}
 		}
@@ -3091,7 +3094,7 @@ static int evt_lib_exit(void *conn)
 			l != &clear_pending; l = nxt) {
 			l != &clear_pending; l = nxt) {
 		nxt = l->next;
 		nxt = l->next;
 		rtc = list_entry(l, struct retention_time_clear_pending, rtc_entry);
 		rtc = list_entry(l, struct retention_time_clear_pending, rtc_entry);
-		if (esip == openais_conn_private_data_get(rtc->rtc_conn)) {
+		if (esip == api->ipc_private_data_get(rtc->rtc_conn)) {
 			list_del(&rtc->rtc_entry);
 			list_del(&rtc->rtc_entry);
 			free(rtc);
 			free(rtc);
 		}
 		}
@@ -3108,22 +3111,24 @@ static int evt_lib_exit(void *conn)
 /*
 /*
  * Called at service start time.
  * Called at service start time.
  */
  */
-static int evt_exec_init(struct objdb_iface_ver0 *objdb)
+static int evt_exec_init(struct corosync_api_v1 *corosync_api)
 {
 {
 	unsigned int object_service_handle;
 	unsigned int object_service_handle;
 	char *value;
 	char *value;
 
 
+	api = corosync_api;
+
 	log_printf(LOG_LEVEL_DEBUG, "Evt exec init request\n");
 	log_printf(LOG_LEVEL_DEBUG, "Evt exec init request\n");
 
 
-	objdb->object_find_reset (OBJECT_PARENT_HANDLE);
-	if (objdb->object_find (
+	api->object_find_reset (OBJECT_PARENT_HANDLE);
+	if (api->object_find (
 		    OBJECT_PARENT_HANDLE,
 		    OBJECT_PARENT_HANDLE,
 		    "event",
 		    "event",
 		    strlen ("event"),
 		    strlen ("event"),
 		    &object_service_handle) == 0) {
 		    &object_service_handle) == 0) {
 
 
 		value = NULL;
 		value = NULL;
-		if ( !objdb->object_key_get (object_service_handle,
+		if ( !api->object_key_get (object_service_handle,
 					     "delivery_queue_size",
 					     "delivery_queue_size",
 					     strlen ("delivery_queue_size"),
 					     strlen ("delivery_queue_size"),
 					     (void *)&value,
 					     (void *)&value,
@@ -3134,7 +3139,7 @@ static int evt_exec_init(struct objdb_iface_ver0 *objdb)
 				   evt_delivery_queue_size);
 				   evt_delivery_queue_size);
 		}
 		}
 		value = NULL;
 		value = NULL;
-		if ( !objdb->object_key_get (object_service_handle,
+		if ( !api->object_key_get (object_service_handle,
 					     "delivery_queue_resume",
 					     "delivery_queue_resume",
 					     strlen ("delivery_queue_resume"),
 					     strlen ("delivery_queue_resume"),
 					     (void *)&value,
 					     (void *)&value,
@@ -3231,28 +3236,30 @@ static void evt_remote_evt(void *msg, unsigned int nodeid)
 	SaClmClusterNodeT *cn;
 	SaClmClusterNodeT *cn;
 
 
 	log_printf(LOG_LEVEL_DEBUG, "Remote event data received from nodeid %s\n",
 	log_printf(LOG_LEVEL_DEBUG, "Remote event data received from nodeid %s\n",
-			totempg_ifaces_print (nodeid));
+			api->totem_ifaces_print (nodeid));
 
 
 	/*
 	/*
 	 * See where the message came from so that we can set the
 	 * See where the message came from so that we can set the
 	 * publishing node id in the message before delivery.
 	 * publishing node id in the message before delivery.
 	 */
 	 */
+#ifdef TODO 
 	cn = main_clm_get_by_nodeid(nodeid);
 	cn = main_clm_get_by_nodeid(nodeid);
 	if (!cn) {
 	if (!cn) {
 			/*
 			/*
 			 * Not sure how this can happen...
 			 * Not sure how this can happen...
 			 */
 			 */
 			log_printf(LOG_LEVEL_DEBUG, "No cluster node data for nodeid %s\n",
 			log_printf(LOG_LEVEL_DEBUG, "No cluster node data for nodeid %s\n",
-				totempg_ifaces_print (nodeid));
+				api->totem_ifaces_print (nodeid));
 			errno = ENXIO;
 			errno = ENXIO;
 			return;
 			return;
 	}
 	}
 	log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
 	log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
-					totempg_ifaces_print (cn->nodeId), cn->nodeName.value);
+					api->totem_ifaces_print (cn->nodeId), cn->nodeName.value);
 
 
 	evtpkt->led_publisher_node_id = nodeid;
 	evtpkt->led_publisher_node_id = nodeid;
 	evtpkt->led_nodeid = nodeid;
 	evtpkt->led_nodeid = nodeid;
 	evtpkt->led_receive_time = clust_time_now();
 	evtpkt->led_receive_time = clust_time_now();
+#endif
 
 
 	if (evtpkt->led_chan_unlink_id != EVT_CHAN_ACTIVE) {
 	if (evtpkt->led_chan_unlink_id != EVT_CHAN_ACTIVE) {
 		log_printf(CHAN_UNLINK_DEBUG,
 		log_printf(CHAN_UNLINK_DEBUG,
@@ -3388,11 +3395,11 @@ static void evt_remote_recovery_evt(void *msg, unsigned int nodeid)
 				 * Not sure how this can happen
 				 * Not sure how this can happen
 				 */
 				 */
 				log_printf(LOG_LEVEL_NOTICE, "No node for nodeid %s\n",
 				log_printf(LOG_LEVEL_NOTICE, "No node for nodeid %s\n",
-						totempg_ifaces_print (evtpkt->led_nodeid));
+						api->totem_ifaces_print (evtpkt->led_nodeid));
 				return;
 				return;
 		}
 		}
 		log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
 		log_printf(LOG_LEVEL_DEBUG, "Cluster node ID %s name %s\n",
-						totempg_ifaces_print (md->mn_node_info.nodeId),
+						api->totem_ifaces_print (md->mn_node_info.nodeId),
 						md->mn_node_info.nodeName.value);
 						md->mn_node_info.nodeName.value);
 
 
 		log_printf(CHAN_UNLINK_DEBUG,
 		log_printf(CHAN_UNLINK_DEBUG,
@@ -3442,7 +3449,7 @@ static void chan_open_timeout(void *data)
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 	res.ico_head.error = SA_AIS_ERR_TIMEOUT;
 	res.ico_head.error = SA_AIS_ERR_TIMEOUT;
 	ocp->ocp_invocation = OPEN_TIMED_OUT;
 	ocp->ocp_invocation = OPEN_TIMED_OUT;
-	openais_conn_send_response(ocp->ocp_conn, &res, sizeof(res));
+	api->ipc_conn_send_response(ocp->ocp_conn, &res, sizeof(res));
 }
 }
 
 
 /*
 /*
@@ -3460,12 +3467,12 @@ static void evt_chan_open_finish(struct open_chan_pending *ocp,
 	uint32_t handle = 0;
 	uint32_t handle = 0;
 	struct libevt_pd *esip;
 	struct libevt_pd *esip;
 
 
-	esip = (struct libevt_pd *)openais_conn_private_data_get(ocp->ocp_conn);
+	esip = (struct libevt_pd *)api->ipc_private_data_get(ocp->ocp_conn);
 
 
 	log_printf(CHAN_OPEN_DEBUG, "Open channel finish %s\n",
 	log_printf(CHAN_OPEN_DEBUG, "Open channel finish %s\n",
 											get_mar_name_t(&ocp->ocp_chan_name));
 											get_mar_name_t(&ocp->ocp_chan_name));
 	if (ocp->ocp_timer_handle) {
 	if (ocp->ocp_timer_handle) {
-		openais_timer_delete (ocp->ocp_timer_handle);
+		api->timer_delete (ocp->ocp_timer_handle);
 	}
 	}
 
 
 	/*
 	/*
@@ -3532,7 +3539,7 @@ open_return:
 		resa.ica_channel_handle = handle;
 		resa.ica_channel_handle = handle;
 		resa.ica_c_handle = ocp->ocp_c_handle;
 		resa.ica_c_handle = ocp->ocp_c_handle;
 		resa.ica_invocation = ocp->ocp_invocation;
 		resa.ica_invocation = ocp->ocp_invocation;
-		openais_conn_send_response(openais_conn_partner_get(ocp->ocp_conn),
+		api->ipc_conn_send_response(api->ipc_conn_partner_get(ocp->ocp_conn),
 				&resa, sizeof(resa));
 				&resa, sizeof(resa));
 	} else {
 	} else {
 		struct res_evt_channel_open res;
 		struct res_evt_channel_open res;
@@ -3540,7 +3547,7 @@ open_return:
 		res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 		res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL;
 		res.ico_head.error = (ret == 0 ? SA_AIS_OK : SA_AIS_ERR_BAD_HANDLE);
 		res.ico_head.error = (ret == 0 ? SA_AIS_OK : SA_AIS_ERR_BAD_HANDLE);
 		res.ico_channel_handle = handle;
 		res.ico_channel_handle = handle;
-		openais_conn_send_response(ocp->ocp_conn, &res, sizeof(res));
+		api->ipc_conn_send_response(ocp->ocp_conn, &res, sizeof(res));
 	}
 	}
 
 
 	if (timer_del_status == 0) {
 	if (timer_del_status == 0) {
@@ -3565,7 +3572,7 @@ static void evt_chan_unlink_finish(struct unlink_chan_pending *ucp)
 	res.iuc_head.size = sizeof(res);
 	res.iuc_head.size = sizeof(res);
 	res.iuc_head.id = MESSAGE_RES_EVT_UNLINK_CHANNEL;
 	res.iuc_head.id = MESSAGE_RES_EVT_UNLINK_CHANNEL;
 	res.iuc_head.error = SA_AIS_OK;
 	res.iuc_head.error = SA_AIS_OK;
-	openais_conn_send_response(ucp->ucp_conn, &res, sizeof(res));
+	api->ipc_conn_send_response(ucp->ucp_conn, &res, sizeof(res));
 
 
 	free(ucp);
 	free(ucp);
 }
 }
@@ -3585,7 +3592,7 @@ static void evt_ret_time_clr_finish(struct retention_time_clear_pending *rtc,
 	res.iec_head.size = sizeof(res);
 	res.iec_head.size = sizeof(res);
 	res.iec_head.id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME;
 	res.iec_head.id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME;
 	res.iec_head.error = ret;
 	res.iec_head.error = ret;
-	openais_conn_send_response(rtc->rtc_conn, &res, sizeof(res));
+	api->ipc_conn_send_response(rtc->rtc_conn, &res, sizeof(res));
 
 
 	list_del(&rtc->rtc_entry);
 	list_del(&rtc->rtc_entry);
 	free(rtc);
 	free(rtc);
@@ -3670,6 +3677,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 	struct member_node_data *mn;
 	struct member_node_data *mn;
 	struct event_svr_channel_instance *eci;
 	struct event_svr_channel_instance *eci;
 
 
+#ifdef TODO
 	log_printf(REMOTE_OP_DEBUG, "Remote channel operation request\n");
 	log_printf(REMOTE_OP_DEBUG, "Remote channel operation request\n");
 	my_node = main_clm_get_by_nodeid(local_node);
 	my_node = main_clm_get_by_nodeid(local_node);
 	log_printf(REMOTE_OP_DEBUG, "my node ID: 0x%x\n", my_node->nodeId);
 	log_printf(REMOTE_OP_DEBUG, "my node ID: 0x%x\n", my_node->nodeId);
@@ -3687,6 +3695,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 			mn = evt_find_node(nodeid);
 			mn = evt_find_node(nodeid);
 		}
 		}
 	}
 	}
+#endif
 
 
 	switch (cpkt->chc_op) {
 	switch (cpkt->chc_op) {
 		/*
 		/*
@@ -3705,7 +3714,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 
 
 		log_printf(CHAN_OPEN_DEBUG, "Opening channel %s for node %s\n",
 		log_printf(CHAN_OPEN_DEBUG, "Opening channel %s for node %s\n",
 						cpkt->u.chc_chan.ocr_name.value,
 						cpkt->u.chc_chan.ocr_name.value,
-						totempg_ifaces_print (mn->mn_node_info.nodeId));
+						api->totem_ifaces_print (mn->mn_node_info.nodeId));
 		eci = find_channel(&cpkt->u.chc_chan.ocr_name, EVT_CHAN_ACTIVE);
 		eci = find_channel(&cpkt->u.chc_chan.ocr_name, EVT_CHAN_ACTIVE);
 
 
 		if (!eci) {
 		if (!eci) {
@@ -3875,13 +3884,13 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 			nodeid,
 			nodeid,
 			(unsigned long long)cpkt->u.chc_set_id.chc_last_id,
 			(unsigned long long)cpkt->u.chc_set_id.chc_last_id,
 			cpkt->u.chc_set_id.chc_nodeid,
 			cpkt->u.chc_set_id.chc_nodeid,
-			totempg_ifaces_print (my_node->nodeId),
+			api->totem_ifaces_print (my_node->nodeId),
 			(unsigned long long)base_id);
 			(unsigned long long)base_id);
 		if (cpkt->u.chc_set_id.chc_nodeid == my_node->nodeId) {
 		if (cpkt->u.chc_set_id.chc_nodeid == my_node->nodeId) {
 			if (cpkt->u.chc_set_id.chc_last_id >= base_id) {
 			if (cpkt->u.chc_set_id.chc_last_id >= base_id) {
 				log_printf(RECOVERY_DEBUG,
 				log_printf(RECOVERY_DEBUG,
 					"Set event ID from nodeid %s to %llx\n",
 					"Set event ID from nodeid %s to %llx\n",
-					totempg_ifaces_print (nodeid),
+					api->totem_ifaces_print (nodeid),
 					(unsigned long long)cpkt->u.chc_set_id.chc_last_id);
 					(unsigned long long)cpkt->u.chc_set_id.chc_last_id);
 				base_id = cpkt->u.chc_set_id.chc_last_id + 1;
 				base_id = cpkt->u.chc_set_id.chc_last_id + 1;
 			}
 			}
@@ -3898,7 +3907,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 		if (recovery_phase == evt_recovery_complete) {
 		if (recovery_phase == evt_recovery_complete) {
 			log_printf(LOG_LEVEL_ERROR,
 			log_printf(LOG_LEVEL_ERROR,
 				"Evt open count msg from nodeid %s, but not in membership change\n",
 				"Evt open count msg from nodeid %s, but not in membership change\n",
-				totempg_ifaces_print (nodeid));
+				api->totem_ifaces_print (nodeid));
 		}
 		}
 
 
 		/*
 		/*
@@ -3913,7 +3922,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 				"Open channel count %s is %d for node %s\n",
 				"Open channel count %s is %d for node %s\n",
 				cpkt->u.chc_set_opens.chc_chan_name.value,
 				cpkt->u.chc_set_opens.chc_chan_name.value,
 				cpkt->u.chc_set_opens.chc_open_count,
 				cpkt->u.chc_set_opens.chc_open_count,
-				totempg_ifaces_print (mn->mn_node_info.nodeId));
+				api->totem_ifaces_print (mn->mn_node_info.nodeId));
 
 
 		eci = find_channel(&cpkt->u.chc_set_opens.chc_chan_name,
 		eci = find_channel(&cpkt->u.chc_set_opens.chc_chan_name,
 					EVT_CHAN_ACTIVE);
 					EVT_CHAN_ACTIVE);
@@ -3930,7 +3939,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 			log_printf(LOG_LEVEL_ERROR,
 			log_printf(LOG_LEVEL_ERROR,
 				"Error setting Open channel count %s for node %s\n",
 				"Error setting Open channel count %s for node %s\n",
 				cpkt->u.chc_set_opens.chc_chan_name.value,
 				cpkt->u.chc_set_opens.chc_chan_name.value,
-				totempg_ifaces_print (mn->mn_node_info.nodeId));
+				api->totem_ifaces_print (mn->mn_node_info.nodeId));
 		}
 		}
 		break;
 		break;
 
 
@@ -3942,14 +3951,14 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 		if (recovery_phase == evt_recovery_complete) {
 		if (recovery_phase == evt_recovery_complete) {
 			log_printf(LOG_LEVEL_ERROR,
 			log_printf(LOG_LEVEL_ERROR,
 				"Evt config msg from nodeid %s, but not in membership change\n",
 				"Evt config msg from nodeid %s, but not in membership change\n",
-				totempg_ifaces_print (nodeid));
+				api->totem_ifaces_print (nodeid));
 		}
 		}
 		log_printf(RECOVERY_DEBUG,
 		log_printf(RECOVERY_DEBUG,
 			"Receive EVT_CONF_CHANGE_DONE from nodeid %s members %d checked in %d\n",
 			"Receive EVT_CONF_CHANGE_DONE from nodeid %s members %d checked in %d\n",
-				totempg_ifaces_print (nodeid), total_member_count, checked_in+1);
+				api->totem_ifaces_print (nodeid), total_member_count, checked_in+1);
 		if (!mn) {
 		if (!mn) {
 			log_printf(RECOVERY_DEBUG,
 			log_printf(RECOVERY_DEBUG,
-				"NO NODE DATA AVAILABLE FOR nodeid %s\n", totempg_ifaces_print (nodeid));
+				"NO NODE DATA AVAILABLE FOR nodeid %s\n", api->totem_ifaces_print (nodeid));
 		}
 		}
 
 
 		if (++checked_in == total_member_count) {
 		if (++checked_in == total_member_count) {
@@ -3980,7 +3989,7 @@ static void evt_remote_chan_op(void *msg, unsigned int nodeid)
 	case EVT_CONF_DONE: {
 	case EVT_CONF_DONE: {
 		log_printf(RECOVERY_DEBUG,
 		log_printf(RECOVERY_DEBUG,
 				"Receive EVT_CONF_DONE from nodeid %s, members %d checked in %d\n",
 				"Receive EVT_CONF_DONE from nodeid %s, members %d checked in %d\n",
-				totempg_ifaces_print (nodeid),
+				api->totem_ifaces_print (nodeid),
 				total_member_count, checked_in+1);
 				total_member_count, checked_in+1);
 		if (++checked_in == total_member_count) {
 		if (++checked_in == total_member_count) {
 			/*
 			/*
@@ -4019,13 +4028,15 @@ static void evt_sync_init(void)
 	/*
 	/*
 	 * Set the base event id
 	 * Set the base event id
 	 */
 	 */
+ #ifdef TODO
 	if (!my_node_id) {
 	if (!my_node_id) {
 		cn = main_clm_get_by_nodeid(my_node);
 		cn = main_clm_get_by_nodeid(my_node);
 		log_printf(RECOVERY_DEBUG, "My node ID %s\n",
 		log_printf(RECOVERY_DEBUG, "My node ID %s\n",
-			totempg_ifaces_print (cn->nodeId));
+			api->totem_ifaces_print (cn->nodeId));
 		my_node_id = cn->nodeId;
 		my_node_id = cn->nodeId;
 		set_event_id(my_node_id);
 		set_event_id(my_node_id);
 	}
 	}
+#endif
 
 
 	/*
 	/*
 	 * account for nodes that left the membership
 	 * account for nodes that left the membership
@@ -4035,13 +4046,13 @@ static void evt_sync_init(void)
 		if (md == 0) {
 		if (md == 0) {
 			log_printf(LOG_LEVEL_WARNING,
 			log_printf(LOG_LEVEL_WARNING,
 					"Can't find cluster node at %s\n",
 					"Can't find cluster node at %s\n",
-							totempg_ifaces_print (*left_list));
+							api->totem_ifaces_print (*left_list));
 		/*
 		/*
 		 * Mark this one as down.
 		 * Mark this one as down.
 		 */
 		 */
 		} else {
 		} else {
 			log_printf(RECOVERY_DEBUG, "cluster node at %s down\n",
 			log_printf(RECOVERY_DEBUG, "cluster node at %s down\n",
-							totempg_ifaces_print(*left_list));
+							api->totem_ifaces_print(*left_list));
 			md->mn_started = 0;
 			md->mn_started = 0;
 			remove_chan_open_info(md->mn_node_info.nodeId);
 			remove_chan_open_info(md->mn_node_info.nodeId);
 		}
 		}
@@ -4129,7 +4140,7 @@ static int evt_sync_process(void)
 				log_printf(RECOVERY_DEBUG,
 				log_printf(RECOVERY_DEBUG,
 					"Send set evt ID %llx to %s\n",
 					"Send set evt ID %llx to %s\n",
 					(unsigned long long)md->mn_last_msg_id,
 					(unsigned long long)md->mn_last_msg_id,
-					totempg_ifaces_print (*add_list));
+					api->totem_ifaces_print (*add_list));
 				md->mn_started = 1;
 				md->mn_started = 1;
 				memset(&cpkt, 0, sizeof(cpkt));
 				memset(&cpkt, 0, sizeof(cpkt));
 				cpkt.chc_head.id =
 				cpkt.chc_head.id =
@@ -4140,12 +4151,11 @@ static int evt_sync_process(void)
 				cpkt.u.chc_set_id.chc_last_id = md->mn_last_msg_id;
 				cpkt.u.chc_set_id.chc_last_id = md->mn_last_msg_id;
 				chn_iovec.iov_base = (char *)&cpkt;
 				chn_iovec.iov_base = (char *)&cpkt;
 				chn_iovec.iov_len = cpkt.chc_head.size;
 				chn_iovec.iov_len = cpkt.chc_head.size;
-				res = totempg_groups_mcast_joined(openais_group_handle,
-						&chn_iovec, 1, TOTEMPG_AGREED);
+				res = api->totem_mcast(&chn_iovec, 1, TOTEM_AGREED);
 				if (res != 0) {
 				if (res != 0) {
 					log_printf(RECOVERY_DEBUG,
 					log_printf(RECOVERY_DEBUG,
 						"Unable to send event id to %s\n",
 						"Unable to send event id to %s\n",
-						totempg_ifaces_print (*add_list));
+						api->totem_ifaces_print (*add_list));
 					/*
 					/*
 					 * We'll try again later.
 					 * We'll try again later.
 					 */
 					 */
@@ -4156,6 +4166,7 @@ static int evt_sync_process(void)
 				/*
 				/*
 				 * Not seen before, add it to our list of nodes.
 				 * Not seen before, add it to our list of nodes.
 				 */
 				 */
+#ifdef TODO
 				cn = main_clm_get_by_nodeid(*add_list);
 				cn = main_clm_get_by_nodeid(*add_list);
 				if (!cn) {
 				if (!cn) {
 					/*
 					/*
@@ -4163,11 +4174,12 @@ static int evt_sync_process(void)
 					 */
 					 */
 					log_printf(LOG_LEVEL_ERROR,
 					log_printf(LOG_LEVEL_ERROR,
 							"recovery error node: %s not found\n",
 							"recovery error node: %s not found\n",
-							totempg_ifaces_print (*add_list));
+							api->totem_ifaces_print (*add_list));
 					assert(0);
 					assert(0);
 				} else {
 				} else {
 					evt_add_node(*add_list, cn);
 					evt_add_node(*add_list, cn);
 				}
 				}
+#endif
 			}
 			}
 
 
 			add_list++;
 			add_list++;
@@ -4207,8 +4219,7 @@ static int evt_sync_process(void)
 			cpkt.u.chc_set_opens.chc_open_count = eci->esc_local_opens;
 			cpkt.u.chc_set_opens.chc_open_count = eci->esc_local_opens;
 			chn_iovec.iov_base = (char *)&cpkt;
 			chn_iovec.iov_base = (char *)&cpkt;
 			chn_iovec.iov_len = cpkt.chc_head.size;
 			chn_iovec.iov_len = cpkt.chc_head.size;
-			res = totempg_groups_mcast_joined(openais_group_handle,
-					&chn_iovec, 1, TOTEMPG_AGREED);
+			res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 
 
 			if (res != 0) {
 			if (res != 0) {
 			/*
 			/*
@@ -4224,8 +4235,7 @@ static int evt_sync_process(void)
 		cpkt.chc_op = EVT_OPEN_COUNT_DONE;
 		cpkt.chc_op = EVT_OPEN_COUNT_DONE;
 		chn_iovec.iov_base = (char *)&cpkt;
 		chn_iovec.iov_base = (char *)&cpkt;
 		chn_iovec.iov_len = cpkt.chc_head.size;
 		chn_iovec.iov_len = cpkt.chc_head.size;
-		res = totempg_groups_mcast_joined(openais_group_handle,
-				&chn_iovec, 1,TOTEMPG_AGREED);
+		res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 		if (res != 0) {
 		if (res != 0) {
 		/*
 		/*
 		 * Try again later.
 		 * Try again later.
@@ -4273,8 +4283,7 @@ static int evt_sync_process(void)
 				SERVICE_ID_MAKE(EVT_SERVICE, MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA);
 				SERVICE_ID_MAKE(EVT_SERVICE, MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA);
 			chn_iovec.iov_base = (char *)&evt->ed_event;
 			chn_iovec.iov_base = (char *)&evt->ed_event;
 			chn_iovec.iov_len = evt->ed_event.led_head.size;
 			chn_iovec.iov_len = evt->ed_event.led_head.size;
-			res = totempg_groups_mcast_joined(openais_group_handle,
-					&chn_iovec, 1, TOTEMPG_AGREED);
+			res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 
 
 			if (res != 0) {
 			if (res != 0) {
 			/*
 			/*
@@ -4302,8 +4311,7 @@ static int evt_sync_process(void)
 		cpkt.chc_op = EVT_CONF_DONE;
 		cpkt.chc_op = EVT_CONF_DONE;
 		chn_iovec.iov_base = (char *)&cpkt;
 		chn_iovec.iov_base = (char *)&cpkt;
 		chn_iovec.iov_len = cpkt.chc_head.size;
 		chn_iovec.iov_len = cpkt.chc_head.size;
-		res = totempg_groups_mcast_joined(openais_group_handle,
-				&chn_iovec, 1, TOTEMPG_AGREED);
+		res = api->totem_mcast (&chn_iovec, 1, TOTEM_AGREED);
 
 
 		recovery_phase = evt_wait_send_retained_events;
 		recovery_phase = evt_wait_send_retained_events;
 		return 1;
 		return 1;

+ 88 - 92
openais/services/lck.c

@@ -48,24 +48,17 @@
 #include <signal.h>
 #include <signal.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
-#include "swab.h"
-#include "objdb.h"
-#include "totem.h"
-#include "service.h"
+#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
+#include <corosync/engine/swab.h>
+#include <corosync/engine/list.h>
+#include <corosync/engine/coroapi.h>
+#include <corosync/engine/logsys.h>
+#include <corosync/saAis.h>
+#include <corosync/lcr/lcr_comp.h>
 #include "../include/saAis.h"
 #include "../include/saAis.h"
 #include "../include/saLck.h"
 #include "../include/saLck.h"
 #include "../include/ipc_lck.h"
 #include "../include/ipc_lck.h"
-#include "../include/list.h"
-#include "../include/queue.h"
-#include "../lcr/lcr_comp.h"
-#include "mempool.h"
-#include "util.h"
-#include "main.h"
-#include "flow.h"
-#include "tlist.h"
-#include "ipc.h"
-#include "totempg.h"
-#include "logsys.h"
 
 
 LOGSYS_DECLARE_SUBSYS ("LCK", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("LCK", LOG_INFO);
 
 
@@ -116,7 +109,7 @@ struct resource_cleanup {
 
 
 DECLARE_LIST_INIT(resource_list_head);
 DECLARE_LIST_INIT(resource_list_head);
 
 
-static int lck_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static int lck_exec_init_fn (struct corosync_api_v1 *);
 
 
 static int lck_lib_exit_fn (void *conn);
 static int lck_lib_exit_fn (void *conn);
 
 
@@ -208,6 +201,7 @@ static int recovery_abort = 0;
 //static struct memb_ring_id saved_ring_id;
 //static struct memb_ring_id saved_ring_id;
 */
 */
 
 
+static struct corosync_api_v1 *api;
 
 
 static void lck_confchg_fn (
 static void lck_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
@@ -225,60 +219,60 @@ struct lck_pd {
 /*
 /*
  * Executive Handler Definition
  * Executive Handler Definition
  */
  */
-static struct openais_lib_handler lck_lib_service[] =
+static struct corosync_lib_handler lck_lib_engine[] =
 {
 {
 	{ /* 0 */
 	{ /* 0 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceopen,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceopen,
 		.response_size		= sizeof (struct res_lib_lck_resourceopen),
 		.response_size		= sizeof (struct res_lib_lck_resourceopen),
 		.response_id		= MESSAGE_RES_LCK_RESOURCEOPEN,
 		.response_id		= MESSAGE_RES_LCK_RESOURCEOPEN,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 1 */
 	{ /* 1 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceopenasync,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceopenasync,
 		.response_size		= sizeof (struct res_lib_lck_resourceopenasync),
 		.response_size		= sizeof (struct res_lib_lck_resourceopenasync),
 		.response_id		= MESSAGE_RES_LCK_RESOURCEOPENASYNC,
 		.response_id		= MESSAGE_RES_LCK_RESOURCEOPENASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 2 */
 	{ /* 2 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceclose,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceclose,
 		.response_size		= sizeof (struct res_lib_lck_resourceclose),
 		.response_size		= sizeof (struct res_lib_lck_resourceclose),
 		.response_id		= MESSAGE_RES_LCK_RESOURCECLOSE,
 		.response_id		= MESSAGE_RES_LCK_RESOURCECLOSE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 3 */
 	{ /* 3 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourcelock,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourcelock,
 		.response_size		= sizeof (struct res_lib_lck_resourcelock),
 		.response_size		= sizeof (struct res_lib_lck_resourcelock),
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCK,
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCK,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 4 */
 	{ /* 4 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourcelockasync,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourcelockasync,
 		.response_size		= sizeof (struct res_lib_lck_resourcelockasync),
 		.response_size		= sizeof (struct res_lib_lck_resourcelockasync),
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCKASYNC,
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCKASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 5 */
 	{ /* 5 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceunlock,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceunlock,
 		.response_size		= sizeof (struct res_lib_lck_resourceunlock),
 		.response_size		= sizeof (struct res_lib_lck_resourceunlock),
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCK,
 		.response_id		= MESSAGE_RES_LCK_RESOURCELOCK,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 6 */
 	{ /* 6 */
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceunlockasync,
 		.lib_handler_fn		= message_handler_req_lib_lck_resourceunlockasync,
 		.response_size		= sizeof (struct res_lib_lck_resourceunlock),
 		.response_size		= sizeof (struct res_lib_lck_resourceunlock),
 		.response_id		= MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC,
 		.response_id		= MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 7 */
 	{ /* 7 */
 		.lib_handler_fn		= message_handler_req_lib_lck_lockpurge,
 		.lib_handler_fn		= message_handler_req_lib_lck_lockpurge,
 		.response_size		= sizeof (struct res_lib_lck_lockpurge),
 		.response_size		= sizeof (struct res_lib_lck_lockpurge),
 		.response_id		= MESSAGE_RES_LCK_LOCKPURGE,
 		.response_id		= MESSAGE_RES_LCK_LOCKPURGE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	}
 	}
 };
 };
 
 
 
 
-static struct openais_exec_handler lck_exec_service[] = {
+static struct corosync_exec_handler lck_exec_engine[] = {
 	{
 	{
 		.exec_handler_fn	= message_handler_req_exec_lck_resourceopen,
 		.exec_handler_fn	= message_handler_req_exec_lck_resourceopen,
 		.exec_endian_convert_fn	= exec_lck_resourceopen_endian_convert
 		.exec_endian_convert_fn	= exec_lck_resourceopen_endian_convert
@@ -305,18 +299,18 @@ static struct openais_exec_handler lck_exec_service[] = {
 	}
 	}
 };
 };
 
 
-struct openais_service_handler lck_service_handler = {
+struct corosync_service_engine lck_service_engine = {
 	.name				= "openais distributed locking service B.01.01",
 	.name				= "openais distributed locking service B.01.01",
 	.id				= LCK_SERVICE,
 	.id				= LCK_SERVICE,
 	.private_data_size		= sizeof (struct lck_pd),
 	.private_data_size		= sizeof (struct lck_pd),
-	.flow_control			= OPENAIS_FLOW_CONTROL_NOT_REQUIRED, 
+	.flow_control			= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED, 
 	.lib_init_fn			= lck_lib_init_fn,
 	.lib_init_fn			= lck_lib_init_fn,
 	.lib_exit_fn			= lck_lib_exit_fn,
 	.lib_exit_fn			= lck_lib_exit_fn,
-	.lib_service			= lck_lib_service,
-	.lib_service_count		= sizeof (lck_lib_service) / sizeof (struct openais_lib_handler),
+	.lib_engine			= lck_lib_engine,
+	.lib_engine_count		= sizeof (lck_lib_engine) / sizeof (struct corosync_lib_handler),
 	.exec_init_fn			= lck_exec_init_fn,
 	.exec_init_fn			= lck_exec_init_fn,
-	.exec_service			= lck_exec_service,
-	.exec_service_count		= sizeof (lck_exec_service) / sizeof (struct openais_exec_handler),
+	.exec_engine			= lck_exec_engine,
+	.exec_engine_count		= sizeof (lck_exec_engine) / sizeof (struct corosync_exec_handler),
 	.exec_dump_fn			= NULL,
 	.exec_dump_fn			= NULL,
 	.confchg_fn			= lck_confchg_fn,
 	.confchg_fn			= lck_confchg_fn,
 	.sync_init			= NULL,
 	.sync_init			= NULL,
@@ -329,10 +323,10 @@ struct openais_service_handler lck_service_handler = {
 /*
 /*
  * Dynamic loader definition
  * Dynamic loader definition
  */
  */
-static struct openais_service_handler *lck_get_handler_ver0 (void);
+static struct corosync_service_engine *lck_get_engine_ver0 (void);
 
 
-static struct openais_service_handler_iface_ver0 lck_service_handler_iface = {
-	.openais_get_service_handler_ver0	= lck_get_handler_ver0
+static struct corosync_service_engine_iface_ver0 lck_service_engine_iface = {
+	.corosync_get_service_engine_ver0	= lck_get_engine_ver0
 };
 };
 
 
 static struct lcr_iface openais_lck_ver0[1] = {
 static struct lcr_iface openais_lck_ver0[1] = {
@@ -345,7 +339,7 @@ static struct lcr_iface openais_lck_ver0[1] = {
 		.dependency_count		= 0,
 		.dependency_count		= 0,
 		.constructor			= NULL,
 		.constructor			= NULL,
 		.destructor			= NULL,
 		.destructor			= NULL,
-		.interfaces			= (void **)(void *)&lck_service_handler_iface,
+		.interfaces			= (void **)(void *)&lck_service_engine_iface,
 	}
 	}
 };
 };
 
 
@@ -354,13 +348,13 @@ static struct lcr_comp lck_comp_ver0 = {
 	.ifaces					= openais_lck_ver0
 	.ifaces					= openais_lck_ver0
 };
 };
 
 
-static struct openais_service_handler *lck_get_handler_ver0 (void)
+static struct corosync_service_engine *lck_get_engine_ver0 (void)
 {
 {
-	return (&lck_service_handler);
+	return (&lck_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void register_this_component (void) {
 __attribute__ ((constructor)) static void register_this_component (void) {
-	lcr_interfaces_set (&openais_lck_ver0[0], &lck_service_handler_iface);
+	lcr_interfaces_set (&openais_lck_ver0[0], &lck_service_engine_iface);
 
 
 	lcr_component_register (&lck_comp_ver0);
 	lcr_component_register (&lck_comp_ver0);
 }
 }
@@ -576,7 +570,7 @@ struct resource_cleanup *lck_resource_cleanup_find (
 {
 {
 	struct list_head *list;
 	struct list_head *list;
 	struct resource_cleanup *resource_cleanup;
 	struct resource_cleanup *resource_cleanup;
-	struct lck_pd *lck_pd = (struct lck_pd *)openais_conn_private_data_get (conn);
+	struct lck_pd *lck_pd = (struct lck_pd *)api->ipc_private_data_get (conn);
 
 
 	for (list = lck_pd->resource_cleanup_list.next;
 	for (list = lck_pd->resource_cleanup_list.next;
 		list != &lck_pd->resource_cleanup_list; list = list->next) {
 		list != &lck_pd->resource_cleanup_list; list = list->next) {
@@ -606,8 +600,8 @@ int lck_resource_close (struct resource *resource)
 	iovec.iov_base = (char *)&req_exec_lck_resourceclose;
 	iovec.iov_base = (char *)&req_exec_lck_resourceclose;
 	iovec.iov_len = sizeof (req_exec_lck_resourceclose);
 	iovec.iov_len = sizeof (req_exec_lck_resourceclose);
 
 
-	if (totempg_groups_send_ok_joined (openais_group_handle, &iovec, 1)) {
-		assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	if (api->totem_send_ok (&iovec, 1)) {
+		assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 		return (0);
 		return (0);
 	}
 	}
 
 
@@ -637,7 +631,7 @@ void resource_lock_orphan (struct resource_lock *resource_lock)
 	iovec.iov_base = (char *)&req_exec_lck_resourcelockorphan;
 	iovec.iov_base = (char *)&req_exec_lck_resourcelockorphan;
 	iovec.iov_len = sizeof (req_exec_lck_resourcelockorphan);
 	iovec.iov_len = sizeof (req_exec_lck_resourcelockorphan);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 void lck_resource_cleanup_lock_remove (
 void lck_resource_cleanup_lock_remove (
@@ -662,7 +656,7 @@ void lck_resource_cleanup_remove (
 
 
 	struct list_head *list;
 	struct list_head *list;
 	struct resource_cleanup *resource_cleanup;
 	struct resource_cleanup *resource_cleanup;
-	struct lck_pd *lck_pd = (struct lck_pd *)openais_conn_private_data_get (conn);
+	struct lck_pd *lck_pd = (struct lck_pd *)api->ipc_private_data_get (conn);
 
 
 	for (list = lck_pd->resource_cleanup_list.next;
 	for (list = lck_pd->resource_cleanup_list.next;
 		list != &lck_pd->resource_cleanup_list;
 		list != &lck_pd->resource_cleanup_list;
@@ -678,8 +672,10 @@ void lck_resource_cleanup_remove (
 }
 }
 
 
 
 
-static int lck_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int lck_exec_init_fn (struct corosync_api_v1 *corosync_api)
 {
 {
+	api = corosync_api;
+
 	/*
 	/*
 	 *  Initialize the saved ring ID.
 	 *  Initialize the saved ring ID.
 	 */
 	 */
@@ -690,7 +686,7 @@ static int lck_lib_exit_fn (void *conn)
 {
 {
 	struct resource_cleanup *resource_cleanup;
 	struct resource_cleanup *resource_cleanup;
 	struct list_head *cleanup_list;
 	struct list_head *cleanup_list;
-	struct lck_pd *lck_pd = (struct lck_pd *)openais_conn_private_data_get (conn);
+	struct lck_pd *lck_pd = (struct lck_pd *)api->ipc_private_data_get (conn);
 
 
 	log_printf(LOG_LEVEL_NOTICE, "lck_exit_fn conn_info %p\n", conn);
 	log_printf(LOG_LEVEL_NOTICE, "lck_exit_fn conn_info %p\n", conn);
 
 
@@ -718,7 +714,7 @@ static int lck_lib_exit_fn (void *conn)
 
 
 static int lck_lib_init_fn (void *conn)
 static int lck_lib_init_fn (void *conn)
 {
 {
-    struct lck_pd *lck_pd = (struct lck_pd *)openais_conn_private_data_get (conn);
+    struct lck_pd *lck_pd = (struct lck_pd *)api->ipc_private_data_get (conn);
 
 
 	list_init (&lck_pd->resource_list);
 	list_init (&lck_pd->resource_list);
 	list_init (&lck_pd->resource_cleanup_list);
 	list_init (&lck_pd->resource_cleanup_list);
@@ -778,14 +774,14 @@ static void message_handler_req_exec_lck_resourceopen (
 	/*
 	/*
 	 * Setup connection information and mark resource as referenced
 	 * Setup connection information and mark resource as referenced
 	 */
 	 */
-	if (message_source_is_local (&req_exec_lck_resourceopen->source)) {
+	if (api->ipc_source_is_local (&req_exec_lck_resourceopen->source)) {
 		log_printf (LOG_LEVEL_DEBUG, "Lock resource opened is %p\n", resource);
 		log_printf (LOG_LEVEL_DEBUG, "Lock resource opened is %p\n", resource);
 		resource_cleanup = malloc (sizeof (struct resource_cleanup));
 		resource_cleanup = malloc (sizeof (struct resource_cleanup));
 		if (resource_cleanup == 0) {
 		if (resource_cleanup == 0) {
 			free (resource);
 			free (resource);
 			error = SA_AIS_ERR_NO_MEMORY;
 			error = SA_AIS_ERR_NO_MEMORY;
 		} else { 
 		} else { 
-			lck_pd = (struct lck_pd *)openais_conn_private_data_get (req_exec_lck_resourceopen->source.conn);
+			lck_pd = (struct lck_pd *)api->ipc_private_data_get (req_exec_lck_resourceopen->source.conn);
 			list_init (&resource_cleanup->list);
 			list_init (&resource_cleanup->list);
 			list_init (&resource_cleanup->resource_lock_list_head);
 			list_init (&resource_cleanup->resource_lock_list_head);
 			resource_cleanup->resource = resource;
 			resource_cleanup->resource = resource;
@@ -806,7 +802,7 @@ error_exit:
 	/*
 	/*
 	 * If this node was the source of the message, respond to this node
 	 * If this node was the source of the message, respond to this node
 	 */
 	 */
-	if (message_source_is_local (&req_exec_lck_resourceopen->source)) {
+	if (api->ipc_source_is_local (&req_exec_lck_resourceopen->source)) {
 		/*
 		/*
 		 * If its an async call respond with the invocation and handle
 		 * If its an async call respond with the invocation and handle
 		 */
 		 */
@@ -820,12 +816,12 @@ error_exit:
 				&req_exec_lck_resourceopen->source,
 				&req_exec_lck_resourceopen->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_lck_resourceopen->source.conn,
 				req_exec_lck_resourceopen->source.conn,
 				&res_lib_lck_resourceopenasync,
 				&res_lib_lck_resourceopenasync,
 				sizeof (struct res_lib_lck_resourceopenasync));
 				sizeof (struct res_lib_lck_resourceopenasync));
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_lck_resourceopen->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_lck_resourceopen->source.conn),
 				&res_lib_lck_resourceopenasync,
 				&res_lib_lck_resourceopenasync,
 				sizeof (struct res_lib_lck_resourceopenasync));
 				sizeof (struct res_lib_lck_resourceopenasync));
 		} else {
 		} else {
@@ -839,7 +835,7 @@ error_exit:
 				&req_exec_lck_resourceopen->source,
 				&req_exec_lck_resourceopen->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (req_exec_lck_resourceopen->source.conn,
+			api->ipc_conn_send_response (req_exec_lck_resourceopen->source.conn,
 				&res_lib_lck_resourceopen,
 				&res_lib_lck_resourceopen,
 				sizeof (struct res_lib_lck_resourceopen));
 				sizeof (struct res_lib_lck_resourceopen));
 		}
 		}
@@ -867,7 +863,7 @@ static void message_handler_req_exec_lck_resourceclose (
 	if (resource->refcount == 0) {
 	if (resource->refcount == 0) {
 	}
 	}
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_lck_resourceclose->source)) {
+	if (api->ipc_source_is_local(&req_exec_lck_resourceclose->source)) {
 		lck_resource_cleanup_remove (
 		lck_resource_cleanup_remove (
 			req_exec_lck_resourceclose->source.conn,
 			req_exec_lck_resourceclose->source.conn,
 			req_exec_lck_resourceclose->resource_handle);
 			req_exec_lck_resourceclose->resource_handle);
@@ -875,7 +871,7 @@ error_exit:
 		res_lib_lck_resourceclose.header.size = sizeof (struct res_lib_lck_resourceclose);
 		res_lib_lck_resourceclose.header.size = sizeof (struct res_lib_lck_resourceclose);
 		res_lib_lck_resourceclose.header.id = MESSAGE_RES_LCK_RESOURCECLOSE;
 		res_lib_lck_resourceclose.header.id = MESSAGE_RES_LCK_RESOURCECLOSE;
 		res_lib_lck_resourceclose.header.error = error;
 		res_lib_lck_resourceclose.header.error = error;
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_lck_resourceclose->source.conn,
 			req_exec_lck_resourceclose->source.conn,
 			&res_lib_lck_resourceclose, sizeof (struct res_lib_lck_resourceclose));
 			&res_lib_lck_resourceclose, sizeof (struct res_lib_lck_resourceclose));
 	}
 	}
@@ -885,7 +881,7 @@ void waiter_notification_send (struct resource_lock *resource_lock)
 {
 {
 	struct res_lib_lck_lockwaitercallback res_lib_lck_lockwaitercallback;
 	struct res_lib_lck_lockwaitercallback res_lib_lck_lockwaitercallback;
 
 
-	if (message_source_is_local (&resource_lock->callback_source) == 0) {
+	if (api->ipc_source_is_local (&resource_lock->callback_source) == 0) {
 		return;
 		return;
 	}
 	}
 
 
@@ -902,8 +898,8 @@ void waiter_notification_send (struct resource_lock *resource_lock)
 		res_lib_lck_lockwaitercallback.mode_held = SA_LCK_PR_LOCK_MODE;
 		res_lib_lck_lockwaitercallback.mode_held = SA_LCK_PR_LOCK_MODE;
 	}
 	}
 
 
-	openais_conn_send_response (
-		openais_conn_partner_get (resource_lock->callback_source.conn),
+	api->ipc_conn_send_response (
+		api->ipc_conn_partner_get (resource_lock->callback_source.conn),
 		&res_lib_lck_lockwaitercallback,
 		&res_lib_lck_lockwaitercallback,
 		sizeof (struct res_lib_lck_lockwaitercallback));
 		sizeof (struct res_lib_lck_lockwaitercallback));
 }
 }
@@ -929,7 +925,7 @@ void resource_lock_async_deliver (
 {
 {
 	struct res_lib_lck_resourcelockasync res_lib_lck_resourcelockasync;
 	struct res_lib_lck_resourcelockasync res_lib_lck_resourcelockasync;
 
 
-	if (source && message_source_is_local(source)) {
+	if (source && api->ipc_source_is_local(source)) {
 		if (resource_lock->async_call) {
 		if (resource_lock->async_call) {
 			res_lib_lck_resourcelockasync.header.size = sizeof (struct res_lib_lck_resourcelockasync);
 			res_lib_lck_resourcelockasync.header.size = sizeof (struct res_lib_lck_resourcelockasync);
 			res_lib_lck_resourcelockasync.header.id = MESSAGE_RES_LCK_RESOURCELOCKASYNC;
 			res_lib_lck_resourcelockasync.header.id = MESSAGE_RES_LCK_RESOURCELOCKASYNC;
@@ -938,8 +934,8 @@ void resource_lock_async_deliver (
 			res_lib_lck_resourcelockasync.lockStatus = resource_lock->lock_status;
 			res_lib_lck_resourcelockasync.lockStatus = resource_lock->lock_status;
 			res_lib_lck_resourcelockasync.invocation = resource_lock->invocation;
 			res_lib_lck_resourcelockasync.invocation = resource_lock->invocation;
 			res_lib_lck_resourcelockasync.lockId = resource_lock->lock_id;
 			res_lib_lck_resourcelockasync.lockId = resource_lock->lock_id;
-			openais_conn_send_response (
-				openais_conn_partner_get (source->conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (source->conn),
 				&res_lib_lck_resourcelockasync,
 				&res_lib_lck_resourcelockasync,
 				sizeof (struct res_lib_lck_resourcelockasync));
 				sizeof (struct res_lib_lck_resourcelockasync));
 		}
 		}
@@ -953,7 +949,7 @@ void lock_response_deliver (
 {
 {
 	struct res_lib_lck_resourcelock res_lib_lck_resourcelock;
 	struct res_lib_lck_resourcelock res_lib_lck_resourcelock;
 
 
-	if (source && message_source_is_local(source)) {
+	if (source && api->ipc_source_is_local(source)) {
 		if (resource_lock->async_call) {
 		if (resource_lock->async_call) {
 			resource_lock_async_deliver (&resource_lock->callback_source, resource_lock, error);
 			resource_lock_async_deliver (&resource_lock->callback_source, resource_lock, error);
 		} else {
 		} else {
@@ -962,7 +958,7 @@ void lock_response_deliver (
 			res_lib_lck_resourcelock.header.error = error;
 			res_lib_lck_resourcelock.header.error = error;
 			res_lib_lck_resourcelock.resource_lock = (void *)resource_lock;
 			res_lib_lck_resourcelock.resource_lock = (void *)resource_lock;
 			res_lib_lck_resourcelock.lockStatus = resource_lock->lock_status;
 			res_lib_lck_resourcelock.lockStatus = resource_lock->lock_status;
-			openais_conn_send_response (source->conn,
+			api->ipc_conn_send_response (source->conn,
 				&res_lib_lck_resourcelock,
 				&res_lib_lck_resourcelock,
 				sizeof (struct res_lib_lck_resourcelock));
 				sizeof (struct res_lib_lck_resourcelock));
 		}
 		}
@@ -1203,7 +1199,7 @@ static void message_handler_req_exec_lck_resourcelock (
 	/*
 	/*
 	 * Add resource lock to cleanup handler for this api resource instance
 	 * Add resource lock to cleanup handler for this api resource instance
 	 */
 	 */
-	if (message_source_is_local (&req_exec_lck_resourcelock->source)) {
+	if (api->ipc_source_is_local (&req_exec_lck_resourcelock->source)) {
 		resource_cleanup = lck_resource_cleanup_find (
 		resource_cleanup = lck_resource_cleanup_find (
 			resource_lock->callback_source.conn,
 			resource_lock->callback_source.conn,
 			req_exec_lck_resourcelock->resource_handle);
 			req_exec_lck_resourcelock->resource_handle);
@@ -1235,14 +1231,14 @@ static void message_handler_req_exec_lck_resourcelock (
 		 * Deliver async response to library
 		 * Deliver async response to library
 		 */
 		 */
 		req_exec_lck_resourcelock->source.conn =
 		req_exec_lck_resourcelock->source.conn =
-			openais_conn_partner_get (req_exec_lck_resourcelock->source.conn);
+			api->ipc_conn_partner_get (req_exec_lck_resourcelock->source.conn);
 		resource_lock_async_deliver (
 		resource_lock_async_deliver (
 			&req_exec_lck_resourcelock->source,
 			&req_exec_lck_resourcelock->source,
 			resource_lock,
 			resource_lock,
 			SA_AIS_OK);
 			SA_AIS_OK);
 // TODO why is this twice ?
 // TODO why is this twice ?
 		req_exec_lck_resourcelock->source.conn =
 		req_exec_lck_resourcelock->source.conn =
-			openais_conn_partner_get (req_exec_lck_resourcelock->source.conn);
+			api->ipc_conn_partner_get (req_exec_lck_resourcelock->source.conn);
 	}
 	}
 
 
 error_exit:
 error_exit:
@@ -1278,7 +1274,7 @@ static void message_handler_req_exec_lck_resourceunlock (
 	unlock_algorithm (resource, resource_lock);
 	unlock_algorithm (resource, resource_lock);
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_lck_resourceunlock->source)) {
+	if (api->ipc_source_is_local(&req_exec_lck_resourceunlock->source)) {
 		if (req_exec_lck_resourceunlock->async_call) {
 		if (req_exec_lck_resourceunlock->async_call) {
 			res_lib_lck_resourceunlockasync.header.size = sizeof (struct res_lib_lck_resourceunlockasync);
 			res_lib_lck_resourceunlockasync.header.size = sizeof (struct res_lib_lck_resourceunlockasync);
 			res_lib_lck_resourceunlockasync.header.id = MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC;
 			res_lib_lck_resourceunlockasync.header.id = MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC;
@@ -1287,19 +1283,19 @@ error_exit:
 				req_exec_lck_resourceunlock->invocation;
 				req_exec_lck_resourceunlock->invocation;
 			res_lib_lck_resourceunlockasync.lockId = req_exec_lck_resourceunlock->lock_id;
 			res_lib_lck_resourceunlockasync.lockId = req_exec_lck_resourceunlock->lock_id;
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_lck_resourceunlock->source.conn,
 				req_exec_lck_resourceunlock->source.conn,
 				&res_lib_lck_resourceunlockasync,
 				&res_lib_lck_resourceunlockasync,
 				sizeof (struct res_lib_lck_resourceunlockasync));
 				sizeof (struct res_lib_lck_resourceunlockasync));
-			openais_conn_send_response (
-				openais_conn_partner_get(req_exec_lck_resourceunlock->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get(req_exec_lck_resourceunlock->source.conn),
 				&res_lib_lck_resourceunlockasync,
 				&res_lib_lck_resourceunlockasync,
 				sizeof (struct res_lib_lck_resourceunlockasync));
 				sizeof (struct res_lib_lck_resourceunlockasync));
 		} else {
 		} else {
 			res_lib_lck_resourceunlock.header.size = sizeof (struct res_lib_lck_resourceunlock);
 			res_lib_lck_resourceunlock.header.size = sizeof (struct res_lib_lck_resourceunlock);
 			res_lib_lck_resourceunlock.header.id = MESSAGE_RES_LCK_RESOURCEUNLOCK;
 			res_lib_lck_resourceunlock.header.id = MESSAGE_RES_LCK_RESOURCEUNLOCK;
 			res_lib_lck_resourceunlock.header.error = error;
 			res_lib_lck_resourceunlock.header.error = error;
-			openais_conn_send_response (req_exec_lck_resourceunlock->source.conn,
+			api->ipc_conn_send_response (req_exec_lck_resourceunlock->source.conn,
 				&res_lib_lck_resourceunlock, sizeof (struct res_lib_lck_resourceunlock));
 				&res_lib_lck_resourceunlock, sizeof (struct res_lib_lck_resourceunlock));
 		}
 		}
 	}
 	}
@@ -1349,14 +1345,14 @@ static void message_handler_req_exec_lck_lockpurge (
 	}
 	}
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_lck_lockpurge->source)) {
+	if (api->ipc_source_is_local(&req_exec_lck_lockpurge->source)) {
 //		lck_resource_cleanup_remove (req_exec_lck_lockpurge->source.conn,
 //		lck_resource_cleanup_remove (req_exec_lck_lockpurge->source.conn,
 //			resource);
 //			resource);
 
 
 		res_lib_lck_lockpurge.header.size = sizeof (struct res_lib_lck_lockpurge);
 		res_lib_lck_lockpurge.header.size = sizeof (struct res_lib_lck_lockpurge);
 		res_lib_lck_lockpurge.header.id = MESSAGE_RES_LCK_LOCKPURGE;
 		res_lib_lck_lockpurge.header.id = MESSAGE_RES_LCK_LOCKPURGE;
 		res_lib_lck_lockpurge.header.error = error;
 		res_lib_lck_lockpurge.header.error = error;
-		openais_conn_send_response (req_exec_lck_lockpurge->source.conn,
+		api->ipc_conn_send_response (req_exec_lck_lockpurge->source.conn,
 			&res_lib_lck_lockpurge, sizeof (struct res_lib_lck_lockpurge));
 			&res_lib_lck_lockpurge, sizeof (struct res_lib_lck_lockpurge));
 	}
 	}
 }
 }
@@ -1377,7 +1373,7 @@ static void message_handler_req_lib_lck_resourceopen (
 	req_exec_lck_resourceopen.header.id =
 	req_exec_lck_resourceopen.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEOPEN);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEOPEN);
 
 
-	message_source_set (&req_exec_lck_resourceopen.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourceopen.source, conn);
 
 
 	memcpy (&req_exec_lck_resourceopen.resource_name,
 	memcpy (&req_exec_lck_resourceopen.resource_name,
 		&req_lib_lck_resourceopen->lockResourceName,
 		&req_lib_lck_resourceopen->lockResourceName,
@@ -1392,7 +1388,7 @@ static void message_handler_req_lib_lck_resourceopen (
 	iovec.iov_base = (char *)&req_exec_lck_resourceopen;
 	iovec.iov_base = (char *)&req_exec_lck_resourceopen;
 	iovec.iov_len = sizeof (req_exec_lck_resourceopen);
 	iovec.iov_len = sizeof (req_exec_lck_resourceopen);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_resourceopenasync (
 static void message_handler_req_lib_lck_resourceopenasync (
@@ -1411,7 +1407,7 @@ static void message_handler_req_lib_lck_resourceopenasync (
 	req_exec_lck_resourceopen.header.id =
 	req_exec_lck_resourceopen.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEOPEN);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEOPEN);
 
 
-	message_source_set (&req_exec_lck_resourceopen.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourceopen.source, conn);
 
 
 	memcpy (&req_exec_lck_resourceopen.resource_name,
 	memcpy (&req_exec_lck_resourceopen.resource_name,
 		&req_lib_lck_resourceopen->lockResourceName,
 		&req_lib_lck_resourceopen->lockResourceName,
@@ -1427,7 +1423,7 @@ static void message_handler_req_lib_lck_resourceopenasync (
 	iovec.iov_base = (char *)&req_exec_lck_resourceopen;
 	iovec.iov_base = (char *)&req_exec_lck_resourceopen;
 	iovec.iov_len = sizeof (req_exec_lck_resourceopen);
 	iovec.iov_len = sizeof (req_exec_lck_resourceopen);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_resourceclose (
 static void message_handler_req_lib_lck_resourceclose (
@@ -1450,7 +1446,7 @@ static void message_handler_req_lib_lck_resourceclose (
 		req_exec_lck_resourceclose.header.id =
 		req_exec_lck_resourceclose.header.id =
 			SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCECLOSE);
 			SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCECLOSE);
 
 
-		message_source_set (&req_exec_lck_resourceclose.source, conn);
+		api->ipc_source_set (&req_exec_lck_resourceclose.source, conn);
 
 
 		memcpy (&req_exec_lck_resourceclose.lockResourceName,
 		memcpy (&req_exec_lck_resourceclose.lockResourceName,
 			&req_lib_lck_resourceclose->lockResourceName, sizeof (mar_name_t));
 			&req_lib_lck_resourceclose->lockResourceName, sizeof (mar_name_t));
@@ -1459,8 +1455,8 @@ static void message_handler_req_lib_lck_resourceclose (
 		iovecs[0].iov_base = (char *)&req_exec_lck_resourceclose;
 		iovecs[0].iov_base = (char *)&req_exec_lck_resourceclose;
 		iovecs[0].iov_len = sizeof (req_exec_lck_resourceclose);
 		iovecs[0].iov_len = sizeof (req_exec_lck_resourceclose);
 
 
-		if (totempg_groups_send_ok_joined (openais_group_handle, iovecs, 1)) {
-			assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0);
+		if (api->totem_send_ok (iovecs, 1)) {
+			assert (api->totem_mcast (iovecs, 1, TOTEM_AGREED) == 0);
 		}
 		}
 	}
 	}
 	else {
 	else {
@@ -1470,7 +1466,7 @@ static void message_handler_req_lib_lck_resourceclose (
 		res_lib_lck_resourceclose.header.id = MESSAGE_RES_LCK_RESOURCECLOSE;
 		res_lib_lck_resourceclose.header.id = MESSAGE_RES_LCK_RESOURCECLOSE;
 		res_lib_lck_resourceclose.header.error = SA_AIS_ERR_NOT_EXIST;
 		res_lib_lck_resourceclose.header.error = SA_AIS_ERR_NOT_EXIST;
 
 
-		openais_conn_send_response (conn,
+		api->ipc_conn_send_response (conn,
 			&res_lib_lck_resourceclose,
 			&res_lib_lck_resourceclose,
 			sizeof (struct res_lib_lck_resourceclose));
 			sizeof (struct res_lib_lck_resourceclose));
 	}
 	}
@@ -1492,7 +1488,7 @@ static void message_handler_req_lib_lck_resourcelock (
 	req_exec_lck_resourcelock.header.id =
 	req_exec_lck_resourcelock.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCELOCK);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCELOCK);
 
 
-	message_source_set (&req_exec_lck_resourcelock.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourcelock.source, conn);
 
 
 	memcpy (&req_exec_lck_resourcelock.req_lib_lck_resourcelock,
 	memcpy (&req_exec_lck_resourcelock.req_lib_lck_resourcelock,
 		req_lib_lck_resourcelock,
 		req_lib_lck_resourcelock,
@@ -1506,7 +1502,7 @@ static void message_handler_req_lib_lck_resourcelock (
 	iovecs[0].iov_base = (char *)&req_exec_lck_resourcelock;
 	iovecs[0].iov_base = (char *)&req_exec_lck_resourcelock;
 	iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock);
 	iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (iovecs, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_resourcelockasync (
 static void message_handler_req_lib_lck_resourcelockasync (
@@ -1525,7 +1521,7 @@ static void message_handler_req_lib_lck_resourcelockasync (
 	req_exec_lck_resourcelock.header.id =
 	req_exec_lck_resourcelock.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCELOCK);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCELOCK);
 
 
-	message_source_set (&req_exec_lck_resourcelock.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourcelock.source, conn);
 
 
 	memcpy (&req_exec_lck_resourcelock.req_lib_lck_resourcelock,
 	memcpy (&req_exec_lck_resourcelock.req_lib_lck_resourcelock,
 		req_lib_lck_resourcelock,
 		req_lib_lck_resourcelock,
@@ -1539,7 +1535,7 @@ static void message_handler_req_lib_lck_resourcelockasync (
 	iovecs[0].iov_base = (char *)&req_exec_lck_resourcelock;
 	iovecs[0].iov_base = (char *)&req_exec_lck_resourcelock;
 	iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock);
 	iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (iovecs, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_resourceunlock (
 static void message_handler_req_lib_lck_resourceunlock (
@@ -1558,7 +1554,7 @@ static void message_handler_req_lib_lck_resourceunlock (
 	req_exec_lck_resourceunlock.header.id =
 	req_exec_lck_resourceunlock.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEUNLOCK);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEUNLOCK);
 
 
-	message_source_set (&req_exec_lck_resourceunlock.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourceunlock.source, conn);
 
 
 	memcpy (&req_exec_lck_resourceunlock.resource_name,
 	memcpy (&req_exec_lck_resourceunlock.resource_name,
 		&req_lib_lck_resourceunlock->lockResourceName,
 		&req_lib_lck_resourceunlock->lockResourceName,
@@ -1571,7 +1567,7 @@ static void message_handler_req_lib_lck_resourceunlock (
 	iovec.iov_base = (char *)&req_exec_lck_resourceunlock;
 	iovec.iov_base = (char *)&req_exec_lck_resourceunlock;
 	iovec.iov_len = sizeof (req_exec_lck_resourceunlock);
 	iovec.iov_len = sizeof (req_exec_lck_resourceunlock);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_resourceunlockasync (
 static void message_handler_req_lib_lck_resourceunlockasync (
@@ -1590,7 +1586,7 @@ static void message_handler_req_lib_lck_resourceunlockasync (
 	req_exec_lck_resourceunlock.header.id =
 	req_exec_lck_resourceunlock.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEUNLOCK);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_RESOURCEUNLOCK);
 
 
-	message_source_set (&req_exec_lck_resourceunlock.source, conn);
+	api->ipc_source_set (&req_exec_lck_resourceunlock.source, conn);
 
 
 	memcpy (&req_exec_lck_resourceunlock.resource_name,
 	memcpy (&req_exec_lck_resourceunlock.resource_name,
 		&req_lib_lck_resourceunlock->lockResourceName,
 		&req_lib_lck_resourceunlock->lockResourceName,
@@ -1603,7 +1599,7 @@ static void message_handler_req_lib_lck_resourceunlockasync (
 	iovec.iov_base = (char *)&req_exec_lck_resourceunlock;
 	iovec.iov_base = (char *)&req_exec_lck_resourceunlock;
 	iovec.iov_len = sizeof (req_exec_lck_resourceunlock);
 	iovec.iov_len = sizeof (req_exec_lck_resourceunlock);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_lck_lockpurge (
 static void message_handler_req_lib_lck_lockpurge (
@@ -1622,7 +1618,7 @@ static void message_handler_req_lib_lck_lockpurge (
 	req_exec_lck_lockpurge.header.id =
 	req_exec_lck_lockpurge.header.id =
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_LOCKPURGE);
 		SERVICE_ID_MAKE (LCK_SERVICE, MESSAGE_REQ_EXEC_LCK_LOCKPURGE);
 
 
-	message_source_set (&req_exec_lck_lockpurge.source, conn);
+	api->ipc_source_set (&req_exec_lck_lockpurge.source, conn);
 
 
 	memcpy (&req_exec_lck_lockpurge.req_lib_lck_lockpurge,
 	memcpy (&req_exec_lck_lockpurge.req_lib_lck_lockpurge,
 		req_lib_lck_lockpurge,
 		req_lib_lck_lockpurge,
@@ -1631,6 +1627,6 @@ static void message_handler_req_lib_lck_lockpurge (
 	iovecs[0].iov_base = (char *)&req_exec_lck_lockpurge;
 	iovecs[0].iov_base = (char *)&req_exec_lck_lockpurge;
 	iovecs[0].iov_len = sizeof (req_exec_lck_lockpurge);
 	iovecs[0].iov_len = sizeof (req_exec_lck_lockpurge);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (iovecs, 1, TOTEM_AGREED) == 0);
 }
 }
 
 

+ 190 - 153
openais/services/msg.c

@@ -47,24 +47,17 @@
 #include <signal.h>
 #include <signal.h>
 #include <arpa/inet.h>
 #include <arpa/inet.h>
 
 
-#include "../include/saAis.h"
+#include <corosync/ipc_gen.h>
+#include <corosync/mar_gen.h>
+#include <corosync/engine/swab.h>
+#include <corosync/engine/list.h>
+#include <corosync/engine/coroapi.h>
+#include <corosync/engine/logsys.h>
+#include <corosync/saAis.h>
+#include <corosync/lcr/lcr_comp.h>
 #include "../include/saMsg.h"
 #include "../include/saMsg.h"
 #include "../include/ipc_msg.h"
 #include "../include/ipc_msg.h"
-#include "../include/list.h"
-#include "../include/queue.h"
-#include "../lcr/lcr_comp.h"
-
-#include "objdb.h"
-#include "totem.h"
-#include "service.h"
-#include "mempool.h"
-#include "util.h"
-#include "main.h"
-#include "flow.h"
-#include "tlist.h"
-#include "ipc.h"
-#include "totempg.h"
-#include "logsys.h"
+
 
 
 LOGSYS_DECLARE_SUBSYS ("MSG", LOG_INFO);
 LOGSYS_DECLARE_SUBSYS ("MSG", LOG_INFO);
 
 
@@ -125,7 +118,9 @@ struct queue_cleanup {
 DECLARE_LIST_INIT(queue_list_head);
 DECLARE_LIST_INIT(queue_list_head);
 DECLARE_LIST_INIT(queue_group_list_head);
 DECLARE_LIST_INIT(queue_group_list_head);
 
 
-static int msg_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static struct corosync_api_v1 *api;
+
+static int msg_exec_init_fn (struct corosync_api_v1 *);
 
 
 static int msg_lib_exit_fn (void *conn);
 static int msg_lib_exit_fn (void *conn);
 
 
@@ -288,120 +283,120 @@ struct msg_pd {
 /*
 /*
  * Executive Handler Definition
  * Executive Handler Definition
  */
  */
-struct openais_lib_handler msg_lib_service[] =
+struct corosync_lib_handler msg_lib_engine[] =
 {
 {
 	{ /* 0 */
 	{ /* 0 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queueopen,
 		.lib_handler_fn		= message_handler_req_lib_msg_queueopen,
 		.response_size		= sizeof (struct res_lib_msg_queueopen),
 		.response_size		= sizeof (struct res_lib_msg_queueopen),
 		.response_id		= MESSAGE_RES_MSG_QUEUEOPEN,
 		.response_id		= MESSAGE_RES_MSG_QUEUEOPEN,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 1 */
 	{ /* 1 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queueopenasync,
 		.lib_handler_fn		= message_handler_req_lib_msg_queueopenasync,
 		.response_size		= sizeof (struct res_lib_msg_queueopenasync),
 		.response_size		= sizeof (struct res_lib_msg_queueopenasync),
 		.response_id		= MESSAGE_RES_MSG_QUEUEOPENASYNC,
 		.response_id		= MESSAGE_RES_MSG_QUEUEOPENASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 2 */
 	{ /* 2 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queueclose,
 		.lib_handler_fn		= message_handler_req_lib_msg_queueclose,
 		.response_size		= sizeof (struct res_lib_msg_queueclose),
 		.response_size		= sizeof (struct res_lib_msg_queueclose),
 		.response_id		= MESSAGE_RES_MSG_QUEUECLOSE,
 		.response_id		= MESSAGE_RES_MSG_QUEUECLOSE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 3 */
 	{ /* 3 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuestatusget,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuestatusget,
 		.response_size		= sizeof (struct res_lib_msg_queuestatusget),
 		.response_size		= sizeof (struct res_lib_msg_queuestatusget),
 		.response_id		= MESSAGE_RES_MSG_QUEUESTATUSGET,
 		.response_id		= MESSAGE_RES_MSG_QUEUESTATUSGET,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 4 */
 	{ /* 4 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queueunlink,
 		.lib_handler_fn		= message_handler_req_lib_msg_queueunlink,
 		.response_size		= sizeof (struct res_lib_msg_queueunlink),
 		.response_size		= sizeof (struct res_lib_msg_queueunlink),
 		.response_id		= MESSAGE_RES_MSG_QUEUEUNLINK,
 		.response_id		= MESSAGE_RES_MSG_QUEUEUNLINK,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 5 */
 	{ /* 5 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupcreate,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupcreate,
 		.response_size		= sizeof (struct res_lib_msg_queuegroupcreate),
 		.response_size		= sizeof (struct res_lib_msg_queuegroupcreate),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPCREATE,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPCREATE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 6 */
 	{ /* 6 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupinsert,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupinsert,
 		.response_size		= sizeof (struct res_lib_msg_queuegroupinsert),
 		.response_size		= sizeof (struct res_lib_msg_queuegroupinsert),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPINSERT,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPINSERT,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 7 */
 	{ /* 7 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupremove,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupremove,
 		.response_size		= sizeof (struct res_lib_msg_queuegroupremove),
 		.response_size		= sizeof (struct res_lib_msg_queuegroupremove),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPREMOVE,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPREMOVE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 8 */
 	{ /* 8 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupdelete,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegroupdelete,
 		.response_size		= sizeof (struct res_lib_msg_queuegroupdelete),
 		.response_size		= sizeof (struct res_lib_msg_queuegroupdelete),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPDELETE,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPDELETE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 9 */
 	{ /* 9 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegrouptrack,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegrouptrack,
 		.response_size		= sizeof (struct res_lib_msg_queuegrouptrack),
 		.response_size		= sizeof (struct res_lib_msg_queuegrouptrack),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPTRACK,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPTRACK,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 10 */
 	{ /* 10 */
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegrouptrackstop,
 		.lib_handler_fn		= message_handler_req_lib_msg_queuegrouptrackstop,
 		.response_size		= sizeof (struct res_lib_msg_queuegrouptrackstop),
 		.response_size		= sizeof (struct res_lib_msg_queuegrouptrackstop),
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPTRACKSTOP,
 		.response_id		= MESSAGE_RES_MSG_QUEUEGROUPTRACKSTOP,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 11 */
 	{ /* 11 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesend,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesend,
 		.response_size		= sizeof (struct res_lib_msg_messagesend),
 		.response_size		= sizeof (struct res_lib_msg_messagesend),
 		.response_id		= MESSAGE_RES_MSG_MESSAGESEND,
 		.response_id		= MESSAGE_RES_MSG_MESSAGESEND,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 12 */
 	{ /* 12 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesendasync,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesendasync,
 		.response_size		= sizeof (struct res_lib_msg_messagesendasync),
 		.response_size		= sizeof (struct res_lib_msg_messagesendasync),
 		.response_id		= MESSAGE_RES_MSG_MESSAGESENDASYNC,
 		.response_id		= MESSAGE_RES_MSG_MESSAGESENDASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 13 */
 	{ /* 13 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messageget,
 		.lib_handler_fn		= message_handler_req_lib_msg_messageget,
 		.response_size		= sizeof (struct res_lib_msg_messageget),
 		.response_size		= sizeof (struct res_lib_msg_messageget),
 		.response_id		= MESSAGE_RES_MSG_MESSAGEGET,
 		.response_id		= MESSAGE_RES_MSG_MESSAGEGET,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 14 */
 	{ /* 14 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagecancel,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagecancel,
 		.response_size		= sizeof (struct res_lib_msg_messagecancel),
 		.response_size		= sizeof (struct res_lib_msg_messagecancel),
 		.response_id		= MESSAGE_RES_MSG_MESSAGECANCEL,
 		.response_id		= MESSAGE_RES_MSG_MESSAGECANCEL,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 15 */
 	{ /* 15 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesendreceive,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagesendreceive,
 		.response_size		= sizeof (struct res_lib_msg_messagesendreceive),
 		.response_size		= sizeof (struct res_lib_msg_messagesendreceive),
 		.response_id		= MESSAGE_RES_MSG_MESSAGESENDRECEIVE,
 		.response_id		= MESSAGE_RES_MSG_MESSAGESENDRECEIVE,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 16 */
 	{ /* 16 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagereply,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagereply,
 		.response_size		= sizeof (struct res_lib_msg_messagereply),
 		.response_size		= sizeof (struct res_lib_msg_messagereply),
 		.response_id		= MESSAGE_RES_MSG_MESSAGEREPLY,
 		.response_id		= MESSAGE_RES_MSG_MESSAGEREPLY,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 	{ /* 17 */
 	{ /* 17 */
 		.lib_handler_fn		= message_handler_req_lib_msg_messagereplyasync,
 		.lib_handler_fn		= message_handler_req_lib_msg_messagereplyasync,
 		.response_size		= sizeof (struct res_lib_msg_messagereplyasync),
 		.response_size		= sizeof (struct res_lib_msg_messagereplyasync),
 		.response_id		= MESSAGE_RES_MSG_MESSAGEREPLYASYNC,
 		.response_id		= MESSAGE_RES_MSG_MESSAGEREPLYASYNC,
-		.flow_control		= OPENAIS_FLOW_CONTROL_REQUIRED
+		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_REQUIRED
 	},
 	},
 };
 };
 
 
 
 
-static struct openais_exec_handler msg_exec_service[] = {
+static struct corosync_exec_handler msg_exec_engine[] = {
 	{
 	{
 		.exec_handler_fn		= message_handler_req_exec_msg_queueopen,
 		.exec_handler_fn		= message_handler_req_exec_msg_queueopen,
 	},
 	},
@@ -449,18 +444,18 @@ static struct openais_exec_handler msg_exec_service[] = {
 	}
 	}
 };
 };
 
 
-struct openais_service_handler msg_service_handler = {
+struct corosync_service_engine msg_service_engine = {
 	.name				= "openais message service B.01.01",
 	.name				= "openais message service B.01.01",
 	.id				= MSG_SERVICE,
 	.id				= MSG_SERVICE,
 	.private_data_size		= sizeof (struct msg_pd),
 	.private_data_size		= sizeof (struct msg_pd),
-	.flow_control			= OPENAIS_FLOW_CONTROL_NOT_REQUIRED, 
+	.flow_control			= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED, 
 	.lib_init_fn			= msg_lib_init_fn,
 	.lib_init_fn			= msg_lib_init_fn,
 	.lib_exit_fn			= msg_lib_exit_fn,
 	.lib_exit_fn			= msg_lib_exit_fn,
-	.lib_service			= msg_lib_service,
-	.lib_service_count		= sizeof (msg_lib_service) / sizeof (struct openais_lib_handler),
+	.lib_engine			= msg_lib_engine,
+	.lib_engine_count		= sizeof (msg_lib_engine) / sizeof (struct corosync_lib_handler),
 	.exec_init_fn			= msg_exec_init_fn,
 	.exec_init_fn			= msg_exec_init_fn,
-	.exec_service			= msg_exec_service,
-	.exec_service_count		= sizeof (msg_exec_service) / sizeof (struct openais_exec_handler),
+	.exec_engine			= msg_exec_engine,
+	.exec_engine_count		= sizeof (msg_exec_engine) / sizeof (struct corosync_exec_handler),
 	.confchg_fn			= msg_confchg_fn,
 	.confchg_fn			= msg_confchg_fn,
 	.exec_dump_fn			= NULL,
 	.exec_dump_fn			= NULL,
 	.sync_init			= NULL, // TODO msg_sync_init,
 	.sync_init			= NULL, // TODO msg_sync_init,
@@ -469,10 +464,10 @@ struct openais_service_handler msg_service_handler = {
 	.sync_abort			= msg_sync_abort
 	.sync_abort			= msg_sync_abort
 };
 };
 
 
-static struct openais_service_handler *msg_get_handler_ver0 (void);
+static struct corosync_service_engine *msg_get_engine_ver0 (void);
 
 
-static struct openais_service_handler_iface_ver0 msg_service_handler_iface = {
-	.openais_get_service_handler_ver0	= msg_get_handler_ver0
+static struct corosync_service_engine_iface_ver0 msg_service_engine_iface = {
+	.corosync_get_service_engine_ver0	= msg_get_engine_ver0
 };
 };
 
 
 static struct lcr_iface openais_msg_ver0[1] = {
 static struct lcr_iface openais_msg_ver0[1] = {
@@ -494,13 +489,13 @@ static struct lcr_comp msg_comp_ver0 = {
 	.ifaces				= openais_msg_ver0
 	.ifaces				= openais_msg_ver0
 };
 };
 
 
-static struct openais_service_handler *msg_get_handler_ver0 (void)
+static struct corosync_service_engine *msg_get_engine_ver0 (void)
 {
 {
-	return (&msg_service_handler);
+	return (&msg_service_engine);
 }
 }
 
 
 __attribute__ ((constructor)) static void register_this_component (void) {
 __attribute__ ((constructor)) static void register_this_component (void) {
-	lcr_interfaces_set (&openais_msg_ver0[0], &msg_service_handler_iface);
+	lcr_interfaces_set (&openais_msg_ver0[0], &msg_service_engine_iface);
 
 
 	lcr_component_register (&msg_comp_ver0);
 	lcr_component_register (&msg_comp_ver0);
 }
 }
@@ -615,6 +610,47 @@ struct req_exec_msg_messagereply {
 	int async_call;
 	int async_call;
 };
 };
 
 
+char *getSaNameT (SaNameT *name)
+{
+#if 0
+        static char ret_name[300];
+
+        memset (ret_name, 0, sizeof (ret_name));
+        if (name->length > 299) {
+                memcpy (ret_name, name->value, 299);
+        } else {
+
+                memcpy (ret_name, name->value, name->length);
+        }
+        return (ret_name);
+#endif
+// TODO
+        return ((char *)name->value);
+}
+
+int name_match(SaNameT *name1, SaNameT *name2)
+{
+	if (name1->length == name2->length) {
+	return ((strncmp ((char *)name1->value, (char *)name2->value, name1->length)) == 0);
+	}
+	return 0;
+}
+
+SaTimeT clust_time_now(void)
+{
+	struct timeval tv;
+	SaTimeT time_now;
+
+	if (gettimeofday(&tv, 0)) {
+		return 0ULL;
+	}
+
+	time_now = (SaTimeT)(tv.tv_sec) * 1000000000ULL;
+	time_now += (SaTimeT)(tv.tv_usec) * 1000ULL;
+
+	return time_now;
+}
+
 #ifdef TODO
 #ifdef TODO
 static void msg_sync_init (void) 
 static void msg_sync_init (void) 
 {
 {
@@ -826,8 +862,10 @@ static unsigned int queue_group_track (
 	return (i);
 	return (i);
 }
 }
 
 
-static int msg_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int msg_exec_init_fn (struct corosync_api_v1 *corosync_api)
 {
 {
+	api = corosync_api;
+
 	/*
 	/*
 	 *  Initialize the saved ring ID.
 	 *  Initialize the saved ring ID.
 	 */
 	 */
@@ -841,7 +879,7 @@ static int msg_exec_init_fn (struct objdb_iface_ver0 *objdb)
 static int msg_lib_exit_fn (void *conn)
 static int msg_lib_exit_fn (void *conn)
 {
 {
 	/*
 	/*
-	 * struct msg_pd *msg_pd = (struct msg_pd *)openais_conn_private_data_get (conn);
+	 * struct msg_pd *msg_pd = (struct msg_pd *)api->ipc_private_data_get (conn);
 	 */
 	 */
 
 
 #ifdef COMPILE_OUT
 #ifdef COMPILE_OUT
@@ -856,7 +894,7 @@ static int msg_lib_exit_fn (void *conn)
 		
 		
 		queue_cleanup = list_entry (list, struct queue_cleanup, list);
 		queue_cleanup = list_entry (list, struct queue_cleanup, list);
 
 
-		if (queue_cleanup->queue->name.length > 0)	{
+		if (queue_cleanup->queue->name.length > 0) {
 			msg_queue_cleanup_lock_remove (queue_cleanup);
 			msg_queue_cleanup_lock_remove (queue_cleanup);
 			msg_queue_close (queue_cleanup->queue);
 			msg_queue_close (queue_cleanup->queue);
 		}
 		}
@@ -873,7 +911,7 @@ static int msg_lib_exit_fn (void *conn)
 
 
 static int msg_lib_init_fn (void *conn)
 static int msg_lib_init_fn (void *conn)
 {
 {
-	struct msg_pd *msg_pd = (struct msg_pd *)openais_conn_private_data_get (conn);
+	struct msg_pd *msg_pd = (struct msg_pd *)api->ipc_private_data_get (conn);
 
 
 	list_init (&msg_pd->queue_list);
 	list_init (&msg_pd->queue_list);
 	list_init (&msg_pd->queue_cleanup_list);
 	list_init (&msg_pd->queue_cleanup_list);
@@ -950,7 +988,7 @@ error_exit:
 	/*
 	/*
 	 * If this node was the source of the message, respond to this node
 	 * If this node was the source of the message, respond to this node
 	 */
 	 */
-	if (message_source_is_local (&req_exec_msg_queueopen->source)) {
+	if (api->ipc_source_is_local (&req_exec_msg_queueopen->source)) {
 		/*
 		/*
 		 * If its an async call respond with the invocation and handle
 		 * If its an async call respond with the invocation and handle
 		 */
 		 */
@@ -971,13 +1009,13 @@ error_exit:
 				&req_exec_msg_queueopen->source,
 				&req_exec_msg_queueopen->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_msg_queueopen->source.conn,
 				req_exec_msg_queueopen->source.conn,
 				&res_lib_msg_queueopenasync,
 				&res_lib_msg_queueopenasync,
 				sizeof (struct res_lib_msg_queueopenasync));
 				sizeof (struct res_lib_msg_queueopenasync));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_queueopen->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_queueopen->source.conn),
 				&res_lib_msg_queueopenasync,
 				&res_lib_msg_queueopenasync,
 				sizeof (struct res_lib_msg_queueopenasync));
 				sizeof (struct res_lib_msg_queueopenasync));
 		} else {
 		} else {
@@ -997,7 +1035,7 @@ error_exit:
 				&req_exec_msg_queueopen->source,
 				&req_exec_msg_queueopen->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_msg_queueopen->source.conn,
 				req_exec_msg_queueopen->source.conn,
 				&res_lib_msg_queueopen,
 				&res_lib_msg_queueopen,
 				sizeof (struct res_lib_msg_queueopen));
 				sizeof (struct res_lib_msg_queueopen));
@@ -1030,7 +1068,7 @@ static void message_handler_req_exec_msg_queueclose (
 	}
 	}
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queueclose->source))
+	if (api->ipc_source_is_local(&req_exec_msg_queueclose->source))
 	{
 	{
 
 
 		/* TODO */
 		/* TODO */
@@ -1047,7 +1085,7 @@ error_exit:
 			MESSAGE_RES_MSG_QUEUECLOSE;
 			MESSAGE_RES_MSG_QUEUECLOSE;
 		res_lib_msg_queueclose.header.error = error;
 		res_lib_msg_queueclose.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queueclose->source.conn,
 			req_exec_msg_queueclose->source.conn,
 			&res_lib_msg_queueclose,
 			&res_lib_msg_queueclose,
 			sizeof (struct res_lib_msg_queueclose));
 			sizeof (struct res_lib_msg_queueclose));
@@ -1107,14 +1145,14 @@ static void message_handler_req_exec_msg_queuegroupcreate (
 	}
 	}
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queuegroupcreate->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegroupcreate->source)) {
 		res_lib_msg_queuegroupcreate.header.size =
 		res_lib_msg_queuegroupcreate.header.size =
 			sizeof (struct res_lib_msg_queuegroupcreate);
 			sizeof (struct res_lib_msg_queuegroupcreate);
 		res_lib_msg_queuegroupcreate.header.id =
 		res_lib_msg_queuegroupcreate.header.id =
 			MESSAGE_RES_MSG_QUEUEGROUPCREATE;
 			MESSAGE_RES_MSG_QUEUEGROUPCREATE;
 		res_lib_msg_queuegroupcreate.header.error = error;
 		res_lib_msg_queuegroupcreate.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queuegroupcreate->source.conn,
 			req_exec_msg_queuegroupcreate->source.conn,
 			&res_lib_msg_queuegroupcreate,
 			&res_lib_msg_queuegroupcreate,
 			sizeof (struct res_lib_msg_queuegroupcreate));
 			sizeof (struct res_lib_msg_queuegroupcreate));
@@ -1207,14 +1245,14 @@ error_track:
 	queue_group_entry->change = SA_MSG_QUEUE_GROUP_NO_CHANGE;
 	queue_group_entry->change = SA_MSG_QUEUE_GROUP_NO_CHANGE;
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queuegroupinsert->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegroupinsert->source)) {
 		res_lib_msg_queuegroupinsert.header.size =
 		res_lib_msg_queuegroupinsert.header.size =
 			sizeof (struct res_lib_msg_queuegroupinsert);
 			sizeof (struct res_lib_msg_queuegroupinsert);
 		res_lib_msg_queuegroupinsert.header.id =
 		res_lib_msg_queuegroupinsert.header.id =
 			MESSAGE_RES_MSG_QUEUEGROUPINSERT;
 			MESSAGE_RES_MSG_QUEUEGROUPINSERT;
 		res_lib_msg_queuegroupinsert.header.error = error;
 		res_lib_msg_queuegroupinsert.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queuegroupinsert->source.conn,
 			req_exec_msg_queuegroupinsert->source.conn,
 			&res_lib_msg_queuegroupinsert,
 			&res_lib_msg_queuegroupinsert,
 			sizeof (struct res_lib_msg_queuegroupinsert));
 			sizeof (struct res_lib_msg_queuegroupinsert));
@@ -1239,13 +1277,13 @@ error_exit:
 				&req_exec_msg_queuegroupinsert->queue_group_name,
 				&req_exec_msg_queuegroupinsert->queue_group_name,
 				sizeof (SaNameT));
 				sizeof (SaNameT));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_queuegroupinsert->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_queuegroupinsert->source.conn),
 				&res_lib_msg_queuegrouptrack,
 				&res_lib_msg_queuegrouptrack,
 				sizeof (struct res_lib_msg_queuegrouptrack));
 				sizeof (struct res_lib_msg_queuegrouptrack));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_queuegroupinsert->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_queuegroupinsert->source.conn),
 				notification,
 				notification,
 				(sizeof (SaMsgQueueGroupNotificationT) *
 				(sizeof (SaMsgQueueGroupNotificationT) *
 				 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 				 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
@@ -1335,14 +1373,14 @@ error_track:
 	list_del (&queue_group_entry->list);
 	list_del (&queue_group_entry->list);
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queuegroupremove->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegroupremove->source)) {
 		res_lib_msg_queuegroupremove.header.size =
 		res_lib_msg_queuegroupremove.header.size =
 			sizeof (struct res_lib_msg_queuegroupremove);
 			sizeof (struct res_lib_msg_queuegroupremove);
 		res_lib_msg_queuegroupremove.header.id =
 		res_lib_msg_queuegroupremove.header.id =
 			MESSAGE_RES_MSG_QUEUEGROUPREMOVE;
 			MESSAGE_RES_MSG_QUEUEGROUPREMOVE;
 		res_lib_msg_queuegroupremove.header.error = error;
 		res_lib_msg_queuegroupremove.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queuegroupremove->source.conn,
 			req_exec_msg_queuegroupremove->source.conn,
 			&res_lib_msg_queuegroupremove,
 			&res_lib_msg_queuegroupremove,
 			sizeof (struct res_lib_msg_queuegroupremove));
 			sizeof (struct res_lib_msg_queuegroupremove));
@@ -1367,13 +1405,13 @@ error_exit:
 				&req_exec_msg_queuegroupremove->queue_group_name,
 				&req_exec_msg_queuegroupremove->queue_group_name,
 				sizeof (SaNameT));
 				sizeof (SaNameT));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_queuegroupremove->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_queuegroupremove->source.conn),
 				&res_lib_msg_queuegrouptrack,
 				&res_lib_msg_queuegrouptrack,
 				sizeof (struct res_lib_msg_queuegrouptrack));
 				sizeof (struct res_lib_msg_queuegrouptrack));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_queuegroupremove->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_queuegroupremove->source.conn),
 				notification,
 				notification,
 				(sizeof (SaMsgQueueGroupNotificationT) *
 				(sizeof (SaMsgQueueGroupNotificationT) *
 				 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 				 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
@@ -1400,14 +1438,14 @@ static void message_handler_req_exec_msg_queuegroupdelete (
 		error = SA_AIS_ERR_NOT_EXIST;
 		error = SA_AIS_ERR_NOT_EXIST;
 	}
 	}
 
 
-	if (message_source_is_local(&req_exec_msg_queuegroupdelete->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegroupdelete->source)) {
 		res_lib_msg_queuegroupdelete.header.size =
 		res_lib_msg_queuegroupdelete.header.size =
 			sizeof (struct res_lib_msg_queuegroupdelete);
 			sizeof (struct res_lib_msg_queuegroupdelete);
 		res_lib_msg_queuegroupdelete.header.id =
 		res_lib_msg_queuegroupdelete.header.id =
 			MESSAGE_RES_MSG_QUEUEGROUPDELETE;
 			MESSAGE_RES_MSG_QUEUEGROUPDELETE;
 		res_lib_msg_queuegroupdelete.header.error = error;
 		res_lib_msg_queuegroupdelete.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queuegroupdelete->source.conn,
 			req_exec_msg_queuegroupdelete->source.conn,
 			&res_lib_msg_queuegroupdelete,
 			&res_lib_msg_queuegroupdelete,
 			sizeof (struct res_lib_msg_queuegroupdelete));
 			sizeof (struct res_lib_msg_queuegroupdelete));
@@ -1469,7 +1507,7 @@ static void message_handler_req_exec_msg_queuegrouptrack (
 	}
 	}
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queuegrouptrack->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegrouptrack->source)) {
 		res_lib_msg_queuegrouptrack.header.size =
 		res_lib_msg_queuegrouptrack.header.size =
 			sizeof (struct res_lib_msg_queuegrouptrack);
 			sizeof (struct res_lib_msg_queuegrouptrack);
 		res_lib_msg_queuegrouptrack.header.id =
 		res_lib_msg_queuegrouptrack.header.id =
@@ -1487,18 +1525,18 @@ error_exit:
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems);
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems);
 
 
-				openais_conn_send_response (
+				api->ipc_conn_send_response (
 					req_exec_msg_queuegrouptrack->source.conn,
 					req_exec_msg_queuegrouptrack->source.conn,
 					&res_lib_msg_queuegrouptrack,
 					&res_lib_msg_queuegrouptrack,
 					sizeof (struct res_lib_msg_queuegrouptrack));
 					sizeof (struct res_lib_msg_queuegrouptrack));
 
 
-				openais_conn_send_response (
+				api->ipc_conn_send_response (
 					req_exec_msg_queuegrouptrack->source.conn,
 					req_exec_msg_queuegrouptrack->source.conn,
 					notification,
 					notification,
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 			} else {
 			} else {
-				openais_conn_send_response (
+				api->ipc_conn_send_response (
 					req_exec_msg_queuegrouptrack->source.conn,
 					req_exec_msg_queuegrouptrack->source.conn,
 					&res_lib_msg_queuegrouptrack,
 					&res_lib_msg_queuegrouptrack,
 					sizeof (struct res_lib_msg_queuegrouptrack));
 					sizeof (struct res_lib_msg_queuegrouptrack));
@@ -1507,19 +1545,19 @@ error_exit:
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems);
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems);
 
 
-				openais_conn_send_response (
-					openais_conn_partner_get (req_exec_msg_queuegrouptrack->source.conn),
+				api->ipc_conn_send_response (
+					api->ipc_conn_partner_get (req_exec_msg_queuegrouptrack->source.conn),
 					&res_lib_msg_queuegrouptrack,
 					&res_lib_msg_queuegrouptrack,
 					sizeof (struct res_lib_msg_queuegrouptrack));
 					sizeof (struct res_lib_msg_queuegrouptrack));
 
 
-				openais_conn_send_response (
-					openais_conn_partner_get (req_exec_msg_queuegrouptrack->source.conn),
+				api->ipc_conn_send_response (
+					api->ipc_conn_partner_get (req_exec_msg_queuegrouptrack->source.conn),
 					notification,
 					notification,
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					(sizeof (SaMsgQueueGroupNotificationT) *
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 					 res_lib_msg_queuegrouptrack.notificationBuffer.numberOfItems));
 			}
 			}
 		} else {
 		} else {
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_msg_queuegrouptrack->source.conn,
 				req_exec_msg_queuegrouptrack->source.conn,
 				&res_lib_msg_queuegrouptrack,
 				&res_lib_msg_queuegrouptrack,
 				sizeof (struct res_lib_msg_queuegrouptrack));
 				sizeof (struct res_lib_msg_queuegrouptrack));
@@ -1553,14 +1591,14 @@ static void message_handler_req_exec_msg_queuegrouptrackstop (
 	queue_group->track_flags = 0;
 	queue_group->track_flags = 0;
 
 
 error_exit:
 error_exit:
-	if (message_source_is_local(&req_exec_msg_queuegrouptrackstop->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_queuegrouptrackstop->source)) {
 		res_lib_msg_queuegrouptrackstop.header.size =
 		res_lib_msg_queuegrouptrackstop.header.size =
 			sizeof (struct res_lib_msg_queuegrouptrackstop);
 			sizeof (struct res_lib_msg_queuegrouptrackstop);
 		res_lib_msg_queuegrouptrackstop.header.id =
 		res_lib_msg_queuegrouptrackstop.header.id =
 			MESSAGE_RES_MSG_QUEUEGROUPTRACKSTOP;
 			MESSAGE_RES_MSG_QUEUEGROUPTRACKSTOP;
 		res_lib_msg_queuegrouptrackstop.header.error = error;
 		res_lib_msg_queuegrouptrackstop.header.error = error;
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_queuegrouptrackstop->source.conn,
 			req_exec_msg_queuegrouptrackstop->source.conn,
 			&res_lib_msg_queuegrouptrackstop,
 			&res_lib_msg_queuegrouptrackstop,
 			sizeof (struct res_lib_msg_queuegrouptrackstop));
 			sizeof (struct res_lib_msg_queuegrouptrackstop));
@@ -1616,7 +1654,7 @@ static void message_handler_req_exec_msg_messagesend (
 
 
 error_exit:
 error_exit:
 
 
-	if (message_source_is_local(&req_exec_msg_messagesend->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_messagesend->source)) {
 		if (req_exec_msg_messagesend->async_call) {
 		if (req_exec_msg_messagesend->async_call) {
 			res_lib_msg_messagesendasync.header.size =
 			res_lib_msg_messagesendasync.header.size =
 				sizeof (struct res_lib_msg_messagesendasync);
 				sizeof (struct res_lib_msg_messagesendasync);
@@ -1630,13 +1668,13 @@ error_exit:
 				&req_exec_msg_messagesend->source,
 				&req_exec_msg_messagesend->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_msg_messagesend->source.conn,
 				req_exec_msg_messagesend->source.conn,
 				&res_lib_msg_messagesendasync,
 				&res_lib_msg_messagesendasync,
 				sizeof (struct res_lib_msg_messagesendasync));
 				sizeof (struct res_lib_msg_messagesendasync));
 
 
-			openais_conn_send_response (
-				openais_conn_partner_get (req_exec_msg_messagesend->source.conn),
+			api->ipc_conn_send_response (
+				api->ipc_conn_partner_get (req_exec_msg_messagesend->source.conn),
 				&res_lib_msg_messagesendasync,
 				&res_lib_msg_messagesendasync,
 				sizeof (struct res_lib_msg_messagesendasync));
 				sizeof (struct res_lib_msg_messagesendasync));
 		} else {
 		} else {
@@ -1650,7 +1688,7 @@ error_exit:
 				&req_exec_msg_messagesend->source,
 				&req_exec_msg_messagesend->source,
 				sizeof (mar_message_source_t));
 				sizeof (mar_message_source_t));
 
 
-			openais_conn_send_response (
+			api->ipc_conn_send_response (
 				req_exec_msg_messagesend->source.conn,
 				req_exec_msg_messagesend->source.conn,
 				&res_lib_msg_messagesend,
 				&res_lib_msg_messagesend,
 				sizeof (struct res_lib_msg_messagesend));
 				sizeof (struct res_lib_msg_messagesend));
@@ -1693,7 +1731,7 @@ static void message_handler_req_exec_msg_messageget (
 
 
 error_exit:
 error_exit:
 
 
-	if (message_source_is_local(&req_exec_msg_messageget->source)) {
+	if (api->ipc_source_is_local(&req_exec_msg_messageget->source)) {
 		res_lib_msg_messageget.header.size =
 		res_lib_msg_messageget.header.size =
 			sizeof (struct res_lib_msg_messageget);
 			sizeof (struct res_lib_msg_messageget);
 		res_lib_msg_messageget.header.id =
 		res_lib_msg_messageget.header.id =
@@ -1706,12 +1744,12 @@ error_exit:
 			&req_exec_msg_messageget->source,
 			&req_exec_msg_messageget->source,
 			sizeof (mar_message_source_t));
 			sizeof (mar_message_source_t));
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_messageget->source.conn,
 			req_exec_msg_messageget->source.conn,
 			&res_lib_msg_messageget,
 			&res_lib_msg_messageget,
 			sizeof (struct res_lib_msg_messageget));
 			sizeof (struct res_lib_msg_messageget));
 
 
-		openais_conn_send_response (
+		api->ipc_conn_send_response (
 			req_exec_msg_messageget->source.conn,
 			req_exec_msg_messageget->source.conn,
 			res_lib_msg_messageget.message.data,
 			res_lib_msg_messageget.message.data,
 			res_lib_msg_messageget.message.size);
 			res_lib_msg_messageget.message.size);
@@ -1768,7 +1806,7 @@ static void message_handler_req_lib_msg_queueopen (
 	req_exec_msg_queueopen.header.id = 
 	req_exec_msg_queueopen.header.id = 
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEOPEN);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEOPEN);
 
 
-	message_source_set (&req_exec_msg_queueopen.source, conn);
+	api->ipc_source_set (&req_exec_msg_queueopen.source, conn);
 
 
 	memcpy (&req_exec_msg_queueopen.queue_name,
 	memcpy (&req_exec_msg_queueopen.queue_name,
 		&req_lib_msg_queueopen->queueName, sizeof (SaNameT));
 		&req_lib_msg_queueopen->queueName, sizeof (SaNameT));
@@ -1786,8 +1824,8 @@ static void message_handler_req_lib_msg_queueopen (
 	iovec.iov_base = (char *)&req_exec_msg_queueopen;
 	iovec.iov_base = (char *)&req_exec_msg_queueopen;
 	iovec.iov_len = sizeof (req_exec_msg_queueopen);
 	iovec.iov_len = sizeof (req_exec_msg_queueopen);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queueopenasync (
 static void message_handler_req_lib_msg_queueopenasync (
@@ -1807,7 +1845,7 @@ static void message_handler_req_lib_msg_queueopenasync (
 	req_exec_msg_queueopen.header.id =
 	req_exec_msg_queueopen.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEOPEN);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEOPEN);
 
 
-	message_source_set (&req_exec_msg_queueopen.source, conn);
+	api->ipc_source_set (&req_exec_msg_queueopen.source, conn);
 
 
 	memcpy (&req_exec_msg_queueopen.queue_name,
 	memcpy (&req_exec_msg_queueopen.queue_name,
 		&req_lib_msg_queueopen->queueName, sizeof (SaNameT));
 		&req_lib_msg_queueopen->queueName, sizeof (SaNameT));
@@ -1825,8 +1863,8 @@ static void message_handler_req_lib_msg_queueopenasync (
 	iovec.iov_base = (char *)&req_exec_msg_queueopen;
 	iovec.iov_base = (char *)&req_exec_msg_queueopen;
 	iovec.iov_len = sizeof (req_exec_msg_queueopen);
 	iovec.iov_len = sizeof (req_exec_msg_queueopen);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queueclose (
 static void message_handler_req_lib_msg_queueclose (
@@ -1846,7 +1884,7 @@ static void message_handler_req_lib_msg_queueclose (
 	req_exec_msg_queueclose.header.id = 
 	req_exec_msg_queueclose.header.id = 
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUECLOSE);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUECLOSE);
 
 
-	message_source_set (&req_exec_msg_queueclose.source, conn);
+	api->ipc_source_set (&req_exec_msg_queueclose.source, conn);
 
 
 	memcpy (&req_exec_msg_queueclose.queue_name,
 	memcpy (&req_exec_msg_queueclose.queue_name,
 		&req_lib_msg_queueclose->queueName, sizeof (SaNameT));
 		&req_lib_msg_queueclose->queueName, sizeof (SaNameT));
@@ -1854,8 +1892,8 @@ static void message_handler_req_lib_msg_queueclose (
 	iovec.iov_base = (char *)&req_exec_msg_queueclose;
 	iovec.iov_base = (char *)&req_exec_msg_queueclose;
 	iovec.iov_len = sizeof (req_exec_msg_queueclose);
 	iovec.iov_len = sizeof (req_exec_msg_queueclose);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuestatusget (
 static void message_handler_req_lib_msg_queuestatusget (
@@ -1875,7 +1913,7 @@ static void message_handler_req_lib_msg_queuestatusget (
 	req_exec_msg_queuestatusget.header.id =
 	req_exec_msg_queuestatusget.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUESTATUSGET);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUESTATUSGET);
 
 
-	message_source_set (&req_exec_msg_queuestatusget.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuestatusget.source, conn);
 
 
 	memcpy (&req_exec_msg_queuestatusget.queue_name,
 	memcpy (&req_exec_msg_queuestatusget.queue_name,
 		&req_lib_msg_queuestatusget->queueName, sizeof (SaNameT));
 		&req_lib_msg_queuestatusget->queueName, sizeof (SaNameT));
@@ -1883,8 +1921,8 @@ static void message_handler_req_lib_msg_queuestatusget (
 	iovec.iov_base = (char *)&req_exec_msg_queuestatusget;
 	iovec.iov_base = (char *)&req_exec_msg_queuestatusget;
 	iovec.iov_len = sizeof (req_exec_msg_queuestatusget);
 	iovec.iov_len = sizeof (req_exec_msg_queuestatusget);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queueunlink (
 static void message_handler_req_lib_msg_queueunlink (
@@ -1904,7 +1942,7 @@ static void message_handler_req_lib_msg_queueunlink (
 	req_exec_msg_queueunlink.header.id =
 	req_exec_msg_queueunlink.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEUNLINK);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEUNLINK);
 
 
-	message_source_set (&req_exec_msg_queueunlink.source, conn);
+	api->ipc_source_set (&req_exec_msg_queueunlink.source, conn);
 
 
 	memcpy (&req_exec_msg_queueunlink.queue_name,
 	memcpy (&req_exec_msg_queueunlink.queue_name,
 		&req_lib_msg_queueunlink->queueName, sizeof (SaNameT));
 		&req_lib_msg_queueunlink->queueName, sizeof (SaNameT));
@@ -1912,8 +1950,8 @@ static void message_handler_req_lib_msg_queueunlink (
 	iovec.iov_base = (char *)&req_exec_msg_queueunlink;
 	iovec.iov_base = (char *)&req_exec_msg_queueunlink;
 	iovec.iov_len = sizeof (req_exec_msg_queueunlink);
 	iovec.iov_len = sizeof (req_exec_msg_queueunlink);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegroupcreate (
 static void message_handler_req_lib_msg_queuegroupcreate (
@@ -1933,7 +1971,7 @@ static void message_handler_req_lib_msg_queuegroupcreate (
 	req_exec_msg_queuegroupcreate.header.id =
 	req_exec_msg_queuegroupcreate.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEGROUPCREATE);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEGROUPCREATE);
 
 
-	message_source_set (&req_exec_msg_queuegroupcreate.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegroupcreate.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegroupcreate.queue_group_name,
 	memcpy (&req_exec_msg_queuegroupcreate.queue_group_name,
 		&req_lib_msg_queuegroupcreate->queueGroupName, sizeof (SaNameT));
 		&req_lib_msg_queuegroupcreate->queueGroupName, sizeof (SaNameT));
@@ -1944,8 +1982,8 @@ static void message_handler_req_lib_msg_queuegroupcreate (
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupcreate;
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupcreate;
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupcreate);
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupcreate);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegroupinsert (
 static void message_handler_req_lib_msg_queuegroupinsert (
@@ -1965,7 +2003,7 @@ static void message_handler_req_lib_msg_queuegroupinsert (
 	req_exec_msg_queuegroupinsert.header.id =
 	req_exec_msg_queuegroupinsert.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEGROUPINSERT);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_QUEUEGROUPINSERT);
 
 
-	message_source_set (&req_exec_msg_queuegroupinsert.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegroupinsert.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegroupinsert.queue_name,
 	memcpy (&req_exec_msg_queuegroupinsert.queue_name,
 		&req_lib_msg_queuegroupinsert->queueName, sizeof (SaNameT));
 		&req_lib_msg_queuegroupinsert->queueName, sizeof (SaNameT));
@@ -1975,8 +2013,8 @@ static void message_handler_req_lib_msg_queuegroupinsert (
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupinsert;
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupinsert;
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupinsert);
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupinsert);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegroupremove (
 static void message_handler_req_lib_msg_queuegroupremove (
@@ -1996,7 +2034,7 @@ static void message_handler_req_lib_msg_queuegroupremove (
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupRemove %s\n",
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupRemove %s\n",
 		getSaNameT (&req_lib_msg_queuegroupremove->queueGroupName));
 		getSaNameT (&req_lib_msg_queuegroupremove->queueGroupName));
 
 
-	message_source_set (&req_exec_msg_queuegroupremove.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegroupremove.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegroupremove.queue_name,
 	memcpy (&req_exec_msg_queuegroupremove.queue_name,
 		&req_lib_msg_queuegroupremove->queueName, sizeof (SaNameT));
 		&req_lib_msg_queuegroupremove->queueName, sizeof (SaNameT));
@@ -2006,8 +2044,8 @@ static void message_handler_req_lib_msg_queuegroupremove (
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupremove;
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupremove;
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupremove);
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupremove);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegroupdelete (
 static void message_handler_req_lib_msg_queuegroupdelete (
@@ -2027,7 +2065,7 @@ static void message_handler_req_lib_msg_queuegroupdelete (
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupDelete %s\n",
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupDelete %s\n",
 		getSaNameT (&req_lib_msg_queuegroupdelete->queueGroupName));
 		getSaNameT (&req_lib_msg_queuegroupdelete->queueGroupName));
 
 
-	message_source_set (&req_exec_msg_queuegroupdelete.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegroupdelete.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegroupdelete.queue_group_name,
 	memcpy (&req_exec_msg_queuegroupdelete.queue_group_name,
 		&req_lib_msg_queuegroupdelete->queueGroupName, sizeof (SaNameT));
 		&req_lib_msg_queuegroupdelete->queueGroupName, sizeof (SaNameT));
@@ -2035,8 +2073,8 @@ static void message_handler_req_lib_msg_queuegroupdelete (
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupdelete;
 	iovec.iov_base = (char *)&req_exec_msg_queuegroupdelete;
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupdelete);
 	iovec.iov_len = sizeof (req_exec_msg_queuegroupdelete);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegrouptrack (
 static void message_handler_req_lib_msg_queuegrouptrack (
@@ -2056,7 +2094,7 @@ static void message_handler_req_lib_msg_queuegrouptrack (
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupTrack %s\n",
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupTrack %s\n",
 		getSaNameT (&req_lib_msg_queuegrouptrack->queueGroupName));
 		getSaNameT (&req_lib_msg_queuegrouptrack->queueGroupName));
 
 
-	message_source_set (&req_exec_msg_queuegrouptrack.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegrouptrack.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegrouptrack.queue_group_name,
 	memcpy (&req_exec_msg_queuegrouptrack.queue_group_name,
 		&req_lib_msg_queuegrouptrack->queueGroupName, sizeof (SaNameT));
 		&req_lib_msg_queuegrouptrack->queueGroupName, sizeof (SaNameT));
@@ -2069,8 +2107,8 @@ static void message_handler_req_lib_msg_queuegrouptrack (
 	iovec.iov_base = (char *)&req_exec_msg_queuegrouptrack;
 	iovec.iov_base = (char *)&req_exec_msg_queuegrouptrack;
 	iovec.iov_len = sizeof (req_exec_msg_queuegrouptrack);
 	iovec.iov_len = sizeof (req_exec_msg_queuegrouptrack);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_queuegrouptrackstop (
 static void message_handler_req_lib_msg_queuegrouptrackstop (
@@ -2090,7 +2128,7 @@ static void message_handler_req_lib_msg_queuegrouptrackstop (
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupTrackStop %s\n",
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgQueueGroupTrackStop %s\n",
 		getSaNameT (&req_lib_msg_queuegrouptrackstop->queueGroupName));
 		getSaNameT (&req_lib_msg_queuegrouptrackstop->queueGroupName));
 
 
-	message_source_set (&req_exec_msg_queuegrouptrackstop.source, conn);
+	api->ipc_source_set (&req_exec_msg_queuegrouptrackstop.source, conn);
 
 
 	memcpy (&req_exec_msg_queuegrouptrackstop.queue_group_name,
 	memcpy (&req_exec_msg_queuegrouptrackstop.queue_group_name,
 		&req_lib_msg_queuegrouptrackstop->queueGroupName, sizeof (SaNameT));
 		&req_lib_msg_queuegrouptrackstop->queueGroupName, sizeof (SaNameT));
@@ -2098,8 +2136,8 @@ static void message_handler_req_lib_msg_queuegrouptrackstop (
 	iovec.iov_base = (char *)&req_exec_msg_queuegrouptrackstop;
 	iovec.iov_base = (char *)&req_exec_msg_queuegrouptrackstop;
 	iovec.iov_len = sizeof (req_exec_msg_queuegrouptrackstop);
 	iovec.iov_len = sizeof (req_exec_msg_queuegrouptrackstop);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_messagesend (
 static void message_handler_req_lib_msg_messagesend (
@@ -2120,7 +2158,7 @@ static void message_handler_req_lib_msg_messagesend (
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgMessageSend %s\n",
 	log_printf (LOG_LEVEL_NOTICE, "LIB request: saMsgMessageSend %s\n",
 		getSaNameT (&req_lib_msg_messagesend->destination));
 		getSaNameT (&req_lib_msg_messagesend->destination));
 
 
-	message_source_set (&req_exec_msg_messagesend.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagesend.source, conn);
 
 
 	memcpy (&req_exec_msg_messagesend.destination,
 	memcpy (&req_exec_msg_messagesend.destination,
 		&req_lib_msg_messagesend->destination, sizeof (SaNameT));
 		&req_lib_msg_messagesend->destination, sizeof (SaNameT));
@@ -2143,11 +2181,11 @@ static void message_handler_req_lib_msg_messagesend (
 	req_exec_msg_messagesend.header.size += iovecs[1].iov_len;
 	req_exec_msg_messagesend.header.size += iovecs[1].iov_len;
 
 
 	if (iovecs[1].iov_len > 0) {
 	if (iovecs[1].iov_len > 0) {
-		assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 2,
-			TOTEMPG_AGREED) == 0);
+		assert (api->totem_mcast (iovecs, 2,
+			TOTEM_AGREED) == 0);
 	} else {
 	} else {
-		assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1,
-			TOTEMPG_AGREED) == 0);
+		assert (api->totem_mcast (iovecs, 1,
+			TOTEM_AGREED) == 0);
 	}
 	}
 }
 }
 
 
@@ -2168,7 +2206,7 @@ static void message_handler_req_lib_msg_messagesendasync (
 	req_exec_msg_messagesend.header.id =
 	req_exec_msg_messagesend.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGESEND);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGESEND);
 
 
-	message_source_set (&req_exec_msg_messagesend.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagesend.source, conn);
 
 
 	memcpy (&req_exec_msg_messagesend.destination,
 	memcpy (&req_exec_msg_messagesend.destination,
 		&req_lib_msg_messagesend->destination, sizeof (SaNameT));
 		&req_lib_msg_messagesend->destination, sizeof (SaNameT));
@@ -2191,11 +2229,11 @@ static void message_handler_req_lib_msg_messagesendasync (
 	req_exec_msg_messagesend.header.size += iovecs[1].iov_len;
 	req_exec_msg_messagesend.header.size += iovecs[1].iov_len;
 
 
 	if (iovecs[1].iov_len > 0) {
 	if (iovecs[1].iov_len > 0) {
-		assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 2,
-			TOTEMPG_AGREED) == 0);
+		assert (api->totem_mcast (iovecs, 2,
+			TOTEM_AGREED) == 0);
 	} else {
 	} else {
-		assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 2,
-			TOTEMPG_AGREED) == 0);
+		assert (api->totem_mcast (iovecs, 2,
+			TOTEM_AGREED) == 0);
 	}
 	}
 }
 }
 
 
@@ -2216,7 +2254,7 @@ static void message_handler_req_lib_msg_messageget (
 	req_exec_msg_messageget.header.id =
 	req_exec_msg_messageget.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEGET);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEGET);
 
 
-	message_source_set (&req_exec_msg_messageget.source, conn);
+	api->ipc_source_set (&req_exec_msg_messageget.source, conn);
 
 
 	memcpy (&req_exec_msg_messageget.queue_name,
 	memcpy (&req_exec_msg_messageget.queue_name,
 		&req_lib_msg_messageget->queueName, sizeof (SaNameT));
 		&req_lib_msg_messageget->queueName, sizeof (SaNameT));
@@ -2224,8 +2262,8 @@ static void message_handler_req_lib_msg_messageget (
 	iovec.iov_base = (char *)&req_exec_msg_messageget;
 	iovec.iov_base = (char *)&req_exec_msg_messageget;
 	iovec.iov_len = sizeof (req_exec_msg_messageget);
 	iovec.iov_len = sizeof (req_exec_msg_messageget);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_messagecancel (
 static void message_handler_req_lib_msg_messagecancel (
@@ -2245,7 +2283,7 @@ static void message_handler_req_lib_msg_messagecancel (
 	req_exec_msg_messagecancel.header.id =
 	req_exec_msg_messagecancel.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGECANCEL);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGECANCEL);
 
 
-	message_source_set (&req_exec_msg_messagecancel.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagecancel.source, conn);
 
 
 	memcpy (&req_exec_msg_messagecancel.queue_name,
 	memcpy (&req_exec_msg_messagecancel.queue_name,
 		&req_lib_msg_messagecancel->queueName, sizeof (SaNameT));
 		&req_lib_msg_messagecancel->queueName, sizeof (SaNameT));
@@ -2253,8 +2291,8 @@ static void message_handler_req_lib_msg_messagecancel (
 	iovec.iov_base = (char *)&req_exec_msg_messagecancel;
 	iovec.iov_base = (char *)&req_exec_msg_messagecancel;
 	iovec.iov_len = sizeof (req_exec_msg_messagecancel);
 	iovec.iov_len = sizeof (req_exec_msg_messagecancel);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_messagesendreceive (
 static void message_handler_req_lib_msg_messagesendreceive (
@@ -2274,7 +2312,7 @@ static void message_handler_req_lib_msg_messagesendreceive (
 	req_exec_msg_messagesendreceive.header.id =
 	req_exec_msg_messagesendreceive.header.id =
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGESENDRECEIVE);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGESENDRECEIVE);
 
 
-	message_source_set (&req_exec_msg_messagesendreceive.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagesendreceive.source, conn);
 
 
 	memcpy (&req_exec_msg_messagesendreceive.queue_name,
 	memcpy (&req_exec_msg_messagesendreceive.queue_name,
 		&req_lib_msg_messagesendreceive->queueName, sizeof (SaNameT));
 		&req_lib_msg_messagesendreceive->queueName, sizeof (SaNameT));
@@ -2282,8 +2320,8 @@ static void message_handler_req_lib_msg_messagesendreceive (
 	iovec.iov_base = (char *)&req_exec_msg_messagesendreceive;
 	iovec.iov_base = (char *)&req_exec_msg_messagesendreceive;
 	iovec.iov_len = sizeof (req_exec_msg_messagesendreceive);
 	iovec.iov_len = sizeof (req_exec_msg_messagesendreceive);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_messagereply (
 static void message_handler_req_lib_msg_messagereply (
@@ -2304,7 +2342,7 @@ static void message_handler_req_lib_msg_messagereply (
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEREPLY);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEREPLY);
 	req_exec_msg_messagereply.async_call = 0;
 	req_exec_msg_messagereply.async_call = 0;
 
 
-	message_source_set (&req_exec_msg_messagereply.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagereply.source, conn);
 
 
 	memcpy (&req_exec_msg_messagereply.queue_name,
 	memcpy (&req_exec_msg_messagereply.queue_name,
 		&req_lib_msg_messagereply->queueName, sizeof (SaNameT));
 		&req_lib_msg_messagereply->queueName, sizeof (SaNameT));
@@ -2312,8 +2350,8 @@ static void message_handler_req_lib_msg_messagereply (
 	iovec.iov_base = (char *)&req_exec_msg_messagereply;
 	iovec.iov_base = (char *)&req_exec_msg_messagereply;
 	iovec.iov_len = sizeof (req_exec_msg_messagereply);
 	iovec.iov_len = sizeof (req_exec_msg_messagereply);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1,
+		TOTEM_AGREED) == 0);
 }
 }
 
 
 static void message_handler_req_lib_msg_messagereplyasync (
 static void message_handler_req_lib_msg_messagereplyasync (
@@ -2334,7 +2372,7 @@ static void message_handler_req_lib_msg_messagereplyasync (
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEREPLY);
 		SERVICE_ID_MAKE (MSG_SERVICE, MESSAGE_REQ_EXEC_MSG_MESSAGEREPLY);
 	req_exec_msg_messagereply.async_call = 1;
 	req_exec_msg_messagereply.async_call = 1;
 
 
-	message_source_set (&req_exec_msg_messagereply.source, conn);
+	api->ipc_source_set (&req_exec_msg_messagereply.source, conn);
 
 
 	memcpy (&req_exec_msg_messagereply.queue_name,
 	memcpy (&req_exec_msg_messagereply.queue_name,
 		&req_lib_msg_messagereply->queueName, sizeof (SaNameT));
 		&req_lib_msg_messagereply->queueName, sizeof (SaNameT));
@@ -2342,6 +2380,5 @@ static void message_handler_req_lib_msg_messagereplyasync (
 	iovec.iov_base = (char *)&req_exec_msg_messagereply;
 	iovec.iov_base = (char *)&req_exec_msg_messagereply;
 	iovec.iov_len = sizeof (req_exec_msg_messagereply);
 	iovec.iov_len = sizeof (req_exec_msg_messagereply);
 
 
-	assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-		TOTEMPG_AGREED) == 0);
+	assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0);
 }
 }

+ 65 - 0
openais/test/sa_error.c

@@ -0,0 +1,65 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "saAis.h"
+
+const char *sa_error_list[] = {
+	"OUT_OF_RANGE",
+	"SA_AIS_OK",
+	"SA_AIS_ERR_LIBRARY",
+	"SA_AIS_ERR_VERSION",
+	"SA_AIS_ERR_INIT",
+	"SA_AIS_ERR_TIMEOUT",
+	"SA_AIS_ERR_TRY_AGAIN",
+	"SA_AIS_ERR_INVALID_PARAM",
+	"SA_AIS_ERR_NO_MEMORY",
+	"SA_AIS_ERR_BAD_HANDLE",
+	"SA_AIS_ERR_BUSY",
+	"SA_AIS_ERR_ACCESS",
+	"SA_AIS_ERR_NOT_EXIST",
+	"SA_AIS_ERR_NAME_TOO_LONG",
+	"SA_AIS_ERR_EXIST",
+	"SA_AIS_ERR_NO_SPACE",
+	"SA_AIS_ERR_INTERRUPT",
+	"SA_AIS_ERR_NAME_NOT_FOUND",
+	"SA_AIS_ERR_NO_RESOURCES",
+	"SA_AIS_ERR_NOT_SUPPORTED",
+	"SA_AIS_ERR_BAD_OPERATION",
+	"SA_AIS_ERR_FAILED_OPERATION",
+	"SA_AIS_ERR_MESSAGE_ERROR",
+	"SA_AIS_ERR_QUEUE_FULL",
+	"SA_AIS_ERR_QUEUE_NOT_AVAILABLE",
+	"SA_AIS_ERR_BAD_CHECKPOINT",
+	"SA_AIS_ERR_BAD_FLAGS",
+	"SA_AIS_ERR_NO_SECTIONS",
+};
+
+int get_sa_error(SaAisErrorT error, char *str, int len)
+{
+	if (error < SA_AIS_OK || 
+			error > SA_AIS_ERR_NO_SECTIONS || 
+					len < strlen(sa_error_list[error])) {
+			errno = EINVAL;
+		return -1;
+	}
+	strncpy(str, sa_error_list[error], len);
+	return 0;
+}
+
+char *get_sa_error_b (SaAisErrorT error) {
+	return ((char *)sa_error_list[error]);
+}
+
+char *get_test_output (SaAisErrorT result, SaAisErrorT expected) {
+static char test_result[256];
+
+        if (result == expected) {
+                return ("PASSED");
+        } else {
+                sprintf (test_result,
+                        "FAILED expected %s got %s",
+			get_sa_error_b(expected), get_sa_error_b(result));
+                return (test_result);
+        }
+}

+ 5 - 0
openais/test/sa_error.h

@@ -0,0 +1,5 @@
+extern int get_sa_error(SaAisErrorT error, char *str, int len);
+
+extern char *get_sa_error_b (SaAisErrorT error);
+
+extern char *get_test_output (SaAisErrorT result, SaAisErrorT expected);

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác