Ver Fonte

Add infrastructure support for multiring to totem library
Make totemsrp support multiple instances of a running protocol within one app.
Rename libtotem to libtotem_pg because of a name conflict with some movie player


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@782 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake há 20 anos atrás
pai
commit
283790b715
27 ficheiros alterados com 1437 adições e 622 exclusões
  1. 1 1
      Makefile
  2. 17 15
      QUICKSTART
  3. 2 2
      conf/openais.conf
  4. 33 27
      exec/Makefile
  5. 0 1
      exec/amf.c
  6. 1 1
      exec/amf.h
  7. 0 1
      exec/ckpt.c
  8. 0 1
      exec/clm.c
  9. 0 1
      exec/evs.c
  10. 0 1
      exec/evt.c
  11. 29 22
      exec/main.c
  12. 4 109
      exec/mainparse.c
  13. 3 39
      exec/mainparse.h
  14. 0 1
      exec/print.c
  15. 14 7
      exec/sync.c
  16. 3 1
      exec/sync.h
  17. 56 4
      exec/totem.h
  18. 179 0
      exec/totemmrp.c
  19. 106 0
      exec/totemmrp.h
  20. 300 0
      exec/totemparse.c
  21. 51 0
      exec/totemparse.h
  22. 24 36
      exec/totempg.c
  23. 7 17
      exec/totempg.h
  24. 589 303
      exec/totemsrp.c
  25. 12 19
      exec/totemsrp.h
  26. 3 3
      include/sq.h
  27. 3 10
      test/Makefile

+ 1 - 1
Makefile

@@ -30,7 +30,7 @@
 
 # Production mode flags
 CFLAGS = -O3 -Wall
-LDFLAGS =
+LDFLAGS = -lpthread
 
 # Debug mode flags
 #CFLAGS = -g -DDEBUG

+ 17 - 15
QUICKSTART

@@ -12,8 +12,8 @@ Exception TSU prsuant to 15 C.F.R Section 740.13(e).
 
 This openais package is broken into four parts.  The exec directory contains
 all of the code responsible for serving the APIs.  The lib directory contains
-APIs the user can link to.  The test directory contains some simple test
-programs which exercise the APIs.  The directory conf contains example
+APIs the to which the user may link.  The test directory contains some simple
+test programs which exercise the APIs.  The directory conf contains example
 configuration files which can be copied directly onto the target system.
 
 The API implements SA Forum APIs for Cluster Membership (CLM), Availabilty
@@ -29,7 +29,7 @@ communicating on a specified multicast address and port.
 
 The directory conf contains the file openais.conf
 
