Make external service engines (openais) work properly.

Also fix up make install.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1606 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2008-07-24 09:12:07 +00:00
parent 2697fe0fad
commit 9c9a91be3d
11 changed files with 42 additions and 13 deletions

View File

@ -1,5 +1,5 @@
# Copyright (c) 2002-2006 MontaVista Software, Inc.
# Copyright (c) 2006 Red Hat, Inc.
# Copyright (c) 2006-2008 Red Hat, Inc.
#
# All rights reserved.
#
@ -43,7 +43,7 @@ SBINDIR=$(PREFIX)/sbin
INCLUDEDIR=$(PREFIX)/include/corosync
INCLUDEDIR_TOTEM=$(PREFIX)/include/corosync/totem
INCLUDEDIR_LCR=$(PREFIX)/include/corosync/lcr
INCLUDEDIR_ENGINE=$(PREFIX)/include/corosync/service
INCLUDEDIR_ENGINE=$(PREFIX)/include/corosync/engine
MANDIR=$(PREFIX)/share/man
ETCDIR=/etc
ARCH=$(shell uname -p)

View File

@ -67,6 +67,7 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
.ipc_fc_create = openais_ipc_flow_control_create,
.ipc_fc_destroy = openais_ipc_flow_control_destroy,
.totem_nodeid_get = totempg_my_nodeid_get,
.totem_family_get = totempg_my_family_get,
.totem_ring_reenable = totempg_ring_reenable,
.totem_mcast = main_mcast,
.totem_send_ok = main_send_ok,

View File

@ -590,9 +590,9 @@ retry_poll:
#endif
#if defined(OPENAIS_LINUX)
char *socketname = "libais.socket";
char *socketname = "libcorosync.socket";
#else
char *socketname = "/var/run/libais.socket";
char *socketname = "/var/run/libcorosync.socket";
#endif

View File

@ -219,7 +219,7 @@ static int openais_service_unlink_common (
service_name, service_version);
if (ais_service[*service_id]->exec_exit_fn) {
ais_service[*service_id]->exec_exit_fn (api);
ais_service[*service_id]->exec_exit_fn ();
}
ais_service[*service_id] = NULL;

View File

@ -202,11 +202,11 @@ int totemip_localhost_check(struct totem_ip_address *addr)
return totemip_equal(addr, &localhost);
}
const char *totemip_print(struct totem_ip_address *addr)
char *totemip_print(struct totem_ip_address *addr)
{
static char buf[INET6_ADDRSTRLEN];
return inet_ntop(addr->family, addr->addr, buf, sizeof(buf));
return ((char *)inet_ntop(addr->family, addr->addr, buf, sizeof(buf)));
}
/* Make a totem_ip_address into a usable sockaddr_storage */

View File

@ -67,7 +67,7 @@ extern void totemip_copy(struct totem_ip_address *addr1, struct totem_ip_address
extern void totemip_copy_endian_convert(struct totem_ip_address *addr1, struct totem_ip_address *addr2);
int totemip_localhost(int family, struct totem_ip_address *localhost);
extern int totemip_localhost_check(struct totem_ip_address *addr);
extern const char *totemip_print(struct totem_ip_address *addr);
extern char *totemip_print(struct totem_ip_address *addr);
extern int totemip_sockaddr_to_totemip_convert(struct sockaddr_storage *saddr, struct totem_ip_address *ip_addr);
extern int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
uint16_t port, struct sockaddr_storage *saddr, int *addrlen);

View File

@ -38,7 +38,11 @@
#include <sys/poll.h>
#include <sys/socket.h>
#ifdef COROSYNC_EXTERNAL_ENGINE
#include <corosync/ipc_gen.h>
#else
#include <ipc_gen.h>
#endif
/* Debug macro
*/

View File

@ -287,6 +287,8 @@ struct corosync_api_v1 {
*/
int (*totem_nodeid_get) (void);
int (*totem_family_get) (void);
int (*totem_ring_reenable) (void);
int (*totem_mcast) (struct iovec *iovec, int iov_len, unsigned int gaurantee);
@ -348,7 +350,7 @@ struct corosync_service_engine {
unsigned int private_data_size;
enum corosync_lib_flow_control flow_control;
int (*exec_init_fn) (struct corosync_api_v1 *);
int (*exec_exit_fn) (struct corosync_api_v1 *);
int (*exec_exit_fn) (void);
void (*exec_dump_fn) (void);
int (*lib_init_fn) (void *conn);
int (*lib_exit_fn) (void *conn);

View File

@ -34,7 +34,11 @@
#ifndef IPC_GEN_H_DEFINED
#define IPC_GEN_H_DEFINED
#include <mar_gen.h>
#ifdef COROSYNC_EXTERNAL_SERVICE
#include <corosync/mar_gen.h>
#else
#include "mar_gen.h"
#endif
enum service_types {
EVS_SERVICE = 0,

View File

@ -44,7 +44,11 @@
#include <string.h>
#include <saAis.h>
#include <swab.h>
#ifdef COROSYNC_EXTERNAL_ENGINE
#include <corosync/engine/swab.h>
#else
#include "swab.h"
#endif
typedef int8_t mar_int8_t;
typedef int16_t mar_int16_t;
@ -101,6 +105,20 @@ typedef struct {
mar_uint8_t value[SA_MAX_NAME_LENGTH] __attribute__((aligned(8)));
} mar_name_t;
static inline char *get_mar_name_t (mar_name_t *name) {
return ((char *)name->value);
}
static int mar_name_match(mar_name_t *name1, mar_name_t *name2)
{
if (name1->length == name2->length) {
return ((strncmp ((char *)name1->value, (char *)name2->value,
name1->length)) == 0);
}
return 0;
}
static inline void swab_mar_name_t (mar_name_t *to_swab)
{
swab_mar_uint16_t (&to_swab->length);

View File

@ -83,9 +83,9 @@ struct saHandle {
#endif
#ifdef OPENAIS_LINUX
static char *socketname = "libais.socket";
static char *socketname = "libcorosync.socket";
#else
static char *socketname = "/var/run/libais.socket";
static char *socketname = "/var/run/libcorosync.socket";
#endif
#ifdef SO_NOSIGPIPE