]> git.proxmox.com Git - mirror_corosync.git/commitdiff
API changes and code to make cfg and cpg service operate properly with corosync.
authorSteven Dake <sdake@redhat.com>
Tue, 22 Jul 2008 07:25:27 +0000 (07:25 +0000)
committerSteven Dake <sdake@redhat.com>
Tue, 22 Jul 2008 07:25:27 +0000 (07:25 +0000)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1600 fd59a12c-fef9-0310-b244-a6a79926bd2f

39 files changed:
corosync/Makefile.inc
corosync/exec/Makefile
corosync/exec/coropoll.c
corosync/exec/flow.c
corosync/exec/flow.h
corosync/exec/ipc.c
corosync/exec/ipc.h
corosync/exec/jhash.h [deleted file]
corosync/exec/main.c
corosync/exec/main.h
corosync/exec/mainconfig.h
corosync/exec/service.c
corosync/exec/service.h
corosync/exec/timer.c
corosync/exec/totem.h
corosync/exec/totemip.h
corosync/exec/totemnet.c
corosync/exec/totempg.c
corosync/exec/totemrrp.c
corosync/exec/totemsrp.c
corosync/exec/vsf_ykd.c
corosync/include/evs.h
corosync/include/hdb.h
corosync/include/jhash.h [new file with mode: 0644]
corosync/include/mar_cpg.h
corosync/include/mar_gen.h
corosync/include/saAis.h
corosync/include/swab.h
corosync/lcr/lcr_ifact.c
corosync/lcr/uic.c
corosync/lcr/uis.c
corosync/lib/evs.c
corosync/lib/util.c
corosync/services/Makefile
corosync/services/cfg.c
corosync/services/cpg.c
corosync/services/evs.c
corosync/test/Makefile
corosync/test/testevs.c

index 84b329a7feb5d09cc912ff518e41f7435f302999..3d43ba674ce928620159ef44ca2f911e8e66f048 100644 (file)
@@ -38,7 +38,7 @@ endif
 # OPENAIS_BUILD can be defined as RELEASE or DEBUG
 #
 ifndef OPENAIS_BUILD
-       OPENAIS_BUILD=RELEASE
+       OPENAIS_BUILD=DEBUG
 endif
 
 # OPENAIS_PROFILE
index fb83cb0cd8e53b21f944ab7c0860deabf338664e..19b95274bd3638b97a40dfb63e46ed1b9e961c86 100644 (file)
@@ -1,5 +1,4 @@
 # Copyright (c) 2002-2006 MontaVista Software, Inc.
-# Copyright (c) 2006 Sun Microsystems, Inc.
 # Copyright (c) 2006-2008 Red Hat, Inc.
 # 
 # All rights reserved.
index 1862f8b888b78740cf825a606cb525ca9a0b2f46..a7133d1ef7b8096455296f093a4a9f90d9b68672 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 114ba1a83d405072af2facf9e43f100530976688..23d063fc0cfd2f3ea29a670730bf2515ceaf5d83 100644 (file)
@@ -34,9 +34,9 @@
 
 /*
  * New messages are allowed from the library ONLY when the processor has not
- * received a OPENAIS_FLOW_CONTROL_STATE_ENABLED from any processor.  If a
- * OPENAIS_FLOW_CONTROL_STATE_ENABLED message is sent, it must later be
- *  cancelled by a OPENAIS_FLOW_CONTROL_STATE_DISABLED message.  A configuration
+ * received a COROSYNC_FLOW_CONTROL_STATE_ENABLED from any processor.  If a
+ * COROSYNC_FLOW_CONTROL_STATE_ENABLED message is sent, it must later be
+ *  cancelled by a COROSYNC_FLOW_CONTROL_STATE_DISABLED message.  A configuration
  * change with the flow controlled processor leaving the configuration will
  * also cancel flow control.
  */