-network {
+totem {
 	bindnetaddr: 192.168.1.0
 	mcastaddr: 226.94.1.1
 	mcastport: 5405
@@ -56,7 +56,7 @@ timeout {
 	fail_recv_const: 250
 }
 
-The network section contains three values.  All three values must be set
+The totem section contains three values.  All three values must be set
 or the openais executive wll exit with an error.
 
 bindnetaddr specifies the address which the openais Executive should bind to.
@@ -104,8 +104,9 @@ These two files should be placed in the /etc/ais directory.
 Building openais
 ----------------
 openais requires GCC, LD, and a Linux 2.4/2.6 kernel.  openais has been tested on
-Debian Sarge, MontaVista Carrier Grade Edition 3.1, and Redhat 9, and Fedora
-Core 2.
+Debian Sarge(i386), Redhat 9(i386), Fedora Core 2(i386), Fedora Core
+4(i386,x86_64) and MontaVista Carrier Grade Edition 3.1(i386, x86_64,
+classic ppc, ppc970, xscale).
 
 Compile openais by running make in the root directory.  Make can also be run
 in the individual directories.  Nothing is installed by make.  If install
@@ -119,7 +120,7 @@ create an "ais" user with the "ais" group.
 
 [root@slickdeal root]# adduser ais -g ais
 
-Set the ais user's password to something you can remember:
+Set the ais user's password:
 
 [root@slickdeal root]# passwd ais
 Changing password for user ais.
@@ -130,8 +131,8 @@ passwd: all authentication tokens updated successfully.
 Generate a private key
 ----------------------
 openais uses cryptographic techniques to ensure authenticity and privacy of
-messages.  In order for openais to work, a private key must be generated and
-shared to all processors.
+messages.  A private key must be generated and shared by all processors for
+correct operation.
 
 First generate the key on one of the nodes:
 
@@ -141,7 +142,7 @@ Gathering 1024 bits for key from /dev/random.
 Writing openais key to /etc/ais/authkey.
 
 
-After this is complete, a private key will be in the directory /etc/ais/authkey.
+After this is complete, a private key will be in the file /etc/ais/authkey.
 This private key must be copied to every processor that will be a member of
 the cluster.  If the private key isn't the same for every node, those nodes
 with nonmatching private keys will not be able to join the same configuration.
@@ -162,9 +163,9 @@ aisexec program after following the previous directions.
 A final note on permissions:
 It is not absolutely required that openais executive runs as root.  If
 it runs as root, it schedules at the highest round robin realtime
-priority and locks all pages into ram in case a swap would cause a delay
-in the real-time nature of the protocol.  The warning about not being
-able to lock pages is simply a warning and can be ignored if you choose
+priority and locks all of it's pages into ram in case a swap would cause a
+delay in the real-time nature of the protocol.  The warning "not  
+able to lock pages" is simply a warning and can be ignored if you choose
 to run as a non root user.
 
 The ais user/group is required because applications are authenticated
@@ -178,7 +179,7 @@ Before running any of the test programs
 ---------------------------------------
 The openais executive will ensure security by only allowing the ais group (or
 uid root) to connect to the service.  Switch to the ais group before
-running any applications linked to the saf api, or the applications will
+running any applications linked to the ais apis, or the applications will
 not be authenticated and won't be able to access services.
 
 [sdake@slickdeal sdake]$ su ais
@@ -225,7 +226,7 @@ service.  This behavior is expected by the openais specification and the
 code in testamf2.c can be read for a clearer understanding of what
 is happening.
 
-Pressing ctrl-z to background the task (which causes the heartbeat to
+Pressing ctrl-z to background the task (which causes the healthcheck to
 timeout) on a component will cause the remaining component to go
 out of service.  If ctrl-z is pressed on the active SU, the standby
 SU will become active.  CTRL-C on these tests behaves the same way.
@@ -261,6 +262,7 @@ su to ais user
 run testevs.  This will generate multicast messages and self deliver them
 
 run evsbench.  This will display the benchmark performance of the evs service.
+
 Write your own applications
 ---------------------------
 Without real applications, finding the hard bugs will be difficult.  Please

+ 2 - 2
conf/openais.conf

@@ -1,4 +1,4 @@
-network {
+totem {
 	bindnetaddr: 192.168.1.0
 	mcastaddr: 226.94.1.1
 	mcastport: 5405
@@ -9,6 +9,6 @@ logging {
 	logoutput: stderr
 	logoutput: syslog
 	logfile: /tmp/ais
-	debug: on
+	debug: off
 	timestamp: on
 }

+ 33 - 27
exec/Makefile

@@ -30,12 +30,12 @@
 
 # Production mode flags
 CFLAGS = -O3 -Wall -fomit-frame-pointer
-LDFLAGS = 
+LDFLAGS = -lpthread
 
 # Debug mode flags
 #CFLAGS = -g -Wall
 ##-DDEBUG
-#LDFLAGS = -g
+#LDFLAGS = -g -lpthread
 
 # Profile mode flags
 #CFLAGS = -O3 -pg
@@ -45,36 +45,36 @@ LDFLAGS =
 #CFLAGS = -ftest-coverage -fprofile-arcs
 #LDFLAGS = -g
 
-TOTEM_SRC = aispoll.c totemsrp.c totempg.c tlist.c hdb.c crypto.c
-TOTEM_OBJS = aispoll.o totemsrp.o totempg.o tlist.o hdb.o crypto.o
+TOTEM_SRC = aispoll.c totemsrp.c totemmrp.c totempg.c totemparse.c tlist.c hdb.c crypto.c
+TOTEM_OBJS = aispoll.o totemsrp.o totemmrp.o totempg.o totemparse.o tlist.o hdb.o crypto.o
 
-EXEC_SRC = main.c clm.c amf.c ckpt.c evt.c evs.c parse.c print.c mempool.c \
+EXEC_SRC = main.c clm.c amf.c ckpt.c evt.c evs.c mainparse.c print.c mempool.c \
 		util.c sync.c
-EXEC_OBJS = main.o clm.o amf.o ckpt.o evt.o evs.o parse.o print.o mempool.o \
+EXEC_OBJS = main.o clm.o amf.o ckpt.o evt.o evs.o mainparse.o print.o mempool.o \
 		util.o sync.o
-EXEC_LIBS = libtotem.a
+EXEC_LIBS = libtotem_pg.a
 
 OBJS = $(TOTEM_OBJS) $(EXEC_OBJS)
 
-all:libtotem.a libtotem.so.1.0 aisexec keygen
+all:libtotem_pg.a libtotem_pg.so.1.0 aisexec keygen
 
-aisexec: $(EXEC_OBJS) libtotem.a
+aisexec: $(EXEC_OBJS) libtotem_pg.a
 	$(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec
 
-libtotem.a: $(TOTEM_OBJS)
-	$(AR) -rc libtotem.a $(TOTEM_OBJS)
+libtotem_pg.a: $(TOTEM_OBJS)
+	$(AR) -rc libtotem_pg.a $(TOTEM_OBJS)
 
-libtotem.so.1.0: $(TOTEM_OBJS)
-	$(CC) -shared -Wl,-soname,libtotem.so.1 $(TOTEM_OBJS) -o $@
-	rm -f libtotem.so.1 libtotem.so
-	ln -s libtotem.so.1.0 libtotem.so.1
-	ln -s libtotem.so.1.0 libtotem.so
+libtotem_pg.so.1.0: $(TOTEM_OBJS)
+	$(CC) -shared -Wl,-soname,libtotem_pg.so.1 $(TOTEM_OBJS) -o $@
+	rm -f libtotem_pg.so.1 libtotem_pg.so
+	ln -s libtotem_pg.so.1.0 libtotem_pg.so.1
+	ln -s libtotem_pg.so.1.0 libtotem_pg.so
 
 keygen: keygen.o
 	$(CC) $(LDFLAGS) keygen.o -o keygen
 
 clean:
-	rm -f aisexec $(OBJS) libtotem.so.1.0 libtotem.so.1 libtotem.so libtotem.a gmon.out keygen keygen.o *.da *.bb *.bbg
+	rm -f aisexec $(OBJS) libtotem_pg.so.1.0 libtotem_pg.so.1 libtotem_pg.so libtotem_pg.a gmon.out keygen keygen.o *.da *.bb *.bbg
 
 depend:
 	makedepend -Y -- $(CFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
@@ -98,44 +98,50 @@ hdb.o: hdb.c
 crypto.o: crypto.c
 	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
 
+totemmrp.o: totemmrp.c
+	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+
+totemparse.o: totemparse.c
+	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+
 # DO NOT DELETE
 
 main.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h
 main.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
-main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h parse.h
+main.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h mainparse.h
 main.o: main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h
 main.o: ../include/saEvt.h swab.h print.h
 clm.o: ../include/ais_types.h ../include/saClm.h ../include/ais_types.h
 clm.o: ../include/ipc_evs.h evs.h ../include/saClm.h ../include/ipc_gen.h
 clm.o: ../include/ipc_clm.h ../include/list.h ../include/queue.h aispoll.h
-clm.o: totempg.h totemsrp.h parse.h main.h clm.h amf.h handlers.h ckpt.h
+clm.o: totempg.h totemsrp.h mainparse.h main.h clm.h amf.h handlers.h ckpt.h
 clm.o: evt.h hdb.h ../include/saEvt.h mempool.h print.h
 amf.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h
 amf.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
 amf.o: ../include/queue.h totempg.h aispoll.h totemsrp.h mempool.h util.h
-amf.o: parse.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h
+amf.o: mainparse.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h evt.h
 amf.o: hdb.h ../include/saEvt.h print.h
 ckpt.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h
 ckpt.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
-ckpt.o: ../include/queue.h aispoll.h mempool.h util.h parse.h totempg.h
+ckpt.o: ../include/queue.h aispoll.h mempool.h util.h mainparse.h totempg.h
 ckpt.o: totemsrp.h main.h clm.h ../include/saClm.h amf.h handlers.h ckpt.h
 ckpt.o: evt.h hdb.h ../include/saEvt.h print.h
 evt.o: ../include/ipc_evt.h ../include/ais_types.h ../include/saEvt.h
 evt.o: ../include/saClm.h ../include/ipc_gen.h ../include/list.h
 evt.o: ../include/queue.h util.h ../include/ais_types.h aispoll.h mempool.h
-evt.o: parse.h totempg.h totemsrp.h main.h evs.h clm.h ../include/saClm.h
+evt.o: mainparse.h totempg.h totemsrp.h main.h evs.h clm.h ../include/saClm.h
 evt.o: amf.h ../include/ipc_evs.h handlers.h ckpt.h evt.h hdb.h
 evt.o: ../include/saEvt.h swab.h print.h
 evs.o: ../include/ais_types.h ../include/ipc_evs.h ../include/ais_types.h
 evs.o: evs.h ../include/saClm.h ../include/ipc_gen.h ../include/list.h
-evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h parse.h main.h clm.h
+evs.o: ../include/queue.h aispoll.h totempg.h totemsrp.h mainparse.h main.h clm.h
 evs.o: ../include/saClm.h amf.h handlers.h ckpt.h evt.h hdb.h
 evs.o: ../include/saEvt.h mempool.h print.h
-parse.o: ../include/ais_types.h ../include/list.h util.h parse.h aispoll.h
-parse.o: totempg.h totemsrp.h mempool.h print.h ../include/saClm.h
-parse.o: ../include/ais_types.h
+mainparse.o: ../include/ais_types.h ../include/list.h util.h mainparse.h aispoll.h
+mainparse.o: totempg.h totemsrp.h mempool.h print.h ../include/saClm.h
+mainparse.o: ../include/ais_types.h
 print.o: print.h ../include/ais_types.h ../include/saClm.h
-print.o: ../include/ais_types.h parse.h ../include/list.h aispoll.h totempg.h
+print.o: ../include/ais_types.h mainparse.h ../include/list.h aispoll.h totempg.h
 print.o: totemsrp.h
 mempool.o: ../include/list.h mempool.h
 util.o: ../include/ais_types.h ../include/list.h util.h

+ 0 - 1
exec/amf.c

@@ -54,7 +54,6 @@
 #include "aispoll.h"
 #include "mempool.h"
 #include "util.h"
-#include "parse.h"
 #include "main.h"
 #include "handlers.h"
 

+ 1 - 1
exec/amf.h

@@ -34,7 +34,7 @@
 #include "../include/ipc_gen.h"
 #include "../include/ipc_amf.h"
 #include "aispoll.h"
-#include "parse.h"
+#include "mainparse.h"
 #include "handlers.h"
 
 #ifndef AMF_H_DEFINED

+ 0 - 1
exec/ckpt.c

@@ -53,7 +53,6 @@
 #include "aispoll.h"
 #include "mempool.h"
 #include "util.h"
-#include "parse.h"
 #include "main.h"
 #include "totempg.h"
 

+ 0 - 1
exec/clm.c

@@ -59,7 +59,6 @@
 #include "../include/queue.h"
 #include "aispoll.h"
 #include "totempg.h"
-#include "parse.h"
 #include "main.h"
 #include "mempool.h"
 #include "handlers.h"

+ 0 - 1
exec/evs.c

@@ -57,7 +57,6 @@
 #include "../include/queue.h"
 #include "aispoll.h"
 #include "totempg.h"
-#include "parse.h"
 #include "main.h"
 #include "mempool.h"
 #include "handlers.h"

+ 0 - 1
exec/evt.c

@@ -54,7 +54,6 @@
 #include "util.h"
 #include "aispoll.h"
 #include "mempool.h"
-#include "parse.h"
 #include "main.h"
 #include "totempg.h"
 #include "hdb.h"

+ 29 - 22
exec/main.c

@@ -63,7 +63,8 @@
 #include "totempg.h"
 #include "totemsrp.h"
 #include "mempool.h"
-#include "parse.h"
+#include "mainparse.h"
+#include "totemparse.h"
 #include "main.h"
 #include "handlers.h"
 #include "sync.h"
@@ -92,9 +93,13 @@ struct service_handler *ais_service_handlers[] = {
     &ckpt_service_handler,
     &evt_service_handler
 };
+
 struct sync_callbacks sync_callbacks[5];
+
 int sync_callback_count;
 
+totemsrp_handle totemsrp_handle_in;
+
 #define AIS_SERVICE_HANDLERS_COUNT 5
 #define AIS_SERVICE_HANDLER_AISEXEC_FUNCTIONS_MAX 40
 
@@ -178,7 +183,6 @@ static void sigusr2_handler (int num)
 
 struct sockaddr_in *this_ip;
 struct sockaddr_in this_non_loopback_ip;
-struct sockaddr_in config_mcast_addr;
 #define LOCALHOST_IP inet_addr("127.0.0.1")
 
 char *socketname = "libais.socket";
@@ -768,6 +772,7 @@ void sigintr_handler (int signum)
 	}
 #endif
 
+	totempg_finalize ();
 	print_stats ();
 	ais_done (AIS_DONE_EXIT);
 }
@@ -825,7 +830,7 @@ void aisexec_sync_fns_build (void)
 			sync_callback_count++;
 		}
 	}
-	sync_register (sync_callbacks, sync_callback_count, sync_completed);
+	sync_register (totemsrp_handle_in, sync_callbacks, sync_callback_count, sync_completed);
 }
 
 char delivery_data[MESSAGE_SIZE_MAX];
@@ -1077,11 +1082,12 @@ void message_source_set (struct message_source *source, struct conn_info *conn_i
 }
 
 
+struct totem_logging_configuration totem_logging_configuration;
+
 int main (int argc, char **argv)
 {
 	int libais_server_fd;
 	int res;
-	unsigned char private_key[128];
 
 	char *error_string;
 	struct openais_config openais_config;
@@ -1104,9 +1110,6 @@ int main (int argc, char **argv)
 	 * there is more then one interface in a system, so
 	 * in this case, only a warning is printed
 	 */
-	/*
-	 * Initialize group messaging interface with multicast address
-	 */
 	res = openais_main_config_read (&error_string, &openais_config, 1);
 	if (res == -1) {
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2004 MontaVista Software, Inc and contributors.\n");
@@ -1115,7 +1118,12 @@ int main (int argc, char **argv)
 		ais_done (AIS_DONE_MAINCONFIGREAD);
 	}
 
-	memcpy (&config_mcast_addr, &openais_config.mcast_addr, sizeof (struct sockaddr_in));
+	res = totem_config_read (&openais_config.totem_config, &error_string, 1);
+	if (res == -1) {
+		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2004 MontaVista Software, Inc and contributors.\n");
+		log_printf (LOG_LEVEL_ERROR, error_string);
+		ais_done (AIS_DONE_MAINCONFIGREAD);
+	}
 
 	res = log_setup (&error_string, openais_config.logmode, openais_config.logfile);
 	if (res == -1) {
@@ -1134,24 +1142,23 @@ int main (int argc, char **argv)
 
 	aisexec_mlockall ();
 
-	aisexec_keyread (private_key);
+	openais_config.totem_config.totem_logging_configuration = totem_logging_configuration;
 
-	totempg_log_printf_init (internal_log_printf,
-		mklog (LOG_LEVEL_SECURITY, LOG_SERVICE_GMI),
-		mklog (LOG_LEVEL_ERROR, LOG_SERVICE_GMI),
-		mklog (LOG_LEVEL_WARNING, LOG_SERVICE_GMI),
-		mklog (LOG_LEVEL_NOTICE, LOG_SERVICE_GMI),
-		mklog (LOG_LEVEL_DEBUG, LOG_SERVICE_GMI));
+	openais_config.totem_config.totem_logging_configuration.log_level_security = mklog (LOG_LEVEL_SECURITY, LOG_SERVICE_GMI);
+	openais_config.totem_config.totem_logging_configuration.log_level_error = mklog (LOG_LEVEL_ERROR, LOG_SERVICE_GMI);
+	openais_config.totem_config.totem_logging_configuration.log_level_warning = mklog (LOG_LEVEL_WARNING, LOG_SERVICE_GMI);
+	openais_config.totem_config.totem_logging_configuration.log_level_notice = mklog (LOG_LEVEL_NOTICE, LOG_SERVICE_GMI);
+	openais_config.totem_config.totem_logging_configuration.log_level_debug = mklog (LOG_LEVEL_DEBUG, LOG_SERVICE_GMI);
+	openais_config.totem_config.totem_logging_configuration.log_printf = internal_log_printf;
 
-	totempg_initialize (&openais_config,
+	totempg_initialize (
 		&aisexec_poll_handle,
-		private_key,
-		sizeof (private_key),
-		0,
-		0,
-		deliver_fn, confchg_fn);
+		&totemsrp_handle_in,
+		&openais_config.totem_config,
+		deliver_fn,
+		confchg_fn);
 	
-	this_ip = &openais_config.interfaces[0].boundto;
+	this_ip = &openais_config.totem_config.interfaces[0].boundto;
 
 	/*
 	 * Drop root privleges to user 'ais'

+ 4 - 109
exec/parse.c → exec/mainparse.c

@@ -43,9 +43,10 @@
 #include "../include/ais_types.h"
 #include "../include/list.h"
 #include "util.h"
-#include "parse.h"
+#include "mainparse.h"
 #include "mempool.h"
 #include "print.h"
+#include "totem.h"
 
 DECLARE_LIST_INIT (saAmfGroupHead);
 
@@ -61,10 +62,7 @@ typedef enum {
 
 typedef enum {
 	MAIN_HEAD,
-	MAIN_NETWORK,
 	MAIN_LOGGING,
-	MAIN_KEY,
-	MAIN_TIMEOUT,
 	MAIN_EVENT
 } main_parse_t;
 
@@ -141,7 +139,7 @@ struct saAmfComponent *findComponent (SaNameT *name)
 	}
 }
 
-char *
+static inline char *
 strstr_rs (const char *haystack, const char *needle)
 {
 	char *end_address;
@@ -413,13 +411,9 @@ extern int openais_main_config_read (char **error_string,
 	int interface_max)
 {
 	FILE *fp;
-	int res = 0;
 	int line_number = 0;
 	main_parse_t parse = MAIN_HEAD;
-	int network_parsed = 0;
 	int logging_parsed = 0;
-	int key_parsed = 0;
-	int timeout_parsed = 0;
 	int event_parsed = 0;
 	char *loc;
 	int i;
@@ -428,17 +422,6 @@ extern int openais_main_config_read (char **error_string,
 	char *error_reason = error_string_response;
 
 	memset (openais_config, 0, sizeof (struct openais_config));
-	openais_config->interfaces = malloc (sizeof (struct totem_interface) * interface_max);
-	if (openais_config->interfaces == 0) {
-		parse_done = 1;
-		*error_string = "Out of memory trying to allocate ethernet interface storage area";
-		return -1;
-	}
-
-	memset (openais_config->interfaces, 0,
-		sizeof (struct totem_interface) * interface_max);
-
-	openais_config->mcast_addr.sin_family = AF_INET;
 	fp = fopen ("/etc/ais/openais.conf", "r");
 	if (fp == 0) {
 		parse_done = 1;
@@ -471,58 +454,15 @@ extern int openais_main_config_read (char **error_string,
 
 		switch (parse) {
 		case MAIN_HEAD:
-			if (network_parsed == 0 && strstr_rs (line, "network{")) {
-				network_parsed = 1;
-				parse = MAIN_NETWORK;
-			} else
 			if (logging_parsed == 0 && strstr_rs (line, "logging{")) {
 				logging_parsed = 1;
 				parse = MAIN_LOGGING;
 			} else
-			if (key_parsed == 0 && strstr_rs (line, "key{")) {
-				key_parsed = 1;
-				parse = MAIN_KEY;
-			} else
-			if (timeout_parsed == 0 && strstr_rs (line, "timeout{")) {
-				timeout_parsed = 1;
-				parse = MAIN_TIMEOUT;
-			} else 
 			if (event_parsed == 0 && strstr_rs (line, "event{")) {
 				event_parsed = 1;
 				parse = MAIN_EVENT;
 			} else {
-				goto parse_error;
-			}
-			break;
-
-		case MAIN_NETWORK:
-			if ((loc = strstr_rs (line, "mcastaddr:"))) {
-				res = inet_aton (loc, &openais_config->mcast_addr.sin_addr);
-			} else
-			if ((loc = strstr_rs (line, "mcastport:"))) {
-				res = openais_config->mcast_addr.sin_port = htons (atoi (loc));
-			} else
-			if ((loc = strstr_rs (line, "bindnetaddr:"))) {
-				if (interface_max == openais_config->interface_count) {
-					sprintf (error_reason,
-						"%d is too many interfaces in /etc/ais/network.conf",
-					openais_config->interface_count);
-					goto parse_error;
-				}
-				res = inet_aton (loc,
-					&openais_config->interfaces[openais_config->interface_count].bindnet.sin_addr);
-				openais_config->interface_count += 1;
-			} else
-			if ((loc = strstr_rs (line, "}"))) {
-				parse = MAIN_HEAD;
-				res = 1; /* any nonzero is ok */
-			} else {
-				goto parse_error;
-			}
-
-			if (res == 0) {
-				sprintf (error_reason, "invalid network address or port number\n");
-				goto parse_error;
+				continue;
 			}
 			break;
 
@@ -569,32 +509,6 @@ extern int openais_main_config_read (char **error_string,
 				goto parse_error;
 			}
 			break;
-		case MAIN_TIMEOUT:
-			if ((loc = strstr_rs (line, "token:"))) {
-				openais_config->timeouts[TOTEM_TOKEN]= atoi(loc);
-			} else if ((loc = strstr_rs (line, "token_retransmit:"))) {
-				openais_config->timeouts[TOTEM_RETRANSMIT_TOKEN] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "hold:"))) {
-				openais_config->timeouts[TOTEM_HOLD_TOKEN] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "retransmits_before_loss:"))) {
-				openais_config->timeouts[TOTEM_RETRANSMITS_BEFORE_LOSS] = atoi(loc);
-		
-			} else if ((loc = strstr_rs (line, "join:"))) {
-				openais_config->timeouts[TOTEM_JOIN] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "consensus:"))) {
-				openais_config->timeouts[TOTEM_CONSENSUS] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "merge:"))) {
-				openais_config->timeouts[TOTEM_MERGE] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "downcheck:"))) {
-				openais_config->timeouts[TOTEM_DOWNCHECK] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "fail_recv_const:"))) {
-				openais_config->timeouts[TOTEM_FAIL_RECV_CONST] = atoi(loc);
-			} else if ((loc = strstr_rs (line, "}"))) {
-				parse = MAIN_HEAD;
-			} else {
-				goto parse_error;
-			}
-			break;
 
 		case MAIN_EVENT:
 			if ((loc = strstr_rs (line, "delivery_queue_size:"))) {
@@ -614,25 +528,6 @@ extern int openais_main_config_read (char **error_string,
 		}
 	}
 
