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

corosync/exec builds.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1594 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 лет назад
Родитель
Сommit
c2045182c2
4 измененных файлов с 158 добавлено и 114 удалено
  1. 4 111
      corosync/exec/Makefile
  2. 1 1
      corosync/exec/main.c
  3. 1 2
      corosync/exec/main.h
  4. 152 0
      corosync/include/saAis.h

+ 4 - 111
corosync/exec/Makefile

@@ -59,13 +59,9 @@ LOGSYS_OBJS = wthread.o logsys.o
 
 EXEC_LIBS = libtotem_pg.a liblogsys.a
 
-# AMF objects
-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
-
 # 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)
+LCR_SRC = vsf_ykd.c objdb.c confdb.c
+LCR_OBJS =aisparser.o vsf_ykd.o objdb.o confdb.o
 
 # main executive objects
 MAIN_SRC = main.c mempool.c util.c sync.c service.c ipc.c flow.c timer.c \
@@ -80,52 +76,15 @@ override CFLAGS += -fPIC
 
 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
+	objdb.lcrso vsf_ykd.lcrso keygen
 else
 EXEC_OBJS = $(MAIN_OBJS) $(LCR_OBJS)
-all: libtotem_pg.a liblogsys.a aisexec keygen openais-instantiate
+all: libtotem_pg.a liblogsys.a aisexec keygen
 endif
 
 
 ifeq (${OPENAIS_COMPAT}, DARWIN)
 
-service_evs.lcrso: evs.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evs.o -o $@
-
-service_clm.lcrso: clm.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load clm.o -o $@
-
-service_amf.lcrso: $(AMF_OBJS)
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load $(AMF_OBJS) -o $@
-
-service_ckpt.lcrso: ckpt.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load ckpt.o -o $@
-
-service_evt.lcrso: evt.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load evt.o -o $@
-
-service_lck.lcrso: lck.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load lck.o -o $@
-
-service_msg.lcrso: msg.o
-	$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ./aisexec -bind_at_load msg.o -o $@
-
-service_cfg.lcrso: cfg.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 $@
 
@@ -135,39 +94,6 @@ vsf_ykd.lcrso: vsf_ykd.o
 
 else
 
-service_evs.lcrso: evs.o
-	$(CC) -shared -Wl,-soname,service_evs.lcrso evs.o -o $@
-
-service_clm.lcrso: clm.o
-	$(CC) -shared -Wl,-soname,service_clm.lcrso clm.o -o $@
-
-service_amf.lcrso: $(AMF_OBJS)
-	$(CC) -shared -Wl,-soname,service_amf.lcrso $(AMF_OBJS) -o $@
-
-service_ckpt.lcrso: ckpt.o
-	$(CC) -shared -Wl,-soname,service_ckpt.lcrso ckpt.o -o $@
-
-service_evt.lcrso: evt.o
-	$(CC) -shared -Wl,-soname,service_evt.lcrso evt.o -o $@
-
-service_lck.lcrso: lck.o
-	$(CC) -shared -Wl,-soname,service_lck.lcrso lck.o -o $@
-
-service_msg.lcrso: msg.o
-	$(CC) -shared -Wl,-soname,service_msg.lcrso msg.o -o $@
-
-service_cfg.lcrso: cfg.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 $@
-
 vsf_ykd.lcrso: vsf_ykd.o
 	$(CC) -shared -Wl,-soname,vsf_ykd.lcrso vsf_ykd.o -o $@
 
