# OPENAIS_BUILD can be defined as RELEASE or DEBUG
#
ifndef OPENAIS_BUILD
- OPENAIS_BUILD=RELEASE
+ OPENAIS_BUILD=DEBUG
endif
# OPENAIS_PROFILE
# Copyright (c) 2002-2006 MontaVista Software, Inc.
-# Copyright (c) 2006 Sun Microsystems, Inc.
# Copyright (c) 2006-2008 Red Hat, Inc.
#
# All rights reserved.
/*
* Copyright (c) 2003-2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*
/*
* 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.
*/
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 {
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;
};
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;
* 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);
}
}
*/
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
* 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);
}
}
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;
*/
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;
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);
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);
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);
#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);
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 (
#include "objdb.h"
#include "config.h"
#include "tlist.h"
-#define LOG_SERVICE LOG_SERVICE_IPC
#include "logsys.h"
+#include "coroapi.h"
#include "util.h"
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;
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);
/*
* 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)) {
/*
* 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 ;
}
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,
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;
#ifndef IPC_H_DEFINED
#define IPC_H_DEFINED
+#include "flow.h"
+
#ifndef TIMER_HANDLE
typedef void * timer_handle;
#define TIMER_HANDLE
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 (
+++ /dev/null
-#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 */
/*
* 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.
*
#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,
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);
}
*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;
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 */
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
/*
* 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 {
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",
.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;
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;
&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);
/*
* 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) {
}
if (service->exec_init_fn) {
- res = service->exec_init_fn (objdb);
+ res = service->exec_init_fn (objdb, &corosync_api_v1);
}
/*
#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
*/
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 */
/*
* 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.
*
/*
* 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)
*
char *vsf_type;
};
+#define TOTEM_CONFIGURATION_TYPE
enum totem_configuration_type {
TOTEM_CONFIGURATION_REGULAR,
TOTEM_CONFIGURATION_TRANSITIONAL
TOTEM_CALLBACK_TOKEN_SENT = 2
};
+#define MEMB_RING_ID
struct memb_ring_id {
struct totem_ip_address rep;
unsigned long long seq;
#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;
/*
* 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.
*
/*
* 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.
*
/*
* 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.
*
int res = 0;
unsigned int i;
-printf ("totemrrp ring reenable\n");
res = hdb_handle_get (&totemrrp_instance_database, handle,
(void *)&instance);
if (res != 0) {
/*
* 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.
*
/*
* 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.
*
/*
* Copyright (c) 2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
*
* All rights reserved.
*
/*
* 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.
*
--- /dev/null
+#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 */
/*
- * 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:
/*
* Copyright (C) 2006 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*
/*
* Copyright (c) 2002-2003 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*
/*
* Copyright (c) 2005 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*
/*
* 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:
*
/*
* 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:
*
/*
* 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:
*
* 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.
*
* 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.
*
cpg.o: cpg.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-
-cfg.o: cfg.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
/*
* 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);
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);
/*
* 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
/*
* 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,
};
/*
* 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,
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);
}
/* 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);
}
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));
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);
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));
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("");
}
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);
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));
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));
/*
- * Copyright (c) 2006, 2008 Red Hat, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*
* 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);
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 */
};
static struct list_head group_lists[GROUP_HASH_SIZE];
+static struct corosync_api_v1 *api = NULL;
+
/*
* Service Interfaces required by service_message_handler struct
*/
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);
/*
* 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,
},
};
-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,
/*
* 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,
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);
}
}
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 ??
}
}
}
-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;
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;
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);
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;
retgi++;
}
}
- openais_conn_send_response(conn, buf, size);
+ api->conn_send_response(conn, buf, size);
}
}
if (buf)
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);
}
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);
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");
}
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;
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 {
nodeid);
/* Ignore our own messages */
- if (nodeid == totempg_my_nodeid_get()) {
+ if (nodeid == api->totem_nodeid_get()) {
return;
}
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,
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);
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++;
}
}
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++;
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);
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;
goto join_err;
}
- openais_ipc_flow_control_create (
+ api->ipc_fc_create (
conn,
CPG_SERVICE,
req_lib_cpg_join->group_name.value,
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);
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;
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,
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;
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;
}
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));
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) {
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;
}
}
/* 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)
}
/* 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)
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));
}
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));
}
/*
* 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.
*
# Copyright (c) 2002-2004 MontaVista Software, Inc.
# Copyright (c) 2006-2008 Red Hat, Inc.
-# Copyright (c) 2006 Sun Microsystems, Inc.
#
# All rights reserved.
#
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)
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)
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
/*
* Copyright (c) 2004 MontaVista Software, Inc.
- * Copyright (c) 2006 Sun Microsystems, Inc.
+ * Copyright (c) 2006-2008 Red Hat, Inc.
*
* All rights reserved.
*