-	/*
-	 * Some error checking of parsed data to make sure its valid
-	 */
-	parse_done = 1;
-	if (openais_config->mcast_addr.sin_addr.s_addr == 0) {
-		error_reason = "No multicast address specified";
-		goto parse_error;
-	}
-
-	if (openais_config->mcast_addr.sin_port == 0) {
-		error_reason = "No multicast port specified";
-		goto parse_error;
-	}
-
-	if (openais_config->interface_count == 0) {
-		error_reason = "No bindnet specified";
-		goto parse_error;
-	}
-
 	if ((openais_config->logmode & LOG_MODE_FILE) && openais_config->logfile == 0) {
 		error_reason = "logmode set to 'file' but no logfile specified";
 		goto parse_error;

+ 3 - 39
exec/parse.h → exec/mainparse.h

@@ -35,6 +35,7 @@
 #include "../include/ais_types.h"
 #include "../include/list.h"
 #include "aispoll.h"
+#include "totemsrp.h"
 #include "totempg.h"
 
 #ifndef PARSE_H_DEFINED
@@ -55,57 +56,20 @@ enum amfOperationalAdministrativeState {
 	AMF_ENABLED_STOPPING = 3
 };
 
-/*
- * Array location of various timeouts as
- * specified in openais.conf.  The last enum
- * specifies the size of the timeouts array and
- * needs to remain the last item in the list.
- */
-enum {
-	TOTEM_RETRANSMITS_BEFORE_LOSS,
-	TOTEM_TOKEN,
-	TOTEM_RETRANSMIT_TOKEN,
-	TOTEM_HOLD_TOKEN,
-	TOTEM_JOIN,
-	TOTEM_CONSENSUS,
-	TOTEM_MERGE,
-	TOTEM_DOWNCHECK,
-	TOTEM_FAIL_RECV_CONST,
-
-	MAX_TOTEM_TIMEOUTS	/* Last item */
-} totem_timeout_types;
-
-
 struct openais_config {
-	/*
-	 * network
-	 */
-    struct totem_interface *interfaces;
-    int interface_count;
-	struct sockaddr_in mcast_addr;
-
 	/*
 	 * logging
 	 */
 	int logmode;
 	char *logfile;
 
-	/*
-	 * key
-	 */
-	unsigned char *key;
-	int keylen;
-
-	/*
-	 * Timeout
-	 */
-	unsigned int timeouts[MAX_TOTEM_TIMEOUTS];
-
 	/*
 	 * Event service
 	 */
 	unsigned int evt_delivery_queue_size;
 	unsigned int evt_delivery_queue_resume;
+
+	struct totem_config totem_config;
 };
 
 struct saAmfUnit {

+ 0 - 1
exec/print.c

@@ -43,7 +43,6 @@
 
 
 #include "print.h"
-#include "parse.h"
 #include "../include/ais_types.h"
 
 unsigned int logmode = LOG_MODE_STDERR | LOG_MODE_SYSLOG;

+ 14 - 7
exec/sync.c

@@ -53,6 +53,7 @@
 #include "main.h"
 #include "sync.h"
 #include "totempg.h"
+#include "totemsrp.h"
 #include "print.h"
 
 #define LOG_SERVICE LOG_SERVICE_SYNC
@@ -64,6 +65,8 @@ struct barrier_data {
 
 static struct memb_ring_id *sync_ring_id;
 
+static totemsrp_handle sync_totemsrp_handle;
+
 static struct sync_callbacks *sync_callbacks;
 
 static int sync_callback_count;
@@ -112,15 +115,15 @@ static void sync_barrier_start (struct memb_ring_id *ring_id)
 	iovec.iov_len = sizeof (req_exec_sync_barrier_start);
 
 	result = totempg_mcast (&iovec, 1, TOTEMPG_AGREED);
-
-	
 }
 
 static void sync_service_init (struct memb_ring_id *ring_id)
 {
 	sync_callbacks[sync_recovery_index].sync_init ();
-	totemsrp_callback_token_destroy (&sync_callback_token_handle);
-	totemsrp_callback_token_create (&sync_callback_token_handle,
+	totemsrp_callback_token_destroy (sync_totemsrp_handle,
+		&sync_callback_token_handle);
+	totemsrp_callback_token_create (sync_totemsrp_handle,
+		&sync_callback_token_handle,
 		TOTEM_CALLBACK_TOKEN_SENT,
 		0, /* don't delete after callback */
 		sync_service_process,
@@ -145,7 +148,7 @@ static int sync_service_process (enum totem_callback_token_type type, void *data
 	 */
 	sync_callbacks[sync_recovery_index].sync_activate ();
 	sync_recovery_index += 1;
-	totemsrp_callback_token_destroy (&sync_callback_token_handle);
+	totemsrp_callback_token_destroy (sync_totemsrp_handle, &sync_callback_token_handle);
 	if (sync_recovery_index > sync_callback_count) {
 		sync_processing = 0;
 	} else {
@@ -154,9 +157,13 @@ static int sync_service_process (enum totem_callback_token_type type, void *data
 	return (0);
 }
 
-void sync_register (struct sync_callbacks *callbacks, int callback_count,
+void sync_register (
+	totemsrp_handle handle,
+	struct sync_callbacks *callbacks,
+	int callback_count,
 	void (*synchronization_completed) (void))
 {
+	sync_totemsrp_handle = handle;
 	sync_callbacks = callbacks;
 	sync_callback_count = callback_count;
 	sync_synchronization_completed = synchronization_completed;
@@ -177,7 +184,7 @@ void sync_confchg_fn (
 
 	sync_processing = 1;
 
-	totemsrp_callback_token_destroy (&sync_callback_token_handle);
+	totemsrp_callback_token_destroy (sync_totemsrp_handle, &sync_callback_token_handle);
 
 	sync_ring_id = ring_id;
 

+ 3 - 1
exec/sync.h

@@ -46,7 +46,9 @@ struct sync_callbacks {
 	void (*sync_abort) (void);
 };
 
-void sync_register (struct sync_callbacks *callbacks, int callback_count,
+void sync_register (totemsrp_handle handle,
+	struct sync_callbacks *callbacks,
+	int callback_count,
 	void (*synchronization_completed) (void));
 
 void sync_confchg_fn (

+ 56 - 4
exec/totem.h

@@ -37,6 +37,62 @@
 #define MESSAGE_SIZE_MAX			256000
 #define PROCESSOR_COUNT_MAX			16
 
+/*
+ * Array location of various timeouts as
+ * specified in openais.conf.  The last enum
+ * specifies the size of the timeouts array and
+ * needs to remain the last item in the list.
+ */
+enum {
+	TOTEM_RETRANSMITS_BEFORE_LOSS,
+	TOTEM_TOKEN,
+	TOTEM_RETRANSMIT_TOKEN,
+	TOTEM_HOLD_TOKEN,
+	TOTEM_JOIN,
+	TOTEM_CONSENSUS,
+	TOTEM_MERGE,
+	TOTEM_DOWNCHECK,
+	TOTEM_FAIL_RECV_CONST,
+
+	MAX_TOTEM_TIMEOUTS	/* Last item */
+} totem_timeout_types;
+
+struct totem_interface {
+	struct sockaddr_in bindnet;
+	struct sockaddr_in boundto;
+};
+
+struct totem_logging_configuration {
+	void (*log_printf) (int, char *, ...);
+	int log_level_security;
+	int log_level_error;
+	int log_level_warning;
+	int log_level_notice;
+	int log_level_debug;
+};
+
+struct totem_config {
+	/*
+	 * network
+	 */
+	struct totem_interface *interfaces;
+	int interface_count;
+	struct sockaddr_in mcast_addr;
+
+	/*
+	 * key information
+	 */
+	unsigned char *private_key;
+	int private_key_len;
+
+	/*
+	 * Timeouts
+	 */
+	unsigned int timeouts[MAX_TOTEM_TIMEOUTS];
+
+	struct totem_logging_configuration totem_logging_configuration;
+};
+
 enum totem_configuration_type {
 	TOTEM_CONFIGURATION_REGULAR,
 	TOTEM_CONFIGURATION_TRANSITIONAL	
@@ -52,9 +108,5 @@ struct memb_ring_id {
 	unsigned long long seq;
 } __attribute__((packed));
 
-struct totem_interface {
-	struct sockaddr_in bindnet;
-	struct sockaddr_in boundto;
-};
 
 #endif /* TOTEM_H_DEFINED */

+ 179 - 0
exec/totemmrp.c

@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2005 MontaVista Software, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@mvista.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <assert.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <sys/un.h>
+#include <sys/sysinfo.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <linux/if.h>
+#include <linux/sockios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <signal.h>
+#include <sched.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/poll.h>
+
+#include "totem.h"
+#include "totemsrp.h"
+#include "aispoll.h"
+
+totemsrp_handle totemsrp_handle_in;
+
+void (*pg_deliver_fn) (
+	struct in_addr source_addr,
+	struct iovec *iovec,
+	int iov_len,
+	int endian_conversion_required) = 0;
+
+void (*pg_confchg_fn) (
+	enum totem_configuration_type configuration_type,
+	struct in_addr *member_list, int member_list_entries,
+	struct in_addr *left_list, int left_list_entries,
+	struct in_addr *joined_list, int joined_list_entries,
+	struct memb_ring_id *ring_id) = 0;
+
+void totemmrp_deliver_fn (
+	struct in_addr source_addr,
+	struct iovec *iovec,
+	int iov_len,
+	int endian_conversion_required)
+{
+	pg_deliver_fn (source_addr, iovec, iov_len, endian_conversion_required);
+}
+
+void totemmrp_confchg_fn (
+	enum totem_configuration_type configuration_type,
+	struct in_addr *member_list, int member_list_entries,
+	struct in_addr *left_list, int left_list_entries,
+	struct in_addr *joined_list, int joined_list_entries,
+	struct memb_ring_id *ring_id)
+{
+	pg_confchg_fn (configuration_type,
+		member_list, member_list_entries,
+		left_list, left_list_entries,
+		joined_list, joined_list_entries,
+		ring_id);
+}
+
+/*
+ * Initialize the totem multiple ring protocol
+ */
+int totemmrp_initialize (
+	poll_handle *poll_handle,
+	totemsrp_handle *totemsrp_handle,
+	struct totem_config *totem_config,
+
+	void (*deliver_fn) (
+		struct in_addr source_addr,
+		struct iovec *iovec,
+		int iov_len,
+		int endian_conversion_required),
+	void (*confchg_fn) (
+		enum totem_configuration_type configuration_type,
+		struct in_addr *member_list, int member_list_entries,
+		struct in_addr *left_list, int left_list_entries,
+		struct in_addr *joined_list, int joined_list_entries,
+		struct memb_ring_id *ring_id))
+{
+	int result;
+	pg_deliver_fn = deliver_fn;
+	pg_confchg_fn = confchg_fn;
+
+	result = totemsrp_initialize (
+		poll_handle,
+		&totemsrp_handle_in,
+		totem_config,
+		totemmrp_deliver_fn,
+		totemmrp_confchg_fn);
+
+	*totemsrp_handle = totemsrp_handle_in;
+
+	return (result);
+}
+
+void totemmrp_finalize (void)
+{
+	totemsrp_finalize (totemsrp_handle_in);
+}
+
+/*
+ * Multicast a message
+ */
+int totemmrp_mcast (
+	struct iovec *iovec,
+	int iov_len,
+	int priority)
+{
+	return totemsrp_mcast (totemsrp_handle_in, iovec, iov_len, priority);
+}
+
+/*
+ * Return number of available messages that can be queued
+ */
+int totemmrp_avail (void)
+{
+	return (totemsrp_avail (totemsrp_handle_in));
+}
+
+int totemmrp_callback_token_create (
+	void **handle_out,
+	enum totem_callback_token_type type,
+	int delete,
+	int (*callback_fn) (enum totem_callback_token_type type, void *),
+	void *data)
+{
+	return totemsrp_callback_token_create (totemsrp_handle_in, handle_out, type, delete, callback_fn, data);
+}
+
+void totemmrp_callback_token_destroy (
+	void **handle_out)
+{
+	totemsrp_callback_token_destroy (totemsrp_handle_in, handle_out);
+}
+
+void totemmrp_new_msg_signal (void) {
+	totemsrp_new_msg_signal (totemsrp_handle_in);
+}

+ 106 - 0
exec/totemmrp.h

@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2005 MontaVista Software, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@mvista.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef TOTEMMRP_H_DEFINED
+#define TOTEMMRP_H_DEFINED
+
+#include "totem.h"
+#include "aispoll.h"
+
+#define TOTEMMRP_PACKET_SIZE_MAX	1404
+
+/*
+ * Totem Single Ring Protocol
+ * depends on poll abstraction, POSIX, IPV4
+ */
+/*
+ * Initialize the logger
+ */
+void totemmrp_log_printf_init (
+	void (*log_printf) (int , char *, ...),
+	int log_level_security,
+	int log_level_error,
+	int log_level_warning,
+	int log_level_notice,
+	int log_level_debug);
+
+/*
+ * Initialize the group messaging interface
+ */
+int totemmrp_initialize (
+	poll_handle *poll_handle,
+	totemsrp_handle *totemsrp_handle,
+	struct totem_config *totem_config,
+
+	void (*deliver_fn) (
+		struct in_addr source_addr,
+		struct iovec *iovec,
+		int iov_len,
+		int endian_conversion_required),
+	void (*confchg_fn) (
+		enum totem_configuration_type configuration_type,
+		struct in_addr *member_list, int member_list_entries,
+		struct in_addr *left_list, int left_list_entries,
+		struct in_addr *joined_list, int joined_list_entries,
+		struct memb_ring_id *ring_id));
+
+int totemmrp_finalize (void);
+
+/*
+ * Multicast a message
+ */
+int totemmrp_mcast (
+	struct iovec *iovec,
+	int iov_len,
+	int priority);
+
+/*
+ * Return number of available messages that can be queued
+ */
+int totemmrp_avail (void);
+
+int totemmrp_callback_token_create (
+	void **handle_out,
+	enum totem_callback_token_type type,
+	int delete,
+	int (*callback_fn) (enum totem_callback_token_type type, void *),
+	void *data);
+
+void totemmrp_callback_token_destroy (
+	void **handle_out);
+
+void totemmrp_new_msg_signal (void);
+
+extern struct sockaddr_in config_mcast_addr;
+
+#endif /* TOTEMMRP_H_DEFINED */

+ 300 - 0
exec/totemparse.c

@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2002-2004 MontaVista Software, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@mvista.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "../include/list.h"
+#include "util.h"
+#include "totem.h"
+#include "totemparse.h"
+#include "print.h"
+
+#define LOG_SERVICE LOG_SERVICE_GMI
+
+static char error_string_response[512];
+
+typedef enum {
+	MAIN_HEAD,
+	MAIN_TOTEM,
+	MAIN_TIMEOUT,
+} main_parse_t;
+
+static inline char *
+strstr_rs (const char *haystack, const char *needle)
+{
+	char *end_address;
+	char *new_needle;
+
+	new_needle = (char *)strdup (needle);
+	new_needle[strlen(new_needle) - 1] = '\0';
+
+	end_address = strstr (haystack, new_needle);
+	if (end_address) {
+		end_address += strlen (new_needle);
+		end_address = strstr (end_address, needle + strlen (new_needle));
+	}
+	if (end_address) {
+		end_address += 1; /* skip past { or = */
+		do {
+			if (*end_address == '\t' || *end_address == ' ') {
+				end_address++;
+			} else {
+				break;
+			}
+		} while (*end_address != '\0');
+	}
+
+	free (new_needle);
+	return (end_address);
+}
+
+extern int totem_config_read (
+	struct totem_config *totem_config,
+	char **error_string,
+	int interface_max)
+{
+	FILE *fp;
+	int res = 0;
+	int line_number = 0;
+	main_parse_t parse = MAIN_HEAD;
+	int totem_parsed = 0;
+	int timeout_parsed = 0;
+	char *loc;
+	int i;
+	int parse_done = 0;
+	char line[512];
+	char *error_reason = error_string_response;
+
+	memset (totem_config, 0, sizeof (struct totem_config));
+	totem_config->interfaces = malloc (sizeof (struct totem_interface) * interface_max);
+	if (totem_config->interfaces == 0) {
+		parse_done = 1;
+		*error_string = "Out of memory trying to allocate ethernet interface storage area";
+		return -1;
+	}
+
+	memset (totem_config->interfaces, 0,
+		sizeof (struct totem_interface) * interface_max);
+
+	totem_config->mcast_addr.sin_family = AF_INET;
+	fp = fopen ("/etc/ais/openais.conf", "r");
+	if (fp == 0) {
+		parse_done = 1;
+		sprintf (error_reason, "Can't read file reason = (%s)\n", strerror (errno));
+		*error_string = error_reason;
+		return -1;
+	}
+
+	while (fgets (line, 255, fp)) {
+		line_number += 1;
+		line[strlen(line) - 1] = '\0';
+		/*
+		 * Clear out white space and tabs
+		 */
+		for (i = strlen (line) - 1; i > -1; i--) {
+			if (line[i] == '\t' || line[i] == ' ') {
+				line[i] = '\0';
+			} else {
+				break;
+			}
+		}
+		/*
+		 * Clear out comments and empty lines
+		 */
+		if (line[0] == '#' || line[0] == '\0') {
+			continue;
+		}
+			
+		line_number += 1;
+
+		switch (parse) {
+		case MAIN_HEAD:
+			if (totem_parsed == 0 && strstr_rs (line, "network{")) {
+				totem_parsed = 1;
+				parse = MAIN_TOTEM;
+			} else
+			if (totem_parsed == 0 && strstr_rs (line, "totem{")) {
+				totem_parsed = 1;
+				parse = MAIN_TOTEM;
+			} else
+			if (timeout_parsed == 0 && strstr_rs (line, "timeout{")) {
+				timeout_parsed = 1;
+				parse = MAIN_TIMEOUT;
+			} else {
+				continue;
+			}
+			break;
+
+		case MAIN_TOTEM:
+			if ((loc = strstr_rs (line, "mcastaddr:"))) {
+				res = inet_aton (loc, &totem_config->mcast_addr.sin_addr);
+			} else
+			if ((loc = strstr_rs (line, "mcastport:"))) {
+				res = totem_config->mcast_addr.sin_port = htons (atoi (loc));
+			} else
+			if ((loc = strstr_rs (line, "bindnetaddr:"))) {
+				if (interface_max == totem_config->interface_count) {
+					sprintf (error_reason,
+						"%d is too many interfaces in /etc/ais/network.conf",
+					totem_config->interface_count);
+					goto parse_error;
+				}
+				res = inet_aton (loc,
+					&totem_config->interfaces[totem_config->interface_count].bindnet.sin_addr);
+				totem_config->interface_count += 1;
+			} else
+			if ((loc = strstr_rs (line, "}"))) {
+				parse = MAIN_HEAD;
+				res = 1; /* any nonzero is ok */
+			} else {
+				goto parse_error;
+			}
+
+			if (res == 0) {
+				sprintf (error_reason, "invalid network address or port number\n");
+				goto parse_error;
+			}
+			break;
+
+		case MAIN_TIMEOUT:
+			if ((loc = strstr_rs (line, "token:"))) {
+				totem_config->timeouts[TOTEM_TOKEN]= atoi(loc);
+			} else if ((loc = strstr_rs (line, "token_retransmit:"))) {
+				totem_config->timeouts[TOTEM_RETRANSMIT_TOKEN] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "hold:"))) {
+				totem_config->timeouts[TOTEM_HOLD_TOKEN] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "retransmits_before_loss:"))) {
+				totem_config->timeouts[TOTEM_RETRANSMITS_BEFORE_LOSS] = atoi(loc);
+		
+			} else if ((loc = strstr_rs (line, "join:"))) {
+				totem_config->timeouts[TOTEM_JOIN] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "consensus:"))) {
+				totem_config->timeouts[TOTEM_CONSENSUS] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "merge:"))) {
+				totem_config->timeouts[TOTEM_MERGE] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "downcheck:"))) {
+				totem_config->timeouts[TOTEM_DOWNCHECK] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "fail_recv_const:"))) {
+				totem_config->timeouts[TOTEM_FAIL_RECV_CONST] = atoi(loc);
+			} else if ((loc = strstr_rs (line, "}"))) {
+				parse = MAIN_HEAD;
+			} else {
+				goto parse_error;
+			}
+			break;
+
+		default:
+			assert (0 == 1); /* SHOULDN'T HAPPEN */
+			break;	
+		}
+	}
+
+	/*
+	 * Some error checking of parsed data to make sure its valid
+	 */
+	parse_done = 1;
+	if (totem_config->mcast_addr.sin_addr.s_addr == 0) {
+		error_reason = "No multicast address specified";
+		goto parse_error;
+	}
+
+	if (totem_config->mcast_addr.sin_port == 0) {
+		error_reason = "No multicast port specified";
+		goto parse_error;
+	}
+
+	if (totem_config->interface_count == 0) {
+		error_reason = "No bindnet specified";
+		goto parse_error;
+	}
+
+	if (parse == MAIN_HEAD) {
+		fclose (fp);
+		return (0);
+	} else {
+		error_reason = "Missing closing brace";
+		goto parse_error;
+	}
+
+parse_error:
+	if (parse_done) {
+		sprintf (error_string_response,
+			"parse error in /etc/ais/openais.conf: %s.\n", error_reason);
+	} else {
+		sprintf (error_string_response,
+			"parse error in /etc/ais/openais.conf: %s (line %d).\n",
+			error_reason, line_number);
+	}
+	*error_string = error_string_response;
+	fclose (fp);
+	return (-1);
+}
+
+int totemparse_keyread (struct totem_config *totem_config)
+{
+	int fd;
+	int res;
+
+	fd = open ("/etc/ais/authkey", O_RDONLY);
+	if (fd == -1) {
+		log_printf (LOG_LEVEL_ERROR, "Could not open /etc/ais/authkey: %s\n", strerror (errno));
+		return (-1);
+	}
+
+	res = read (fd, totem_config->private_key, 128);
+	if (res == -1) {
+		log_printf (LOG_LEVEL_ERROR, "Could not read /etc/ais/authkey: %s\n", strerror (errno));
+		return (-1);
+	}
+
+	totem_config->private_key_len = 128;
+
+	if (res != 128) {
+		log_printf (LOG_LEVEL_ERROR, "Could only read %d bits of 1024 bits from /etc/ais/authkey.\n", res * 8);
+		return (-1);
+	}
+
+	close (fd);
+	return (0);
+}

+ 51 - 0
exec/totemparse.h

@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2005 MontaVista Software, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake@mvista.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <netinet/in.h>
+#include "../include/ais_types.h"
+#include "../include/list.h"
+#include "aispoll.h"
+#include "totemsrp.h"
+#include "totempg.h"
+
+#ifndef TOTEMPARSE_H_DEFINED
+#define TOTEMPARSE_H_DEFINED
+
+extern int totem_config_read (
+	struct totem_config *totem_config,
+	char **error_string,
+	int interface_max);
+	
+int totemparse_keyread (struct totem_config *totem_config);
+
+#endif /* TOTEMPARSE_H_DEFINED */

+ 24 - 36
exec/totempg.c

@@ -46,7 +46,7 @@
  *	store remaining multicast into head of fragmentation data and set lens field
  *
  * If a message exceeds the maximum packet size allowed by the totem
- * single ring protocol, the protocol could loose forward progress.
+ * single ring protocol, the protocol could lose forward progress.
  * Statically calculating the allowed data amount doesn't work because
  * the amount of data allowed depends on the number of fragments in
  * each message.  In this implementation, the maximum fragment size
@@ -83,6 +83,7 @@
 
 #include "totempg.h"
 #include "totemsrp.h"
+#include "totemmrp.h"
 #include <sys/uio.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -127,7 +128,7 @@ struct totempg_mcast {
  * Maximum packet size for totem pg messages
  */
 #define TOTEMPG_PACKET_SIZE (TOTEMSRP_PACKET_SIZE_MAX - \
-				sizeof (struct totempg_mcast))
+	sizeof (struct totempg_mcast))
 
 /*
  * Local variables used for packing small messages
@@ -407,25 +408,6 @@ printf ("Message fragmented %d count %d\n", mcast->fragmented, mcast->msg_count)
  * Totem Process Group Abstraction
  * depends on poll abstraction, POSIX, IPV4
  */