@@ -67,12 +67,12 @@ struct flow_control_message {
        unsigned int service __attribute__((aligned(8)));
        char id[1024] __attribute__((aligned(8)));
        unsigned int id_len __attribute__((aligned(8)));
-       enum openais_flow_control_state flow_control_state __attribute__((aligned(8)));
+       enum corosync_flow_control_state flow_control_state __attribute__((aligned(8)));
 };
 
 struct flow_control_node_state {
        unsigned int nodeid;
-       enum openais_flow_control_state flow_control_state;
+       enum corosync_flow_control_state flow_control_state;
 };
 
 struct flow_control_service {
@@ -80,10 +80,10 @@ struct flow_control_service {
        unsigned int service;
        char id[1024];
        unsigned int id_len;
-       void (*flow_control_state_set_fn) (void *context, enum openais_flow_control_state flow_control_state);
+       void (*flow_control_state_set_fn) (void *context, enum corosync_flow_control_state flow_control_state);
        void *context;
        unsigned int processor_count;
-       enum openais_flow_control_state flow_control_state;
+       enum corosync_flow_control_state flow_control_state;
        struct list_head list;
        struct list_head list_all;
 };
@@ -107,7 +107,7 @@ static unsigned int flow_control_member_list_entries;
 
 static inline int flow_control_xmit (
        struct flow_control_service *flow_control_service,
-       enum openais_flow_control_state flow_control_state)
+       enum corosync_flow_control_state flow_control_state)
 {
        struct flow_control_message flow_control_message;
        struct iovec iovec;
@@ -164,11 +164,11 @@ static void flow_control_deliver_fn (
                 * Determine if any flow control is enabled on any nodes and set
                 * the internal variable appropriately
                 */
-               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_DISABLED;
+               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
                flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
                for (i = 0; i < flow_control_service->processor_count; i++) {
-                       if (flow_control_service->flow_control_node_state[i].flow_control_state == OPENAIS_FLOW_CONTROL_STATE_ENABLED) {
-                               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_ENABLED;
+                       if (flow_control_service->flow_control_node_state[i].flow_control_state == COROSYNC_FLOW_CONTROL_STATE_ENABLED) {
+                               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_ENABLED;
                                flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
                        }
                }
@@ -203,7 +203,7 @@ static void flow_control_confchg_fn (
                 */
                for (i = 0; i < member_list_entries; i++) {
                        flow_control_node_state_temp[i].nodeid = member_list[i];
-                       flow_control_node_state_temp[i].flow_control_state = OPENAIS_FLOW_CONTROL_STATE_DISABLED;
+                       flow_control_node_state_temp[i].flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
 
                        /*
                         * Determine if previous state was set for this processor
@@ -230,10 +230,10 @@ static void flow_control_confchg_fn (
                 * Turn on all flow control after a configuration change
                 */
                flow_control_service->processor_count = flow_control_member_list_entries;
-               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_DISABLED;
+               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
                for (i = 0; i < member_list_entries; i++) {
-                       if (flow_control_service->flow_control_node_state[i].flow_control_state == OPENAIS_FLOW_CONTROL_STATE_ENABLED) {
-                               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_ENABLED;
+                       if (flow_control_service->flow_control_node_state[i].flow_control_state == COROSYNC_FLOW_CONTROL_STATE_ENABLED) {
+                               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_ENABLED;
                                flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
                        }
                }
@@ -312,7 +312,7 @@ unsigned int openais_flow_control_create (
        unsigned int service,
        void *id,
        unsigned int id_len,
-       void (*flow_control_state_set_fn) (void *context, enum openais_flow_control_state flow_control_state),
+       void (*flow_control_state_set_fn) (void *context, enum corosync_flow_control_state flow_control_state),
        void *context)
 {
        struct flow_control_service *flow_control_service;
@@ -336,7 +336,7 @@ unsigned int openais_flow_control_create (
         */
        memset (flow_control_service, 0, sizeof (struct flow_control_service));
 
-       flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_DISABLED;
+       flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
        flow_control_service->service = service;
        memcpy (flow_control_service->id, id, id_len);
        flow_control_service->id_len = id_len;
@@ -388,7 +388,7 @@ unsigned int openais_flow_control_destroy (
                if ((flow_control_service->id_len == id_len) &&
                        (memcmp (flow_control_service->id, id, id_len) == 0)) {
                        flow_control_xmit (flow_control_service,
-                               OPENAIS_FLOW_CONTROL_STATE_DISABLED);
+                               COROSYNC_FLOW_CONTROL_STATE_DISABLED);
                        list_del (&flow_control_service->list);
                        list_del (&flow_control_service->list_all);
                        free (flow_control_service);
@@ -424,8 +424,8 @@ unsigned int openais_flow_control_disable (
                list = list->next) {
 
                flow_control_service = list_entry (list, struct flow_control_service, list);
-               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_DISABLED;
-               flow_control_xmit (flow_control_service, OPENAIS_FLOW_CONTROL_STATE_DISABLED);
+               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
+               flow_control_xmit (flow_control_service, COROSYNC_FLOW_CONTROL_STATE_DISABLED);
        }
        hdb_handle_put (&flow_control_hdb, flow_control_handle);
 
@@ -457,8 +457,8 @@ unsigned int openais_flow_control_enable (
 
 
                flow_control_service = list_entry (list, struct flow_control_service, list);
-               flow_control_service->flow_control_state = OPENAIS_FLOW_CONTROL_STATE_ENABLED;
-               flow_control_xmit (flow_control_service, OPENAIS_FLOW_CONTROL_STATE_ENABLED);
+               flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_ENABLED;
+               flow_control_xmit (flow_control_service, COROSYNC_FLOW_CONTROL_STATE_ENABLED);
        }
        hdb_handle_put (&flow_control_hdb, flow_control_handle);
 
index bf79136e342e577ec0a55540bfb0ca0bdb08fc1b..c31e913e4277e908db688aa88bd111b20652d805 100644 (file)
 #ifndef FLOW_H_DEFINED
 #define FLOW_H_DEFINED
 
-enum openais_flow_control_state {
-       OPENAIS_FLOW_CONTROL_STATE_DISABLED,
-       OPENAIS_FLOW_CONTROL_STATE_ENABLED
+#define COROSYNC_FLOW_CONTROL_STATE
+enum corosync_flow_control_state {
+       COROSYNC_FLOW_CONTROL_STATE_DISABLED,
+       COROSYNC_FLOW_CONTROL_STATE_ENABLED
 };
 
 unsigned int openais_flow_control_initialize (void);
@@ -55,7 +56,7 @@ unsigned int openais_flow_control_create (
        unsigned int service,
        void *id,
        unsigned int id_len,
-       void (*flow_control_state_set_fn) (void *context, enum openais_flow_control_state flow_control_state),
+       void (*flow_control_state_set_fn) (void *context, enum corosync_flow_control_state flow_control_state),
        void *context);
 
 unsigned int openais_flow_control_destroy (
index 093e96b853151c185b008e89bed50c67274869f9..aa7903a404b6202729ee87c98d7064e06b6f5097 100644 (file)
@@ -83,8 +83,8 @@
 #include "objdb.h"
 #include "config.h"
 #include "tlist.h"
-#define LOG_SERVICE LOG_SERVICE_IPC
 #include "logsys.h"
+#include "coroapi.h"
 
 #include "util.h"
 
@@ -149,7 +149,7 @@ struct conn_info {
        unsigned int flow_control_handle;       /* flow control identifier */
        unsigned int flow_control_enabled;      /* flow control enabled bit */
        unsigned int flow_control_local_count;  /* flow control local count */
-       enum openais_flow_control flow_control; /* Does this service use IPC flow control */
+       enum corosync_lib_flow_control flow_control;    /* Does this service use IPC flow control */
        pthread_mutex_t flow_control_mutex;
         int (*lib_exit_fn) (void *conn);
        struct timerlist timerlist;
@@ -292,7 +292,7 @@ static int dispatch_init_send_response (
 
        conn_info->flow_control = ais_service[conn_info->service]->flow_control;
        conn_info->conn_info_partner->flow_control = ais_service[conn_info->service]->flow_control;
-       if (ais_service[conn_info->service]->flow_control == OPENAIS_FLOW_CONTROL_REQUIRED) {
+       if (ais_service[conn_info->service]->flow_control == COROSYNC_LIB_FLOW_CONTROL_REQUIRED) {
                openais_flow_control_ipc_init (
                        &conn_info->flow_control_handle,
                        conn_info->service);
@@ -629,7 +629,7 @@ static void ipc_flow_control (struct conn_info *conn_info)
        /*
         * IPC group-wide flow control
         */
-       if (conn_info->flow_control == OPENAIS_FLOW_CONTROL_REQUIRED) {
+       if (conn_info->flow_control == COROSYNC_LIB_FLOW_CONTROL_REQUIRED) {
                if (conn_info->flow_control_enabled == 0 &&
                        ((fcc + FLOW_CONTROL_ENTRIES_ENABLE) > SIZEQUEUE)) {
 
@@ -875,9 +875,9 @@ retry_recv:
                        /*
                         * Not an init service, but a standard service
                         */
-                       if (header->id < 0 || header->id > ais_service[service]->lib_service_count) {
+                       if (header->id < 0 || header->id > ais_service[service]->lib_engine_count) {
                                log_printf (LOG_LEVEL_SECURITY, "Invalid header id is %d min 0 max %d\n",
-                               header->id, ais_service[service]->lib_service_count);
+                               header->id, ais_service[service]->lib_engine_count);
                                return ;
                        }
 
@@ -894,22 +894,22 @@ retry_recv:
 
                        send_ok =
                                (sync_primary_designated() == 1) && (
-                               (ais_service[service]->lib_service[header->id].flow_control == OPENAIS_FLOW_CONTROL_NOT_REQUIRED) ||
-                               ((ais_service[service]->lib_service[header->id].flow_control == OPENAIS_FLOW_CONTROL_REQUIRED) &&
+                               (ais_service[service]->lib_engine[header->id].flow_control == COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED) ||
+                               ((ais_service[service]->lib_engine[header->id].flow_control == COROSYNC_LIB_FLOW_CONTROL_REQUIRED) &&
                                (send_ok_joined) &&
                                (sync_in_process() == 0)));
 
                        if (send_ok) {
-                               ais_service[service]->lib_service[header->id].lib_handler_fn(conn_info, header);
+                               ais_service[service]->lib_engine[header->id].lib_handler_fn(conn_info, header);
                        } else {
 
                                /*
                                 * Overload, tell library to retry
                                 */
                                res_overlay.header.size =
-                                       ais_service[service]->lib_service[header->id].response_size;
+                                       ais_service[service]->lib_engine[header->id].response_size;
                                res_overlay.header.id =
-                                       ais_service[service]->lib_service[header->id].response_id;
+                                       ais_service[service]->lib_engine[header->id].response_id;
                                res_overlay.header.error = SA_AIS_ERR_TRY_AGAIN;
                                openais_conn_send_response (
                                        conn_info,
@@ -1270,7 +1270,7 @@ void openais_ipc_flow_control_create (
        unsigned int service,
        char *id,
        int id_len,
-       void (*flow_control_state_set_fn) (void *conn, enum openais_flow_control_state),
+       void (*flow_control_state_set_fn) (void *conn, enum corosync_flow_control_state),
        void *context)
 {
        struct conn_info *conn_info = (struct conn_info *)conn;
index 26fb48932d8b76bb08d1689bee9106b84149ddf5..a8ff7dcac284de18645be49554c79afccf6a20f1 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef IPC_H_DEFINED
 #define IPC_H_DEFINED
 
+#include "flow.h"
+
 #ifndef TIMER_HANDLE
 typedef void * timer_handle;
 #define TIMER_HANDLE
@@ -75,7 +77,7 @@ extern void openais_ipc_flow_control_create (
        unsigned int service,
        char *id,
        int id_len,
-       void (*flow_control_state_set_fn) (void *context, enum openais_flow_control_state flow_control_state_set),
+       void (*flow_control_state_set_fn) (void *context, enum corosync_flow_control_state flow_control_state_set),
        void *context);
        
 extern void openais_ipc_flow_control_destroy (
diff --git a/corosync/exec/jhash.h b/corosync/exec/jhash.h
deleted file mode 100644 (file)
index cf76876..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef _LINUX_JHASH_H
-#define _LINUX_JHASH_H
-
-/* jhash.h: Jenkins hash support.
- *
- * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)
- *
- * http://burtleburtle.net/bob/hash/
- *
- * These are the credits from Bob's sources:
- *
- * lookup2.c, by Bob Jenkins, December 1996, Public Domain.
- * hash(), hash2(), hash3, and mix() are externally useful functions.
- * Routines to test the hash are included if SELF_TEST is defined.
- * You can use this free for any purpose.  It has no warranty.
- *
- * Copyright (C) 2003 David S. Miller (davem@redhat.com)
- *
- * I've modified Bob's hash to be useful in the Linux kernel, and
- * any bugs present are surely my fault.  -DaveM
- */
-
-typedef uint32_t u32;
-typedef uint8_t u8;
-
-/* NOTE: Arguments are modified. */
-#define __jhash_mix(a, b, c) \
-{ \
-  a -= b; a -= c; a ^= (c>>13); \
-  b -= c; b -= a; b ^= (a<<8); \
-  c -= a; c -= b; c ^= (b>>13); \
-  a -= b; a -= c; a ^= (c>>12);  \
-  b -= c; b -= a; b ^= (a<<16); \
-  c -= a; c -= b; c ^= (b>>5); \
-  a -= b; a -= c; a ^= (c>>3);  \
-  b -= c; b -= a; b ^= (a<<10); \
-  c -= a; c -= b; c ^= (b>>15); \
-}
-
-/* The golden ration: an arbitrary value */
-#define JHASH_GOLDEN_RATIO     0x9e3779b9
-
-/* The most generic version, hashes an arbitrary sequence
- * of bytes.  No alignment or length assumptions are made about
- * the input key.
- */
-static inline u32 jhash(const void *key, u32 length, u32 initval)
-{
-       u32 a, b, c, len;
-       const u8 *k = key;
-
-       len = length;
-       a = b = JHASH_GOLDEN_RATIO;
-       c = initval;
-
-       while (len >= 12) {
-               a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
-               b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
-               c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
-
-               __jhash_mix(a,b,c);
-
-               k += 12;
-               len -= 12;
-       }
-
-       c += length;
-       switch (len) {
-       case 11: c += ((u32)k[10]<<24);
-       case 10: c += ((u32)k[9]<<16);
-       case 9 : c += ((u32)k[8]<<8);
-       case 8 : b += ((u32)k[7]<<24);
-       case 7 : b += ((u32)k[6]<<16);
-       case 6 : b += ((u32)k[5]<<8);
-       case 5 : b += k[4];
-       case 4 : a += ((u32)k[3]<<24);
-       case 3 : a += ((u32)k[2]<<16);
-       case 2 : a += ((u32)k[1]<<8);
-       case 1 : a += k[0];
-       };
-
-       __jhash_mix(a,b,c);
-
-       return c;
-}
-
-/* A special optimized version that handles 1 or more of u32s.
- * The length parameter here is the number of u32s in the key.
- */
-static inline u32 jhash2(u32 *k, u32 length, u32 initval)
-{
-       u32 a, b, c, len;
-
-       a = b = JHASH_GOLDEN_RATIO;
-       c = initval;
-       len = length;
-
-       while (len >= 3) {
-               a += k[0];
-               b += k[1];
-               c += k[2];
-               __jhash_mix(a, b, c);
-               k += 3; len -= 3;
-       }
-
-       c += length * 4;
-
-       switch (len) {
-       case 2 : b += k[1];
-       case 1 : a += k[0];
-       };
-
-       __jhash_mix(a,b,c);
-
-       return c;
-}
-
-
-/* A special ultra-optimized versions that knows they are hashing exactly
- * 3, 2 or 1 word(s).
- *
- * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
- *       done at the end is not done here.
- */
-static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
-{
-       a += JHASH_GOLDEN_RATIO;
-       b += JHASH_GOLDEN_RATIO;
-       c += initval;
-
-       __jhash_mix(a, b, c);
-
-       return c;
-}
-
-static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
-{
-       return jhash_3words(a, b, 0, initval);
-}
-
-static inline u32 jhash_1word(u32 a, u32 initval)
-{
-       return jhash_3words(a, 0, 0, initval);
-}
-
-#endif /* _LINUX_JHASH_H */
index ea2061f13d69e5ebcf67b53411488922f41699d1..586a26d9a41c8cc70a5a9b229b287595e6af8e21 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
- * Copyright (c) 2006 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -81,6 +80,7 @@
 #include "util.h"
 #include "flow.h"
 #include "version.h"
+#include "coroapi.h"
 
 LOGSYS_DECLARE_SYSTEM ("corosync",
        LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_BUFFER_BEFORE_CONFIG,
@@ -447,12 +447,12 @@ static void deliver_fn (
        service = header->id >> 16;
        fn_id = header->id & 0xffff;
        if (endian_conversion_required) {
-               assert(ais_service[service]->exec_service[fn_id].exec_endian_convert_fn != NULL);
-               ais_service[service]->exec_service[fn_id].exec_endian_convert_fn
+               assert(ais_service[service]->exec_engine[fn_id].exec_endian_convert_fn != NULL);
+               ais_service[service]->exec_engine[fn_id].exec_endian_convert_fn
                        (header);
        }
 
-       ais_service[service]->exec_service[fn_id].exec_handler_fn
+       ais_service[service]->exec_engine[fn_id].exec_handler_fn
                (header, nodeid);
 }
 
@@ -462,6 +462,14 @@ void main_get_config_modules(struct config_iface_ver0 ***modules, int *num)
        *num = num_config_modules;
 }
 
+int main_mcast (
+        struct iovec *iovec,
+        int iov_len,
+        unsigned int guarantee)
+{
+       return (totempg_groups_mcast_joined (openais_group_handle, iovec, iov_len, guarantee));
+}
+
 int main (int argc, char **argv)
 {
        char *error_string;
index 4e5c02e5291bff450caed98b2018eeccf1482ddd..b03bf4044267d388ec154ef86e4655a2a98ab00b 100644 (file)
@@ -65,4 +65,9 @@ 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);
 
+extern int main_mcast (
+       struct iovec *iovec,
+       int iov_len,
+       unsigned int guarantee);
+
 #endif /* AIS_EXEC_H_DEFINED */
index 362ec5fe0e674b859c09b7af5b8b6f6882d475e1..b7d58dbb544ac86b37be316a093a7407d2c30801 100644 (file)
@@ -45,7 +45,7 @@ struct dynamic_service {
        char *name;
        unsigned int ver;
        unsigned int handle;
-       struct openais_service_handler_iface_ver0 *iface_ver0;
+       struct openais_service_engine_iface_ver0 *iface_ver0;
 };
 #define MAX_DYNAMIC_SERVICES 128
 
index b28a0fb6ca1d330db12c0a024de90b8bde981f3e..426d119f3cf1148c3761cba493212dd407a746a9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
 #include "util.h"
 #include "logsys.h"
 
+#include "timer.h"
+#include "totempg.h"
+#include "totemip.h"
+#include "main.h"
+#include "ipc.h"
+
+#include "../include/coroapi.h"
+
 LOGSYS_DECLARE_SUBSYS ("SERV", LOG_INFO);
 
 struct default_service {
@@ -53,11 +61,40 @@ struct default_service {
        int ver;
 };
 
+static struct corosync_api_v1 corosync_api_v1 = {
+       .timer_add_duration = openais_timer_add_duration,
+       .timer_add_absolute = openais_timer_add_absolute,
+       .timer_delete = openais_timer_delete,
+       .timer_time_get = NULL,
+       .ipc_source_set = message_source_set,
+       .ipc_source_is_local = message_source_is_local,
+       .ipc_private_data_get = openais_conn_private_data_get,
+       .ipc_response_send = NULL,
+       .ipc_dispatch_send = NULL,
+       .conn_send_response = openais_conn_send_response,
+       .conn_partner_get = openais_conn_partner_get,
+       .ipc_refcnt_inc =  openais_ipc_flow_control_local_increment,
+       .ipc_refcnt_dec = openais_ipc_flow_control_local_decrement,
+       .ipc_fc_create = openais_ipc_flow_control_create,
+       .ipc_fc_destroy = openais_ipc_flow_control_destroy,
+       .totem_nodeid_get = totempg_my_nodeid_get,
+       .totem_ring_reenable = totempg_ring_reenable,
+       .totem_mcast = main_mcast,
+       .service_link_and_init = openais_service_link_and_init,
+       .service_unlink_and_exit = openais_service_unlink_and_exit,
+       .totem_ifaces_get = totempg_ifaces_get,
+       .totem_ifaces_print = totempg_ifaces_print,
+       .totem_ip_print = totemip_print,
+       .error_memory_failure = NULL
+};
+
 static struct default_service default_services[] = {
+/*
        {
                .name                    = "corosync_evs",
                .ver                     = 0,
        },
+*/
        {
 
                .name                    = "corosync_cfg",
@@ -67,13 +104,15 @@ static struct default_service default_services[] = {
                .name                    = "corosync_cpg",
                .ver                     = 0,
        },
+/*
        {
                .name                    = "corosync_confdb",
                .ver                     = 0,
        },
+*/
 };
 
-struct openais_service_handler *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
+struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 
 static unsigned int object_internal_configuration_handle;
 
@@ -112,10 +151,10 @@ unsigned int openais_service_link_and_init (
        char *service_name,
        unsigned int service_ver)
 {
-       struct openais_service_handler_iface_ver0 *iface_ver0;
+       struct corosync_service_engine_iface_ver0 *iface_ver0;
        void *iface_ver0_p;
        unsigned int handle;
-       struct openais_service_handler *service;
+       struct corosync_service_engine *service;
        unsigned int res;
        unsigned int object_service_handle;
 
@@ -130,7 +169,7 @@ unsigned int openais_service_link_and_init (
                &iface_ver0_p,
                (void *)0);
 
-       iface_ver0 = (struct openais_service_handler_iface_ver0 *)iface_ver0_p;
+       iface_ver0 = (struct corosync_service_engine_iface_ver0 *)iface_ver0_p;
 
        if (iface_ver0 == 0) {
                log_printf(LOG_LEVEL_ERROR, "Service failed to load '%s'.\n", service_name);
@@ -141,7 +180,7 @@ unsigned int openais_service_link_and_init (
        /*
         * Initialize service
         */
-       service = iface_ver0->openais_get_service_handler_ver0();
+       service = iface_ver0->corosync_get_service_engine_ver0();
 
        ais_service[service->id] = service;
        if (service->config_init_fn) {
@@ -149,7 +188,7 @@ unsigned int openais_service_link_and_init (
        }
 
        if (service->exec_init_fn) {
-               res = service->exec_init_fn (objdb);
+               res = service->exec_init_fn (objdb, &corosync_api_v1);
        }
 
        /*
index 20c315292c4e601d35067b23dc0bdb5e659152bc..aa06d31141791471a935a70b5735213b2efbf74c 100644 (file)
 #ifndef OPENAIS_SERVICE_H_DEFINED
 #define OPENAIS_SERVICE_H_DEFINED
 
-#define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
-#define SERVICE_HANDLER_MAXIMUM_COUNT 64
-
-enum openais_flow_control {
-       OPENAIS_FLOW_CONTROL_REQUIRED = 1,
-       OPENAIS_FLOW_CONTROL_NOT_REQUIRED = 2
-};
-
-struct openais_lib_handler {
-       void (*lib_handler_fn) (void *conn, void *msg);
-       int response_size;
-       int response_id;
-       enum openais_flow_control flow_control;
-};
-
-struct openais_exec_handler {
-       void (*exec_handler_fn) (void *msg, unsigned int nodeid);
-       void (*exec_endian_convert_fn) (void *msg);
-};
-
-struct openais_service_handler {
-       char *name;
-       unsigned short id;
-       unsigned int private_data_size;
-       enum openais_flow_control flow_control;
-       int (*lib_init_fn) (void *conn);
-       int (*lib_exit_fn) (void *conn);
-       struct openais_lib_handler *lib_service;
-       int lib_service_count;
-       struct openais_exec_handler *exec_service;
-       int (*exec_init_fn) (struct objdb_iface_ver0 *);
-       int (*exec_exit_fn) (struct objdb_iface_ver0 *);
-       int (*config_init_fn) (struct objdb_iface_ver0 *);
-       void (*exec_dump_fn) (void);
-       int exec_service_count;
-       void (*confchg_fn) (
-               enum totem_configuration_type configuration_type,
-               unsigned int *member_list, int member_list_entries,
-               unsigned int *left_list, int left_list_entries,
-               unsigned int *joined_list, int joined_list_entries,
-               struct memb_ring_id *ring_id);
-       void (*sync_init) (void);
-       int (*sync_process) (void);
-       void (*sync_activate) (void);
-       void (*sync_abort) (void);
-};
-
-struct openais_service_handler_iface_ver0 {
-       struct openais_service_handler *(*openais_get_service_handler_ver0) (void);
-};
-
 /*
  * Link and initialize a service
  */
@@ -108,13 +57,12 @@ extern unsigned int openais_service_unlink_and_exit (
 extern unsigned int openais_service_unlink_all (
     struct objdb_iface_ver0 *objdb);
 
-
 /*
  * Load all of the default services
  */
 extern unsigned int openais_service_defaults_link_and_init (
        struct objdb_iface_ver0 *objdb);
 
-extern struct openais_service_handler *ais_service[];
+extern struct corosync_service_engine *ais_service[];
 
 #endif /* SERVICE_H_DEFINED */
index c1c3558ca91467650807dd27bab7e002c1dac7ec..95f3619481d1a9c788d4e643b39b7a87f2a5ab97 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 364741bf3c759fba92a26aa9545a57dfdc1eced6..582dc5ef1a1dce4da7ca96673bb2e25fd8391bd0 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * Author: Steven Dake (sdake@redhat.com)
  *
@@ -149,6 +148,7 @@ struct totem_config {
        char *vsf_type;
 };
 
+#define TOTEM_CONFIGURATION_TYPE
 enum totem_configuration_type {
        TOTEM_CONFIGURATION_REGULAR,
        TOTEM_CONFIGURATION_TRANSITIONAL        
@@ -159,6 +159,7 @@ enum totem_callback_token_type {
        TOTEM_CALLBACK_TOKEN_SENT = 2
 };
 
+#define MEMB_RING_ID
 struct memb_ring_id {
        struct totem_ip_address rep;
        unsigned long long seq;
index ec87b793f399952c5cdcc38108ca5c0f0af50c06..9e50bc40c4d5b472a7ba21a492d0aa6e9ecada11 100644 (file)
@@ -52,6 +52,7 @@ void totemip_nosigpipe(int s);
 #define TOTEMIP_ADDRLEN (sizeof(struct in6_addr))
 
 /* These are the things that get passed around */
+#define TOTEM_IP_ADDRESS
 struct totem_ip_address
 {
        unsigned int   nodeid;
index 8bbf7764eea4bd51689c1c9a6ed706450bd4888c..c91aa16d39c1230585712ff20cd5487d5004b51f 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index b882a2efc2e7e8cea78423ec221ce960ce7ae5db..a05c98d132b1eb591ff7c4d91ce9e9a75fa20a89 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * Copyright (c) 2003-2005 MontaVista Software, Inc.
  * Copyright (c) 2005 OSDL.
- * Copyright (c) 2006 Sun Microsystems, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index a5e61e979122f917cd9ae9810f5d6551fcf4782c..94fa84a8ed4b462d0e354e33fc3a7c66b57af574 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -1696,7 +1695,6 @@ int totemrrp_ring_reenable (
        int res = 0;
        unsigned int i;
 
-printf ("totemrrp ring reenable\n");
        res = hdb_handle_get (&totemrrp_instance_database, handle,
                (void *)&instance);
        if (res != 0) {
index 5eceef443ae431b4570e5b3d1942b5fa7a3bc2c3..c332eaa6b288a1521155fcf9e2629ef3964bfbcd 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2003-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 8e71f7a351f5d694984ce1d06be8e2c6d62891ca..110a9c42dd41eb938e2d536091c9ea009e22d57a 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 55c1d464c608306a8f0ee1e79bebb658bceff20a..831b2a3867d4118e1cb0aba50e45fbf2efef856e 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
  *
  * All rights reserved.
  *
index daca7b701e51e9967ec1e1dd0798a0fe6335bc9b..2c429b905af4a471ed8584341afc8a0f273ec2d2 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
- * Copyright (c) 2006 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
diff --git a/corosync/include/jhash.h b/corosync/include/jhash.h
new file mode 100644 (file)
index 0000000..cf76876
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef _LINUX_JHASH_H
+#define _LINUX_JHASH_H
+
+/* jhash.h: Jenkins hash support.
+ *
+ * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)
+ *
+ * http://burtleburtle.net/bob/hash/
+ *
+ * These are the credits from Bob's sources:
+ *
+ * lookup2.c, by Bob Jenkins, December 1996, Public Domain.
+ * hash(), hash2(), hash3, and mix() are externally useful functions.
+ * Routines to test the hash are included if SELF_TEST is defined.
+ * You can use this free for any purpose.  It has no warranty.
+ *
+ * Copyright (C) 2003 David S. Miller (davem@redhat.com)
+ *
+ * I've modified Bob's hash to be useful in the Linux kernel, and
+ * any bugs present are surely my fault.  -DaveM
+ */
+
+typedef uint32_t u32;
+typedef uint8_t u8;
+
+/* NOTE: Arguments are modified. */
+#define __jhash_mix(a, b, c) \
+{ \
+  a -= b; a -= c; a ^= (c>>13); \
+  b -= c; b -= a; b ^= (a<<8); \
+  c -= a; c -= b; c ^= (b>>13); \
+  a -= b; a -= c; a ^= (c>>12);  \
+  b -= c; b -= a; b ^= (a<<16); \
+  c -= a; c -= b; c ^= (b>>5); \
+  a -= b; a -= c; a ^= (c>>3);  \
+  b -= c; b -= a; b ^= (a<<10); \
+  c -= a; c -= b; c ^= (b>>15); \
+}
+
+/* The golden ration: an arbitrary value */
+#define JHASH_GOLDEN_RATIO     0x9e3779b9
+
+/* The most generic version, hashes an arbitrary sequence
+ * of bytes.  No alignment or length assumptions are made about
+ * the input key.
+ */
+static inline u32 jhash(const void *key, u32 length, u32 initval)
+{
+       u32 a, b, c, len;
+       const u8 *k = key;
+
+       len = length;
+       a = b = JHASH_GOLDEN_RATIO;
+       c = initval;
+
+       while (len >= 12) {
+               a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
+               b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
+               c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
+
+               __jhash_mix(a,b,c);
+
+               k += 12;
+               len -= 12;
+       }
+
+       c += length;
+       switch (len) {
+       case 11: c += ((u32)k[10]<<24);
+       case 10: c += ((u32)k[9]<<16);
+       case 9 : c += ((u32)k[8]<<8);
+       case 8 : b += ((u32)k[7]<<24);
+       case 7 : b += ((u32)k[6]<<16);
+       case 6 : b += ((u32)k[5]<<8);
+       case 5 : b += k[4];
+       case 4 : a += ((u32)k[3]<<24);
+       case 3 : a += ((u32)k[2]<<16);
+       case 2 : a += ((u32)k[1]<<8);
+       case 1 : a += k[0];
+       };
+
+       __jhash_mix(a,b,c);
+
+       return c;
+}
+
+/* A special optimized version that handles 1 or more of u32s.
+ * The length parameter here is the number of u32s in the key.
+ */
+static inline u32 jhash2(u32 *k, u32 length, u32 initval)
+{
+       u32 a, b, c, len;
+
+       a = b = JHASH_GOLDEN_RATIO;
+       c = initval;
+       len = length;
+
+       while (len >= 3) {
+               a += k[0];
+               b += k[1];
+               c += k[2];
+               __jhash_mix(a, b, c);
+               k += 3; len -= 3;
+       }
+
+       c += length * 4;
+
+       switch (len) {
+       case 2 : b += k[1];
+       case 1 : a += k[0];
+       };
+
+       __jhash_mix(a,b,c);
+
+       return c;
+}
+
+
+/* A special ultra-optimized versions that knows they are hashing exactly
+ * 3, 2 or 1 word(s).
+ *
+ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
+ *       done at the end is not done here.
+ */
+static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
+{
+       a += JHASH_GOLDEN_RATIO;
+       b += JHASH_GOLDEN_RATIO;
+       c += initval;
+
+       __jhash_mix(a, b, c);
+
+       return c;
+}
+
+static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
+{
+       return jhash_3words(a, b, 0, initval);
+}
+
+static inline u32 jhash_1word(u32 a, u32 initval)
+{
+       return jhash_3words(a, 0, 0, initval);
+}
+
+#endif /* _LINUX_JHASH_H */
index 02d2701d2ccee85b6481c21740ade37ef0e68a59..08c9d15d0f0115b46339dafa76f4b7267173b707 100644 (file)
@@ -1,9 +1,7 @@
 /*
- * Copyright (c) 2006 Red Hat, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  * Author: Patrick Caulfield (pcaulfie@redhat.com)
  *
- * Copyright (c) 2006 Sun Microsystems, Inc.
- *
  * All rights reserved.
  *
  * This software licensed under BSD license, the text of which follows:
index f0c63c9355948e6c2e49dd07be6d42758577dd84..a577384f9bbbecf1d79c80759f57390102bdcca7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 5670557e523fbf4162631a1ea768f536a2d0edbf..ee8f02ed268d850bd124c6232fd876a5865d4fd4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2002-2003 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 594fceedc65dbb1279f3e685f138f68a361f4cff..2da045070aa1d7cf29c2b2b5bf1a5236ac659705 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index deaaaf6b0bc9b5d4ab9ccc09bc34b47f103f693f..d19316d29575a17a22fe92cec2ea78a57bcfea26 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2006 Steven Dake (sdake@redhat.com)
- * Copyright (c) 2006 Sun Microsystems, Inc.
  *
  * This software licensed under BSD license, the text of which follows:
  * 
index 6ee0a91787338689d320ee369842f32c9393b160..3527c1eaea73a26c58a513340d4f0b0b8ce8aa71 100755 (executable)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Steven Dake (sdake@redhat.com)
- * Copyright (c) 2006 Sun Microsystems, Inc.
  *
  * This software licensed under BSD license, the text of which follows:
  * 
index 361d22e1f69520ae91287e68a04a0784b513e318..81db447e35fcce934b0aba0e19632cbfde997968 100755 (executable)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2006 Steven Dake (sdake@redhat.com)
- * Copyright (c) 2006 Sun Microsystems, Inc.
  *
  * This software licensed under BSD license, the text of which follows:
  * 
index dea2479790d87b01d4a9ef262555558990cd5a92..dd0bd9cc1c5cb80d3caff39be23ff41b5d5f38b8 100644 (file)
@@ -2,7 +2,7 @@
  * vi: set autoindent tabstop=4 shiftwidth=4 :
 
  * Copyright (c) 2004-2005 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index 4b27a1ff646ecf70a1c82c2bee62d7d8dba110d8..81327f3fe607fcd30e4678a9cd0adb1213821898 100644 (file)
@@ -2,7 +2,7 @@
  * vi: set autoindent tabstop=4 shiftwidth=4 :
  *
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index f71aed65ee937bb9cce2168ac80e0232ad532b74..2099b8947f3fa07b6a12b3140bbe2ffbe36c69c5 100644 (file)
@@ -104,6 +104,3 @@ confdb.o: confdb.c
 
 cpg.o: cpg.c
        $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cfg.o: cfg.c
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
index 7e01bf626b1f3a2bcb653e964c053f6d27b92624..079dd3b459b04109a305c69118043399cab008a4 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2005-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
 #include "../include/ipc_gen.h"
 #include "../include/ipc_cfg.h"
 #include "../include/list.h"
-#include "totem.h"
-#include "totempg.h"
-#include "flow.h"
-#include "tlist.h"
-#include "ipc.h"
 #include "../include/queue.h"
 #include "../lcr/lcr_comp.h"
-#include "objdb.h"
-#include "service.h"
-#include "totempg.h"
-#include "mempool.h"
-#include "util.h"
-#include "logsys.h"
-#include "main.h"
+#include "../exec/logsys.h"
+#include "../include/coroapi.h"
 
 LOGSYS_DECLARE_SUBSYS ("CFG", LOG_INFO);
 
@@ -81,7 +70,9 @@ static void cfg_confchg_fn (
        unsigned int *joined_list, int joined_list_entries,
        struct memb_ring_id *ring_id);
 
-static int cfg_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static int cfg_exec_init_fn (struct objdb_iface_ver0 *objdb, struct corosync_api_v1 *corosync_api_v1);
+
+static struct corosync_api_v1 *api;
 
 static int cfg_lib_init_fn (void *conn);
 
@@ -126,59 +117,59 @@ static void message_handler_req_lib_cfg_serviceunload (
 /*
  * Service Handler Definition
  */
-static struct openais_lib_handler cfg_lib_service[] =
+static struct corosync_lib_handler cfg_lib_engine[] =
 {
        { /* 0 */
                .lib_handler_fn         = message_handler_req_lib_cfg_ringstatusget,
                .response_size          = sizeof (struct res_lib_cfg_ringstatusget),
                .response_id            = MESSAGE_RES_CFG_RINGSTATUSGET,
-               .flow_control           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 1 */
                .lib_handler_fn         = message_handler_req_lib_cfg_ringreenable,
                .response_size          = sizeof (struct res_lib_cfg_ringreenable),
                .response_id            = MESSAGE_RES_CFG_RINGREENABLE,
-               .flow_control           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 2 */
                .lib_handler_fn         = message_handler_req_lib_cfg_statetrack,
                .response_size          = sizeof (struct res_lib_cfg_statetrack),
                .response_id            = MESSAGE_RES_CFG_STATETRACKSTART,
-               .flow_control           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 3 */
                .lib_handler_fn         = message_handler_req_lib_cfg_statetrackstop,
                .response_size          = sizeof (struct res_lib_cfg_statetrackstop),
                .response_id            = MESSAGE_RES_CFG_STATETRACKSTOP,
-               .flow_control           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 4 */
                .lib_handler_fn         = message_handler_req_lib_cfg_administrativestateset,
                .response_size          = sizeof (struct res_lib_cfg_administrativestateset),
                .response_id            = MESSAGE_RES_CFG_ADMINISTRATIVESTATESET,
-               .flow_control           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 5 */
                .lib_handler_fn         = message_handler_req_lib_cfg_administrativestateget,
                .response_size          = sizeof (struct res_lib_cfg_administrativestateget),
                .response_id            = MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET,
-               .flow_control           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 6 */
                .lib_handler_fn         = message_handler_req_lib_cfg_serviceload,
                .response_size          = sizeof (struct res_lib_cfg_serviceload),
                .response_id            = MESSAGE_RES_CFG_SERVICELOAD,
-               .flow_control           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 7 */
                .lib_handler_fn         = message_handler_req_lib_cfg_serviceunload,
                .response_size          = sizeof (struct res_lib_cfg_serviceunload),
                .response_id            = MESSAGE_RES_CFG_SERVICEUNLOAD,
-               .flow_control           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        }
 };
 
-static struct openais_exec_handler cfg_exec_service[] =
+static struct corosync_exec_handler cfg_exec_engine[] =
 {
        {
                message_handler_req_exec_cfg_ringreenable
@@ -188,18 +179,18 @@ static struct openais_exec_handler cfg_exec_service[] =
 /*
  * Exports the interface for the service
  */
-struct openais_service_handler cfg_service_handler = {
-       .name                                   = "openais configuration service",
+struct corosync_service_engine cfg_service_engine = {
+       .name                                   = "corosync configuration service",
        .id                                     = CFG_SERVICE,
        .private_data_size                      = 0,
-       .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED, 
+       .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED, 
        .lib_init_fn                            = cfg_lib_init_fn,
        .lib_exit_fn                            = cfg_lib_exit_fn,
-       .lib_service                            = cfg_lib_service,
-       .lib_service_count                      = sizeof (cfg_lib_service) / sizeof (struct openais_lib_handler),
+       .lib_engine                             = cfg_lib_engine,
+       .lib_engine_count                       = sizeof (cfg_lib_engine) / sizeof (struct corosync_lib_handler),
        .exec_init_fn                           = cfg_exec_init_fn,
-       .exec_service                           = cfg_exec_service,
-       .exec_service_count                     = 0, /* sizeof (cfg_aisexec_handler_fns) / sizeof (openais_exec_handler), */
+       .exec_engine                            = cfg_exec_engine,
+       .exec_engine_count                      = 0, /* sizeof (cfg_aisexec_handler_fns) / sizeof (coroync_exec_handler), */
        .confchg_fn                             = cfg_confchg_fn,
 };
 
@@ -208,15 +199,15 @@ static struct objdb_iface_ver0 *my_objdb;
 /*
  * Dynamic Loader definition
  */
-static struct openais_service_handler *cfg_get_handler_ver0 (void);
+static struct corosync_service_engine *cfg_get_handler_ver0 (void);
 
-static struct openais_service_handler_iface_ver0 cfg_service_handler_iface = {
-       .openais_get_service_handler_ver0       = cfg_get_handler_ver0
+static struct corosync_service_engine_iface_ver0 cfg_service_engine_iface = {
+       .corosync_get_service_engine_ver0       = cfg_get_handler_ver0
 };
 
-static struct lcr_iface openais_cfg_ver0[1] = {
+static struct lcr_iface corosync_cfg_ver0[1] = {
        {
-               .name                           = "openais_cfg",
+               .name                           = "corosync_cfg",
                .version                        = 0,
                .versions_replace               = 0,
                .versions_replace_count         = 0,
@@ -230,16 +221,16 @@ static struct lcr_iface openais_cfg_ver0[1] = {
 
 static struct lcr_comp cfg_comp_ver0 = {
        .iface_count                            = 1,
-       .ifaces                                 = openais_cfg_ver0
+       .ifaces                                 = corosync_cfg_ver0
 };
 
-static struct openais_service_handler *cfg_get_handler_ver0 (void)
+static struct corosync_service_engine *cfg_get_handler_ver0 (void)
 {
-       return (&cfg_service_handler);
+       return (&cfg_service_engine);
 }
 
 __attribute__ ((constructor)) static void register_this_component (void) {
-       lcr_interfaces_set (&openais_cfg_ver0[0], &cfg_service_handler_iface);
+       lcr_interfaces_set (&corosync_cfg_ver0[0], &cfg_service_engine_iface);
 
        lcr_component_register (&cfg_comp_ver0);
 }
@@ -251,9 +242,12 @@ struct req_exec_cfg_ringreenable {
 
 /* IMPL */
 
-static int cfg_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int cfg_exec_init_fn (
+       struct objdb_iface_ver0 *objdb,
+       struct corosync_api_v1 *corosync_api_v1)
 {
        my_objdb = objdb;
+       api = corosync_api_v1;
        return (0);
 }
 
@@ -292,12 +286,12 @@ static void message_handler_req_exec_cfg_ringreenable (
        struct res_lib_cfg_ringreenable res_lib_cfg_ringreenable;
 
        ENTER("");
-       totempg_ring_reenable ();
-        if (message_source_is_local(&req_exec_cfg_ringreenable->source)) {
+       api->totem_ring_reenable ();
+        if (api->ipc_source_is_local(&req_exec_cfg_ringreenable->source)) {
                res_lib_cfg_ringreenable.header.id = MESSAGE_RES_CFG_RINGREENABLE;
                res_lib_cfg_ringreenable.header.size = sizeof (struct res_lib_cfg_ringreenable);
                res_lib_cfg_ringreenable.header.error = SA_AIS_OK;
-               openais_conn_send_response (
+               api->conn_send_response (
                        req_exec_cfg_ringreenable->source.conn,
                        &res_lib_cfg_ringreenable,
                        sizeof (struct res_lib_cfg_ringreenable));
@@ -326,8 +320,8 @@ static void message_handler_req_lib_cfg_ringstatusget (
        res_lib_cfg_ringstatusget.header.size = sizeof (struct res_lib_cfg_ringstatusget);
        res_lib_cfg_ringstatusget.header.error = SA_AIS_OK;
 
-       totempg_ifaces_get (
-               totempg_my_nodeid_get(),
+       api->totem_ifaces_get (
+               api->totem_nodeid_get(),
                interfaces,
                &status,
                &iface_count);
@@ -335,13 +329,13 @@ static void message_handler_req_lib_cfg_ringstatusget (
        res_lib_cfg_ringstatusget.interface_count = iface_count;
 
        for (i = 0; i < iface_count; i++) {
-               totem_ip_string = (char *)totemip_print (&interfaces[i]);
+               totem_ip_string = (char *)api->totem_ip_print (&interfaces[i]);
                strcpy ((char *)&res_lib_cfg_ringstatusget.interface_status[i],
                        status[i]);
                strcpy ((char *)&res_lib_cfg_ringstatusget.interface_name[i],
                        totem_ip_string);
        }
-       openais_conn_send_response (
+       api->conn_send_response (
                conn,
                &res_lib_cfg_ringstatusget,
                sizeof (struct res_lib_cfg_ringstatusget));
@@ -361,13 +355,12 @@ static void message_handler_req_lib_cfg_ringreenable (
                sizeof (struct req_exec_cfg_ringreenable);
        req_exec_cfg_ringreenable.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
                MESSAGE_REQ_EXEC_CFG_RINGREENABLE);
-       message_source_set (&req_exec_cfg_ringreenable.source, conn);
+       api->ipc_source_set (&req_exec_cfg_ringreenable.source, conn);
 
        iovec.iov_base = (char *)&req_exec_cfg_ringreenable;
        iovec.iov_len = sizeof (struct req_exec_cfg_ringreenable);
 
-       assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1,
-               TOTEMPG_SAFE) == 0);
+       assert (api->totem_mcast (&iovec, 1, TOTEM_SAFE) == 0);
 
        LEAVE("");
 }
@@ -418,7 +411,7 @@ static void message_handler_req_lib_cfg_serviceload (
        struct res_lib_cfg_serviceload res_lib_cfg_serviceload;
 
        ENTER("");
-       openais_service_link_and_init (
+       api->service_link_and_init (
                my_objdb,
                (char *)req_lib_cfg_serviceload->service_name,
                req_lib_cfg_serviceload->service_ver);
@@ -426,7 +419,7 @@ static void message_handler_req_lib_cfg_serviceload (
        res_lib_cfg_serviceload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
        res_lib_cfg_serviceload.header.size = sizeof (struct res_lib_cfg_serviceload);
        res_lib_cfg_serviceload.header.error = SA_AIS_OK;
-       openais_conn_send_response (
+       api->conn_send_response (
                conn,
                &res_lib_cfg_serviceload,
                sizeof (struct res_lib_cfg_serviceload));
@@ -442,14 +435,14 @@ static void message_handler_req_lib_cfg_serviceunload (
        struct res_lib_cfg_serviceunload res_lib_cfg_serviceunload;
 
        ENTER("");
-       openais_service_unlink_and_exit (
+       api->service_unlink_and_exit (
                my_objdb,
                (char *)req_lib_cfg_serviceunload->service_name,
                req_lib_cfg_serviceunload->service_ver);
        res_lib_cfg_serviceunload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD;
        res_lib_cfg_serviceunload.header.size = sizeof (struct res_lib_cfg_serviceunload);
        res_lib_cfg_serviceunload.header.error = SA_AIS_OK;
-       openais_conn_send_response (
+       api->conn_send_response (
                conn,
                &res_lib_cfg_serviceunload,
                sizeof (struct res_lib_cfg_serviceunload));
index 68f71e99a4c94a22193627c30fb7d28d2c0bd477..e6a92c07bad3a624504778071a9020256725f503 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2006, 2008 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -32,7 +31,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef OPENAIS_BSD
+#ifndef COROSYNC_BSD
 #include <alloca.h>
 #endif
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include "../exec/logsys.h"
+
 #include "../include/saAis.h"
-#include "../include/saClm.h"
 #include "../include/ipc_gen.h"
 #include "../include/ipc_cpg.h"
 #include "../include/mar_cpg.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 "jhash.h"
-#include "swab.h"
-#include "ipc.h"
-#include "flow.h"
-#include "logsys.h"
+#include "../include/coroapi.h"
+#include "../exec/logsys.h"
+#include "../include/jhash.h"
 
 LOGSYS_DECLARE_SUBSYS ("CPG", LOG_INFO);
 
@@ -111,7 +101,7 @@ struct process_info {
        void *conn;
        void *trackerconn;
        struct group_info *group;
-       enum openais_flow_control_state flow_control_state;
+       enum corosync_flow_control_state flow_control_state;
        struct list_head list; /* on the group_info members list */
 };
 
@@ -122,6 +112,8 @@ struct join_list_entry {
 
 static struct list_head group_lists[GROUP_HASH_SIZE];
 
+static struct corosync_api_v1 *api = NULL;
+
 /*
  * Service Interfaces required by service_message_handler struct
  */
@@ -132,7 +124,7 @@ static void cpg_confchg_fn (
        unsigned int *joined_list, int joined_list_entries,
        struct memb_ring_id *ring_id);
 
-static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb);
+static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb, struct corosync_api_v1 *);
 
 static int cpg_lib_init_fn (void *conn);
 
@@ -193,59 +185,59 @@ static void cpg_sync_abort (void);
 /*
  * Library Handler Definition
  */
-static struct openais_lib_handler cpg_lib_service[] =
+static struct corosync_lib_handler cpg_lib_engine[] =
 {
        { /* 0 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_join,
                .response_size                          = sizeof (struct res_lib_cpg_join),
                .response_id                            = MESSAGE_RES_CPG_JOIN,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 1 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_leave,
                .response_size                          = sizeof (struct res_lib_cpg_leave),
                .response_id                            = MESSAGE_RES_CPG_LEAVE,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 2 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_mcast,
                .response_size                          = sizeof (struct res_lib_cpg_mcast),
                .response_id                            = MESSAGE_RES_CPG_MCAST,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED
        },
        { /* 3 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_membership,
                .response_size                          = sizeof (mar_res_header_t),
                .response_id                            = MESSAGE_RES_CPG_MEMBERSHIP,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 4 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_trackstart,
                .response_size                          = sizeof (struct res_lib_cpg_trackstart),
                .response_id                            = MESSAGE_RES_CPG_TRACKSTART,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 5 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_trackstop,
                .response_size                          = sizeof (struct res_lib_cpg_trackstart),
                .response_id                            = MESSAGE_RES_CPG_TRACKSTOP,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 6 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_local_get,
                .response_size                          = sizeof (struct res_lib_cpg_local_get),
                .response_id                            = MESSAGE_RES_CPG_LOCAL_GET,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        },
        { /* 7 */
                .lib_handler_fn                         = message_handler_req_lib_cpg_groups_get,
                .response_size                          = sizeof (struct res_lib_cpg_groups_get),
                .response_id                            = MESSAGE_RES_CPG_GROUPS_GET,
-               .flow_control                           = OPENAIS_FLOW_CONTROL_NOT_REQUIRED
+               .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
        }
 };
 
-static struct openais_exec_handler cpg_exec_service[] =
+static struct corosync_exec_handler cpg_exec_engine[] =
 {
        { /* 0 */
                .exec_handler_fn        = message_handler_req_exec_cpg_procjoin,
@@ -269,19 +261,19 @@ static struct openais_exec_handler cpg_exec_service[] =
        },
 };
 
-struct openais_service_handler cpg_service_handler = {
-       .name                                   = "openais cluster closed process group service v1.01",
+struct corosync_service_engine cpg_service_engine = {
+       .name                                   = "corosync cluster closed process group service v1.01",
        .id                                     = CPG_SERVICE,
        .private_data_size                      = sizeof (struct process_info),
-       .flow_control                           = OPENAIS_FLOW_CONTROL_REQUIRED,
+       .flow_control                           = COROSYNC_LIB_FLOW_CONTROL_REQUIRED,
        .lib_init_fn                            = cpg_lib_init_fn,
        .lib_exit_fn                            = cpg_lib_exit_fn,
-       .lib_service                            = cpg_lib_service,
-       .lib_service_count                      = sizeof (cpg_lib_service) / sizeof (struct openais_lib_handler),
+       .lib_engine                             = cpg_lib_engine,
+       .lib_engine_count                       = sizeof (cpg_lib_engine) / sizeof (struct corosync_lib_handler),
        .exec_init_fn                           = cpg_exec_init_fn,
        .exec_dump_fn                           = NULL,
-       .exec_service                           = cpg_exec_service,
-       .exec_service_count                     = sizeof (cpg_exec_service) / sizeof (struct openais_exec_handler),
+       .exec_engine                            = cpg_exec_engine,
+       .exec_engine_count                      = sizeof (cpg_exec_engine) / sizeof (struct corosync_exec_handler),
        .confchg_fn                             = cpg_confchg_fn,
        .sync_init                              = cpg_sync_init,
        .sync_process                           = cpg_sync_process,
@@ -292,15 +284,15 @@ struct openais_service_handler cpg_service_handler = {
 /*
  * Dynamic loader definition
  */
-static struct openais_service_handler *cpg_get_service_handler_ver0 (void);
+static struct corosync_service_engine *cpg_get_service_engine_ver0 (void);
 
-static struct openais_service_handler_iface_ver0 cpg_service_handler_iface = {
-       .openais_get_service_handler_ver0               = cpg_get_service_handler_ver0
+static struct corosync_service_engine_iface_ver0 cpg_service_engine_iface = {
+       .corosync_get_service_engine_ver0               = cpg_get_service_engine_ver0
 };
 
-static struct lcr_iface openais_cpg_ver0[1] = {
+static struct lcr_iface corosync_cpg_ver0[1] = {
        {
-               .name                           = "openais_cpg",
+               .name                           = "corosync_cpg",
                .version                        = 0,
                .versions_replace               = 0,
                .versions_replace_count         = 0,
@@ -314,17 +306,17 @@ static struct lcr_iface openais_cpg_ver0[1] = {
 
 static struct lcr_comp cpg_comp_ver0 = {
        .iface_count                    = 1,
-       .ifaces                         = openais_cpg_ver0
+       .ifaces                         = corosync_cpg_ver0
 };
 
 
-static struct openais_service_handler *cpg_get_service_handler_ver0 (void)
+static struct corosync_service_engine *cpg_get_service_engine_ver0 (void)
 {
-       return (&cpg_service_handler);
+       return (&cpg_service_engine);
 }
 
 __attribute__ ((constructor)) static void cpg_comp_register (void) {
-        lcr_interfaces_set (&openais_cpg_ver0[0], &cpg_service_handler_iface);
+        lcr_interfaces_set (&corosync_cpg_ver0[0], &cpg_service_engine_iface);
 
        lcr_component_register (&cpg_comp_ver0);
 }
@@ -449,14 +441,14 @@ static int notify_lib_joinlist(
        }
 
        if (conn) {
-               openais_conn_send_response(conn, buf, size);
+               api->conn_send_response(conn, buf, size);
        }
        else {
                /* Send it to all listeners */
                for (iter = gi->members.next, tmp=iter->next; iter != &gi->members; iter = tmp, tmp=iter->next) {
                        struct process_info *pi = list_entry(iter, struct process_info, list);
                        if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
-                               if (openais_conn_send_response(pi->trackerconn, buf, size) == -1) {
+                               if (api->conn_send_response(pi->trackerconn, buf, size) == -1) {
                                        // Error ??
                                }
                        }
@@ -473,7 +465,7 @@ static void remove_group(struct group_info *gi)
 }
 
 
-static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb)
+static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb, struct corosync_api_v1 *corosync_api)
 {
        int i;
 
@@ -481,12 +473,13 @@ static int cpg_exec_init_fn (struct objdb_iface_ver0 *objdb)
                list_init(&group_lists[i]);
        }
 
+       api = corosync_api;
        return (0);
 }
 
 static int cpg_lib_exit_fn (void *conn)
 {
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
        struct group_info *gi = pi->group;
        mar_cpg_address_t notify_info;
 
@@ -494,7 +487,7 @@ static int cpg_lib_exit_fn (void *conn)
 
        if (gi) {
                notify_info.pid = pi->pid;
-               notify_info.nodeid = totempg_my_nodeid_get();
+               notify_info.nodeid = api->totem_nodeid_get();
                notify_info.reason = CONFCHG_CPG_REASON_PROCDOWN;
                cpg_node_joinleave_send(gi, pi, MESSAGE_REQ_EXEC_CPG_PROCLEAVE, CONFCHG_CPG_REASON_PROCDOWN);
                list_del(&pi->list);
@@ -551,7 +544,7 @@ static void send_group_list_callbacks(int num_groups, void *conn)
        struct group_info *gi;
        uint32_t hash;
        int max_proc_count=0;
-       int size;
+       int size = 0;
        int group_counter = 0;
        char *buf = NULL;
        struct res_lib_cpg_groups_get_callback *res;
@@ -602,7 +595,7 @@ static void send_group_list_callbacks(int num_groups, void *conn)
                                        retgi++;
                                }
                        }
-                       openais_conn_send_response(conn, buf, size);
+                       api->conn_send_response(conn, buf, size);
                }
        }
        if (buf)
@@ -625,7 +618,7 @@ static int cpg_node_joinleave_send (struct group_info *gi, struct process_info *
        req_exec_cpg_iovec.iov_base = (char *)&req_exec_cpg_procjoin;
        req_exec_cpg_iovec.iov_len = sizeof(req_exec_cpg_procjoin);
 
-       result = totempg_groups_mcast_joined (openais_group_handle, &req_exec_cpg_iovec, 1, TOTEMPG_AGREED);
+       result = api->totem_mcast (&req_exec_cpg_iovec, 1, TOTEM_AGREED);
 
        return (result);
 }
@@ -718,8 +711,8 @@ static void cpg_confchg_fn (
                                lowest_nodeid = member_list[i];
                }
 
-               log_printf(LOG_LEVEL_DEBUG, "confchg, low nodeid=%d, us = %d\n", lowest_nodeid, totempg_my_nodeid_get());
-               if (lowest_nodeid == totempg_my_nodeid_get()) {
+               log_printf(LOG_LEVEL_DEBUG, "confchg, low nodeid=%d, us = %d\n", lowest_nodeid, api->totem_nodeid_get());
+               if (lowest_nodeid == api->totem_nodeid_get()) {
 
                        req_exec_cpg_downlist.header.id = SERVICE_ID_MAKE(CPG_SERVICE, MESSAGE_REQ_EXEC_CPG_DOWNLIST);
                        req_exec_cpg_downlist.header.size = sizeof(struct req_exec_cpg_downlist);
@@ -737,7 +730,7 @@ static void cpg_confchg_fn (
                req_exec_cpg_iovec.iov_base = (char *)&req_exec_cpg_downlist;
                req_exec_cpg_iovec.iov_len = req_exec_cpg_downlist.header.size;
 
-               totempg_groups_mcast_joined (openais_group_handle, &req_exec_cpg_iovec, 1, TOTEMPG_AGREED);
+               api->totem_mcast (&req_exec_cpg_iovec, 1, TOTEM_AGREED);
                req_exec_cpg_downlist.left_nodes = 0;
                log_printf(LOG_LEVEL_DEBUG, "confchg, sent downlist\n");
        }
@@ -745,7 +738,7 @@ static void cpg_confchg_fn (
 
 static void cpg_flow_control_state_set_fn (
        void *context,
-       enum openais_flow_control_state flow_control_state)
+       enum corosync_flow_control_state flow_control_state)
 {
        struct process_info *process_info = (struct process_info *)context;
 
@@ -820,7 +813,7 @@ static void do_proc_join(
                if (pi->pid == pid && pi->nodeid == nodeid) {
 
                        /* It could be a local join message */
-                       if ((nodeid == totempg_my_nodeid_get()) &&
+                       if ((nodeid == api->totem_nodeid_get()) &&
                                (!pi->flags & PI_FLAG_MEMBER)) {
                                goto local_join;
                        } else {
@@ -957,7 +950,7 @@ static void message_handler_req_exec_cpg_joinlist (
                nodeid);
 
        /* Ignore our own messages */
-       if (nodeid == totempg_my_nodeid_get()) {
+       if (nodeid == api->totem_nodeid_get()) {
                return;
        }
 
@@ -993,9 +986,9 @@ static void message_handler_req_exec_cpg_mcast (
        res_lib_cpg_mcast->pid = req_exec_cpg_mcast->pid;
        res_lib_cpg_mcast->nodeid = nodeid;
        res_lib_cpg_mcast->flow_control_state = CPG_FLOW_CONTROL_DISABLED;
-       if (message_source_is_local (&req_exec_cpg_mcast->source)) {
-               openais_ipc_flow_control_local_decrement (req_exec_cpg_mcast->source.conn);
-               process_info = (struct process_info *)openais_conn_private_data_get (req_exec_cpg_mcast->source.conn);
+       if (api->ipc_source_is_local (&req_exec_cpg_mcast->source)) {
+               api->ipc_refcnt_dec (req_exec_cpg_mcast->source.conn);
+               process_info = (struct process_info *)api->ipc_private_data_get (req_exec_cpg_mcast->source.conn);
                res_lib_cpg_mcast->flow_control_state = process_info->flow_control_state;
        }
        memcpy(&res_lib_cpg_mcast->group_name, &gi->group_name,
@@ -1007,7 +1000,7 @@ static void message_handler_req_exec_cpg_mcast (
        for (iter = gi->members.next; iter != &gi->members; iter = iter->next) {
                struct process_info *pi = list_entry(iter, struct process_info, list);
                if (pi->trackerconn && (pi->flags & PI_FLAG_MEMBER)) {
-                       openais_conn_send_response(
+                       api->conn_send_response(
                                pi->trackerconn,
                                buf,
                                res_lib_cpg_mcast->header.size);
@@ -1036,7 +1029,7 @@ static int cpg_exec_send_joinlist(void)
                        gi = list_entry(iter, struct group_info, list);
                        for (iter2 = gi->members.next; iter2 != &gi->members; iter2 = iter2->next) {
                                struct process_info *pi = list_entry(iter2, struct process_info, list);
-                               if (pi->pid && pi->nodeid == totempg_my_nodeid_get()) {
+                               if (pi->pid && pi->nodeid == api->totem_nodeid_get()) {
                                        count++;
                                }
                        }
@@ -1063,7 +1056,7 @@ static int cpg_exec_send_joinlist(void)
                        for (iter2 = gi->members.next; iter2 != &gi->members; iter2 = iter2->next) {
 
                                struct process_info *pi = list_entry(iter2, struct process_info, list);
-                               if (pi->pid && pi->nodeid == totempg_my_nodeid_get()) {
+                               if (pi->pid && pi->nodeid == api->totem_nodeid_get()) {
                                        memcpy(&jle->group_name, &gi->group_name, sizeof(mar_cpg_name_t));
                                        jle->pid = pi->pid;
                                        jle++;
@@ -1078,12 +1071,12 @@ static int cpg_exec_send_joinlist(void)
        req_exec_cpg_iovec.iov_base = buf;
        req_exec_cpg_iovec.iov_len = res->size;
 
-       return totempg_groups_mcast_joined (openais_group_handle, &req_exec_cpg_iovec, 1, TOTEMPG_AGREED);
+       return (api->totem_mcast (&req_exec_cpg_iovec, 1, TOTEM_AGREED));
 }
 
 static int cpg_lib_init_fn (void *conn)
 {
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
        pi->conn = conn;
 
        log_printf(LOG_LEVEL_DEBUG, "lib_init_fn: conn=%p, pi=%p\n", conn, pi);
@@ -1094,7 +1087,7 @@ static int cpg_lib_init_fn (void *conn)
 static void message_handler_req_lib_cpg_join (void *conn, void *message)
 {
        struct req_lib_cpg_join *req_lib_cpg_join = (struct req_lib_cpg_join *)message;
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
        struct res_lib_cpg_join res_lib_cpg_join;
        struct group_info *gi;
        SaAisErrorT error = SA_AIS_OK;
@@ -1113,7 +1106,7 @@ static void message_handler_req_lib_cpg_join (void *conn, void *message)
                goto join_err;
        }
 
-       openais_ipc_flow_control_create (
+       api->ipc_fc_create (
                conn,
                CPG_SERVICE,
                req_lib_cpg_join->group_name.value,
@@ -1122,7 +1115,7 @@ static void message_handler_req_lib_cpg_join (void *conn, void *message)
                pi);
 
        /* Add a node entry for us */
-       pi->nodeid = totempg_my_nodeid_get();
+       pi->nodeid = api->totem_nodeid_get();
        pi->pid = req_lib_cpg_join->pid;
        pi->group = gi;
        list_add(&pi->list, &gi->members);
@@ -1134,13 +1127,13 @@ join_err:
        res_lib_cpg_join.header.size = sizeof(res_lib_cpg_join);
        res_lib_cpg_join.header.id = MESSAGE_RES_CPG_JOIN;
        res_lib_cpg_join.header.error = error;
-       openais_conn_send_response(conn, &res_lib_cpg_join, sizeof(res_lib_cpg_join));
+       api->conn_send_response(conn, &res_lib_cpg_join, sizeof(res_lib_cpg_join));
 }
 
 /* Leave message from the library */
 static void message_handler_req_lib_cpg_leave (void *conn, void *message)
 {
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
        struct res_lib_cpg_leave res_lib_cpg_leave;
        struct group_info *gi;
        SaAisErrorT error = SA_AIS_OK;
@@ -1158,7 +1151,7 @@ static void message_handler_req_lib_cpg_leave (void *conn, void *message)
        cpg_node_joinleave_send(gi, pi, MESSAGE_REQ_EXEC_CPG_PROCLEAVE, CONFCHG_CPG_REASON_LEAVE);
        pi->group = NULL;
 
-       openais_ipc_flow_control_destroy (
+       api->ipc_fc_destroy (
                conn,
                CPG_SERVICE,
                (unsigned char *)gi->group_name.value,
@@ -1169,14 +1162,14 @@ leave_ret:
        res_lib_cpg_leave.header.size = sizeof(res_lib_cpg_leave);
        res_lib_cpg_leave.header.id = MESSAGE_RES_CPG_LEAVE;
        res_lib_cpg_leave.header.error = error;
-       openais_conn_send_response(conn, &res_lib_cpg_leave, sizeof(res_lib_cpg_leave));
+       api->conn_send_response(conn, &res_lib_cpg_leave, sizeof(res_lib_cpg_leave));
 }
 
 /* Mcast message from the library */
 static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
 {
        struct req_lib_cpg_mcast *req_lib_cpg_mcast = (struct req_lib_cpg_mcast *)message;
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
        struct group_info *gi = pi->group;
        struct iovec req_exec_cpg_iovec[2];
        struct req_exec_cpg_mcast req_exec_cpg_mcast;
@@ -1192,7 +1185,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
                res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
                res_lib_cpg_mcast.header.error = SA_AIS_ERR_ACCESS; /* TODO Better error code ?? */
                res_lib_cpg_mcast.flow_control_state = CPG_FLOW_CONTROL_DISABLED;
-               openais_conn_send_response(conn, &res_lib_cpg_mcast,
+               api->conn_send_response(conn, &res_lib_cpg_mcast,
                        sizeof(res_lib_cpg_mcast));
                return;
        }
@@ -1202,7 +1195,7 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
                MESSAGE_REQ_EXEC_CPG_MCAST);
        req_exec_cpg_mcast.pid = pi->pid;
        req_exec_cpg_mcast.msglen = msglen;
-       message_source_set (&req_exec_cpg_mcast.source, conn);
+       api->ipc_source_set (&req_exec_cpg_mcast.source, conn);
        memcpy(&req_exec_cpg_mcast.group_name, &gi->group_name,
                sizeof(mar_cpg_name_t));
 
@@ -1212,20 +1205,20 @@ static void message_handler_req_lib_cpg_mcast (void *conn, void *message)
        req_exec_cpg_iovec[1].iov_len = msglen;
 
        // TODO: guarantee type...
-       result = totempg_groups_mcast_joined (openais_group_handle, req_exec_cpg_iovec, 2, TOTEMPG_AGREED);
-       openais_ipc_flow_control_local_increment (conn);
+       result = api->totem_mcast (req_exec_cpg_iovec, 2, TOTEM_AGREED);
+       api->ipc_refcnt_inc (conn);
 
        res_lib_cpg_mcast.header.size = sizeof(res_lib_cpg_mcast);
        res_lib_cpg_mcast.header.id = MESSAGE_RES_CPG_MCAST;
        res_lib_cpg_mcast.header.error = SA_AIS_OK;
        res_lib_cpg_mcast.flow_control_state = pi->flow_control_state;
-       openais_conn_send_response(conn, &res_lib_cpg_mcast,
+       api->conn_send_response(conn, &res_lib_cpg_mcast,
                sizeof(res_lib_cpg_mcast));
 }
 
 static void message_handler_req_lib_cpg_membership (void *conn, void *message)
 {
-       struct process_info *pi = (struct process_info *)openais_conn_private_data_get (conn);
+       struct process_info *pi = (struct process_info *)api->ipc_private_data_get (conn);
 
        log_printf(LOG_LEVEL_DEBUG, "got membership request on %p\n", conn);
        if (!pi->group) {
@@ -1233,7 +1226,7 @@ static void message_handler_req_lib_cpg_membership (void *conn, void *message)
                res.size = sizeof(res);
                res.id = MESSAGE_RES_CPG_MEMBERSHIP;
                res.error = SA_AIS_ERR_ACCESS; /* TODO Better error code */
-               openais_conn_send_response(conn, &res, sizeof(res));
+               api->conn_send_response(conn, &res, sizeof(res));
                return;
        }
 
@@ -1259,15 +1252,15 @@ static void message_handler_req_lib_cpg_trackstart (void *conn, void *message)
        }
 
        /* Find the partner connection and add us to it's process_info struct */
-       otherconn = openais_conn_partner_get (conn);
-       otherpi = (struct process_info *)openais_conn_private_data_get (conn);
+       otherconn = api->conn_partner_get (conn);
+       otherpi = (struct process_info *)api->ipc_private_data_get (conn);
        otherpi->trackerconn = conn;
 
 tstart_ret:
        res_lib_cpg_trackstart.header.size = sizeof(res_lib_cpg_trackstart);
        res_lib_cpg_trackstart.header.id = MESSAGE_RES_CPG_TRACKSTART;
        res_lib_cpg_trackstart.header.error = SA_AIS_OK;
-       openais_conn_send_response(conn, &res_lib_cpg_trackstart, sizeof(res_lib_cpg_trackstart));
+       api->conn_send_response(conn, &res_lib_cpg_trackstart, sizeof(res_lib_cpg_trackstart));
 }
 
 static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
@@ -1288,15 +1281,15 @@ static void message_handler_req_lib_cpg_trackstop (void *conn, void *message)
        }
 
        /* Find the partner connection and add us to it's process_info struct */
-       otherconn = openais_conn_partner_get (conn);
-       otherpi = (struct process_info *)openais_conn_private_data_get (conn);
+       otherconn = api->conn_partner_get (conn);
+       otherpi = (struct process_info *)api->ipc_private_data_get (conn);
        otherpi->trackerconn = NULL;
 
 tstop_ret:
        res_lib_cpg_trackstop.header.size = sizeof(res_lib_cpg_trackstop);
        res_lib_cpg_trackstop.header.id = MESSAGE_RES_CPG_TRACKSTOP;
        res_lib_cpg_trackstop.header.error = SA_AIS_OK;
-       openais_conn_send_response(conn, &res_lib_cpg_trackstop.header, sizeof(res_lib_cpg_trackstop));
+       api->conn_send_response(conn, &res_lib_cpg_trackstop.header, sizeof(res_lib_cpg_trackstop));
 }
 
 static void message_handler_req_lib_cpg_local_get (void *conn, void *message)
@@ -1306,9 +1299,9 @@ static void message_handler_req_lib_cpg_local_get (void *conn, void *message)
        res_lib_cpg_local_get.header.size = sizeof(res_lib_cpg_local_get);
        res_lib_cpg_local_get.header.id = MESSAGE_RES_CPG_LOCAL_GET;
        res_lib_cpg_local_get.header.error = SA_AIS_OK;
-       res_lib_cpg_local_get.local_nodeid = totempg_my_nodeid_get ();
+       res_lib_cpg_local_get.local_nodeid = api->totem_nodeid_get ();
 
-       openais_conn_send_response(conn, &res_lib_cpg_local_get,
+       api->conn_send_response(conn, &res_lib_cpg_local_get,
                sizeof(res_lib_cpg_local_get));
 }
 
@@ -1321,11 +1314,11 @@ static void message_handler_req_lib_cpg_groups_get (void *conn, void *message)
        res_lib_cpg_groups_get.header.error = SA_AIS_OK;
        res_lib_cpg_groups_get.num_groups = count_groups();
 
-       openais_conn_send_response(conn, &res_lib_cpg_groups_get,
+       api->conn_send_response(conn, &res_lib_cpg_groups_get,
                sizeof(res_lib_cpg_groups_get));
 
        /* Now do the callbacks for each group */
        send_group_list_callbacks(res_lib_cpg_groups_get.num_groups,
-               openais_conn_partner_get (conn));
+               api->conn_partner_get (conn));
 }
 
index fc6106523191b6bfe4676be33aa95acaae96fb97..4e74ec2e792aac1f59a2a66f744814f62ce695ac 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2004-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *
index d6278d69b3cd4ba40918d7ddb0df2d973e85e64f..b6b5e5ef2bafed67abcd7aa672f71aa7fb0cdcb8 100644 (file)
@@ -1,6 +1,5 @@
 # Copyright (c) 2002-2004 MontaVista Software, Inc.
 # Copyright (c) 2006-2008 Red Hat, Inc.
-# Copyright (c) 2006 Sun Microsystems, Inc.
 # 
 # All rights reserved.
 # 
@@ -38,59 +37,22 @@ ifeq (${OPENAIS_COMPAT}, SOLARIS)
        override LDFLAGS += -lnsl -lsocket -lrt
 endif
 
-LIBRARIES= ../lib/libSaClm.a ../lib/libSaAmf.a ../lib/libSaCkpt.a ../lib/libSaEvt.a ../lib/libSaLck.a ../lib/libSaMsg.a ../lib/libevs.a ../lib/libcpg.a ../lib/libcfg.a ../lib/libconfdb.a
+LIBRARIES= ../lib/libevs.a ../lib/libcpg.a ../lib/libcfg.a ../lib/libconfdb.a
 LIBS = $(LIBRARIES) 
-BINARIES=testclm testamf1 \
-       testckpt ckptstress ckptbench \
-       ckptbenchth ckpt-rd ckpt-wr testevt testevs \
-       evsbench subscription publish evtbench unlink testclm2 testlck \
-       testmsg testmsg2 testcpg testcpg2 cpgbench testconfdb openais-cfgtool \
-       logsys_s logsys_t1 logsys_t2
+BINARIES= testevs evsbench testmsg2 testcpg testcpg2 \
+               cpgbench testconfdb openais-cfgtool
 
 override CFLAGS += -I../include
 override LDFLAGS += -L../lib
 
 EXTRA_CFLAGS = -I$(srcdir)include
-TEST_SRC =  testclm.c testamf1.c \
-       testamf4.c testamf5.c testamf6.c testamfth.c  \
-       testckpt.c ckptstress.c ckptbench.c  \
-       ckptbenchth.c testevt.c testevs.c evsbench.c \
-       subscription.c publish.c evtbench.c \
-       sa_error.c unlink.c testclm2.c testlck.c testmsg.c testmsg2.c \
-       logsys_s1.c logsys_s2.c logsys_s.c logsys_t1.c logsys_t2.c
+TEST_SRC = sa_error.c logsys_s1.c logsys_s2.c logsys_s.c logsys_t1.c logsys_t2.c
 
 all: $(BINARIES)
 
 testtimer: testtimer.o $(LIBRARIES)
        $(CC) $(LDFLAGS) -o testtimer testtimer.o ../exec/timer.o
 
-testamf: testamf.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf testamf.o $(LIBS)
-
-testamf1: testamf1.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf1 testamf1.o $(LIBS)
-
-testamf2: testamf2.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf2 testamf2.o $(LIBS)
-
-testamf3: testamf3.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf3 testamf3.o $(LIBS)
-
-testamf4: testamf4.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf4 testamf4.o $(LIBS)
-
-testamf5: testamf5.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf5 testamf5.o $(LIBS)
-
-testamf6: testamf6.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamf6 testamf6.o $(LIBS)
-
-testamfth: testamfth.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testamfth testamfth.o $(LIBS)
-
-testevt: testevt.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testevt testevt.o sa_error.o $(LIBS)
-
 testevs: testevs.o $(LIBS)
        $(CC) $(LDFLAGS) -o testevs testevs.o $(LIBS)
 
@@ -100,54 +62,6 @@ testevsth: testevsth.o $(LIBS)
 evsbench: evsbench.o $(LIBS)
        $(CC) $(LDFLAGS) -o evsbench evsbench.o $(LIBS)
 
-testclm: testclm.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testclm testclm.o $(LIBS)
-
-testckpt: testckpt.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testckpt testckpt.o sa_error.o $(LIBS)
-
-ckptbench: ckptbench.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o ckptbench ckptbench.o sa_error.o $(LIBS)
-
-ckptbenchth: ckptbenchth.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o ckptbenchth ckptbenchth.o sa_error.o $(LIBS)
-
-ckptstress: ckptstress.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o ckptstress ckptstress.o $(LIBS)
-
-subscription: subscription.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o subscription subscription.o sa_error.o $(LIBS)
-
-publish: publish.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o publish publish.o sa_error.o $(LIBS)
-
-unlink: unlink.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o unlink unlink.o sa_error.o $(LIBS)
-
-evtbench: evtbench.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o evtbench evtbench.o sa_error.o $(LIBS)
-
-test: test.o $(LIBRARIES)
-       g++ $(LDFLAGS) -o test test.o $(LIBS)
-
-ckpt-rd: ckpt-rd.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o ckpt-rd ckpt-rd.o sa_error.o $(LIBS)
-
-ckpt-wr: ckpt-wr.o sa_error.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o ckpt-wr ckpt-wr.o sa_error.o $(LIBS)
-
-testclm2: testclm2.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testclm2 testclm2.o $(LIBS)
-
-testlck: testlck.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testlck testlck.o $(LIBS)
-
-testmsg: testmsg.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testmsg testmsg.o $(LIBS)
-
-testmsg2: testmsg2.o $(LIBRARIES)
-       $(CC) $(LDFLAGS) -o testmsg2 testmsg2.o $(LIBS)
-
 testcpg: testcpg.o $(LIBRARIES)
        $(CC) $(LDFLAGS) -o testcpg testcpg.o $(LIBS)
 
@@ -180,26 +94,3 @@ clean:
 
 depend:
        makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(TEST_SRC) > /dev/null 2>&1
-# DO NOT DELETE
-
-testclm.o: ../include/saAis.h ../include/saClm.h
-testamf.o: ../include/saAis.h ../include/saAmf.h ../include/saClm.h
-testamf1.o: ../include/saAis.h ../include/saAmf.h
-testamf2.o: ../include/saAis.h ../include/saAmf.h
-testamf3.o: ../include/saAis.h ../include/saAmf.h
-testamf4.o: ../include/saAis.h ../include/saAmf.h
-testamf5.o: ../include/saAis.h ../include/saAmf.h
-testamf6.o: ../include/saAis.h ../include/saAmf.h
-testamfth.o: ../include/saAis.h ../include/saAmf.h ../include/saClm.h
-testckpt.o: ../include/saAis.h ../include/saCkpt.h sa_error.h
-ckptstress.o: ../include/saAis.h ../include/saCkpt.h
-ckptbench.o: ../include/saAis.h ../include/saCkpt.h
-ckptbenchth.o: ../include/saAis.h ../include/saCkpt.h
-testevt.o: ../include/saAis.h ../include/saEvt.h
-testevs.o: ../include/evs.h
-evsbench.o: ../include/saAis.h ../include/evs.h
-subscription.o: ../include/saAis.h ../include/saEvt.h
-publish.o: ../include/saAis.h ../include/saEvt.h
-evtbench.o: ../include/saAis.h ../include/saEvt.h
-sa_error.o: ../include/saAis.h
-unlink.o: ../include/saAis.h ../include/saEvt.h
index d2b728d66629349cf3ec46152a38886c495c99ab..03f291b8b8fc915d1dbda6196ed5d6f740ec665b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
  *
  * All rights reserved.
  *