@@ -219,42 +145,9 @@ depend:
 ../lcr/lcr_ifact.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
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-amf.o: amf.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-ckpt.o: ckpt.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-evt.o: evt.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-lck.o: lck.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-msg.o: msg.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cfg.o: cfg.c
-	$(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 $@ $<
 

+ 1 - 1
corosync/exec/main.c

@@ -109,7 +109,7 @@ static struct config_iface_ver0 *config_modules[MAX_DYNAMIC_SERVICES];
 
 static struct objdb_iface_ver0 *objdb = NULL;
 
-SaClmClusterNodeT *(*main_clm_get_by_nodeid) (unsigned int node_id);
+unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
 static void sigusr2_handler (int num)
 {

+ 1 - 2
corosync/exec/main.h

@@ -36,7 +36,6 @@
 #define TRUE 1
 #define FALSE 0
 #include "../include/saAis.h"
-#include "../include/saClm.h"
 #include "../include/ipc_gen.h"
 #include "objdb.h"
 #include "config.h"
@@ -61,7 +60,7 @@ extern totempg_groups_handle openais_group_handle;
 
 poll_handle aisexec_poll_handle;
 
-extern SaClmClusterNodeT *(*main_clm_get_by_nodeid) (unsigned int node_id);
+extern unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
 extern void main_get_config_modules(struct config_iface_ver0 ***modules, int *num);
 

+ 152 - 0
corosync/include/saAis.h

@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2002-2003 MontaVista Software, Inc.
+ * Copyright (c) 2006 Sun Microsystems, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@redhat.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AIS_TYPES_H_DEFINED
+#define AIS_TYPES_H_DEFINED
+
+/**
+ * @defgroup saf Service Availability Forum Application Interface Specification
+ */
+
+typedef enum {
+	SA_FALSE = 0,
+	SA_TRUE = 1
+} SaBoolT;
+
+#ifndef OPENAIS_SOLARIS
+#include <stdint.h>
+#else
+#include <sys/types.h>
+#endif
+
+typedef int8_t SaInt8T;
+typedef int16_t SaInt16T;
+typedef int32_t SaInt32T;
+typedef int64_t SaInt64T;
+
+typedef uint8_t SaUint8T;
+typedef uint16_t SaUint16T;
+typedef uint32_t SaUint32T;
+typedef uint64_t SaUint64T;
+
+typedef float SaFloatT;
+typedef double SaDoubleT;
+typedef char * SaStringT;
+typedef SaInt64T SaTimeT;
+
+#define SA_TIME_END    ((SaTimeT)0x7FFFFFFFFFFFFFFFULL)
+#define SA_TIME_BEGIN            0x0ULL
+#define SA_TIME_UNKNOWN          0x8000000000000000ULL
+
+#define SA_TIME_ONE_MICROSECOND 1000ULL
+#define SA_TIME_ONE_MILLISECOND 1000000ULL
+#define SA_TIME_ONE_SECOND      1000000000ULL
+#define SA_TIME_ONE_MINUTE      60000000000ULL
+#define SA_TIME_ONE_HOUR        3600000000000ULL
+#define SA_TIME_ONE_DAY         86400000000000ULL
+#define SA_TIME_MAX             SA_TIME_END
+
+#define SA_MAX_NAME_LENGTH 256
+
+typedef struct {
+	SaUint16T length;
+	SaUint8T value[SA_MAX_NAME_LENGTH];
+} SaNameT;
+
+typedef struct {
+	char releaseCode;
+	unsigned char majorVersion;
+	unsigned char minorVersion;
+} SaVersionT;
+
+typedef SaUint64T SaNtfIdentifierT;
+
+#define SA_TRACK_CURRENT 0x01
+#define SA_TRACK_CHANGES 0x02
+#define SA_TRACK_CHANGES_ONLY 0x04
+
+typedef enum {
+	SA_DISPATCH_ONE = 1,
+	SA_DISPATCH_ALL = 2,
+	SA_DISPATCH_BLOCKING = 3
+} SaDispatchFlagsT;
+
+typedef enum {
+	SA_AIS_OK = 1,
+	SA_AIS_ERR_LIBRARY = 2,
+	SA_AIS_ERR_VERSION = 3,
+	SA_AIS_ERR_INIT = 4,
+	SA_AIS_ERR_TIMEOUT = 5,
+	SA_AIS_ERR_TRY_AGAIN = 6,
+	SA_AIS_ERR_INVALID_PARAM = 7,
+	SA_AIS_ERR_NO_MEMORY = 8,
+	SA_AIS_ERR_BAD_HANDLE = 9,
+	SA_AIS_ERR_BUSY = 10,
+	SA_AIS_ERR_ACCESS = 11,
+	SA_AIS_ERR_NOT_EXIST = 12,
+	SA_AIS_ERR_NAME_TOO_LONG = 13,
+	SA_AIS_ERR_EXIST = 14,
+	SA_AIS_ERR_NO_SPACE = 15,
+	SA_AIS_ERR_INTERRUPT = 16,
+	SA_AIS_ERR_NAME_NOT_FOUND = 17,
+	SA_AIS_ERR_NO_RESOURCES = 18,
+	SA_AIS_ERR_NOT_SUPPORTED = 19,
+	SA_AIS_ERR_BAD_OPERATION = 20,
+	SA_AIS_ERR_FAILED_OPERATION = 21,
+	SA_AIS_ERR_MESSAGE_ERROR = 22,
+	SA_AIS_ERR_QUEUE_FULL = 23,
+	SA_AIS_ERR_QUEUE_NOT_AVAILABLE = 24,
+	SA_AIS_ERR_BAD_FLAGS = 25,
+	SA_AIS_ERR_TOO_BIG = 26,
+	SA_AIS_ERR_NO_SECTIONS = 27
+} SaAisErrorT;
+
+typedef union {
+	SaInt64T int64Value;
+	SaUint64T uint64Value;
+	SaTimeT timeValue;
+	SaFloatT floatValue;
+	SaDoubleT doubleValue;
+} SaLimitValueT;
+
+typedef SaUint64T SaSelectionObjectT;
+
+typedef SaUint64T SaInvocationT;
+
+typedef SaUint64T SaSizeT;
+
+#define SA_HANDLE_INVALID 0x0ULL
+
+#endif /* AIS_TYPES_H_DEFINED */