-/*
- * Initialize the logger
- */
-void totempg_log_printf_init (
-	void (*log_printf) (int , char *, ...),
-	int log_level_security,
-	int log_level_error,
-	int log_level_warning,
-	int log_level_notice,
-	int log_level_debug)
-{
-	totemsrp_log_printf_init (
-		log_printf,
-		log_level_security,
-		log_level_error,
-		log_level_warning,
-		log_level_notice,
-		log_level_debug);
-}
 
 void *callback_token_received_handle;
 
@@ -456,7 +438,7 @@ int callback_token_received_fn (enum totem_callback_token_type type,
 	iovecs[1].iov_len = mcast_packed_msg_count * sizeof (unsigned short);
 	iovecs[2].iov_base = &fragmentation_data[0];
 	iovecs[2].iov_len = fragment_size;
-	res = totemsrp_mcast (iovecs, 3, 0);
+	res = totemmrp_mcast (iovecs, 3, 0);
 
 	mcast_packed_msg_count = 0;
 	fragment_size = 0;
@@ -468,17 +450,16 @@ int callback_token_received_fn (enum totem_callback_token_type type,
  * Initialize the totem process group abstraction
  */
 int totempg_initialize (
-	struct openais_config *openais_config,
 	poll_handle *poll_handle,
-	unsigned char *private_key,
-	int private_key_len,
-	void *member_private,
-	int member_private_len,
+	totemsrp_handle *totemsrp_handle,
+	struct totem_config *totem_config,
+
 	void (*deliver_fn) (
 		struct in_addr source_addr,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
+
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
 		struct in_addr *member_list, int member_list_entries,
@@ -491,13 +472,14 @@ int totempg_initialize (
 	app_deliver_fn = deliver_fn;
 	app_confchg_fn = confchg_fn;
 
-	res = totemsrp_initialize (openais_config,
+	res = totemmrp_initialize (
 		poll_handle,
-		private_key, private_key_len,
-		member_private, member_private_len,
+		totemsrp_handle,
+		totem_config,
 		totempg_deliver_fn, totempg_confchg_fn);
- 
-	totemsrp_callback_token_create (&callback_token_received_handle, 
+
+	totemmrp_callback_token_create (
+		&callback_token_received_handle, 
 		TOTEM_CALLBACK_TOKEN_RECEIVED,
 		0,
 		callback_token_received_fn,
@@ -506,6 +488,11 @@ int totempg_initialize (
 	return (res);
 }
 
+void totempg_finalize (void)
+{
+	totemmrp_finalize ();
+}
+
 static unsigned char next_fragment = 1;
 
 /*
@@ -524,7 +511,7 @@ int totempg_mcast (
 	int copy_len = 0; 
 	int copy_base = 0;
 
-	totemsrp_new_msg_signal ();
+	totemmrp_new_msg_signal ();
 
 	max_packet_size = TOTEMPG_PACKET_SIZE -
 		(sizeof (unsigned short) * (mcast_packed_msg_count + 1));
@@ -543,7 +530,8 @@ int totempg_mcast (
 		 * doesn't exceed the size of the fragment_buffer on the next call.
 		 */
 		if ((copy_len + fragment_size) < 
-						(max_packet_size - sizeof (unsigned short))) {
+			(max_packet_size - sizeof (unsigned short))) {
+
 			memcpy (&fragmentation_data[fragment_size],
 				iovec[i].iov_base + copy_base, copy_len);
 			fragment_size += copy_len;
@@ -591,7 +579,7 @@ int totempg_mcast (
 												sizeof(unsigned short);
 			iovecs[2].iov_base = fragmentation_data;
 			iovecs[2].iov_len = max_packet_size;
-			res = totemsrp_mcast (iovecs, 3, guarantee);
+			res = totemmrp_mcast (iovecs, 3, guarantee);
 
 			/*
 			 * Recalculate counts and indexes for the next.
@@ -637,7 +625,7 @@ int totempg_send_ok (
 	int msg_size)
 {
 	int avail = 0;
-	avail = totemsrp_avail ();
+	avail = totemmrp_avail ();
 
 	return (avail > 200);
 }

+ 7 - 17
exec/totempg.h

@@ -38,7 +38,6 @@
 #include <netinet/in.h>
 #include "aispoll.h"
 #include "totemsrp.h"
-#include "parse.h"
 #include "totem.h"
 
 #define TOTEMPG_AGREED			0
@@ -48,32 +47,21 @@
  * Totem Single Ring Protocol
  * depends on poll abstraction, POSIX, IPV4
  */
-/*
- * Initialize the logger
- */
-void totempg_log_printf_init (
-	void (*log_printf) (int , char *, ...),
-	int log_level_security,
-	int log_level_error,
-	int log_level_warning,
-	int log_level_notice,
-	int log_level_debug);
 
 /*
- * Initialize the group messaging interface
+ * Initialize the totem process group abstraction
  */
 int totempg_initialize (
-	struct openais_config *openais_config,
 	poll_handle *poll_handle,
-	unsigned char *private_key,
-	int private_key_len,
-	void *member_private,
-	int member_private_len,
+	totemsrp_handle *totemsrp_handle,
+	struct totem_config *totem_config,
+
 	void (*deliver_fn) (
 		struct in_addr source_addr,
 		struct iovec *iovec,
 		int iov_len,
 		int endian_conversion_required),
+
 	void (*confchg_fn) (
 		enum totem_configuration_type configuration_type,
 		struct in_addr *member_list, int member_list_entries,
@@ -81,6 +69,8 @@ int totempg_initialize (
 		struct in_addr *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 
+void totempg_finalize (void);
+
 /*
  * Multicast a message
  */

Diff do ficheiro suprimidas por serem muito extensas
+ 589 - 303
exec/totemsrp.c


+ 12 - 19
exec/totemsrp.h

@@ -36,35 +36,23 @@
 
 #include "totem.h"
 #include "aispoll.h"
-#include "parse.h"
 
 #define TOTEMSRP_PACKET_SIZE_MAX	1404
 
+typedef unsigned int totemsrp_handle;
+
 /*
  * Totem Single Ring Protocol
  * depends on poll abstraction, POSIX, IPV4
  */
-/*
- * Initialize the logger
- */
-void totemsrp_log_printf_init (
-	void (*log_printf) (int , char *, ...),
-	int log_level_security,
-	int log_level_error,
-	int log_level_warning,
-	int log_level_notice,
-	int log_level_debug);
 
 /*
- * Initialize the group messaging interface
+ * Create a protocol instance
  */
 int totemsrp_initialize (
-	struct openais_config *openais_config,
 	poll_handle *poll_handle,
-	unsigned char *private_key,
-	int private_key_len,
-	void *member_private,
-	int member_private_len,
+	totemsrp_handle *handle,
+	struct totem_config *totem_config,
 
 	void (*deliver_fn) (
 		struct in_addr source_addr,
@@ -78,10 +66,13 @@ int totemsrp_initialize (
 		struct in_addr *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 
+void totemsrp_finalize (totemsrp_handle handle);
+
 /*
  * Multicast a message
  */
 int totemsrp_mcast (
+	totemsrp_handle handle,
 	struct iovec *iovec,
 	int iov_len,
 	int priority);
@@ -89,9 +80,10 @@ int totemsrp_mcast (
 /*
  * Return number of available messages that can be queued
  */
-int totemsrp_avail (void);
+int totemsrp_avail (totemsrp_handle handle);
 
 int totemsrp_callback_token_create (
+	totemsrp_handle handle,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	int delete,
@@ -99,9 +91,10 @@ int totemsrp_callback_token_create (
 	void *data);
 
 void totemsrp_callback_token_destroy (
+	totemsrp_handle handle,
 	void **handle_out);
 
-void totemsrp_new_msg_signal (void);
+int totemsrp_new_msg_signal (totemsrp_handle handle);
 
 extern struct sockaddr_in config_mcast_addr;
 

+ 3 - 3
include/sq.h

@@ -111,7 +111,7 @@ static inline void sq_free (struct sq *sq) {
 	free (sq->items_inuse);
 }
 
-static inline int sq_item_add (
+static inline void *sq_item_add (
 	struct sq *sq,
 	void *item,
 	int seqid)
@@ -120,7 +120,7 @@ static inline int sq_item_add (
 	int sq_position;
 
 	if (seqid - sq->head_seqid >= sq->size) {
-		return E2BIG;
+		return(0);
 	}
 	sq_position = (sq->head + seqid - sq->head_seqid) % sq->size;
 	if (sq_position > sq->pos_max) {
@@ -135,7 +135,7 @@ static inline int sq_item_add (
 	memcpy (sq_item, item, sq->size_per_item);
 	sq->items_inuse[sq_position] = 1;
 
-	return (0);
+	return (sq_item);
 }
 
 static inline int sq_item_inuse (

+ 3 - 10
test/Makefile

@@ -51,19 +51,16 @@ LIBS = $(LIBRARIES) -lpthread
 EXTRA_CFLAGS = -I../include
 TEST_SRC =  testclm.c testamf.c testamf1.c testamf2.c testamf3.c \
 		testamf4.c testamf5.c testamf6.c testamfth.c  \
-		testckpt.c ckptstress.c testparse.c ckptbench.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
 
 all: testclm testamf testamf1 testamf2 testamf3 testamf4 testamf5 \
-	testamf6 testamfth testckpt ckptstress testparse ckptbench \
+	testamf6 testamfth testckpt ckptstress ckptbench \
 	ckptbenchth ckpt-rd ckpt-wr testevt testevs \
 	evsbench subscription publish evtbench unlink
 
-testparse: testparse.o $(LIBRARIES)
-	$(CC) $(LDFLAGS) -o testparse testparse.o ../exec/parse.o ../exec/print.o ../exec/mempool.o ../exec/util.o
-
 testtimer: testtimer.o $(LIBRARIES)
 	$(CC) $(LDFLAGS) -o testtimer testtimer.o ../exec/timer.o
 
@@ -141,7 +138,7 @@ ckpt-wr: ckpt-wr.o sa_error.o $(LIBRARIES)
 
 clean:
 	rm -f *.o testclm testamf testamf1 testamf2 testamf3 testamf4 \
-	testamf5 testamf6 testamfth testckpt ckptstress testparse testtimer \
+	testamf5 testamf6 testamfth testckpt ckptstress testtimer \
 	ckptbench ckptbenchth testevt testevs ckpt-wr ckpt-rd \
 	evsbench subscription publish evtbench unlink
 %.o: %.c
@@ -162,10 +159,6 @@ testamf6.o: ../include/ais_types.h ../include/ais_amf.h
 testamfth.o: ../include/ais_types.h ../include/ais_amf.h ../include/saClm.h
 testckpt.o: ../include/ais_types.h ../include/saCkpt.h sa_error.h
 ckptstress.o: ../include/ais_types.h ../include/saCkpt.h
-testparse.o: ../include/ais_types.h ../exec/parse.h ../include/list.h
-testparse.o: ../exec/aispoll.h ../exec/totempg.h ../exec/totemsrp.h
-testparse.o: ../exec/totem.h ../exec/parse.h ../exec/print.h
-testparse.o: ../include/saClm.h ../include/ais_types.h
 ckptbench.o: ../include/ais_types.h ../include/saCkpt.h
 ckptbenchth.o: ../include/ais_types.h ../include/saCkpt.h
 testevt.o: ../include/ais_types.h ../include/saEvt.h

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff