From 1bf4e3bb25c173f3250d439742ccc655e22ba2ba Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 13 Jul 2005 19:57:48 +0000 Subject: [PATCH] defect 734 cleanup include files and exports from libraries git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@731 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/Makefile | 12 +- exec/amf.c | 46 ++++++- exec/amf.h | 3 +- exec/ckpt.c | 104 ++++++++++++++++ exec/ckpt.h | 1 - exec/clm.c | 10 +- exec/evs.c | 3 +- exec/main.c | 1 - exec/main.h | 34 ++++++ exec/sync.c | 2 +- exec/totem.h | 1 + exec/totempg.h | 3 +- include/{ais_msg.h => ipc_amf.h} | 201 +------------------------------ include/ipc_ckpt.h | 105 +--------------- include/ipc_clm.h | 5 - include/ipc_evs.h | 139 +++++++++++++++++++++ include/ipc_gen.h | 78 +++++++----- lib/Makefile | 22 ++-- lib/amf.c | 13 +- lib/ckpt.c | 5 +- lib/clm.c | 2 +- lib/evs.c | 4 +- lib/evt.c | 2 +- lib/libSaAis.versions | 180 +++++++++++++++++++++++++++ lib/libSaAmf.versions | 38 ++++++ lib/libSaCkpt.versions | 43 +++++++ lib/libSaClm.versions | 29 +++++ lib/libSaEvt.versions | 39 ++++++ lib/libevs.versions | 30 +++++ lib/util.c | 115 +----------------- lib/util.h | 37 +----- test/Makefile | 10 +- test/testamf.c | 2 +- test/testamfth.c | 2 +- 34 files changed, 791 insertions(+), 530 deletions(-) rename include/{ais_msg.h => ipc_amf.h} (62%) create mode 100644 include/ipc_evs.h create mode 100644 lib/libSaAis.versions create mode 100644 lib/libSaAmf.versions create mode 100644 lib/libSaCkpt.versions create mode 100644 lib/libSaClm.versions create mode 100644 lib/libSaEvt.versions create mode 100644 lib/libevs.versions diff --git a/exec/Makefile b/exec/Makefile index 4a670a56..9927f6aa 100644 --- a/exec/Makefile +++ b/exec/Makefile @@ -100,22 +100,22 @@ crypto.o: crypto.c # DO NOT DELETE -main.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h +main.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h main.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h parse.h main.o: main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h main.o: ../include/saEvt.h swab.h print.h clm.o: ../include/ais_types.h ../include/saClm.h ../include/ais_types.h -clm.o: ../include/ais_msg.h evs.h ../include/saClm.h ../include/ipc_gen.h +clm.o: ../include/ipc_evs.h evs.h ../include/saClm.h ../include/ipc_gen.h clm.o: ../include/ipc_clm.h ../include/list.h ../include/queue.h aispoll.h clm.o: totempg.h totemsrp.h parse.h main.h clm.h amf.h handlers.h ckpt.h clm.o: evt.h hdb.h ../include/saEvt.h mempool.h print.h -amf.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h +amf.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h amf.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h amf.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h util.h amf.o: parse.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h amf.o: hdb.h ../include/saEvt.h print.h -ckpt.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h +ckpt.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h ckpt.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h ckpt.o: ../include/queue.h aispoll.h mempool.h util.h parse.h totempg.h ckpt.o: totemsrp.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h @@ -124,9 +124,9 @@ evt.o: ../include/ipc_evt.h ../include/ais_types.h ../include/saEvt.h evt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h evt.o: ../include/queue.h util.h ../include/ais_types.h aispoll.h mempool.h evt.o: parse.h totempg.h totemsrp.h main.h evs.h clm.h ../include/saClm.h -evt.o: amf.h ../include/ais_msg.h handlers.h ckpt.h evt.h hdb.h +evt.o: amf.h ../include/ipc_evs.h handlers.h ckpt.h evt.h hdb.h evt.o: ../include/saEvt.h swab.h print.h -evs.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h +evs.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h evs.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h parse.h main.h clm.h evs.o: ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h diff --git a/exec/amf.c b/exec/amf.c index e2bec8ba..1fa0f878 100644 --- a/exec/amf.c +++ b/exec/amf.c @@ -46,7 +46,8 @@ #include #include "../include/ais_types.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" +#include "../include/ipc_amf.h" #include "../include/list.h" #include "../include/queue.h" #include "totempg.h" @@ -288,6 +289,9 @@ static int message_handler_req_amf_response (struct conn_info *conn_info, void * static int message_handler_req_amf_componentcapabilitymodelget (struct conn_info *conn_info, void *message); +/* + * Service Handler Definition + */ struct libais_handler amf_libais_handlers[] = { { /* 0 */ @@ -382,6 +386,46 @@ struct service_handler amf_service_handler = { .exec_dump_fn = amf_dump }; +struct req_exec_amf_componentregister { + struct req_header header; + struct message_source source; + struct req_lib_amf_componentregister req_lib_amf_componentregister; + SaAmfReadinessStateT currentReadinessState; + SaAmfReadinessStateT newReadinessState; + SaAmfHAStateT currentHAState; + SaAmfHAStateT newHAState; +} __attribute__((packed)); + +struct req_exec_amf_componentunregister { + struct req_header header; + struct message_source source; + struct req_lib_amf_componentunregister req_lib_amf_componentunregister; +}; + +struct req_exec_amf_readinessstateset { + struct req_header header; + SaNameT compName; + SaAmfReadinessStateT readinessState; +}; + +struct req_exec_amf_hastateset { + struct req_header header; + SaNameT compName; + SaAmfHAStateT haState; +}; + +struct req_exec_amf_errorreport { + struct req_header header; + struct message_source source; + struct req_lib_amf_errorreport req_lib_amf_errorreport; +}; + +struct req_exec_amf_errorcancelall { + struct req_header header; + struct message_source source; + struct req_lib_amf_errorcancelall req_lib_amf_errorcancelall; +}; + static void grow_amf_track_table (struct conn_info *conn_info, int growby) { struct libamf_ci_trackentry *tracks; diff --git a/exec/amf.h b/exec/amf.h index 2f82080b..00535a41 100644 --- a/exec/amf.h +++ b/exec/amf.h @@ -31,7 +31,8 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" +#include "../include/ipc_amf.h" #include "aispoll.h" #include "parse.h" #include "handlers.h" diff --git a/exec/ckpt.c b/exec/ckpt.c index da18b88d..d1d7c93d 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -193,6 +193,9 @@ static int ckpt_confchg_fn( struct in_addr *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); +/* + * Executive Handler Definition + */ struct libais_handler ckpt_libais_handlers[] = { { /* 0 */ @@ -332,6 +335,107 @@ struct service_handler ckpt_service_handler = { .sync_abort = ckpt_recovery_abort, }; +/* + * All data types used for executive messages + */ +struct req_exec_ckpt_checkpointclose { + struct req_header header; + struct message_source source; + SaNameT checkpointName; +}; + +struct req_exec_ckpt_checkpointretentiondurationset { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + SaTimeT retentionDuration; +}; + +struct req_exec_ckpt_checkpointretentiondurationexpire { + struct req_header header; + SaNameT checkpointName; +}; + +struct req_exec_ckpt_checkpointopen { + struct req_header header; + struct message_source source; + struct req_lib_ckpt_checkpointopen req_lib_ckpt_checkpointopen; + SaCkptCheckpointHandleT checkpointHandle; + SaInvocationT invocation; + int async_call; + SaAisErrorT fail_with_error; +}; + +struct req_exec_ckpt_checkpointunlink { + struct req_header header; + struct message_source source; + struct req_lib_ckpt_checkpointunlink req_lib_ckpt_checkpointunlink; +}; + +struct req_exec_ckpt_sectioncreate { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectioncreate req_lib_ckpt_sectioncreate; /* this must be last */ +}; + +struct req_exec_ckpt_sectiondelete { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectiondelete req_lib_ckpt_sectiondelete; /* this must be last */ +}; + +struct req_exec_ckpt_sectionexpirationtimeset { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectionexpirationtimeset req_lib_ckpt_sectionexpirationtimeset; +}; + +struct req_exec_ckpt_sectionwrite { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectionwrite req_lib_ckpt_sectionwrite; +}; + +struct req_exec_ckpt_sectionoverwrite { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectionoverwrite req_lib_ckpt_sectionoverwrite; +}; + +struct req_exec_ckpt_sectionread { + struct req_header header; + struct message_source source; + SaNameT checkpointName; + struct req_lib_ckpt_sectionread req_lib_ckpt_sectionread; +}; + +struct req_exec_ckpt_synchronize_state { + struct req_header header; + struct memb_ring_id previous_ring_id; + SaNameT checkpointName; + SaCkptCheckpointCreationAttributesT checkpointCreationAttributes; + SaCkptSectionDescriptorT sectionDescriptor; + struct in_addr source_addr; + struct ckpt_refcnt ckpt_refcount[PROCESSOR_COUNT_MAX]; +}; + +struct req_exec_ckpt_synchronize_section { + struct req_header header; + struct memb_ring_id previous_ring_id; + SaNameT checkpointName; + SaCkptSectionIdT sectionId; + SaUint32T dataOffSet; + SaUint32T dataSize; +}; + +/* + * Implementation + */ static int processor_index_set(struct in_addr *proc_addr, struct ckpt_refcnt *ckpt_refcount) { diff --git a/exec/ckpt.h b/exec/ckpt.h index 831a229d..c5305164 100644 --- a/exec/ckpt.h +++ b/exec/ckpt.h @@ -34,7 +34,6 @@ #include "../include/ais_types.h" #include "../include/saCkpt.h" #include "aispoll.h" -#include "parse.h" #include "totemsrp.h" #ifndef CKPT_H_DEFINED diff --git a/exec/clm.c b/exec/clm.c index f39ba346..4a2416c2 100644 --- a/exec/clm.c +++ b/exec/clm.c @@ -53,7 +53,7 @@ #include "../include/ais_types.h" #include "../include/saClm.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" #include "../include/ipc_clm.h" #include "../include/list.h" #include "../include/queue.h" @@ -136,6 +136,9 @@ static int message_handler_req_clm_nodegetasync (struct conn_info *conn_info, static int clm_exit_fn (struct conn_info *conn_info); +/* + * Executive Handler Definition + */ struct libais_handler clm_libais_handlers[] = { { /* 0 */ @@ -184,6 +187,11 @@ struct service_handler clm_service_handler = { .sync_abort = clm_sync_abort, }; +struct req_exec_clm_nodejoin { + struct req_header header; + SaClmClusterNodeT clusterNode; +}; + static int clm_exec_init_fn (struct openais_config *openais_config) { memset (clusterNodes, 0, sizeof (SaClmClusterNodeT) * NODE_MAX); diff --git a/exec/evs.c b/exec/evs.c index 2da02c4a..d6c579bb 100644 --- a/exec/evs.c +++ b/exec/evs.c @@ -51,7 +51,8 @@ #include #include "../include/ais_types.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" +#include "../include/ipc_evs.h" #include "../include/list.h" #include "../include/queue.h" #include "aispoll.h" diff --git a/exec/main.c b/exec/main.c index 8a19f0ad..39592fa2 100644 --- a/exec/main.c +++ b/exec/main.c @@ -57,7 +57,6 @@ #include #include "../include/ais_types.h" -#include "../include/ais_msg.h" #include "../include/list.h" #include "../include/queue.h" #include "poll.h" diff --git a/exec/main.h b/exec/main.h index 9b8558ef..381476f5 100644 --- a/exec/main.h +++ b/exec/main.h @@ -36,6 +36,7 @@ #define FALSE 0 #include #include "../include/ais_types.h" +#include "../include/queue.h" #include "poll.h" #include "evs.h" #include "clm.h" @@ -108,6 +109,39 @@ struct conn_info { int should_exit_fn; /* Should call the exit function when closing this ipc */ }; + +enum nodeexec_message_types { + MESSAGE_REQ_EXEC_SYNC_BARRIER = 0, + MESSAGE_REQ_EXEC_EVS_MCAST = 1, + MESSAGE_REQ_EXEC_CLM_NODEJOIN = 2, + MESSAGE_REQ_EXEC_AMF_COMPONENTREGISTER = 3, + MESSAGE_REQ_EXEC_AMF_COMPONENTUNREGISTER = 4, + MESSAGE_REQ_EXEC_AMF_ERRORREPORT = 5, + MESSAGE_REQ_EXEC_AMF_ERRORCANCELALL = 6, + MESSAGE_REQ_EXEC_AMF_READINESSSTATESET = 7, + MESSAGE_REQ_EXEC_AMF_HASTATESET = 8, + MESSAGE_REQ_EXEC_CKPT_CHECKPOINTOPEN = 9, + MESSAGE_REQ_EXEC_CKPT_CHECKPOINTCLOSE = 10, + MESSAGE_REQ_EXEC_CKPT_CHECKPOINTUNLINK = 11, + MESSAGE_REQ_EXEC_CKPT_CHECKPOINTRETENTIONDURATIONSET = 12, + MESSAGE_REQ_EXEC_CKPT_CHECKPOINTRETENTIONDURATIONEXPIRE = 13, + MESSAGE_REQ_EXEC_CKPT_SECTIONCREATE = 14, + MESSAGE_REQ_EXEC_CKPT_SECTIONDELETE = 15, + MESSAGE_REQ_EXEC_CKPT_SECTIONEXPIRATIONTIMESET = 16, + MESSAGE_REQ_EXEC_CKPT_SECTIONWRITE = 17, + MESSAGE_REQ_EXEC_CKPT_SECTIONOVERWRITE = 18, + MESSAGE_REQ_EXEC_CKPT_SECTIONREAD = 19, + MESSAGE_REQ_EXEC_CKPT_SYNCHRONIZESTATE = 20, + MESSAGE_REQ_EXEC_CKPT_SYNCHRONIZESECTION = 21, + MESSAGE_REQ_EXEC_EVT_EVENTDATA = 22, + MESSAGE_REQ_EXEC_EVT_CHANCMD = 23, + MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA = 24 +}; + +struct message_source { + struct conn_info *conn_info; + struct in_addr in_addr; +} __attribute__((packed)); extern struct sockaddr_in *this_ip; poll_handle aisexec_poll_handle; diff --git a/exec/sync.c b/exec/sync.c index e720d357..682d8e00 100644 --- a/exec/sync.c +++ b/exec/sync.c @@ -50,7 +50,7 @@ #include #include "../include/ais_types.h" -#include "../include/ipc_gen.h" +#include "main.h" #include "sync.h" #include "totempg.h" #include "print.h" diff --git a/exec/totem.h b/exec/totem.h index b909c18c..235321ed 100644 --- a/exec/totem.h +++ b/exec/totem.h @@ -34,6 +34,7 @@ #ifndef TOTEM_H_DEFINED #define TOTEM_H_DEFINED +#define MESSAGE_SIZE_MAX 256000 #define PROCESSOR_COUNT_MAX 16 enum totem_configuration_type { diff --git a/exec/totempg.h b/exec/totempg.h index fd08f3ae..556db9fa 100644 --- a/exec/totempg.h +++ b/exec/totempg.h @@ -39,8 +39,7 @@ #include "aispoll.h" #include "totemsrp.h" #include "parse.h" - -#define MESSAGE_SIZE_MAX 256000 +#include "totem.h" #define TOTEMPG_AGREED 0 #define TOTEMPG_SAFE 1 diff --git a/include/ais_msg.h b/include/ipc_amf.h similarity index 62% rename from include/ais_msg.h rename to include/ipc_amf.h index 9de96b7a..e15a0417 100644 --- a/include/ais_msg.h +++ b/include/ipc_amf.h @@ -31,14 +31,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef AIS_MSG_H_DEFINED -#define AIS_MSG_H_DEFINED +#ifndef AIS_IPC_AMF_H_DEFINED +#define AIS_IPC_AMF_H_DEFINED #include -#include "ais_types.h" -#include "evs.h" -#include "saClm.h" #include "ipc_gen.h" +#include "ais_types.h" +#include "ais_amf.h" enum req_amf_response_interfaces { MESSAGE_REQ_AMF_RESPONSE_SAAMFHEALTHCHECKCALLBACK = 1, @@ -51,24 +50,6 @@ enum req_amf_response_interfaces { MESSAGE_REQ_AMF_RESPONSE_SAAMFPENDINGOPERATIONCONFIRMCALLBACK }; -enum req_lib_evs_types { - MESSAGE_REQ_EVS_JOIN = 0, - MESSAGE_REQ_EVS_LEAVE = 1, - MESSAGE_REQ_EVS_MCAST_JOINED = 2, - MESSAGE_REQ_EVS_MCAST_GROUPS = 3, - MESSAGE_REQ_EVS_MEMBERSHIP_GET = 4 -}; - -enum res_lib_evs_types { - MESSAGE_RES_EVS_DELIVER_CALLBACK = 0, - MESSAGE_RES_EVS_CONFCHG_CALLBACK = 1, - MESSAGE_RES_EVS_JOIN = 2, - MESSAGE_RES_EVS_LEAVE = 3, - MESSAGE_RES_EVS_MCAST_JOINED = 4, - MESSAGE_RES_EVS_MCAST_GROUPS = 5, - MESSAGE_RES_EVS_MEMBERSHIP_GET = 6 -}; - enum req_amf_types { MESSAGE_REQ_AMF_COMPONENTREGISTER = 0, MESSAGE_REQ_AMF_COMPONENTUNREGISTER, @@ -103,146 +84,12 @@ enum res_lib_amf_types { MESSAGE_RES_AMF_RESPONSE }; -struct res_evs_deliver_callback { - struct res_header header; - struct in_addr source_addr; - int msglen; - char msg[0]; -}; - -struct res_evs_confchg_callback { - struct res_header header; - int member_list_entries; - int left_list_entries; - int joined_list_entries; - struct in_addr member_list[16]; - struct in_addr left_list[16]; - struct in_addr joined_list[16]; -}; - -struct req_lib_evs_join { - struct res_header header; - int group_entries; - struct evs_group groups[0]; -}; - -struct res_lib_evs_join { - struct res_header header; -}; - -struct req_lib_evs_leave { - struct res_header header; - int group_entries; - struct evs_group groups[0]; -}; - -struct res_lib_evs_leave { - struct res_header header; -}; - -struct req_lib_evs_mcast_joined { - struct res_header header; - evs_guarantee_t guarantee; - int msg_len; - char msg[0]; -}; - -struct res_lib_evs_mcast_joined { - struct res_header header; -}; - -struct req_lib_evs_mcast_groups { - struct res_header header; - evs_guarantee_t guarantee; - int msg_len; - int group_entries; - struct evs_group groups[0]; -}; - -struct res_lib_evs_mcast_groups { - struct res_header header; -}; - - -struct req_exec_evs_mcast { - struct req_header header; - int group_entries; - int msg_len; - struct evs_group groups[0]; - /* data goes here */ -}; - -struct req_lib_evs_membership_get { - struct req_header header; -}; - -struct res_lib_evs_membership_get { - struct res_header header; - struct in_addr local_addr; - struct in_addr member_list[16]; - int member_list_entries; -}; - -struct req_lib_resdis_init { - int size; - int id; - int service; -}; - -// TODO REMOVE THIS -enum req_init_types_a { - MESSAGE_REQ_EVS_INIT, - MESSAGE_REQ_CLM_INIT, - MESSAGE_REQ_AMF_INIT, - MESSAGE_REQ_CKPT_INIT, - MESSAGE_REQ_CKPT_CHECKPOINT_INIT, - MESSAGE_REQ_CKPT_SECTIONITERATOR_INIT, - MESSAGE_REQ_EVT_INIT -}; - -struct req_lib_response_init { - struct req_lib_resdis_init resdis_header; -}; - -struct req_lib_dispatch_init { - struct req_lib_resdis_init resdis_header; - unsigned long conn_info; -}; - - -struct req_lib_init { - struct res_header header; -}; - -struct res_lib_init { - struct res_header header; -}; - -struct res_lib_response_init { - struct res_header header; - unsigned long conn_info; -}; - -struct res_lib_dispatch_init { - struct res_header header; -}; - struct req_lib_amf_componentregister { struct req_header header; SaNameT compName; SaNameT proxyCompName; } __attribute__((packed)); -struct req_exec_amf_componentregister { - struct req_header header; - struct message_source source; - struct req_lib_amf_componentregister req_lib_amf_componentregister; - SaAmfReadinessStateT currentReadinessState; - SaAmfReadinessStateT newReadinessState; - SaAmfHAStateT currentHAState; - SaAmfHAStateT newHAState; -} __attribute__((packed)); - struct res_lib_amf_componentregister { struct res_header header; }; @@ -253,12 +100,6 @@ struct req_lib_amf_componentunregister { SaNameT proxyCompName; }; -struct req_exec_amf_componentunregister { - struct req_header header; - struct message_source source; - struct req_lib_amf_componentunregister req_lib_amf_componentunregister; -}; - struct res_lib_amf_componentunregister { struct res_header header; }; @@ -288,18 +129,6 @@ struct res_lib_amf_readinessstatesetcallback { SaAmfReadinessStateT readinessState; }; -struct req_exec_amf_readinessstateset { - struct req_header header; - SaNameT compName; - SaAmfReadinessStateT readinessState; -}; - -struct req_exec_amf_hastateset { - struct req_header header; - SaNameT compName; - SaAmfHAStateT haState; -}; - struct res_lib_amf_componentterminatecallback { struct res_header header; SaInvocationT invocation; @@ -377,12 +206,6 @@ struct req_lib_amf_errorreport { SaAmfAdditionalDataT additionalData; }; -struct req_exec_amf_errorreport { - struct req_header header; - struct message_source source; - struct req_lib_amf_errorreport req_lib_amf_errorreport; -}; - struct res_lib_amf_errorreport { struct res_header header; }; @@ -392,12 +215,6 @@ struct req_lib_amf_errorcancelall { SaNameT compName; }; -struct req_exec_amf_errorcancelall { - struct req_header header; - struct message_source source; - struct req_lib_amf_errorcancelall req_lib_amf_errorcancelall; -}; - struct res_lib_amf_errorcancelall { struct res_header header; }; @@ -432,12 +249,4 @@ struct res_lib_amf_componentcapabilitymodelget { SaAmfComponentCapabilityModelT componentCapabilityModel; }; -struct req_lib_activatepoll { - struct req_header header; -}; - -struct res_lib_activatepoll { - struct res_header header; -}; - -#endif /* AIS_MSG_H_DEFINED */ +#endif /* AIS_IPC_AMF_H_DEFINED */ diff --git a/include/ipc_ckpt.h b/include/ipc_ckpt.h index f01c891e..c5352fb8 100644 --- a/include/ipc_ckpt.h +++ b/include/ipc_ckpt.h @@ -34,11 +34,9 @@ #ifndef IPC_CKPT_H_DEFINED #define IPC_CKPT_H_DEFINED -#include "../include/ipc_gen.h" -#include "../include/ais_types.h" -#include "../include/saCkpt.h" -#include "../exec/totemsrp.h" -#include "../exec/ckpt.h" +#include "ais_types.h" +#include "saCkpt.h" +#include "ipc_gen.h" enum req_lib_ckpt_checkpoint_types { MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN = 0, @@ -80,24 +78,6 @@ enum res_lib_ckpt_checkpoint_types { MESSAGE_RES_CKPT_SECTIONITERATOR_SECTIONITERATORNEXT = 16 }; -struct req_exec_ckpt_checkpointclose { - struct req_header header; - struct message_source source; - SaNameT checkpointName; -}; - -struct req_exec_ckpt_checkpointretentiondurationset { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - SaTimeT retentionDuration; -}; - -struct req_exec_ckpt_checkpointretentiondurationexpire { - struct req_header header; - SaNameT checkpointName; -}; - struct req_lib_ckpt_checkpointopen { struct req_header header; SaNameT checkpointName; @@ -110,17 +90,6 @@ struct res_lib_ckpt_checkpointopen { struct res_header header; }; -struct req_exec_ckpt_checkpointopen { - struct req_header header; - struct message_source source; - struct req_lib_ckpt_checkpointopen req_lib_ckpt_checkpointopen; - SaCkptCheckpointHandleT checkpointHandle; - SaInvocationT invocation; - int async_call; - SaAisErrorT fail_with_error; -}; - - struct req_lib_ckpt_checkpointopenasync { struct req_header header; SaNameT checkpointName; @@ -156,12 +125,6 @@ struct res_lib_ckpt_checkpointunlink { struct res_header header; }; -struct req_exec_ckpt_checkpointunlink { - struct req_header header; - struct message_source source; - struct req_lib_ckpt_checkpointunlink req_lib_ckpt_checkpointunlink; -}; - struct req_lib_ckpt_checkpointretentiondurationset { struct req_header header; SaNameT checkpointName; @@ -202,13 +165,6 @@ struct res_lib_ckpt_sectioncreate { struct res_header header; }; -struct req_exec_ckpt_sectioncreate { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectioncreate req_lib_ckpt_sectioncreate; /* this must be last */ -}; - struct req_lib_ckpt_sectiondelete { struct req_header header; SaNameT checkpointName; @@ -218,12 +174,6 @@ struct req_lib_ckpt_sectiondelete { struct res_lib_ckpt_sectiondelete { struct res_header header; }; -struct req_exec_ckpt_sectiondelete { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectiondelete req_lib_ckpt_sectiondelete; /* this must be last */ -}; struct req_lib_ckpt_sectionexpirationtimeset { struct req_header header; @@ -236,13 +186,6 @@ struct res_lib_ckpt_sectionexpirationtimeset { struct res_header header; }; -struct req_exec_ckpt_sectionexpirationtimeset { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectionexpirationtimeset req_lib_ckpt_sectionexpirationtimeset; -}; - struct req_lib_ckpt_sectioniteratorinitialize { struct req_header header; SaNameT checkpointName; @@ -275,13 +218,6 @@ struct res_lib_ckpt_sectionwrite { struct res_header header; }; -struct req_exec_ckpt_sectionwrite { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectionwrite req_lib_ckpt_sectionwrite; -}; - struct req_lib_ckpt_sectionoverwrite { struct req_header header; SaNameT checkpointName; @@ -293,13 +229,6 @@ struct res_lib_ckpt_sectionoverwrite { struct res_header header; }; -struct req_exec_ckpt_sectionoverwrite { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectionoverwrite req_lib_ckpt_sectionoverwrite; -}; - struct req_lib_ckpt_sectionread { struct req_header header; SaNameT checkpointName; @@ -313,13 +242,6 @@ struct res_lib_ckpt_sectionread { SaSizeT dataRead; }; -struct req_exec_ckpt_sectionread { - struct req_header header; - struct message_source source; - SaNameT checkpointName; - struct req_lib_ckpt_sectionread req_lib_ckpt_sectionread; -}; - struct req_lib_ckpt_checkpointsynchronize { struct req_header header; }; @@ -337,25 +259,4 @@ struct res_lib_ckpt_checkpointsynchronizeasync { struct res_header header; }; -struct req_exec_ckpt_synchronize_state { - struct req_header header; - struct memb_ring_id previous_ring_id; - SaNameT checkpointName; - SaCkptCheckpointCreationAttributesT checkpointCreationAttributes; - SaCkptSectionDescriptorT sectionDescriptor; - struct in_addr source_addr; - struct ckpt_refcnt ckpt_refcount[PROCESSOR_COUNT_MAX]; -}; - -struct req_exec_ckpt_synchronize_section { - struct req_header header; - struct memb_ring_id previous_ring_id; - SaNameT checkpointName; - SaCkptSectionIdT sectionId; - SaUint32T dataOffSet; - SaUint32T dataSize; -}; - - - #endif /* IPC_CKPT_H_DEFINED */ diff --git a/include/ipc_clm.h b/include/ipc_clm.h index 0be4309c..26c3fa53 100644 --- a/include/ipc_clm.h +++ b/include/ipc_clm.h @@ -110,9 +110,4 @@ struct res_clm_nodegetcallback { SaClmClusterNodeT clusterNode; }; -struct req_exec_clm_nodejoin { - struct req_header header; - SaClmClusterNodeT clusterNode; -}; - #endif /* IPC_CLM_H_DEFINED */ diff --git a/include/ipc_evs.h b/include/ipc_evs.h new file mode 100644 index 00000000..c6033459 --- /dev/null +++ b/include/ipc_evs.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2002-2004 MontaVista Software, Inc. + * + * All rights reserved. + * + * Author: Steven Dake (sdake@mvista.com) + * + * This software licensed under BSD license, the text of which follows: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the MontaVista Software, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef IPC_EVS_H_DEFINED +#define IPC_EVS_H_DEFINED + +#include +#include "ais_types.h" +#include "evs.h" +#include "ipc_gen.h" + +enum req_lib_evs_types { + MESSAGE_REQ_EVS_JOIN = 0, + MESSAGE_REQ_EVS_LEAVE = 1, + MESSAGE_REQ_EVS_MCAST_JOINED = 2, + MESSAGE_REQ_EVS_MCAST_GROUPS = 3, + MESSAGE_REQ_EVS_MEMBERSHIP_GET = 4 +}; + +enum res_lib_evs_types { + MESSAGE_RES_EVS_DELIVER_CALLBACK = 0, + MESSAGE_RES_EVS_CONFCHG_CALLBACK = 1, + MESSAGE_RES_EVS_JOIN = 2, + MESSAGE_RES_EVS_LEAVE = 3, + MESSAGE_RES_EVS_MCAST_JOINED = 4, + MESSAGE_RES_EVS_MCAST_GROUPS = 5, + MESSAGE_RES_EVS_MEMBERSHIP_GET = 6 +}; + +struct res_evs_deliver_callback { + struct res_header header; + struct in_addr source_addr; + int msglen; + char msg[0]; +}; + +struct res_evs_confchg_callback { + struct res_header header; + int member_list_entries; + int left_list_entries; + int joined_list_entries; + struct in_addr member_list[16]; + struct in_addr left_list[16]; + struct in_addr joined_list[16]; +}; + +struct req_lib_evs_join { + struct res_header header; + int group_entries; + struct evs_group groups[0]; +}; + +struct res_lib_evs_join { + struct res_header header; +}; + +struct req_lib_evs_leave { + struct res_header header; + int group_entries; + struct evs_group groups[0]; +}; + +struct res_lib_evs_leave { + struct res_header header; +}; + +struct req_lib_evs_mcast_joined { + struct res_header header; + evs_guarantee_t guarantee; + int msg_len; + char msg[0]; +}; + +struct res_lib_evs_mcast_joined { + struct res_header header; +}; + +struct req_lib_evs_mcast_groups { + struct res_header header; + evs_guarantee_t guarantee; + int msg_len; + int group_entries; + struct evs_group groups[0]; +}; + +struct res_lib_evs_mcast_groups { + struct res_header header; +}; + + +struct req_exec_evs_mcast { + struct req_header header; + int group_entries; + int msg_len; + struct evs_group groups[0]; + /* data goes here */ +}; + +struct req_lib_evs_membership_get { + struct req_header header; +}; + +struct res_lib_evs_membership_get { + struct res_header header; + struct in_addr local_addr; + struct in_addr member_list[16]; + int member_list_entries; +}; +#endif /* IPC_EVS_H_DEFINED */ diff --git a/include/ipc_gen.h b/include/ipc_gen.h index b82818fd..c272768a 100644 --- a/include/ipc_gen.h +++ b/include/ipc_gen.h @@ -51,34 +51,6 @@ enum res_init_types { MESSAGE_RES_INIT }; -enum nodeexec_message_types { - MESSAGE_REQ_EXEC_SYNC_BARRIER = 0, - MESSAGE_REQ_EXEC_EVS_MCAST = 1, - MESSAGE_REQ_EXEC_CLM_NODEJOIN = 2, - MESSAGE_REQ_EXEC_AMF_COMPONENTREGISTER = 3, - MESSAGE_REQ_EXEC_AMF_COMPONENTUNREGISTER = 4, - MESSAGE_REQ_EXEC_AMF_ERRORREPORT = 5, - MESSAGE_REQ_EXEC_AMF_ERRORCANCELALL = 6, - MESSAGE_REQ_EXEC_AMF_READINESSSTATESET = 7, - MESSAGE_REQ_EXEC_AMF_HASTATESET = 8, - MESSAGE_REQ_EXEC_CKPT_CHECKPOINTOPEN = 9, - MESSAGE_REQ_EXEC_CKPT_CHECKPOINTCLOSE = 10, - MESSAGE_REQ_EXEC_CKPT_CHECKPOINTUNLINK = 11, - MESSAGE_REQ_EXEC_CKPT_CHECKPOINTRETENTIONDURATIONSET = 12, - MESSAGE_REQ_EXEC_CKPT_CHECKPOINTRETENTIONDURATIONEXPIRE = 13, - MESSAGE_REQ_EXEC_CKPT_SECTIONCREATE = 14, - MESSAGE_REQ_EXEC_CKPT_SECTIONDELETE = 15, - MESSAGE_REQ_EXEC_CKPT_SECTIONEXPIRATIONTIMESET = 16, - MESSAGE_REQ_EXEC_CKPT_SECTIONWRITE = 17, - MESSAGE_REQ_EXEC_CKPT_SECTIONOVERWRITE = 18, - MESSAGE_REQ_EXEC_CKPT_SECTIONREAD = 19, - MESSAGE_REQ_EXEC_CKPT_SYNCHRONIZESTATE = 20, - MESSAGE_REQ_EXEC_CKPT_SYNCHRONIZESECTION = 21, - MESSAGE_REQ_EXEC_EVT_EVENTDATA = 22, - MESSAGE_REQ_EXEC_EVT_CHANCMD = 23, - MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA = 24 -}; - struct req_header { int size; int id; @@ -87,12 +59,52 @@ struct req_header { struct res_header { int size; int id; - SaErrorT error; + SaAisErrorT error; }; -struct message_source { - struct conn_info *conn_info; - struct in_addr in_addr; -} __attribute__((packed)); +#ifdef CMPILE_OUT +// TODO REMOVE THIS +enum req_init_types_a { + MESSAGE_REQ_EVS_INIT, + MESSAGE_REQ_CLM_INIT, + MESSAGE_REQ_AMF_INIT, + MESSAGE_REQ_CKPT_INIT, + MESSAGE_REQ_CKPT_CHECKPOINT_INIT, + MESSAGE_REQ_CKPT_SECTIONITERATOR_INIT, + MESSAGE_REQ_EVT_INIT +}; +#endif +struct req_lib_resdis_init { + int size; + int id; + int service; +}; + +struct req_lib_response_init { + struct req_lib_resdis_init resdis_header; +}; + +struct req_lib_dispatch_init { + struct req_lib_resdis_init resdis_header; + unsigned long conn_info; +}; + + +struct req_lib_init { + struct res_header header; +}; + +struct res_lib_init { + struct res_header header; +}; + +struct res_lib_response_init { + struct res_header header; + unsigned long conn_info; +}; + +struct res_lib_dispatch_init { + struct res_header header; +}; #endif /* IPC_GEN_H_DEFINED */ diff --git a/lib/Makefile b/lib/Makefile index 0c687ed0..5ddf2214 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -55,7 +55,7 @@ libSaClm.a: util.o clm.o $(AR) -rc libSaClm.a util.o clm.o libSaClm.so.1.0: util.o clm.o - $(CC) -shared -Wl,-soname,libSaClm.so.1 util.o clm.o -o $@ + $(CC) -shared -Wl,-soname,libSaClm.so.1,-version-script=libSaClm.versions util.o clm.o -o $@ rm -f libSaClm.so.1 libSaClm.so ln -s libSaClm.so.1.0 libSaClm.so.1 ln -s libSaClm.so.1.0 libSaClm.so @@ -64,7 +64,7 @@ libSaAmf.a: util.o amf.o $(AR) -rc libSaAmf.a util.o amf.o libSaAmf.so.1.0: util.o amf.o - $(CC) -shared -Wl,-soname,libSaAmf.so.1 util.o amf.o -o $@ + $(CC) -shared -Wl,-soname,libSaAmf.so.1,-version-script=libSaAmf.versions util.o amf.o -o $@ rm -f libSaAmf.so.1 libSaAmf.so ln -s libSaAmf.so.1.0 libSaAmf.so.1 ln -s libSaAmf.so.1.0 libSaAmf.so @@ -73,7 +73,7 @@ libSaCkpt.a: util.o ckpt.o $(AR) -rc libSaCkpt.a util.o ckpt.o libSaCkpt.so.1.0: util.o ckpt.o - $(CC) -shared -Wl,-soname,libSaCkpt.so.1 util.o ckpt.o -o $@ + $(CC) -shared -Wl,-soname,libSaCkpt.so.1,-version-script=libSaCkpt.versions util.o ckpt.o -o $@ rm -f libSaCkpt.so.1 libSaCkpt.so ln -s libSaCkpt.so.1.0 libSaCkpt.so.1 ln -s libSaCkpt.so.1.0 libSaCkpt.so @@ -82,7 +82,7 @@ libSaEvt.a: util.o evt.o $(AR) -rc libSaEvt.a util.o evt.o libSaEvt.so.1.0: util.o evt.o - $(CC) -shared -Wl,-soname,libSaEvt.so.1 util.o evt.o -o $@ + $(CC) -shared -Wl,-soname,libSaEvt.so.1,-version-script=libSaEvt.versions util.o evt.o -o $@ rm -f libSaEvt.so.1 libSaEvt.so ln -s libSaEvt.so.1.0 libSaEvt.so.1 ln -s libSaEvt.so.1.0 libSaEvt.so @@ -91,7 +91,7 @@ libais.a: util.o amf.o clm.o ckpt.o evt.o $(AR) -rc libais.a util.o amf.o clm.o ckpt.o evt.o libais.so.1.0: util.o amf.o clm.o ckpt.o evt.o - $(CC) -shared -Wl,-soname,libais.so.1 util.o amf.o clm.o ckpt.o \ + $(CC) -shared -Wl,-soname,libais.so.1,-version-script=libSaAis.versions util.o amf.o clm.o ckpt.o \ evt.o -o $@ rm -f libais.so.1 libais.so ln -s libais.so.1.0 libais.so.1 @@ -101,7 +101,7 @@ libevs.a: util.o evs.o $(AR) -rc libevs.a util.o evs.o libevs.so.1.0: util.o evs.o - $(CC) -shared -Wl,-soname,libevs.so.1 util.o evs.o -o $@ + $(CC) -shared -Wl,-soname,libevs.so.1,-version-script=libevs.versions util.o evs.o -o $@ rm -f libevs.so.1 libevs.so ln -s libevs.so.1.0 libevs.so.1 ln -s libevs.so.1.0 libevs.so @@ -119,18 +119,18 @@ depend: makedepend -Y -- $(CFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1 # DO NOT DELETE -util.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h +util.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h util.o: ../include/evs.h ../include/saClm.h ../include/ipc_gen.h util.h amf.o: ../include/ais_types.h ../include/ais_amf.h ../include/ais_types.h -amf.o: ../include/ais_msg.h ../include/evs.h ../include/saClm.h +amf.o: ../include/ipc_evs.h ../include/evs.h ../include/saClm.h amf.o: ../include/ipc_gen.h util.h clm.o: ../include/ais_types.h ../include/saClm.h ../include/ais_types.h -clm.o: ../include/ais_msg.h ../include/evs.h ../include/saClm.h +clm.o: ../include/ipc_evs.h ../include/evs.h ../include/saClm.h clm.o: ../include/ipc_gen.h ../include/ipc_clm.h util.h ckpt.o: ../include/list.h ../include/ais_types.h ../include/saCkpt.h -ckpt.o: ../include/ais_types.h ../include/ais_msg.h ../include/evs.h +ckpt.o: ../include/ais_types.h ../include/ipc_evs.h ../include/evs.h ckpt.o: ../include/saClm.h ../include/ipc_gen.h util.h evt.o: ../include/ipc_evt.h ../include/ais_types.h ../include/saEvt.h -evt.o: ../include/saClm.h ../include/ipc_gen.h util.h ../include/ais_msg.h +evt.o: ../include/saClm.h ../include/ipc_gen.h util.h ../include/ipc_evs.h evt.o: ../include/evs.h ../exec/totempg.h ../exec/aispoll.h evt.o: ../exec/totemsrp.h diff --git a/lib/amf.c b/lib/amf.c index 279e3ecc..9a89c3f8 100644 --- a/lib/amf.c +++ b/lib/amf.c @@ -47,7 +47,8 @@ #include "../include/ais_types.h" #include "../include/ais_amf.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" +#include "../include/ipc_amf.h" #include "util.h" struct res_overlay { @@ -576,7 +577,7 @@ saAmfStoppingComplete ( int fd; SaErrorT errorResult; - errorResult = saServiceConnect (&fd, MESSAGE_REQ_AMF_INIT); + errorResult = saServiceConnect (&fd, AMF_SERVICE); if (errorResult != SA_OK) { goto exit_noclose; } @@ -610,7 +611,7 @@ saAmfHAStateGet ( int fd; SaErrorT error; - error = saServiceConnect (&fd, MESSAGE_REQ_AMF_INIT); + error = saServiceConnect (&fd, AMF_SERVICE); if (error != SA_OK) { goto exit_noclose; } @@ -732,7 +733,7 @@ saAmfErrorReport ( int fd; SaErrorT error; - error = saServiceConnect (&fd, MESSAGE_REQ_AMF_INIT); + error = saServiceConnect (&fd, AMF_SERVICE); if (error != SA_OK) { goto exit_noclose; } @@ -772,7 +773,7 @@ saAmfErrorCancelAll ( int fd; SaErrorT error; - error = saServiceConnect (&fd, MESSAGE_REQ_AMF_INIT); + error = saServiceConnect (&fd, AMF_SERVICE); if (error != SA_OK) { goto exit_noclose; } @@ -806,7 +807,7 @@ saAmfComponentCapabilityModelGet ( struct req_amf_componentcapabilitymodelget req_amf_componentcapabilitymodelget; struct res_lib_amf_componentcapabilitymodelget res_lib_amf_componentcapabilitymodelget; - error = saServiceConnect (&fd, MESSAGE_REQ_AMF_INIT); + error = saServiceConnect (&fd, AMF_SERVICE); if (error != SA_OK) { goto exit_noclose; } diff --git a/lib/ckpt.c b/lib/ckpt.c index af98f1d7..0e66ce7c 100644 --- a/lib/ckpt.c +++ b/lib/ckpt.c @@ -45,13 +45,14 @@ #include #include -#include "util.h" - +#include "../include/ais_types.h" #include "../include/list.h" #include "../include/saCkpt.h" #include "../include/ipc_gen.h" #include "../include/ipc_ckpt.h" +#include "util.h" + struct message_overlay { struct res_header header; char data[4096]; diff --git a/lib/clm.c b/lib/clm.c index 76ed929a..a7103595 100644 --- a/lib/clm.c +++ b/lib/clm.c @@ -46,7 +46,7 @@ #include "../include/ais_types.h" #include "../include/saClm.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" #include "../include/ipc_clm.h" #include "util.h" diff --git a/lib/evs.c b/lib/evs.c index e5473470..16b4fe4f 100644 --- a/lib/evs.c +++ b/lib/evs.c @@ -44,11 +44,11 @@ #include #include #include -#include "util.h" -#include "../include/ais_msg.h" #include "../include/ais_types.h" #include "../include/evs.h" +#include "../include/ipc_evs.h" +#include "util.h" struct evs_inst { int response_fd; diff --git a/lib/evt.c b/lib/evt.c index 47f1843a..48c6f07d 100644 --- a/lib/evt.c +++ b/lib/evt.c @@ -41,7 +41,7 @@ #include #include "../include/ipc_evt.h" #include "util.h" -#include "../exec/totempg.h" +#include "../exec/totem.h" #include "../include/list.h" static void evtHandleInstanceDestructor(void *instance); diff --git a/lib/libSaAis.versions b/lib/libSaAis.versions new file mode 100644 index 00000000..347ad2c4 --- /dev/null +++ b/lib/libSaAis.versions @@ -0,0 +1,180 @@ +# 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; + saQueueInit; + saQueueIsEmpty; + saQueueIsFull; + saQueueItemAdd; + saQueueItemGet; + saQueueItemRemove; + saRecvRetry; + saSelectRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; + +# Version and symbol export for libSaClm.so + +OPENAIS_AMF_A.01.01 { + global: + saAmfInitialize; + saAmfSelectionObjectGet; + saAmfDispatch; + saAmfFinalize; + saAmfComponentRegister; + saAmfComponentUnregister; + saAmfCompNameGet; + saAmfReadinessStateGet; + saAmfStoppingComplete; + saAmfHAStateGet; + saAmfProtectionGroupTrackStart; + saAmfProtectionGroupTrackStop; + saAmfErrorReport; + saAmfErrorCancelAll; + saAmfComponentCapabilityModelGet; + saAmfPendingOperationGet; + saAmfResponse; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saQueueInit; + saQueueIsEmpty; + saQueueIsFull; + saQueueItemAdd; + saQueueItemGet; + saQueueItemRemove; + saRecvRetry; + saSelectRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; + +# Version and symbol export for libSaCkpt.so + +OPENAIS_CKPT_B.01.01 { + global: + saCkptInitialize; + saCkptSelectionObjectGet; + saCkptDispatch; + saCkptFinalize; + saCkptCheckpointOpen; + saCkptCheckpointOpenAsync; + saCkptCheckpointClose; + saCkptCheckpointUnlink; + saCkptCheckpointRetentionDurationSet; + saCkptActiveReplicaSet; + saCkptCheckpointStatusGet; + saCkptSectionCreate; + saCkptSectionDelete; + saCkptSectionExpirationTimeSet; + saCkptSectionIterationInitialize; + saCkptSectionIterationNext; + saCkptSectionIterationFinalize; + saCkptCheckpointWrite; + saCkptCheckpointOverwrite; + saCkptCheckpointRead; + saCkptCheckpointSynchronize; + saCkptCheckpointSynchronizeAsync; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saQueueInit; + saQueueIsEmpty; + saQueueIsFull; + saQueueItemAdd; + saQueueItemGet; + saQueueItemRemove; + saRecvRetry; + saSelectRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; + +# Version and symbol export for libSaClm.so + +OPENAIS_EVT_B.01.01 { + global: + + saEvtInitialize; + saEvtSelectionObjectGet; + saEvtDispatch; + saEvtFinalize; + saEvtChannelOpen; + saEvtChannelClose; + saEvtChannelOpenAsync; + saEvtChannelUnlink; + saEvtChannelAllocate; + saEvtEventFree; + saEvtEventAttributesSet; + saEvtEventAttributesGet; + saEvtEventDataGet; + saEvtEventPublish; + saEvtEventSubscribe; + saEvtEventUnsubscribe; + saEvtEventRetentionTimeClear; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saQueueInit; + saQueueIsEmpty; + saQueueIsFull; + saQueueItemAdd; + saQueueItemGet; + saQueueItemRemove; + saRecvRetry; + saSelectRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/libSaAmf.versions b/lib/libSaAmf.versions new file mode 100644 index 00000000..f44edaed --- /dev/null +++ b/lib/libSaAmf.versions @@ -0,0 +1,38 @@ +# Version and symbol export for libSaClm.so + +OPENAIS_AMF_A.01.01 { + global: + saAmfInitialize; + saAmfSelectionObjectGet; + saAmfDispatch; + saAmfFinalize; + saAmfComponentRegister; + saAmfComponentUnregister; + saAmfCompNameGet; + saAmfReadinessStateGet; + saAmfStoppingComplete; + saAmfHAStateGet; + saAmfProtectionGroupTrackStart; + saAmfProtectionGroupTrackStop; + saAmfErrorReport; + saAmfErrorCancelAll; + saAmfComponentCapabilityModelGet; + saAmfPendingOperationGet; + saAmfResponse; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saRecvRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/libSaCkpt.versions b/lib/libSaCkpt.versions new file mode 100644 index 00000000..fe98b49e --- /dev/null +++ b/lib/libSaCkpt.versions @@ -0,0 +1,43 @@ +# Version and symbol export for libSaCkpt.so + +OPENAIS_CKPT_B.01.01 { + global: + saCkptInitialize; + saCkptSelectionObjectGet; + saCkptDispatch; + saCkptFinalize; + saCkptCheckpointOpen; + saCkptCheckpointOpenAsync; + saCkptCheckpointClose; + saCkptCheckpointUnlink; + saCkptCheckpointRetentionDurationSet; + saCkptActiveReplicaSet; + saCkptCheckpointStatusGet; + saCkptSectionCreate; + saCkptSectionDelete; + saCkptSectionExpirationTimeSet; + saCkptSectionIterationInitialize; + saCkptSectionIterationNext; + saCkptSectionIterationFinalize; + saCkptCheckpointWrite; + saCkptCheckpointOverwrite; + saCkptCheckpointRead; + saCkptCheckpointSynchronize; + saCkptCheckpointSynchronizeAsync; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saRecvRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/libSaClm.versions b/lib/libSaClm.versions new file mode 100644 index 00000000..918dcbc4 --- /dev/null +++ b/lib/libSaClm.versions @@ -0,0 +1,29 @@ +# 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; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/libSaEvt.versions b/lib/libSaEvt.versions new file mode 100644 index 00000000..798f78eb --- /dev/null +++ b/lib/libSaEvt.versions @@ -0,0 +1,39 @@ +# Version and symbol export for libSaClm.so + +OPENAIS_EVT_B.01.01 { + global: + + saEvtInitialize; + saEvtSelectionObjectGet; + saEvtDispatch; + saEvtFinalize; + saEvtChannelOpen; + saEvtChannelClose; + saEvtChannelOpenAsync; + saEvtChannelUnlink; + saEvtChannelAllocate; + saEvtEventFree; + saEvtEventAttributesSet; + saEvtEventAttributesGet; + saEvtEventDataGet; + saEvtEventPublish; + saEvtEventSubscribe; + saEvtEventUnsubscribe; + saEvtEventRetentionTimeClear; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saPollRetry; + saRecvRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/libevs.versions b/lib/libevs.versions new file mode 100644 index 00000000..a06bd704 --- /dev/null +++ b/lib/libevs.versions @@ -0,0 +1,30 @@ +# Version and symbol export for libSaClm.so + +OPENAIS_EVS_1.0 { + global: + evs_initialize; + evs_finalize; + evs_fd_get; + evs_dispatch; + evs_join; + evs_leave; + evs_mcast_joined; + evs_mcast_groups; + evs_membership_get; + + local: + saHandleCreate; + saHandleDestroy; + saHandleInstanceGet; + saHandleInstancePut; + saRecvRetry; + saSelectRetry; + saSendMsgReceiveReply; + saSendMsgRetry; + saSendReceiveReply; + saSendRetry; + saServiceConnect; + saServiceConnectTwo; + saVersionVerify; + clustTimeNow; +}; diff --git a/lib/util.c b/lib/util.c index 0f818776..4d6bd8c0 100644 --- a/lib/util.c +++ b/lib/util.c @@ -51,7 +51,7 @@ #include #include "../include/ais_types.h" -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" #include "util.h" enum SA_HANDLE_STATE { @@ -397,29 +397,6 @@ error_exit: return (error); } -SaErrorT -saSelectRetry ( - int s, - fd_set *readfds, - fd_set *writefds, - fd_set *exceptfds, - struct timeval *timeout) -{ - SaErrorT error = SA_AIS_OK; - int result; - -retry_select: - result = select (s, readfds, writefds, exceptfds, timeout); - if (result == -1 && errno == EINTR) { - goto retry_select; - } - if (result == -1) { - error = SA_AIS_ERR_LIBRARY; - } - - return (error); -} - SaErrorT saPollRetry ( struct pollfd *ufds, @@ -625,96 +602,6 @@ saVersionVerify ( return (error); } - -SaErrorT -saQueueInit ( - struct queue *queue, - int queueItems, - int bytesPerItem) -{ - queue->head = 0; - queue->tail = queueItems - 1; - queue->used = 0; - queue->usedhw = 0; - queue->size = queueItems; - queue->bytesPerItem = bytesPerItem; - queue->items = (void *)malloc (queueItems * bytesPerItem); - if (queue->items == 0) { - return (SA_AIS_ERR_NO_MEMORY); - } - memset (queue->items, 0, queueItems * bytesPerItem); - return (SA_AIS_OK); -} - -SaErrorT -saQueueIsFull ( - struct queue *queue, - int *isFull) -{ - *isFull = ((queue->size - 1) == queue->used); - return (SA_AIS_OK); -} - - -SaErrorT -saQueueIsEmpty ( - struct queue *queue, - int *isEmpty) -{ - *isEmpty = (queue->used == 0); - return (SA_AIS_OK); -} - - -SaErrorT -saQueueItemAdd ( - struct queue *queue, - void *item) -{ - char *queueItem; - int queuePosition; - - queuePosition = queue->head; - queueItem = queue->items; - queueItem += queuePosition * queue->bytesPerItem; - memcpy (queueItem, item, queue->bytesPerItem); - - assert (queue->tail != queue->head); - if (queue->tail == queue->head) { - return (SA_AIS_ERR_LIBRARY); - } - queue->head = (queue->head + 1) % queue->size; - queue->used++; - if (queue->used > queue->usedhw) { - queue->usedhw = queue->used; - } - return (SA_AIS_OK); -} - -SaErrorT -saQueueItemGet (struct queue *queue, void **item) -{ - char *queueItem; - int queuePosition; - - queuePosition = (queue->tail + 1) % queue->size; - queueItem = queue->items; - queueItem += queuePosition * queue->bytesPerItem; - *item = (void *)queueItem; - return (SA_AIS_OK); -} - -SaErrorT -saQueueItemRemove (struct queue *queue) -{ - queue->tail = (queue->tail + 1) % queue->size; - if (queue->tail == queue->head) { - return (SA_AIS_ERR_LIBRARY); - } - queue->used--; - return (SA_AIS_OK); -} - /* * Get the time of day and convert to nanoseconds */ diff --git a/lib/util.h b/lib/util.h index 1979019e..6f34d141 100644 --- a/lib/util.h +++ b/lib/util.h @@ -38,7 +38,7 @@ #include #include -#include "../include/ais_msg.h" +#include "../include/ipc_gen.h" struct saHandleDatabase { unsigned int handleCount; @@ -114,14 +114,6 @@ SaErrorT saSendReceiveReply ( void *responseMessage, int responseLen); -SaErrorT -saSelectRetry ( - int s, - fd_set *readfds, - fd_set *writefds, - fd_set *exceptfds, - struct timeval *timeout); - SaErrorT saPollRetry ( struct pollfd *ufds, @@ -155,33 +147,6 @@ saVersionVerify ( struct saVersionDatabase *versionDatabase, SaVersionT *version); -SaErrorT -saQueueInit ( - struct queue *queue, - int queueItems, - int sizePerItem); - -SaErrorT -saQueueIsFull ( - struct queue *queue, - int *isFull); - -SaErrorT -saQueueIsEmpty ( - struct queue *queue, - int *isEmpty); - -SaErrorT -saQueueItemAdd ( - struct queue *queue, - void *item); - -SaErrorT -saQueueItemGet (struct queue *queue, void **item); - -SaErrorT -saQueueItemRemove (struct queue *queue); - #define offset_of(type,member) (int)(&(((type *)0)->member)) SaTimeT diff --git a/test/Makefile b/test/Makefile index 101c3dd7..4748c233 100644 --- a/test/Makefile +++ b/test/Makefile @@ -39,7 +39,8 @@ CFLAGS = -c -g -Wall -DDEBUG -I../include CPPFLAGS = -c -g -Wall -DDEBUG -I../include LDFLAGS = -g -L../lib -LIBRARIES= ../lib/libSaClm.a ../lib/libSaAmf.a ../lib/libSaCkpt.a ../lib/libSaEvt.a ../lib/libevs.a +#LIBRARIES= /lib/libSaClm.a ../lib/libSaAmf.a ../lib/libSaCkpt.a ../lib/libSaEvt.a ../lib/libevs.a +LIBRARIES= ../lib/libSaAmf.a ../lib/libSaCkpt.a ../lib/libSaEvt.a ../lib/libevs.a LIBS = $(LIBRARIES) -lpthread # Profile mode flags @@ -104,7 +105,8 @@ evsbench: evsbench.o $(LIBS) $(CC) $(LDFLAGS) -o evsbench evsbench.o $(LIBS) testclm: testclm.o $(LIBRARIES) - $(CC) $(LDFLAGS) -o testclm testclm.o $(LIBS) + $(CC) $(LDFLAGS) -o testclm testclm.o -lais +# $(LIBS) -lSaClm testckpt: testckpt.o sa_error.o $(LIBRARIES) $(CC) $(LDFLAGS) -o testckpt testckpt.o sa_error.o $(LIBS) @@ -149,7 +151,7 @@ depend: # DO NOT DELETE testclm.o: ../include/ais_types.h ../include/saClm.h -testamf.o: ../include/ais_types.h ../include/ais_amf.h ../include/ais_msg.h +testamf.o: ../include/ais_types.h ../include/ais_amf.h ../include/ipc_evs.h testamf.o: ../include/evs.h ../include/saClm.h ../include/ipc_gen.h testamf1.o: ../include/ais_types.h ../include/ais_amf.h testamf2.o: ../include/ais_types.h ../include/ais_amf.h @@ -157,7 +159,7 @@ testamf3.o: ../include/ais_types.h ../include/ais_amf.h testamf4.o: ../include/ais_types.h ../include/ais_amf.h testamf5.o: ../include/ais_types.h ../include/ais_amf.h testamf6.o: ../include/ais_types.h ../include/ais_amf.h -testamfth.o: ../include/ais_types.h ../include/ais_amf.h ../include/ais_msg.h +testamfth.o: ../include/ais_types.h ../include/ais_amf.h ../include/ipc_evs.h testamfth.o: ../include/evs.h ../include/saClm.h ../include/ipc_gen.h testckpt.o: ../include/ais_types.h ../include/saCkpt.h ckptstress.o: ../include/ais_types.h ../include/saCkpt.h diff --git a/test/testamf.c b/test/testamf.c index 36a09bd9..03ccbb91 100644 --- a/test/testamf.c +++ b/test/testamf.c @@ -43,7 +43,7 @@ #include "ais_types.h" #include "ais_amf.h" -#include "ais_msg.h" +#include "saClm.h" void printSaClmNodeAddressT (SaClmNodeAddressT *nodeAddress) { int i; diff --git a/test/testamfth.c b/test/testamfth.c index 6ca31fe7..963484d5 100644 --- a/test/testamfth.c +++ b/test/testamfth.c @@ -43,7 +43,7 @@ #include "ais_types.h" #include "ais_amf.h" -#include "ais_msg.h" +#include "saClm.h" void printSaNameT (SaNameT *name) {