[Spread-cvs] commit: r495 - in trunk: . daemon libspread libspread-util/include libspread-util/src
jonathan at spread.org
jonathan at spread.org
Tue Mar 6 01:17:04 EST 2012
Author: jonathan
Date: 2012-03-06 01:17:03 -0500 (Tue, 06 Mar 2012)
New Revision: 495
Removed:
trunk/daemon/alarm.c
trunk/daemon/alarm.h
trunk/daemon/data_link.c
trunk/daemon/data_link.h
trunk/daemon/events.c
trunk/daemon/memory.c
trunk/daemon/memory.h
trunk/daemon/objects.h
Modified:
trunk/Makefile.in
trunk/configure
trunk/configure.in
trunk/daemon/Makefile.in
trunk/daemon/acm.c
trunk/daemon/acp-permit.c
trunk/daemon/auth-ip.c
trunk/daemon/auth-null.c
trunk/daemon/config_parse.y
trunk/daemon/configuration.c
trunk/daemon/flow_control.c
trunk/daemon/groups.c
trunk/daemon/log.c
trunk/daemon/membership.c
trunk/daemon/message.c
trunk/daemon/monitor.c
trunk/daemon/net_types.h
trunk/daemon/network.c
trunk/daemon/prot_body.h
trunk/daemon/protocol.c
trunk/daemon/r.c
trunk/daemon/s.c
trunk/daemon/sess_types.h
trunk/daemon/session.c
trunk/daemon/spread.c
trunk/daemon/spread_params.h
trunk/daemon/status.c
trunk/libspread-util/include/spu_objects_local.h
trunk/libspread-util/src/Makefile.in
trunk/libspread/Makefile.in
trunk/libspread/sp.c
Log:
Convert all of spread (daemon, libspread, examples) to use new libspread-util library. Everything now builds successfully. Remove versions of alarm, data_link, events and memory from the Spread code.
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/Makefile.in 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,7 +1,8 @@
-SUBDIRS=stdutil daemon docs libspread examples
+SUBDIRS=stdutil libspread-util daemon docs libspread examples
INSTALLSUBDIRS=daemon docs libspread examples
BINSUBDIRS=daemon libspread examples
+.PHONY: all clean distclean mrproper veryclean binrelease install uninstallall uninstall
all: $(SUBDIRS)
for dir in $(SUBDIRS); do \
( $(MAKE) -C $$dir); \
Modified: trunk/configure
===================================================================
--- trunk/configure 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/configure 2012-03-06 06:17:03 UTC (rev 495)
@@ -749,7 +749,7 @@
CPP
YACC
YFLAGS'
-ac_subdirs_all='stdutil'
+ac_subdirs_all='stdutil libspread-util'
# Initialize some variables set by options.
ac_init_help=
@@ -1879,7 +1879,7 @@
-subdirs="$subdirs stdutil"
+subdirs="$subdirs stdutil libspread-util"
# Make sure we can run config.sub.
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/configure.in 2012-03-06 06:17:03 UTC (rev 495)
@@ -3,7 +3,7 @@
AC_CONFIG_AUX_DIR(buildtools)
AC_CONFIG_HEADERS(daemon/config.h)
-AC_CONFIG_SUBDIRS(stdutil)
+AC_CONFIG_SUBDIRS(stdutil libspread-util)
AC_CANONICAL_HOST
Modified: trunk/daemon/Makefile.in
===================================================================
--- trunk/daemon/Makefile.in 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/Makefile.in 2012-03-06 06:17:03 UTC (rev 495)
@@ -26,10 +26,14 @@
PATHS=
+#libspread-util includes
+LIBSPREADUTIL_DIR=../libspread-util
+LIBSPREADUTIL_PATHS=-I$(LIBSPREADUTIL_DIR)/include -I$(top_srcdir)/libspread-util/include
+
CC=@CC@
LD=@LD@
CFLAGS=@CFLAGS@
-CPPFLAGS=-I. -I$(srcdir) -I$(top_srcdir)/include -I../stdutil/src -I$(top_srcdir)/stdutil/src @CPPFLAGS@ $(PATHS) @DEFS@
+CPPFLAGS=-I. -I$(srcdir) -I$(top_srcdir)/include -I../stdutil/src -I$(top_srcdir)/stdutil/src $(LIBSPREADUTIL_PATHS) @CPPFLAGS@ $(PATHS) @DEFS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
THLDFLAGS=@THLDFLAGS@
@@ -43,11 +47,11 @@
TARGETS=spread$(EXEEXT) spmonitor$(EXEEXT)
-SPREADOBJS= spread.o protocol.o session.o groups.o alarm.o events.o memory.o membership.o data_link.o network.o status.o log.o flow_control.o message.o lex.yy.o y.tab.o configuration.o acm.o acp-permit.o auth-null.o auth-ip.o
+SPREADOBJS= spread.o protocol.o session.o groups.o membership.o network.o status.o log.o flow_control.o message.o lex.yy.o y.tab.o configuration.o acm.o acp-permit.o auth-null.o auth-ip.o
-MONITOR_OBJS= monitor.o alarm.o events.o memory.o data_link.o lex.yy.o y.tab.o configuration.o acm.o
+MONITOR_OBJS= monitor.o lex.yy.o y.tab.o configuration.o acm.o
-TMONITOR_OBJS= monitor.to alarm.to events.to memory.to data_link.to lex.yy.to y.tab.to configuration.to acm.to
+TMONITOR_OBJS= monitor.to lex.yy.to y.tab.to configuration.to acm.to
all: $(TARGETS)
@@ -73,22 +77,22 @@
#y.tab.c: config_parse.y
# $(YACC) -d config_parse.y
-spread$(EXEEXT): $(SPREADOBJS) ../stdutil/lib/libstdutil-threaded-release.a
- $(LD) -o $@ $(SPREADOBJS) ../stdutil/lib/libstdutil-threaded-release.a $(LDFLAGS) $(LIBS)
+spread$(EXEEXT): $(SPREADOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a
+ $(LD) -o $@ $(SPREADOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a $(LDFLAGS) $(LIBS)
-spmonitor$(EXEEXT): $(MONITOR_OBJS)
- $(LD) -o $@ $(MONITOR_OBJS) $(LDFLAGS) $(LIBS)
+spmonitor$(EXEEXT): $(MONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(LD) -o $@ $(MONITOR_OBJS) $(LDFLAGS) $(LIBS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
-sptmonitor$(EXEEXT): $(TMONITOR_OBJS)
- $(LD) $(THLDFLAGS) -o $@ $(TMONITOR_OBJS) $(LDFLAGS) $(LIBS) $(THLIBS)
+sptmonitor$(EXEEXT): $(TMONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(LD) $(THLDFLAGS) -o $@ $(TMONITOR_OBJS) $(LDFLAGS) $(LIBS) $(THLIBS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
testprog: spsend$(EXEEXT) sprecv$(EXEEXT)
-spsend$(EXEEXT): s.o alarm.o data_link.o events.o memory.o
- $(LD) -o $@ s.o alarm.o data_link.o events.o memory.o $(LDFLAGS) $(LIBS)
+spsend$(EXEEXT): s.o $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(LD) -o $@ s.o $(LDFLAGS) $(LIBS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
-sprecv$(EXEEXT): r.o alarm.o data_link.o
- $(LD) -o $@ r.o alarm.o data_link.o events.o memory.o $(LDFLAGS) $(LIBS)
+sprecv$(EXEEXT): r.o $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(LD) -o $@ r.o $(LDFLAGS) $(LIBS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
clean:
rm -f *.lo *.tlo *.to *.o *.a *.dylib $(TARGETS) spsimple_user
Modified: trunk/daemon/acm.c
===================================================================
--- trunk/daemon/acm.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/acm.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -38,9 +38,9 @@
#include <assert.h>
#include "acm.h"
-#include "alarm.h"
-#include "memory.h"
-#include "objects.h"
+#include "spu_alarm.h"
+#include "spu_memory.h"
+#include "spu_objects.h"
struct auth_info {
char name[MAX_AUTH_NAME];
@@ -87,7 +87,7 @@
void Acm_init()
{
- Mem_init_object( SESSION_AUTH_INFO, sizeof( struct session_auth_info ), 0, 0 );
+ Mem_init_object( SESSION_AUTH_INFO, "session_auth_info", sizeof( struct session_auth_info ), 0, 0 );
/* establish default authentication -- allow all connections if nothing is configured.
* This is overridden by whatever is configured in the spread.conf file
*/
Modified: trunk/daemon/acp-permit.c
===================================================================
--- trunk/daemon/acp-permit.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/acp-permit.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -40,7 +40,7 @@
#include "arch.h"
#include "acm.h"
#include "session.h"
-#include "alarm.h"
+#include "spu_alarm.h"
ACM_ReturnVal permit_open_connection(char *user);
ACM_ReturnVal permit_open_monitor(char *user);
Deleted: trunk/daemon/alarm.c
===================================================================
--- trunk/daemon/alarm.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/alarm.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,278 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-#include "arch.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-/* undef redefined variables under windows */
-#ifdef ARCH_PC_WIN95
-#undef EINTR
-#undef EAGAIN
-#undef EWOULDBLOCK
-#undef EINPROGRESS
-#endif
-#include <errno.h>
-
-#ifdef HAVE_GOOD_VARGS
-#include <stdarg.h>
-#endif
-
-#include "alarm.h"
-
-#include "sp_events.h"
-
-static int32 Alarm_type_mask = PRINT | EXIT ;
-static int16 Alarm_cur_priority = SPLOG_DEBUG ;
-
-static char *Alarm_timestamp_format = NULL;
-
-static int Alarm_precise_timestamp = FALSE;
-
-static const char *DEFAULT_TIMESTAMP_FORMAT="[%a %d %b %Y %H:%M:%S]";
-
-static int AlarmInteractiveProgram = FALSE;
-
-#ifdef HAVE_GOOD_VARGS
-
-/* Probably should work on all platforms, but just in case, I leave it to the
- developers...
-*/
-
-void Alarmp( int16 priority, int32 mask, char *message, ...)
-{
- /* log event if in mask and of higher priority, or if FATAL event, always log */
- if ( (( Alarm_type_mask & mask ) && (Alarm_cur_priority <= priority))
- || (priority == SPLOG_FATAL) )
- {
- va_list ap;
-
- if ( Alarm_timestamp_format && (priority != SPLOG_PRINT_NODATE) )
- {
- char timestamp[42];
- struct tm *tm_now;
- time_t time_now;
- size_t length;
-
- time_now = time(NULL);
- tm_now = localtime(&time_now);
- length = strftime(timestamp, 40,
- Alarm_timestamp_format, tm_now);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- if ( Alarm_precise_timestamp )
- {
- sp_time precise_now;
- precise_now = E_get_time();
- length = sprintf (timestamp, " (%lu us): ", precise_now.usec);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- }
- }
-
- va_start(ap,message);
- vprintf(message, ap);
- va_end(ap);
- }
-
- if ( ( EXIT & mask ) || (priority == SPLOG_FATAL) )
- {
- printf("Exit caused by Alarm(EXIT)\n");
- exit( 0 );
- }
-}
-
-/* For backwards compatibility while moving all Alarm calls over, this provides
- * the old interface and logs them as WARNING events.
- */
-void Alarm( int32 mask, char *message, ...)
-{
- if ( ( Alarm_type_mask & mask ) && (Alarm_cur_priority <= SPLOG_WARNING) )
- {
- va_list ap;
-
- if ( Alarm_timestamp_format )
- {
- char timestamp[42];
- struct tm *tm_now;
- time_t time_now;
- size_t length;
-
- time_now = time(NULL);
- tm_now = localtime(&time_now);
- length = strftime(timestamp, 40,
- Alarm_timestamp_format, tm_now);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- if ( Alarm_precise_timestamp )
- {
- sp_time precise_now;
- precise_now = E_get_time();
- length = sprintf (timestamp, " (%lu us): ", precise_now.usec);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- }
- }
-
- va_start(ap,message);
- vprintf(message, ap);
- va_end(ap);
- }
-
- if ( EXIT & mask )
- {
- printf("Exit caused by Alarm(EXIT)\n");
- exit( 0 );
- }
-}
-#else
-
-void Alarm( int16 priority, int32 mask, char *message,
- void *ptr1, void *ptr2, void *ptr3, void *ptr4,
- void *ptr5, void *ptr6, void *ptr7, void *ptr8,
- void *ptr9, void *ptr10, void*ptr11, void *ptr12,
- void *ptr13, void *ptr14, void *ptr15, void *ptr16,
- void *ptr17, void *ptr18, void *ptr19, void *ptr20)
-{
- if ( ( Alarm_type_mask & mask ) && (Alarm_cur_priority < priority) )
- {
- if ( Alarm_timestamp_format )
- {
- char timestamp[42];
- struct tm *tm_now;
- time_t time_now;
- size_t length;
-
- time_now = time(NULL);
- tm_now = localtime(&time_now);
- length = strftime(timestamp, 40,
- Alarm_timestamp_format, tm_now);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- if ( Alarm_precise_timestamp )
- {
- sp_time precise_now;
- precise_now = E_get_time();
- length = sprintf (timestamp, " (%lu us): ", precise_now.usec);
- timestamp[length] = ' ';
- fwrite(timestamp, length+1, sizeof(char), stdout);
- }
- }
- printf(message, ptr1, ptr2, ptr3, ptr4, ptr5, ptr6, ptr7, ptr8, ptr9, ptr10, ptr11, ptr12, ptr13, ptr14, ptr15, ptr16, ptr17, ptr18, ptr19, ptr20 );
-
- }
- if ( EXIT & mask )
- {
- printf("Exit caused by Alarm(EXIT)\n");
- exit( 0 );
- }
-}
-
-#endif /* HAVE_GOOD_VARGS */
-
-void Alarm_set_interactive(void)
-{
- AlarmInteractiveProgram = TRUE;
-}
-
-int Alarm_get_interactive(void)
-{
- return(AlarmInteractiveProgram);
-}
-
-void Alarm_enable_precise_timestamp(void)
-{
- Alarm_precise_timestamp = TRUE;
-}
-
-void Alarm_disable_precise_timestamp(void)
-{
- Alarm_precise_timestamp = FALSE;
-}
-
-void Alarm_set_output(char *filename) {
- FILE *newfile;
- newfile = freopen(filename, "a", stdout);
- if ( NULL == newfile ) {
- printf("failed to open file (%s) for stdout. Error: %d\n", filename, errno);
- }
- newfile = freopen(filename, "a", stderr);
- if ( NULL == newfile ) {
- printf("failed to open file (%s) for stderr. Error: %d\n", filename, errno);
- }
- setvbuf(stderr, (char *)0, _IONBF, 0);
- setvbuf(stdout, (char *)0, _IONBF, 0);
-}
-
-void Alarm_enable_timestamp(char *format)
-{
- static char _local_timestamp[40];
- if(format)
- strncpy(_local_timestamp, format, 40);
- else
- strncpy(_local_timestamp, DEFAULT_TIMESTAMP_FORMAT, 40);
- Alarm_timestamp_format = _local_timestamp;
-}
-
-void Alarm_disable_timestamp(void)
-{
- Alarm_timestamp_format = NULL;
-}
-
-void Alarm_set_types(int32 mask)
-{
- Alarm_type_mask = Alarm_type_mask | mask;
-}
-
-void Alarm_clear_types(int32 mask)
-{
- Alarm_type_mask = Alarm_type_mask & ~mask;
-}
-
-int32 Alarm_get_types(void)
-{
- return(Alarm_type_mask);
-}
-
-void Alarm_set_priority(int16 priority)
-{
- Alarm_cur_priority = priority;
-}
-
-int16 Alarm_get_priority(void)
-{
- return(Alarm_cur_priority);
-}
Deleted: trunk/daemon/alarm.h
===================================================================
--- trunk/daemon/alarm.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/alarm.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,132 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#ifndef INC_ALARM
-#define INC_ALARM
-
-#include <stdio.h>
-#include "arch.h"
-
-#define DEBUG 0x00000001
-#define EXIT 0x00000002
-#define PRINT 0x00000004
-/* new type to replace general prints */
-#define SYSTEM 0x00000004
-
-#define DATA_LINK 0x00000010
-#define NETWORK 0x00000020
-#define PROTOCOL 0x00000040
-#define SESSION 0x00000080
-#define CONF 0x00000100
-#define MEMB 0x00000200
-#define FLOW_CONTROL 0x00000400
-#define STATUS 0x00000800
-#define EVENTS 0x00001000
-#define GROUPS 0x00002000
-
-#define HOP 0x00004000
-#define OBJ_HANDLER 0x00008000
-#define MEMORY 0x00010000
-#define ROUTE 0x00020000
-#define QOS 0x00040000
-#define RING 0x00080000
-#define TCP_HOP 0x00100000
-
-#define SKIPLIST 0x00200000
-#define ACM 0x00400000
-
-#define SECURITY 0x00800000
-
-#define ALL 0xffffffff
-#define NONE 0x00000000
-
-/* Priority levels */
-#define SPLOG_DEBUG 1 /* Program information that is only useful for debugging.
- Will normally be turned off in operation. */
-#define SPLOG_INFO 2 /* Program reports information that may be useful for
- performance tuning, analysis, or operational checks. */
-#define SPLOG_WARNING 3 /* Program encountered a situation that is not erroneous,
- but is uncommon and may indicate an error. */
-#define SPLOG_ERROR 4 /* Program encountered an error that can be recovered from. */
-#define SPLOG_CRITICAL 5 /* Program will not exit, but has only temporarily recovered
- and without help may soon fail. */
-#define SPLOG_FATAL 6 /* Program will exit() or abort(). */
-
-#define SPLOG_PRINT 7 /* Program should always print this information */
-#define SPLOG_PRINT_NODATE 8 /* Program should always print this information, but the datestamp should be omitted. */
-
-#ifdef HAVE_GOOD_VARGS
-void Alarmp( int16 priority, int32 type, char *message, ...);
-void Alarm( int32 type, char *message, ...);
-
-#else
-void Alarm();
-#endif
-
-void Alarm_set_output(char *filename);
-
-void Alarm_enable_timestamp(char *format);
-void Alarm_disable_timestamp(void);
-
-void Alarm_enable_precise_timestamp(void);
-void Alarm_disable_precise_timestamp(void);
-
-void Alarm_set_types(int32 mask);
-void Alarm_clear_types(int32 mask);
-int32 Alarm_get_types(void);
-
-void Alarm_set_priority(int16 priority);
-int16 Alarm_get_priority(void);
-
-void Alarm_set_interactive(void);
-int Alarm_get_interactive(void);
-
-#define IPF "%d.%d.%d.%d"
-
-#define IP1(address) ( (int) ( ( (address) >> 24 ) & 0xFF ) )
-#define IP2(address) ( (int) ( ( (address) >> 16 ) & 0xFF ) )
-#define IP3(address) ( (int) ( ( (address) >> 8 ) & 0xFF ) )
-#define IP4(address) ( (int) ( ( (address) >> 0 ) & 0xFF ) )
-
-#define IP(address) IP1(address), IP2(address), IP3(address), IP4(address)
-
-#define IP1_NET(address) ( (int) ( (unsigned char*) &(address) )[0] )
-#define IP2_NET(address) ( (int) ( (unsigned char*) &(address) )[1] )
-#define IP3_NET(address) ( (int) ( (unsigned char*) &(address) )[2] )
-#define IP4_NET(address) ( (int) ( (unsigned char*) &(address) )[3] )
-
-#define IP_NET(address) IP1_NET(address), IP2_NET(address), IP3_NET(address), IP4_NET(address)
-
-#endif /* INC_ALARM */
Modified: trunk/daemon/auth-ip.c
===================================================================
--- trunk/daemon/auth-ip.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/auth-ip.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -44,7 +44,7 @@
#include "acm.h"
#include "session.h"
#include "sess_body.h" /* for Sessions[] */
-#include "alarm.h"
+#include "spu_alarm.h"
#include <stdlib.h>
#include <string.h>
Modified: trunk/daemon/auth-null.c
===================================================================
--- trunk/daemon/auth-null.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/auth-null.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -40,7 +40,7 @@
#include "arch.h"
#include "acm.h"
#include "session.h"
-#include "alarm.h"
+#include "spu_alarm.h"
void null_auth_client_connection(struct session_auth_info *sess_auth_p);
void null_auth_monitor_connection(mailbox mbox, int32 ip_addr);
Modified: trunk/daemon/config_parse.y
===================================================================
--- trunk/daemon/config_parse.y 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/config_parse.y 2012-03-06 06:17:03 UTC (rev 495)
@@ -53,10 +53,10 @@
#include <winsock.h>
#endif /* ARCH_PC_WIN95 */
-#include "alarm.h"
+#include "spu_alarm.h"
#include "configuration.h"
-#include "memory.h"
-#include "objects.h"
+#include "spu_memory.h"
+#include "spu_objects.h"
#include "conf_body.h"
#include "acm.h"
@@ -74,6 +74,11 @@
static int authentication_configured = 0;
+#define MAX_ALARM_FORMAT 40
+ static char alarm_format[MAX_ALARM_FORMAT];
+ static int alarm_precise = 0;
+ static int alarm_custom_format = 0;
+
void parser_init()
{
num_procs = 0;
@@ -96,13 +101,13 @@
}
static void alarm_print_proc(proc *p, int port) {
if(port == p->port)
- Alarm(CONF, "\t%20s: %d.%d.%d.%d\n", p->name,
+ Alarm(CONF_SYS, "\t%20s: %d.%d.%d.%d\n", p->name,
(p->id & 0xff000000)>>24,
(p->id & 0xff0000)>>16,
(p->id & 0xff00)>>8,
(p->id & 0xff));
else
- Alarm(CONF, "\t%20s: %d.%d.%d.%d:%d\n", p->name,
+ Alarm(CONF_SYS, "\t%20s: %d.%d.%d.%d:%d\n", p->name,
(p->id & 0xff000000)>>24,
(p->id & 0xff0000)>>16,
(p->id & 0xff00)>>8,
@@ -252,8 +257,8 @@
if (curlen > strsize) {
/* ran out of space in string -- should never happen. */
- Alarmp( SPLOG_ERROR, CONF, "config_parse.y:convert_segment_to_string: The segment string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
- Alarmp( SPLOG_ERROR, CONF, "config_parse.y:convert_segment_to_string:The error occured on segment %d.%d.%d.%d. Successful string was: %s\n",
+ Alarmp( SPLOG_ERROR, CONF_SYS, "config_parse.y:convert_segment_to_string: The segment string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
+ Alarmp( SPLOG_ERROR, CONF_SYS, "config_parse.y:convert_segment_to_string:The error occured on segment %d.%d.%d.%d. Successful string was: %s\n",
(seg->bcast_address & 0xff000000)>>24,
(seg->bcast_address & 0xff0000)>>16,
(seg->bcast_address & 0xff00)>>8,
@@ -262,7 +267,7 @@
return(-1);
}
- Alarmp( SPLOG_DEBUG, CONF, "config_parse.y:convert_segment_to_string:The segment string is %d characters long:\n%s", curlen, segstr);
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "config_parse.y:convert_segment_to_string:The segment string is %d characters long:\n%s", curlen, segstr);
return(curlen);
}
@@ -330,8 +335,8 @@
{
Config->num_segments = segments;
Config->num_total_procs = num_procs;
- Alarm(CONF, "Finished configuration file.\n");
- Alarmp( SPLOG_DEBUG, CONF, "config_parse.y:The full segment string is %d characters long:\n%s", strlen(ConfStringRep), ConfStringRep);
+ Alarm(CONF_SYS, "Finished configuration file.\n");
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "config_parse.y:The full segment string is %d characters long:\n%s", strlen(ConfStringRep), ConfStringRep);
}
@@ -385,7 +390,7 @@
if (! Alarm_get_interactive() ) {
Alarm_clear_types(ALL);
Alarm_set_types($4.mask);
- Alarm(CONF, "Set Alarm mask to: %x\n", Alarm_get_types());
+ Alarm(CONF_SYS, "Set Alarm mask to: %x\n", Alarm_get_types());
}
}
| EVENTPRIORITY EQUALS PriorityLevel
@@ -406,19 +411,34 @@
| EVENTTIMESTAMP EQUALS STRING
{
if (! Alarm_get_interactive() ) {
- Alarm_enable_timestamp($3.string);
+ strncpy(alarm_format, $3.string, MAX_ALARM_FORMAT);
+ alarm_custom_format = 1;
+ if (alarm_precise) {
+ Alarm_enable_timestamp_high_res(alarm_format);
+ } else {
+ Alarm_enable_timestamp(alarm_format);
+ }
}
}
| EVENTTIMESTAMP
{
if (! Alarm_get_interactive() ) {
- Alarm_enable_timestamp(NULL);
+ if (alarm_precise) {
+ Alarm_enable_timestamp_high_res(NULL);
+ } else {
+ Alarm_enable_timestamp(NULL);
+ }
}
}
| EVENTPRECISETIMESTAMP
{
if (! Alarm_get_interactive() ) {
- Alarm_enable_precise_timestamp();
+ alarm_precise = 1;
+ if (alarm_custom_format) {
+ Alarm_enable_timestamp_high_res(alarm_format);
+ } else {
+ Alarm_enable_timestamp_high_res(NULL);
+ }
}
}
| DANGEROUSMONITOR EQUALS SP_BOOL
@@ -541,7 +561,7 @@
$2.ip.addr.s_addr;
if(Config->segments[segments].port == 0)
Config->segments[segments].port = DEFAULT_SPREAD_PORT;
- Alarm(CONF, "Successfully configured Segment %d [%s] with %d procs:\n",
+ Alarm(CONF_SYS, "Successfully configured Segment %d [%s] with %d procs:\n",
segments,
segment2str(segments),
segment_procs);
@@ -689,7 +709,7 @@
RouteStruct : ROUTEMATRIX OPENBRACE Routevectors CLOSEBRACE
{
- Alarm(CONF, "Successfully configured Routing Matrix for %d Segments with %d rows in the routing matrix\n",segments, rvec_num);
+ Alarm(CONF_SYS, "Successfully configured Routing Matrix for %d Segments with %d rows in the routing matrix\n",segments, rvec_num);
}
;
Modified: trunk/daemon/configuration.c
===================================================================
--- trunk/daemon/configuration.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/configuration.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -80,8 +80,8 @@
#include "conf_body.h"
#undef ext_conf_body
-#include "alarm.h"
-#include "memory.h"
+#include "spu_alarm.h"
+#include "spu_memory.h"
#include "spread_params.h"
static proc My;
@@ -153,11 +153,11 @@
Config = Mem_alloc( sizeof( configuration ) );
if (Config == NULL) {
- Alarmp( SPLOG_FATAL, CONF, "Conf_init: Failed to allocate memory for configuration structure\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration structure\n");
}
Config_procs = Mem_alloc( MAX_PROCS_RING * sizeof( proc ) );
if (Config_procs == NULL) {
- Alarmp( SPLOG_FATAL, CONF, "Conf_init: Failed to allocate memory for configuration procs array\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration procs array\n");
}
Conf_load_conf_file( file_name, my_name);
@@ -223,11 +223,11 @@
Config_Previous = Mem_alloc( sizeof( configuration ) );
if (Config_Previous == NULL) {
- Alarmp( SPLOG_FATAL, CONF, "Conf_reload_initiate: Failed to allocate memory for old configuration structure\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration structure\n");
}
Config_Previous_Procs = Mem_alloc( MAX_PROCS_RING * sizeof( proc ) );
if (Config_Previous_Procs == NULL) {
- Alarmp( SPLOG_FATAL, CONF, "Conf_reload_initiate: Failed to allocate memory for old configuration procs array\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration procs array\n");
}
Conf_config_copy( Config, Config_Previous, Config_procs, Config_Previous_Procs );
@@ -241,10 +241,10 @@
*/
if ( Conf_proc_by_id( My.id, &np ) < 0 ) {
/* I am no longer in config */
- Alarmp(SPLOG_FATAL, CONF, "Conf_reload_initiate: I (%d.%d.%d.%d) am no longer in config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
+ Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: I (%d.%d.%d.%d) am no longer in config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
}
if ( Conf_prev_proc_by_id( My.id, &op ) < 0 ) {
- Alarmp(SPLOG_FATAL, CONF, "Conf_reload_initiate: BUG! I (%d.%d.%d.%d) am not in previous config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
+ Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: BUG! I (%d.%d.%d.%d) am not in previous config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
}
if ( strncmp( np.name, op.name, MAX_PROC_NAME ) ||
@@ -252,7 +252,7 @@
(Config->segments[np.seg_index].bcast_address != Config_Previous->segments[op.seg_index].bcast_address) )
{
/* My identity has changed so exit */
- Alarmp( SPLOG_FATAL, CONF, "Conf_reload_initiate: My identity has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address), IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: My identity has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address), IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
}
/* Check interfaces are identical */
for (i = 0 ; i < np.num_if; i++) {
@@ -260,7 +260,7 @@
(np.ifc[i].port != op.ifc[i].port) ||
(np.ifc[i].type != op.ifc[i].type) )
{
- Alarmp( SPLOG_FATAL, CONF, "Conf_reload_initiate: My interface spec has changed so must exit: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: My interface spec has changed so must exit: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
}
}
/* Check if only new configuration contains only additions and subtractions of daemons and no changes */
@@ -268,7 +268,7 @@
{
np = Config_procs[pi];
if ( Conf_prev_proc_by_id( np.id, &op ) < 0 ) {
- Alarmp( SPLOG_INFO, CONF, "Conf_reload_initiate: Config Added daemon at %d.%d.%d.%d \n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id));
+ Alarmp( SPLOG_INFO, CONF_SYS, "Conf_reload_initiate: Config Added daemon at %d.%d.%d.%d \n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id));
} else {
/* compare proc entries to check if identical */
if ( strncmp( np.name, op.name, MAX_PROC_NAME ) ||
@@ -276,7 +276,7 @@
(Config->segments[np.seg_index].bcast_address != Config_Previous->segments[op.seg_index].bcast_address) )
{
need_partition = TRUE;
- Alarmp( SPLOG_DEBUG, CONF, "Conf_reload_initiate: identity of daemon %d.%d.%d.%d has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address), IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: identity of daemon %d.%d.%d.%d has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address), IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
}
/* Check interfaces are identical */
for (i = 0 ; i < np.num_if; i++) {
@@ -285,7 +285,7 @@
(np.ifc[i].type != op.ifc[i].type) )
{
need_partition = TRUE;
- Alarmp( SPLOG_DEBUG, CONF, "Conf_reload_initiate: daemon interface spec for %d.%d.%d.%d has changed.: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: daemon interface spec for %d.%d.%d.%d has changed.: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
}
}
} /* else */
@@ -298,7 +298,7 @@
Config_Previous = NULL;
Config_Previous_Procs = NULL;
- Alarmp( SPLOG_DEBUG, CONF, "Conf_reload_initiate: Return need_partition = %d\n", need_partition);
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: Return need_partition = %d\n", need_partition);
return(need_partition);
}
@@ -331,12 +331,12 @@
if (curlen > strsize) {
/* ran out of space in string -- should never happen. */
- Alarmp( SPLOG_ERROR, CONF, "The conf hash string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
- Alarmp( SPLOG_ERROR, CONF, "The error occured when adding the version number. Successful string was: %s\n", segstr);
+ Alarmp( SPLOG_ERROR, CONF_SYS, "The conf hash string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
+ Alarmp( SPLOG_ERROR, CONF_SYS, "The error occured when adding the version number. Successful string was: %s\n", segstr);
return(-1);
}
- Alarmp( SPLOG_DEBUG, CONF, "The version string is %d characters long:\n%s", curlen, segstr);
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "The version string is %d characters long:\n%s", curlen, segstr);
return(curlen);
}
@@ -398,22 +398,22 @@
Alarmp( SPLOG_PRINT, PRINT, "Conf_load_conf_file: Invalid configuration:\n");
Conf_print( Config );
Alarmp( SPLOG_PRINT, PRINT, "\n");
- Alarmp( SPLOG_FATAL, CONF, "Conf_load_conf_file: Localhost segments can not be used along with regular network address segments.\nMost likely you need to remove or comment out the \nSpread_Segment 127.0.0.255 {...}\n section of your configuration file.\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: Localhost segments can not be used along with regular network address segments.\nMost likely you need to remove or comment out the \nSpread_Segment 127.0.0.255 {...}\n section of your configuration file.\n");
}
}
/* Add Spread daemon version number to hash string */
added_len = conf_convert_version_to_string(&ConfStringRep[ConfStringLen], MAX_CONF_STRING - ConfStringLen );
if (added_len == -1 )
- Alarmp( SPLOG_FATAL, CONF, "Failed to update string with version number!\n");
+ Alarmp( SPLOG_FATAL, CONF_SYS, "Failed to update string with version number!\n");
ConfStringLen += added_len;
/* calculate hash value of configuration.
* This daemon will only work with other daemons who have an identical hash value.
*/
Config->hash_code = conf_hash_string(ConfStringRep, ConfStringLen);
- Alarmp( SPLOG_DEBUG, CONF, "Full hash string is %d characters long:\n%s", ConfStringLen, ConfStringRep);
- Alarmp( SPLOG_INFO, CONF, "Hash value for this configuration is: %u\n", Config->hash_code);
+ Alarmp( SPLOG_DEBUG, CONF_SYS, "Full hash string is %d characters long:\n%s", ConfStringLen, ConfStringRep);
+ Alarmp( SPLOG_INFO, CONF_SYS, "Hash value for this configuration is: %u\n", Config->hash_code);
/* Match my IP address to entry in configuration file */
if( my_name == NULL ){
@@ -452,7 +452,7 @@
name_len = strlen( machine_name );
if( name_len > sizeof(My.name) ) name_len = sizeof(My.name);
memcpy(My.name, machine_name, name_len );
- Alarm( CONF, "Conf_load_conf_file: My name: %s, id: %d\n",
+ Alarm( CONF_SYS, "Conf_load_conf_file: My name: %s, id: %d\n",
My.name, My.id );
return;
}else{
@@ -467,7 +467,7 @@
}
Conf_id_to_str( My.id, ip );
- Alarm( CONF, "Conf_load_conf_file: My name: %s, id: %s, port: %hd\n",
+ Alarm( CONF_SYS, "Conf_load_conf_file: My name: %s, id: %s, port: %hd\n",
My.name, ip, My.port );
return;
@@ -847,10 +847,10 @@
void Conf_set_max_session_messages(int max_messages)
{
if (max_messages < 0) {
- Alarmp(SPLOG_ERROR, CONF, "Conf_set_max_session_messages: Attempt to set max_message to less then zero. Resetting to default value of %d\n", DEFAULT_MAX_SESSION_MESSAGES);
+ Alarmp(SPLOG_ERROR, CONF_SYS, "Conf_set_max_session_messages: Attempt to set max_message to less then zero. Resetting to default value of %d\n", DEFAULT_MAX_SESSION_MESSAGES);
max_messages = DEFAULT_MAX_SESSION_MESSAGES;
}
- Alarmp(SPLOG_DEBUG, CONF, "Conf_set_max_session_messages: Set Max Session Messages to %d\n", max_messages);
+ Alarmp(SPLOG_DEBUG, CONF_SYS, "Conf_set_max_session_messages: Set Max Session Messages to %d\n", max_messages);
MaxSessionMessages = max_messages;
}
Deleted: trunk/daemon/data_link.c
===================================================================
--- trunk/daemon/data_link.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/data_link.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,387 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#include <stdlib.h>
-#include "arch.h"
-
-#ifndef ARCH_PC_WIN95
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/uio.h>
-/* for select */
-#include <sys/time.h>
-#include <unistd.h>
-
-#include <errno.h>
-#else /* ARCH_PC_WIN95 */
-
-#include <winsock.h>
-
-#endif /* ARCH_PC_WIN95 */
-
-#include <string.h>
-#include <assert.h>
-#include "data_link.h"
-#include "status.h"
-#include "alarm.h"
-#include "sp_events.h" /* for sp_time */
-
-channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address )
-{
- channel chan;
- struct sockaddr_in soc_addr;
- int on=1;
-#ifdef IP_MULTICAST_TTL
- unsigned char ttl_val;
-#endif
-
- if((chan = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
- Alarm( EXIT, "DL_init_channel: socket error for port %d\n", port );
-
- if ( channel_type & SEND_CHANNEL )
- {
- if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on,
- sizeof(on)) < 0)
- Alarm( EXIT, "DL_init_channel: setsockopt error for port %d\n",port);
- Alarm( DATA_LINK, "DL_init_channel: setsockopt for send and broadcast went ok\n");
-
-#ifdef IP_MULTICAST_TTL
- /* ### Isn't this for sending??? */
- ttl_val = 1;
- if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&ttl_val,
- sizeof(ttl_val)) < 0)
- {
- Alarm( DATA_LINK, "DL_init_channel: problem in setsockopt of multicast ttl %d - ignore in WinNT or Win95\n", ttl_val );
- }
- Alarm( DATA_LINK, "DL_init_channel: setting Mcast TTL to %d\n",ttl_val);
-#endif
- }
-
- if ( channel_type & RECV_CHANNEL )
- {
- memset(&soc_addr, 0, sizeof(soc_addr));
- soc_addr.sin_family = AF_INET;
- soc_addr.sin_port = htons(port);
- memset(&soc_addr.sin_zero, 0, sizeof(soc_addr.sin_zero));
-#ifdef HAVE_SIN_LEN_IN_STRUCT_SOCKADDR_IN
- soc_addr.sin_len = sizeof(soc_addr);
-#endif
- if (interface_address == 0)
- soc_addr.sin_addr.s_addr= INADDR_ANY;
- else
- soc_addr.sin_addr.s_addr= htonl(interface_address);
-
- if ( channel_type & REUSE_ADDR )
- {
- if(setsockopt(chan, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) < 0)
- {
- Alarm( EXIT, "DL_init_channel: Failed to set socket option REUSEADDR, errno: %d\n", errno);
- }
- }
-
-
- if(bind( chan, (struct sockaddr *) &soc_addr,
- sizeof(soc_addr)) == -1)
- {
- Alarm( EXIT, "DL_init_channel: bind error (%d): %s for port %d, with sockaddr (" IPF ": %d) probably already running\n", sock_errno, sock_strerror(sock_errno), port, IP_NET(soc_addr.sin_addr.s_addr), ntohs(soc_addr.sin_port));
- }
- Alarm( DATA_LINK, "DL_init_channel: bind for recv_channel for " IPF " port %d with chan %d ok\n",
- IP_NET(soc_addr.sin_addr.s_addr), port, chan);
-
- if( IS_MCAST_ADDR(mcast_address) )
- {
-#ifdef IP_MULTICAST_TTL
- struct ip_mreq mreq;
-
- mreq.imr_multiaddr.s_addr = htonl( mcast_address );
-
- /* the interface could be changed to a specific interface if needed */
- mreq.imr_interface.s_addr = INADDR_ANY;
-
- if (setsockopt(chan, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mreq,
- sizeof(mreq)) < 0)
- {
- Alarm( EXIT, "DL_init_channel: problem in setsockopt to multicast address " IPF "\n", IP(mcast_address) );
- }
-
- Alarm( DATA_LINK, "DL_init_channel: Joining multicast address " IPF " went ok\n", IP(mcast_address) );
-#else /* no multicast support */
- Alarm( EXIT, "DL_init_channel: Old SunOS architecture does not support IP multicast: " IPF "\n", IP(mcast_address));
-#endif
- } else {
- if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on,
- sizeof(on)) < 0)
- Alarm( EXIT, "DL_init_channel: setsockopt SO_BROADCAST error for port %d, socket %d\n",port,chan);
- Alarm( DATA_LINK, "DL_init_channel: setsockopt for recv and broadcast went ok\n");
- }
- }
-
- Alarm( DATA_LINK, "DL_init_channel: went ok on channel %d\n",chan);
- return ( chan );
-}
-
-void DL_close_channel(channel chan)
-{
-
- if( -1 == close(chan))
- {
- Alarm(EXIT, "DL_close_channel: error closing channel %d\n", chan);
- }
-
-}
-int DL_send( channel chan, int32 address, int16 port, sys_scatter *scat )
-{
-
-#ifndef ARCH_SCATTER_NONE
- struct msghdr msg;
-#else /* ARCH_SCATTER_NONE */
- char pseudo_scat[MAX_PACKET_SIZE];
-#endif /* ARCH_SCATTER_NONE */
-
- struct sockaddr_in soc_addr;
- struct timeval select_delay = { 0, 10000 };
- int ret;
- int total_len;
- int i;
- int num_try;
- char *send_errormsg = NULL; /* fool compiler */
-
- /* Check that the scatter passed is small enough to be a valid system scatter */
- assert(scat->num_elements <= ARCH_SCATTER_SIZE);
-
- memset(&soc_addr, 0, sizeof(soc_addr));
- soc_addr.sin_family = AF_INET;
- soc_addr.sin_addr.s_addr= htonl(address);
- soc_addr.sin_port = htons(port);
-
-#ifdef HAVE_SIN_LEN_IN_STRUCT_SOCKADDR_IN
- soc_addr.sin_len = sizeof(soc_addr);
-#endif
-
-#ifdef ARCH_PC_HOME
- soc_addr.sin_addr.s_addr= htonl(-1073741814);
-#endif /* ARCH_PC_HOME */
-
-#ifndef ARCH_SCATTER_NONE
- memset(&msg, 0, sizeof(msg));
- msg.msg_name = (caddr_t) &soc_addr;
- msg.msg_namelen = sizeof(soc_addr);
- msg.msg_iov = (struct iovec *)scat->elements;
- msg.msg_iovlen = scat->num_elements;
-#endif /* ARCH_SCATTER_NONE */
-
-#ifdef ARCH_SCATTER_CONTROL
- msg.msg_controllen = 0;
-#endif /* ARCH_SCATTER_CONTROL */
-#ifdef ARCH_SCATTER_ACCRIGHTS
- msg.msg_accrightslen = 0;
-#endif /* ARCH_SCATTER_ACCRIGHTS */
-
- for( i=0, total_len=0; i < scat->num_elements; i++)
- {
-#ifdef ARCH_SCATTER_NONE
- memcpy( &pseudo_scat[total_len], scat->elements[i].buf,
- scat->elements[i].len );
-#endif /* ARCH_SCATTER_NONE */
- total_len+=scat->elements[i].len;
- }
-#if 0
-#ifndef ARCH_SCATTER_NONE
- if( msg.msg_iovlen > 16)
- {
- Alarm(EXIT, "Too Big iovec of size %d\n", msg.msg_iovlen);
- }
-#endif
-#endif
- for( ret=-10, num_try=0; ret < 0 && num_try < 10; num_try++ )
- {
-#ifndef ARCH_SCATTER_NONE
- ret = sendmsg(chan, &msg, 0);
-#else /* ARCH_SCATTER_NONE */
- ret = sendto(chan, pseudo_scat, total_len, 0,
- (struct sockaddr *)&soc_addr, sizeof(soc_addr) );
-#endif /* ARCH_SCATTER_NONE */
- if(ret < 0) {
- /* delay for a short while */
- send_errormsg = sock_strerror(sock_errno);
- Alarm( DATA_LINK, "DL_send: delaying after failure in send to " IPF ", ret is %d\n", IP(address), ret);
- select( 0, 0, 0, 0, &select_delay );
- select_delay.tv_sec = 0;
- select_delay.tv_usec = 10000;
- }
- }
- if (ret < 0)
- {
- for( i=0; i < scat->num_elements; i++)
- Alarm( DATA_LINK, "DL_send: element[%d]: %d bytes\n",
- i,scat->elements[i].len);
- Alarm( DATA_LINK, "DL_send: error: %s\n sending %d bytes on channel %d to address " IPF "\n",
- send_errormsg, total_len,chan,IP(address) );
- }else if(ret < total_len){
- Alarm( DATA_LINK, "DL_send: partial sending %d out of %d\n",
- ret,total_len);
- }
- Alarm( DATA_LINK, "DL_send: sent a message of %d bytes to (" IPF ":%d) on channel %d\n",
- ret,IP(address),port,chan);
-
- return(ret);
-}
-
-int DL_recv( channel chan, sys_scatter *scat )
-{
- int ret;
- ret = DL_recvfrom( chan, scat, NULL, NULL );
-
- return(ret);
-}
-
-int DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port )
-{
-#ifndef ARCH_SCATTER_NONE
-static struct msghdr msg;
-#else /* ARCH_SCATTER_NONE */
-static char pseudo_scat[MAX_PACKET_SIZE];
- int bytes_to_copy;
- int total_len;
- int start;
- int i;
-#endif /* ARCH_SCATTER_NONE */
- struct sockaddr_in source_address;
- int sip;
- unsigned short sport;
- socklen_t sa_len;
- int ret;
-
- /* check the scat is small enough to be a sys_scatter */
- assert(scat->num_elements <= ARCH_SCATTER_SIZE);
-
-#ifndef ARCH_SCATTER_NONE
- msg.msg_name = (caddr_t) &source_address;
- msg.msg_namelen = sizeof(source_address);
- msg.msg_iov = (struct iovec *)scat->elements;
- msg.msg_iovlen = scat->num_elements;
-#endif /* ARCH_SCATTER_NONE */
-
-#ifdef ARCH_SCATTER_CONTROL
- msg.msg_control = (caddr_t) 0;
- msg.msg_controllen = 0;
-#endif /* ARCH_SCATTER_CONTROL */
-#ifdef ARCH_SCATTER_ACCRIGHTS
- msg.msg_accrights = (caddr_t) 0;
- msg.msg_accrightslen = 0;
-#endif /* ARCH_SCATTER_ACCRIGHTS */
-
-#ifndef ARCH_SCATTER_NONE
- ret = recvmsg( chan, &msg, 0 );
- sa_len = msg.msg_namelen;
-#else /* ARCH_SCATTER_NONE */
-
- total_len = 0; /*This is for TCP, to not receive*/
- for(i=0; i<scat->num_elements; i++) /*more than one packet. */
- total_len += scat->elements[i].len;
-
- if(total_len>MAX_PACKET_SIZE)
- total_len = MAX_PACKET_SIZE;
-
- sa_len = sizeof(source_address);
- ret = recvfrom( chan, pseudo_scat, total_len, 0, &source_address, &sa_len);
-
- for( i=0, total_len = ret, start =0; total_len > 0; i++)
- {
- bytes_to_copy = scat->elements[i].len;
- if( bytes_to_copy > total_len ) bytes_to_copy = total_len;
- memcpy( scat->elements[i].buf, &pseudo_scat[start],
- bytes_to_copy );
- total_len-= scat->elements[i].len;
- start += scat->elements[i].len;
- }
-#endif /* ARCH_SCATTER_NONE */
- if (ret < 0)
- {
- Alarm( DATA_LINK, "DL_recv: error %d receiving on channel %d\n", ret, chan );
- return( -1 );
- }
-#ifdef ARCH_SCATTER_CONTROL
- else if (ret == 0)
- {
- char *sptr;
- sptr = (char *) inet_ntoa(source_address.sin_addr);
- Alarm( DATA_LINK, "DL_recv: received zero length packet on channel %d flags 0x%x\nfrom %s", chan, msg.msg_flags,sptr );
-#ifdef MSG_BCAST
- if ( msg.msg_flags & MSG_BCAST )
- {
- Alarm( DATA_LINK, "\t(BROADCAST)");
- }
-#endif
-#ifdef MSG_MCAST
- if ( msg.msg_flags & MSG_MCAST )
- {
- Alarm( DATA_LINK, "\t(MULTICAST)");
- }
-#endif
-#ifdef MSG_TRUNC
- if ( msg.msg_flags & MSG_TRUNC )
- {
- Alarm( DATA_LINK, "\t(Data TRUNCATED)");
- }
-#endif
-#ifdef MSG_CTRUNC
- if ( msg.msg_flags & MSG_CTRUNC )
- {
- Alarm( DATA_LINK, "\t(Control TRUNCATED)");
- }
-#endif
- Alarm( DATA_LINK, "\n");
- }
-#endif
- /* Report the source address and port if requested by caller */
- if (sa_len >= sizeof(struct sockaddr_in) ) {
- memcpy(&sip, &source_address.sin_addr, sizeof(int32) );
- sip = Flip_int32(sip);
- if (src_address != NULL)
- *src_address = sip;
- sport = Flip_int16(source_address.sin_port);
- if (src_port != NULL)
- *src_port = sport;
- Alarm( DATA_LINK, "\tfrom (" IPF ") with family %d port %d\n", IP(sip), source_address.sin_family, sport );
- }
- Alarm( DATA_LINK, "DL_recv: received %d bytes on channel %d\n",
- ret, chan );
-
- return(ret);
-}
Deleted: trunk/daemon/data_link.h
===================================================================
--- trunk/daemon/data_link.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/data_link.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,58 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#ifndef INC_DATA_LINK
-#define INC_DATA_LINK
-
-#include "arch.h"
-#include "scatter.h"
-
-#define MAX_PACKET_SIZE 1472 /*1472 = 1536-64 (of udp)*/
-
-#define SEND_CHANNEL 0x00000001
-#define RECV_CHANNEL 0x00000002
-#define RESERVED 0x00000004
-#define REUSE_ADDR 0x00000008
-
-#define IS_MCAST_ADDR(addr) ( ( (addr) & 0xF0000000 ) == 0xE0000000 )
-#define IS_MCAST_ADDR_NET(addr) ( ( (unsigned char*) &(addr) )[0] == 0xE0 )
-
-channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address );
-void DL_close_channel(channel chan);
-int DL_send( channel chan, int32 address, int16 port, sys_scatter *scat );
-int DL_recv( channel chan, sys_scatter *scat );
-int DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port );
-
-#endif /* INC_DATA_LINK */
Deleted: trunk/daemon/events.c
===================================================================
--- trunk/daemon/events.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/events.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,790 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#include "arch.h"
-
-/* undef redefined variables under windows */
-#ifdef ARCH_PC_WIN95
-#undef EINTR
-#undef EAGAIN
-#undef EWOULDBLOCK
-#undef EINPROGRESS
-#endif
-#include <errno.h>
-
-#ifndef ARCH_PC_WIN95
-
-#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#else /* ARCH_PC_WIN95 */
-
-#include <winsock.h>
-#include <sys/timeb.h>
-
-#endif /* ARCH_PC_WIN95 */
-
-#include <string.h>
-#include "sp_events.h"
-#include "objects.h" /* For memory */
-#include "memory.h" /* for memory */
-#include "alarm.h"
-
-typedef struct dummy_t_event {
- sp_time t;
- void (* func)( int code, void *data );
- int code;
- void *data;
- struct dummy_t_event *next;
-} time_event;
-
-typedef struct dummy_fd_event {
- int fd;
- int fd_type;
- void (* func)( mailbox mbox, int code, void *data );
- int code;
- void *data;
- int active; /* true if active, false if inactive */
-} fd_event;
-
-typedef struct dummy_fd_queue {
- int num_fds;
- int num_active_fds;
- fd_event events[MAX_FD_EVENTS];
-} fd_queue;
-
-static sp_time E_get_time_monotonic(void);
-
-static time_event *Time_queue;
-static sp_time Now;
-
-static fd_queue Fd_queue[NUM_PRIORITY];
-static fd_set Fd_mask[NUM_FDTYPES];
-static int Active_priority;
-static int Exit_events;
-
-int E_init(void)
-{
- int i,ret;
-
- Time_queue = NULL;
-
- ret = Mem_init_object(TIME_EVENT, sizeof(time_event), 100,0);
- if (ret < 0)
- {
- Alarm(EXIT, "E_Init: Failure to Initialize TIME_EVENT memory objects\n");
- }
-
- for ( i=0; i < NUM_PRIORITY; i++ )
- {
- Fd_queue[i].num_fds = 0;
- Fd_queue[i].num_active_fds = 0;
- }
- for ( i=0; i < NUM_FDTYPES; i++ )
- {
- FD_ZERO( &Fd_mask[i] );
- }
- Active_priority = LOW_PRIORITY;
-
- E_get_time_monotonic();
-
- Alarm( EVENTS, "E_init: went ok\n");
-
- return( 0 );
-}
-
-sp_time E_get_time(void)
-{
- sp_time t;
-
-#ifndef ARCH_PC_WIN95
- struct timeval read_time;
-
-#if HAVE_STRUCT_TIMEZONE
- struct timezone dummy_tz;
-#else
- sp_time dummy_tz;
-#endif
- int ret;
-
- ret = gettimeofday( &read_time, &dummy_tz );
- if ( ret < 0 ) Alarm( EXIT, "E_get_time: gettimeofday problems.\n" );
- t.sec = read_time.tv_sec;
- t.usec = read_time.tv_usec;
-
-#else /* ARCH_PC_WIN95 */
-
- struct _timeb timebuffer;
-
- _ftime( &timebuffer );
-
- t.sec = timebuffer.time;
- t.usec = timebuffer.millitm;
- t.usec *= 1000;
-
-#endif /* ARCH_PC_WIN95 */
-#if 0
- Alarm( EVENTS, "E_get_time: time is (%d, %d)\n", t.sec, t.usec);
-#endif
- return ( t );
-}
-
-static sp_time E_get_time_monotonic(void)
-#ifdef HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC
-{
- struct timespec t;
-
- if (clock_gettime(CLOCK_MONOTONIC, &t) != 0) {
- Alarm( EXIT, "E_get_time_monotonic: clock_gettime problems: %d '%s'\n", errno, strerror(errno) );
- }
-
- Now.sec = t.tv_sec;
- Now.usec = (t.tv_nsec + 500) / 1000;
-
- return Now;
-}
-#else
-{
- Now = E_get_time();
-
- return Now;
-}
-#endif
-
-sp_time E_sub_time( sp_time t, sp_time delta_t )
-{
- sp_time res;
-
- res.sec = t.sec - delta_t.sec;
- res.usec = t.usec - delta_t.usec;
- if ( res.usec < 0 )
- {
- res.usec = res.usec + 1000000;
- res.sec--;
- }
- if ( res.sec < 0 ) Alarm( EVENTS, "E_sub_time: negative time result.\n");
- return ( res );
-}
-
-sp_time E_add_time( sp_time t, sp_time delta_t )
-{
- sp_time res;
-
- res.sec = t.sec + delta_t.sec;
- res.usec = t.usec + delta_t.usec;
- if ( res.usec > 1000000 )
- {
- res.usec = res.usec - 1000000;
- res.sec++;
- }
- return ( res );
-}
-
-int E_compare_time( sp_time t1, sp_time t2 )
-{
- if ( t1.sec > t2.sec ) return ( 1 );
- else if ( t1.sec < t2.sec ) return ( -1 );
- else if ( t1.usec > t2.usec ) return ( 1 );
- else if ( t1.usec < t2.usec ) return ( -1 );
- else return ( 0 );
-}
-
-int E_queue( void (* func)( int code, void *data ), int code, void *data,
- sp_time delta_time )
-{
- time_event *t_pre;
- time_event *t_post;
- time_event *t_e;
- int inserted;
- int deleted;
- int compare;
-
- t_e = new( TIME_EVENT );
-
- t_e->t = E_add_time( E_get_time_monotonic(), delta_time );
- t_e->func = func;
- t_e->code = code;
- t_e->data = data;
- deleted = 0;
- inserted = 0;
-
- if( Time_queue != NULL )
- {
- if( Time_queue->func == t_e->func &&
- Time_queue->data == t_e->data &&
- Time_queue->code == t_e->code )
- {
- t_pre = Time_queue;
- Time_queue = Time_queue->next;
- dispose( t_pre );
- deleted = 1;
- Alarm( EVENTS, "E_queue: dequeued a (first) simillar event\n" );
- }
- }
- if( Time_queue == NULL )
- {
- t_e->next = NULL;
- Time_queue = t_e;
- Alarm( EVENTS, "E_queue: (only) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
- return( 0 );
- }else{
- compare = E_compare_time ( t_e->t, Time_queue->t );
- if( compare < 0 )
- {
- t_e->next = Time_queue;
- Time_queue = t_e;
- inserted = 1;
- Alarm( EVENTS, "E_queue: (first) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
- }
- }
- t_pre = Time_queue ;
- t_post = Time_queue->next;
- while ( t_post != NULL && ( !inserted || !deleted ) )
- {
- if( t_post->func == t_e->func &&
- t_post->data == t_e->data &&
- t_post->code == t_e->code )
- {
- t_pre->next = t_post->next;
- dispose( t_post );
- t_post = t_pre->next;
- deleted = 1;
- Alarm( EVENTS, "E_queue: dequeued a simillar event\n" );
- continue;
- }
-
- if ( !inserted )
- {
- compare = E_compare_time ( t_e->t, t_post->t );
- if( compare < 0 )
- {
- t_pre->next = t_e;
- t_e->next = t_post;
- inserted = 1;
- Alarm( EVENTS, "E_queue: event queued for func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
- }
- }
-
- t_pre = t_post;
- t_post = t_post->next;
- }
-
- if( !inserted )
- {
- t_pre->next = t_e;
- t_e->next = NULL;
- Alarm( EVENTS, "E_queue: (last) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
- }
-
- return( 0 );
-}
-
-int E_dequeue( void (* func)( int code, void *data ), int code,
- void *data )
-{
- time_event *t_pre;
- time_event *t_ptr;
-
- if( Time_queue == NULL )
- {
- Alarm( EVENTS, "E_dequeue: no such event\n" );
- return( -1 );
- }
-
- if( Time_queue->func == func &&
- Time_queue->data == data &&
- Time_queue->code == code )
- {
- t_ptr = Time_queue;
- Time_queue = Time_queue->next;
- dispose( t_ptr );
- Alarm( EVENTS, "E_dequeue: first event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
- return( 0 );
- }
-
- t_pre = Time_queue;
- while ( t_pre->next != NULL )
- {
- t_ptr = t_pre->next;
- if( t_ptr->func == func &&
- t_ptr->data == data &&
- t_ptr->code == code )
- {
- t_pre->next = t_ptr->next;
- dispose( t_ptr );
- Alarm( EVENTS, "E_dequeue: event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
- return( 0 );
- }
- t_pre = t_ptr;
- }
-
- Alarm( EVENTS, "E_dequeue: no such event\n" );
- return( -1 );
-}
-
-void E_delay( sp_time t )
-{
- struct timeval tmp_t;
-
- tmp_t.tv_sec = t.sec;
- tmp_t.tv_usec = t.usec;
-
-#ifndef ARCH_PC_WIN95
- if (select(0, NULL, NULL, NULL, &tmp_t ) < 0)
- {
- Alarm( EVENTS, "E_delay: select delay returned error: %s\n", strerror(errno));
- }
-#else /* ARCH_PC_WIN95 */
- SleepEx( tmp_t.tv_sec*1000+tmp_t.tv_usec/1000, 0 );
-#endif /* ARCH_PC_WIN95 */
-
-}
-
-int E_attach_fd( int fd, int fd_type,
- void (* func)( mailbox mbox, int code, void *data ),
- int code, void *data, int priority )
-{
- int num_fds;
- int j;
-
- if( priority < 0 || priority > NUM_PRIORITY )
- {
- Alarm( PRINT, "E_attach_fd: invalid priority %d for fd %d with fd_type %d\n", priority, fd, fd_type );
- return( -1 );
- }
- if( fd_type < 0 || fd_type > NUM_FDTYPES )
- {
- Alarm( PRINT, "E_attach_fd: invalid fd_type %d for fd %d with priority %d\n", fd_type, fd, priority );
- return( -1 );
- }
-#ifndef ARCH_PC_WIN95
- /* Windows bug: Reports FD_SETSIZE of 64 but select works on all
- * fd's even ones with numbers greater then 64.
- */
- if( fd < 0 || fd > FD_SETSIZE )
- {
- Alarm( PRINT, "E_attach_fd: invalid fd %d (max %d) with fd_type %d with priority %d\n", fd, FD_SETSIZE, fd_type, priority );
- return( -1 );
- }
-#endif
- for( j=0; j < Fd_queue[priority].num_fds; j++ )
- {
- if( ( Fd_queue[priority].events[j].fd == fd ) && ( Fd_queue[priority].events[j].fd_type == fd_type ) )
- {
- Fd_queue[priority].events[j].func = func;
- Fd_queue[priority].events[j].code = code;
- Fd_queue[priority].events[j].data = data;
- if ( !(Fd_queue[priority].events[j].active) )
- Fd_queue[priority].num_active_fds++;
- Fd_queue[priority].events[j].active = TRUE;
- Alarm( PRINT,
- "E_attach_fd: fd %d with type %d exists & replaced & activated\n", fd, fd_type );
- return( 1 );
- }
- }
- num_fds = Fd_queue[priority].num_fds;
-
- if ( num_fds == MAX_FD_EVENTS ) {
- Alarm( PRINT, "E_attach_fd: Reached Maximum number of events. Recompile with larger MAX_FD_EVENTS\n");
- return( -1 );
- }
- Fd_queue[priority].events[num_fds].fd = fd;
- Fd_queue[priority].events[num_fds].fd_type = fd_type;
- Fd_queue[priority].events[num_fds].func = func;
- Fd_queue[priority].events[num_fds].code = code;
- Fd_queue[priority].events[num_fds].data = data;
- Fd_queue[priority].events[num_fds].active = TRUE;
- Fd_queue[priority].num_fds++;
- Fd_queue[priority].num_active_fds++;
- if( Active_priority <= priority ) FD_SET( fd, &Fd_mask[fd_type] );
-
- Alarm( EVENTS, "E_attach_fd: fd %d, fd_type %d, code %d, data 0x%x, priority %d Active_priority %d\n",
- fd, fd_type, code, data, priority, Active_priority );
-
- return( 0 );
-}
-
-int E_detach_fd( int fd, int fd_type )
-{
- int i,j;
- int found;
-
- if( fd_type < 0 || fd_type > NUM_FDTYPES )
- {
- Alarm( PRINT, "E_detach_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
- return( -1 );
- }
-
- found = 0;
- for( i=0; i < NUM_PRIORITY; i++ )
- for( j=0; j < Fd_queue[i].num_fds; j++ )
- {
- if( ( Fd_queue[i].events[j].fd == fd ) && ( Fd_queue[i].events[j].fd_type == fd_type ) )
- {
- if (Fd_queue[i].events[j].active)
- Fd_queue[i].num_active_fds--;
- Fd_queue[i].num_fds--;
- Fd_queue[i].events[j] = Fd_queue[i].events[Fd_queue[i].num_fds];
-
- FD_CLR( fd, &Fd_mask[fd_type] );
- found = 1;
-
- break; /* from the j for only */
- }
- }
-
- if( ! found ) return( -1 );
-
- return( 0 );
-}
-
-int E_deactivate_fd( int fd, int fd_type )
-{
- int i,j;
- int found;
-
- if( fd_type < 0 || fd_type > NUM_FDTYPES )
- {
- Alarm( PRINT, "E_deactivate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
- return( -1 );
- }
-
- found = 0;
-
- for( i=0; i < NUM_PRIORITY; i++ )
- for( j=0; j < Fd_queue[i].num_fds; j++ )
- {
- if( ( Fd_queue[i].events[j].fd == fd ) && ( Fd_queue[i].events[j].fd_type == fd_type ) )
- {
- if (Fd_queue[i].events[j].active)
- Fd_queue[i].num_active_fds--;
- Fd_queue[i].events[j].active = FALSE;
- FD_CLR( fd, &Fd_mask[fd_type] );
- found = 1;
-
- break; /* from the j for only */
- }
- }
-
- if( ! found ) return( -1 );
- return( 0 );
-}
-
-int E_activate_fd( int fd, int fd_type )
-{
- int i,j;
- int found;
-
- if( fd_type < 0 || fd_type > NUM_FDTYPES )
- {
- Alarm( PRINT, "E_activate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
- return( -1 );
- }
-
- found = 0;
-
- for( i=0; i < NUM_PRIORITY; i++ )
- for( j=0; j < Fd_queue[i].num_fds; j++ )
- {
- if( ( Fd_queue[i].events[j].fd == fd ) && ( Fd_queue[i].events[j].fd_type == fd_type ) )
- {
- if ( !(Fd_queue[i].events[j].active) )
- Fd_queue[i].num_active_fds++;
- Fd_queue[i].events[j].active = TRUE;
- if( i >= Active_priority ) FD_SET( fd, &Fd_mask[ fd_type ] );
- found = 1;
-
- break; /* from the j for only */
- }
- }
-
- if( ! found ) return( -1 );
- return( 0 );
-}
-
-int E_set_active_threshold( int priority )
-{
- int fd_type;
- int i,j;
-
- if( priority < 0 || priority > NUM_PRIORITY )
- {
- Alarm( PRINT, "E_set_active_threshold: invalid priority %d\n", priority );
- return( -1 );
- }
-
- if( priority == Active_priority ) return( priority );
-
- Active_priority = priority;
- for ( i=0; i < NUM_FDTYPES; i++ )
- {
- FD_ZERO( &Fd_mask[i] );
- }
-
- for( i = priority; i < NUM_PRIORITY; i++ )
- for( j=0; j < Fd_queue[i].num_fds; j++ )
- {
- fd_type = Fd_queue[i].events[j].fd_type;
- if (Fd_queue[i].events[j].active)
- FD_SET( Fd_queue[i].events[j].fd, &Fd_mask[fd_type] );
- }
-
- Alarm( EVENTS, "E_set_active_threshold: changed to %d\n",Active_priority);
-
- return( priority );
-}
-
-int E_num_active( int priority )
-{
- if( priority < 0 || priority > NUM_PRIORITY )
- {
- Alarm( PRINT, "E_num_active: invalid priority %d\n", priority );
- return( -1 );
- }
- return( Fd_queue[priority].num_active_fds );
-}
-
-void E_handle_events(void)
-{
-static int Round_robin = 0;
-static const sp_time long_timeout = { 10000, 0};
-static const sp_time zero_sec = { 0, 0};
-#ifdef BADCLOCK
-static const sp_time mili_sec = { 0, 1000};
- int clock_sync;
-#endif
- int num_set;
- int treated;
- int fd;
- int fd_type;
- int i,j;
- sp_time timeout;
- struct timeval sel_timeout, wait_timeout;
- fd_set current_mask[NUM_FDTYPES];
- time_event *temp_ptr;
- int first=1;
-#ifdef TESTTIME
- sp_time tmp_late,start,stop,req_time; /* DEBUGGING */
-#endif
-#ifdef BADCLOCK
- clock_sync = 0;
-#endif
- for( Exit_events = 0 ; !Exit_events ; )
- {
- Alarm( EVENTS, "E_handle_events: next event \n");
-
- /* Handle time events */
- timeout = long_timeout;
-#ifdef TESTTIME
- start = E_get_time_monotonic();
-#endif
- while( Time_queue != NULL )
- {
-#ifdef BADCLOCK
- if ( clock_sync >= 0 )
- {
- E_get_time_monotonic();
- clock_sync = -20;
- }
-#else
- E_get_time_monotonic();
-#endif
- if ( !first && E_compare_time( Now, Time_queue->t ) >= 0 )
- {
-#ifdef TESTTIME
- tmp_late = E_sub_time( Now, Time_queue->t );
-#endif
- temp_ptr = Time_queue;
- Time_queue = Time_queue->next;
- Alarm( EVENTS, "E_handle_events: exec time event \n");
-#ifdef TESTTIME
- Alarm( DEBUG, "Events: TimeEv is %d %d late\n",tmp_late.sec, tmp_late.usec);
-#endif
- temp_ptr->func( temp_ptr->code, temp_ptr->data );
- dispose( temp_ptr );
-#ifdef BADCLOCK
- Now = E_add_time( Now, mili_sec );
- clock_sync++;
-#else
- E_get_time_monotonic();
-#endif
- if (Exit_events) goto end_handler;
- }else{
- timeout = E_sub_time( Time_queue->t, Now );
- break;
- }
- }
- if (timeout.sec < 0 )
- timeout.sec = timeout.usec = 0; /* this can happen until first is unset */
-#ifdef TESTTIME
- stop = E_get_time_monotonic();
- tmp_late = E_sub_time(stop, start);
- Alarm(DEBUG, "Events: TimeEv's took %d %d to handle\n", tmp_late.sec, tmp_late.usec);
-#endif
- /* Handle fd events */
- for( i=0; i < NUM_FDTYPES; i++ )
- {
- current_mask[i] = Fd_mask[i];
- }
- Alarm( EVENTS, "E_handle_events: poll select\n");
-#ifdef TESTTIME
- req_time = zero_sec;
-#endif
- wait_timeout.tv_sec = zero_sec.sec;
- wait_timeout.tv_usec = zero_sec.usec;
- num_set = select( FD_SETSIZE, ¤t_mask[READ_FD], ¤t_mask[WRITE_FD], ¤t_mask[EXCEPT_FD],
- &wait_timeout );
- if (num_set == 0 && !Exit_events)
- {
-#ifdef BADCLOCK
- clock_sync = 0;
-#endif
- for( i=0; i < NUM_FDTYPES; i++ )
- {
- current_mask[i] = Fd_mask[i];
- }
- Alarm( EVENTS, "E_handle_events: select with timeout (%d, %d)\n",
- timeout.sec,timeout.usec );
-#ifdef TESTTIME
- req_time = E_add_time(req_time, timeout);
-#endif
- sel_timeout.tv_sec = timeout.sec;
- sel_timeout.tv_usec = timeout.usec;
- num_set = select( FD_SETSIZE, ¤t_mask[READ_FD], ¤t_mask[WRITE_FD],
- ¤t_mask[EXCEPT_FD], &sel_timeout );
- }
-#ifdef TESTTIME
- start = E_get_time_monotonic();
- tmp_late = E_sub_time(start, stop);
- Alarm( DEBUG, "Events: Waiting for fd or timout took %d %d asked for %d %d\n", tmp_late.sec, tmp_late.usec, req_time.sec, req_time.usec);
-#endif
- /* Handle all high and medium priority fd events */
- for( i=NUM_PRIORITY-1,treated=0;
- i > LOW_PRIORITY && num_set > 0 && !treated;
- i-- )
- {
- for( j=0; j < Fd_queue[i].num_fds && num_set > 0; j++ )
- {
- fd = Fd_queue[i].events[j].fd;
- fd_type = Fd_queue[i].events[j].fd_type;
- if( FD_ISSET( fd, ¤t_mask[fd_type] ) )
- {
- Alarm( EVENTS, "E_handle_events: exec handler for fd %d, fd_type %d, priority %d\n",
- fd, fd_type, i );
- Fd_queue[i].events[j].func(
- Fd_queue[i].events[j].fd,
- Fd_queue[i].events[j].code,
- Fd_queue[i].events[j].data );
- treated = 1;
- num_set--;
-#ifdef BADCLOCK
- Now = E_add_time( Now, mili_sec );
- clock_sync++;
-#else
- E_get_time_monotonic();
-#endif
- if (Exit_events) goto end_handler;
- }
- }
- }
- /* Don't handle timed events until all non-low-priority fd events have been handled
- * FIXME: This may or may not be right. If continual high priority events occur, then
- * timed events will starve, I'm not sure if that is better then what we have. We
- * could also set first=0 no matter what after trying the high events once, then
- * they will get a shot first, but after that timed events will also be handled.
- */
- if (!treated)
- first = 0;
-
-#ifdef TESTTIME
- stop = E_get_time_monotonic();
- tmp_late = E_sub_time(stop, start);
- Alarm(DEBUG, "Events: High & Med took %d %d time to handle\n", tmp_late.sec, tmp_late.usec);
-#endif
- /* Handle one low priority fd event.
- However, verify that Active_priority still allows LOW_PRIORITY events.
- Active_priority can change because of calls to E_set_threshold() during the current select loop.
- */
- for( i=0; i < Fd_queue[LOW_PRIORITY].num_fds
- && num_set > 0
- && Active_priority == LOW_PRIORITY;
- i++ )
- {
- j = ( i + Round_robin ) % Fd_queue[LOW_PRIORITY].num_fds;
- fd = Fd_queue[LOW_PRIORITY].events[j].fd;
- fd_type = Fd_queue[LOW_PRIORITY].events[j].fd_type;
- if( FD_ISSET( fd, ¤t_mask[fd_type] ) )
- {
- Round_robin = ( j + 1 ) % Fd_queue[LOW_PRIORITY].num_fds;
-
- Alarm( EVENTS , "E_handle_events: exec ext fd event \n");
- Fd_queue[LOW_PRIORITY].events[j].func(
- Fd_queue[LOW_PRIORITY].events[j].fd,
- Fd_queue[LOW_PRIORITY].events[j].code,
- Fd_queue[LOW_PRIORITY].events[j].data );
- num_set--;
-#ifdef BADCLOCK
- Now = E_add_time( Now, mili_sec );
- clock_sync++;
-#else
- E_get_time_monotonic();
-#endif
- if (Exit_events) goto end_handler;
- break;
- }
- }
-#ifdef TESTTIME
- start = E_get_time_monotonic();
- tmp_late = E_sub_time(start, stop);
- Alarm(DEBUG, "Events: Low priority took %d %d to handle\n", tmp_late.sec, tmp_late.usec);
-#endif
- }
- end_handler:
- /* Clean up data structures for exit OR restart of handler loop */
- /* Actually nothing needs to be cleaned up to allow E_handle_events()
- * to be called again. The events are still registered (or not registered)
- * and the only state for the actual events loop is Exit_events which is reset
- * in the for loop.
- */
-
- return;
-}
-
-void E_exit_events(void)
-{
- Alarm( EVENTS, "E_exit_events:\n");
- Exit_events = 1;
-}
Modified: trunk/daemon/flow_control.c
===================================================================
--- trunk/daemon/flow_control.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/flow_control.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -38,7 +38,7 @@
#include "membership.h"
#include "prot_body.h"
#include "status.h"
-#include "alarm.h"
+#include "spu_alarm.h"
static int16 Window;
static int16 Personal_window;
Modified: trunk/daemon/groups.c
===================================================================
--- trunk/daemon/groups.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/groups.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -43,16 +43,15 @@
#include "sess_types.h"
#include "sess_body.h"
#include "groups.h"
-#include "objects.h"
-#include "memory.h"
-#include "sp_events.h"
+#include "spu_objects.h"
+#include "spu_memory.h"
+#include "spu_events.h"
#include "status.h"
-#include "alarm.h"
+#include "spu_alarm.h"
#include "membership.h"
#if ( SPREAD_PROTOCOL > 3 )
#include "queues.h"
#endif
-#include "alarm.h"
#include "message.h"
#ifndef NULL
@@ -260,27 +259,27 @@
if (ret != 0) {
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize GroupsList\n");
}
- ret = Mem_init_object(GROUP, sizeof(group), 1000, 0);
+ ret = Mem_init_object(GROUP, "group", sizeof(group), 1000, 0);
if (ret < 0)
{
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize GROUP memory objects\n");
}
- ret = Mem_init_object(DAEMON_MEMBERS, sizeof(daemon_members), 2000, 0);
+ ret = Mem_init_object(DAEMON_MEMBERS, "daemon_members", sizeof(daemon_members), 2000, 0);
if (ret < 0)
{
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize DAEMON_MEMBERS memory objects\n");
}
- ret = Mem_init_object(MEMBER, sizeof(member), 10000, 0);
+ ret = Mem_init_object(MEMBER, "member", sizeof(member), 10000, 0);
if (ret < 0)
{
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize MEMBER memory objects\n");
}
- ret = Mem_init_object(GROUPS_BUF_LINK, sizeof(groups_buf_link), 1, 1);
+ ret = Mem_init_object(GROUPS_BUF_LINK, "groups_buf_link", sizeof(groups_buf_link), 1, 1);
if( ret < 0 )
{
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize GROUPS_BUF_LINK memory objects\n");
}
- ret = Mem_init_object(GROUPS_MESSAGE_LINK, sizeof(groups_message_link), 1, 1);
+ ret = Mem_init_object(GROUPS_MESSAGE_LINK, "groups_message_link", sizeof(groups_message_link), 1, 1);
if( ret < 0 )
{
Alarmp( SPLOG_FATAL, GROUPS, "G_init: Failure to Initialize GROUPS_MESSAGE_LINK memory objects\n");
Modified: trunk/daemon/log.c
===================================================================
--- trunk/daemon/log.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/log.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -51,8 +51,8 @@
#include "configuration.h"
#include "membership.h"
#include "prot_body.h"
-#include "sp_events.h"
-#include "alarm.h"
+#include "spu_events.h"
+#include "spu_alarm.h"
static int Is_inited = 0;
Modified: trunk/daemon/membership.c
===================================================================
--- trunk/daemon/membership.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/membership.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -42,10 +42,10 @@
#include "prot_body.h"
#include "net_types.h"
#include "network.h"
-#include "objects.h"
-#include "memory.h"
+#include "spu_objects.h"
+#include "spu_memory.h"
#include "status.h"
-#include "alarm.h"
+#include "spu_alarm.h"
#define POTENTIAL_REP 0
#define SEG_REP 1
@@ -2112,20 +2112,20 @@
Alarmp( SPLOG_PRINT, PRINT, "Form Token members list -- Active (%hd) Pending (%hd)\n", m_info->num_members, m_info->num_pending);
for (i=0; i < m_info->num_members; i++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", i, IP1(m_info->members[i]), IP2(m_info->members[i]), IP3(m_info->members[i]), IP4(m_info->members[i]) );
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", i, IP1(m_info->members[i]), IP2(m_info->members[i]), IP3(m_info->members[i]), IP4(m_info->members[i]) );
if ( (i % 3) == 2 )
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\nPending Members:\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\nPending Members:\n");
for (i= m_info->num_members; i < ( m_info->num_members + m_info->num_pending); i++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", i, IP1(m_info->members[i]), IP2(m_info->members[i]), IP3(m_info->members[i]), IP4(m_info->members[i]) );
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", i, IP1(m_info->members[i]), IP2(m_info->members[i]), IP3(m_info->members[i]), IP4(m_info->members[i]) );
if ( (i % 3) == 2 )
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
if ( is_form1 )
{
@@ -2133,11 +2133,11 @@
Alarmp( SPLOG_PRINT, PRINT, "Form Token reps list -- Count (%hd) index (%hd)\n", r_info->num_reps, r_info->rep_index);
for (i=0; i < r_info->num_reps; i++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u: %u.%u.%u.%u (T %hd SegInd %hd) ", i, IP1(r_info->reps[i].proc_id), IP2(r_info->reps[i].proc_id), IP3(r_info->reps[i].proc_id), IP4(r_info->reps[i].proc_id), r_info->reps[i].type, r_info->reps[i].seg_index );
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u: %u.%u.%u.%u (T %hd SegInd %hd) ", i, IP1(r_info->reps[i].proc_id), IP2(r_info->reps[i].proc_id), IP3(r_info->reps[i].proc_id), IP4(r_info->reps[i].proc_id), r_info->reps[i].type, r_info->reps[i].seg_index );
if ( (i % 3) == 2 )
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
} else /* so is FORM2 type */
{
Alarmp( SPLOG_PRINT, PRINT, "Form Token Membership ID %u.%u.%u.%u : %d\n", IP1(m_id_info->proc_id), IP2(m_id_info->proc_id), IP3(m_id_info->proc_id), IP4(m_id_info->proc_id), m_id_info->time );
@@ -2159,32 +2159,32 @@
Alarmp( SPLOG_PRINT, PRINT, "\tMessage Holes:");
for (j=0; j < rg_info->num_holes; j++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u ", *commit_id);
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u ", *commit_id);
commit_id++;
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
/* Now print transitional member list */
Alarmp( SPLOG_PRINT, PRINT, "\tTrans List:");
for (j=0; j < rg_info->num_trans; j++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", j, IP1(*commit_id), IP2(*commit_id), IP3(*commit_id), IP4(*commit_id) );
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", j, IP1(*commit_id), IP2(*commit_id), IP3(*commit_id), IP4(*commit_id) );
if ( (j % 3) == 2 )
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
commit_id++;
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
/* Now print commit list. This follows the trans list with no gaps. */
Alarmp( SPLOG_PRINT, PRINT, "\tCommit List:");
for (j=rg_info->num_trans; j < rg_info->num_commit; j++)
{
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", j, IP1(*commit_id), IP2(*commit_id), IP3(*commit_id), IP4(*commit_id) );
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\t%u: %u.%u.%u.%u ", j, IP1(*commit_id), IP2(*commit_id), IP3(*commit_id), IP4(*commit_id) );
if ( (j % 3) == 2 )
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
commit_id++;
}
- Alarmp( SPLOG_PRINT_NODATE, PRINT, "\n");
+ Alarmp( SPLOG_PRINT | SPLOG_NODATE, PRINT, "\n");
/* next ring */
rg_info = (ring_info *)&c_ptr[bytes_to_skip];
Deleted: trunk/daemon/memory.c
===================================================================
--- trunk/daemon/memory.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/memory.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,783 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-/* memory.c
- * memory allocater and deallocater
- *
- */
-#include "arch.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "errors.h"
-#include "memory.h"
-#include "alarm.h"
-#include "objects.h"
-
-#define MAX_MEM_OBJECTS 200
-
-/* Define SPREAD_STATUS when Memory is compiled with the Spread Status system.
- * If memory is being used outside of Spread then comment the below define out.
- */
-
-
-#ifdef SPREAD_STATUS
-#include "status.h"
-#endif
-
-/************************
- * Global Variables
- ************************/
-
-/* Total bytes currently allocated including overhead */
-static unsigned int Mem_Bytes_Allocated;
-/* Total number of objects of all types allocated currently */
-static unsigned int Mem_Obj_Allocated;
-/* Total number of objects currently used by the application */
-static unsigned int Mem_Obj_Inuse;
-/* Maximum bytes allocated at any one time during execution */
-static unsigned int Mem_Max_Bytes;
-/* Maximum number of objects allocated at any one time */
-static unsigned int Mem_Max_Objects;
-/* Maximum number of ojects used by application at any one time */
-static unsigned int Mem_Max_Obj_Inuse;
-
-
-typedef struct mem_header_d
-{
- int32u obj_type;
- size_t block_len;
-} mem_header;
-
-/* NOTE: Only num_obj_inpool is updated when debugging is turned off
- * (i.e. define NDEBUG) it is NECESSARY to track buffer pool size
- */
-typedef struct mem_info_d
-{
- bool exist; /* 1 = object registered, 0 = unused object number */
- size_t size; /* size of object in bytes (should be from sizeof so aligned ) */
- unsigned int threshold;
-#ifndef NDEBUG
- unsigned int bytes_allocated;
- unsigned int max_bytes;
- unsigned int num_obj;
- unsigned int max_obj;
- unsigned int num_obj_inuse;
- unsigned int max_obj_inuse;
-#endif
- unsigned int num_obj_inpool;
- void **list_head;
-} mem_info;
-
-static mem_info Mem[MAX_MEM_OBJECTS];
-
-#ifndef NDEBUG
- static bool Initialized;
-#endif
-
-
-#ifdef SPREAD_STATUS
-static bool MemStatus_initialized;
-#endif
-
-int Mem_valid_objtype(int32u objtype)
-{
- /* if any bits set higher then max object type return failure */
- if (objtype > MAX_MEM_OBJECTS) { return(0); }
-
- /* if table entry is valid return that */
- return(Mem[objtype].exist);
-}
-
-/* Size of the memory object */
-static size_t sizeobj(int32u objtype)
-{
- return(Mem[objtype].size);
-}
-
-
-
-/************************
- * Query Functions
- ************************/
-
-unsigned int Mem_total_bytes()
-{
- return(Mem_Bytes_Allocated);
-}
-unsigned int Mem_total_inuse()
-{
- return( Mem_Obj_Inuse );
-}
-unsigned int Mem_total_obj()
-{
- return( Mem_Obj_Allocated );
-}
-unsigned int Mem_total_max_bytes()
-{
- return(Mem_Max_Bytes);
-}
-unsigned int Mem_total_max_inuse()
-{
- return( Mem_Max_Obj_Inuse );
-}
-unsigned int Mem_total_max_obj()
-{
- return( Mem_Max_Objects );
-}
-unsigned int Mem_obj_in_pool(int32u objtype)
-{
- return( Mem[objtype].num_obj_inpool);
-}
-
-#ifndef NDEBUG
-unsigned int Mem_obj_in_app(int32u objtype)
-{
- return( Mem[objtype].num_obj_inuse );
-}
-unsigned int Mem_max_in_app(int32u objtype)
-{
- return( Mem[objtype].max_obj_inuse );
-}
-
-unsigned int Mem_obj_total(int32u objtype)
-{
- return( Mem[objtype].num_obj );
-}
-unsigned int Mem_max_obj(int32u objtype)
-{
- return( Mem[objtype].max_obj );
-}
-unsigned int Mem_bytes(int32u objtype)
-{
- return( Mem[objtype].bytes_allocated );
-}
-unsigned int Mem_max_bytes(int32u objtype)
-{
- return( Mem[objtype].max_bytes );
-}
-#endif /* NDEBUG */
-
-/**********************
- * Internal functions
- **********************/
-
-#define mem_header_ptr(obj) ( (mem_header *) (((char *)obj) - sizeof(mem_header)) )
-
-void Mem_init_status()
-{
-#ifdef SPREAD_STATUS
- struct StatGroup *sgroup;
- int obj_type;
- char memobj_name[32];
- char memobj_desc[200];
- if (!MemStatus_initialized)
- {
- sgroup = Stat_Group_Create("Memory_Summary_0", "Statistics for memory useage summarized over all memory objects");
- if (!sgroup)
- {
- Alarm(PRINT, "Mem_init_object: Failed to create Memory Status group\n");
- } else {
- Stat_Insert_Record("Memory_Summary_0", "Current Bytes Used", "bytes", STAT_INT, &Mem_Bytes_Allocated );
- Stat_Group_Add_Member(sgroup, &Mem_Bytes_Allocated);
- Stat_Insert_Record("Memory_Summary_0", "Maximum Bytes Used", "max_bytes", STAT_INT, &Mem_Max_Bytes );
- Stat_Group_Add_Member(sgroup, &Mem_Max_Bytes);
- Stat_Insert_Record("Memory_Summary_0", "Current Objects Used", "objs", STAT_INT, &Mem_Obj_Allocated );
- Stat_Group_Add_Member(sgroup, &Mem_Obj_Allocated);
- Stat_Insert_Record("Memory_Summary_0", "Maximum Objects Used", "max_objs", STAT_INT, &Mem_Max_Objects);
- Stat_Group_Add_Member(sgroup, &Mem_Max_Objects);
- Stat_Insert_Record("Memory_Summary_0", "Current Objects Inuse", "objs_inuse", STAT_INT, &Mem_Obj_Inuse);
- Stat_Group_Add_Member(sgroup, &Mem_Obj_Inuse);
- Stat_Insert_Record("Memory_Summary_0", "Maximum Objects Inuse", "max_obj_inuse", STAT_INT, &Mem_Max_Obj_Inuse);
- Stat_Group_Add_Member(sgroup, &Mem_Max_Obj_Inuse);
- }
- MemStatus_initialized = TRUE;
- }
-
- for (obj_type = 1; obj_type < MAX_MEM_OBJECTS; obj_type++)
- {
- if (Mem[obj_type].exist) {
- sprintf(memobj_name, "Memory_%d", obj_type);
- sprintf(memobj_desc, "Memory statistics for object: %s", Objnum_to_String(obj_type) );
- sgroup = Stat_Group_Create(memobj_name, memobj_desc);
- if (!sgroup)
- Alarm(PRINT, "Mem_init_object:Failed to create stat group for object: %s\n", Objnum_to_String(obj_type) );
- else {
-#ifndef NDEBUG
- Stat_Insert_Record(memobj_name, "Current Bytes Used", "bytes", STAT_INT, &(Mem[obj_type].bytes_allocated) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].bytes_allocated) );
- Stat_Insert_Record(memobj_name, "Maximum Bytes Used", "max_bytes", STAT_INT, &(Mem[obj_type].max_bytes) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_bytes) );
- Stat_Insert_Record(memobj_name, "Current Objects Used", "objs", STAT_INT, &(Mem[obj_type].num_obj) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj) );
- Stat_Insert_Record(memobj_name, "Maximum Objects Used", "max_objs", STAT_INT, &(Mem[obj_type].max_obj) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_obj) );
- Stat_Insert_Record(memobj_name, "Current Objects Inuse", "obj_inuse", STAT_INT, &(Mem[obj_type].num_obj_inuse) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj_inuse) );
- Stat_Insert_Record(memobj_name, "Maximum Objects Inuse", "max_inuse", STAT_INT, &(Mem[obj_type].max_obj_inuse) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_obj_inuse) );
-#endif
- Stat_Insert_Record(memobj_name, "Current Objects In Pool", "obj_inpool", STAT_INT, &(Mem[obj_type].num_obj_inpool) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj_inpool) );
- }
- } /* if exists */
- } /* for loop */
- return;
-#else
- return;
-#endif
-}
-void Mem_init_object_abort( int32u obj_type, int32u size, unsigned int threshold, unsigned int initial )
-{
- char *obj_name;
- int ret;
-
- ret = Mem_init_object( obj_type, size, threshold, initial );
- if (ret < 0 ) {
- obj_name = Objnum_to_String( obj_type );
- Alarm( EXIT, "Mem_init_object_abort: Failed to initialize a/an %s object\n", obj_name);
- }
-}
-/* Input: valid object type, threshold/watermark value for this object, initial objects to create
- * Output: none
- * Effects: sets watermark for type,creates initial memory buffers and updates global vars
- * Should ONLY be called once per execution of the program
- */
-int Mem_init_object(int32u obj_type, int32u size, unsigned int threshold, unsigned int initial)
-{
- int mem_error = 0;
-#ifdef SPREAD_STATUS
- char memobj_name[32];
- char memobj_desc[200];
- struct StatGroup *sgroup;
-#endif
- assert((obj_type > 0) && (obj_type < MAX_MEM_OBJECTS));
- assert(size > 0 );
-
-#ifndef NDEBUG
- if (!Initialized) {
- /* do any initialization needed just once here */
- Mem_Bytes_Allocated = 0;
- Mem_Obj_Allocated = 0;
- Mem_Obj_Inuse = 0;
- Mem_Max_Bytes = 0;
- Mem_Max_Objects = 0;
- Mem_Max_Obj_Inuse = 0;
-
- Initialized = TRUE;
- }
-#endif
- assert(!(Mem[obj_type].exist));
-
- if( obj_type == BLOCK_OBJECT )
- {
- assert(threshold == 0);
- assert(initial == 0);
- }
-
- Mem[obj_type].exist = TRUE;
- Mem[obj_type].size = size;
- Mem[obj_type].threshold = threshold;
- /* Only enabled when MEM_DISABLE_CACHE set. Disable threshold so all memory is dellocated at dispose() */
-#ifdef MEM_DISABLE_CACHE
- Mem[obj_type].threshold = 0;
-#endif
-#ifndef NDEBUG
- Mem[obj_type].num_obj = 0;
- Mem[obj_type].bytes_allocated = 0;
- Mem[obj_type].num_obj_inuse = 0;
- Mem[obj_type].max_bytes = 0;
- Mem[obj_type].max_obj = 0;
- Mem[obj_type].max_obj_inuse = 0;
-#endif
- Mem[obj_type].num_obj_inpool = 0;
- if (initial > 0)
- {
- /* Create 'initial' objects */
- int i;
- mem_header *head_ptr;
- void ** body_ptr;
- for(i = initial; i > 0; i--)
- {
- head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + sizeobj(obj_type) );
- if (head_ptr == NULL)
- {
- Alarm(MEMORY, "mem_init_object: Failure to calloc an initial object. Returning with existant buffers\n");
- mem_error = 1;
- break;
- }
-
-
- head_ptr->obj_type = obj_type;
- head_ptr->block_len = sizeobj(obj_type);
- /* We add 1 because pointer arithm. states a pointer + 1 equals a pointer
- * to the next element in an array where each element is of a particular size.
- * in this case that size is 8 (or 12)
- * (since it is a pointer to a struct of a 32bit int and a size_t)
- * so adding one actually moves the pointer 8 (or 12) bytes forward!
- */
- body_ptr = (void **) (head_ptr + 1);
-
-#ifdef TESTING
- printf("alignment objtype = %u\n", __alignof__(head_ptr->obj_type));
- printf("alignment blocklen = %u\n", __alignof__(head_ptr->block_len));
- printf("initial head = 0x%x\n", head_ptr);
- printf("initial body = 0x%x\n", body_ptr);
- printf("alignment head = %u\n", __alignof__(head_ptr));
- printf("alignment body = %u\n", __alignof__(body_ptr));
- printf("sizeof body pointer = %u\n", sizeof(body_ptr));
- printf("size head = %u\t size body = %u\n", sizeof(mem_header), sizeobj(obj_type));
-#endif
-
- *body_ptr = (void *) Mem[obj_type].list_head;
- Mem[obj_type].list_head = body_ptr;
- Mem[obj_type].num_obj_inpool++;
-#ifndef NDEBUG
- Mem[obj_type].num_obj++;
- Mem[obj_type].bytes_allocated += (sizeobj(obj_type) + sizeof(mem_header));
-#endif
- }
-#ifndef NDEBUG
- Mem[obj_type].max_bytes = Mem[obj_type].bytes_allocated;
- Mem[obj_type].max_obj = Mem[obj_type].num_obj;
-
- Mem_Bytes_Allocated += Mem[obj_type].bytes_allocated;
- Mem_Obj_Allocated += Mem[obj_type].num_obj;
- if (Mem_Bytes_Allocated > Mem_Max_Bytes)
- {
- Mem_Max_Bytes = Mem_Bytes_Allocated;
- }
- if (Mem_Obj_Allocated > Mem_Max_Objects)
- {
- Mem_Max_Objects = Mem_Obj_Allocated;
- }
-#endif
- }
-
-#ifndef NDEBUG
-#ifdef SPREAD_STATUS
- if (MemStatus_initialized) {
- sprintf(memobj_name, "Memory_%d", obj_type);
- sprintf(memobj_desc, "Memory statistics for object: %s", Objnum_to_String(obj_type) );
- sgroup = Stat_Group_Create(memobj_name, memobj_desc);
- if (!sgroup)
- Alarm(PRINT, "Mem_init_object:Failed to create stat group for object: %s\n", Objnum_to_String(obj_type) );
- else {
- Stat_Insert_Record(memobj_name, "Current Bytes Used", "bytes", STAT_INT, &(Mem[obj_type].bytes_allocated) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].bytes_allocated) );
- Stat_Insert_Record(memobj_name, "Maximum Bytes Used", "max_bytes", STAT_INT, &(Mem[obj_type].max_bytes) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_bytes) );
- Stat_Insert_Record(memobj_name, "Current Objects Used", "objs", STAT_INT, &(Mem[obj_type].num_obj) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj) );
- Stat_Insert_Record(memobj_name, "Maximum Objects Used", "max_objs", STAT_INT, &(Mem[obj_type].max_obj) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_obj) );
- Stat_Insert_Record(memobj_name, "Current Objects Inuse", "obj_inuse", STAT_INT, &(Mem[obj_type].num_obj_inuse) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj_inuse) );
- Stat_Insert_Record(memobj_name, "Maximum Objects Inuse", "max_inuse", STAT_INT, &(Mem[obj_type].max_obj_inuse) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].max_obj_inuse) );
- Stat_Insert_Record(memobj_name, "Current Objects In Pool", "obj_inpool", STAT_INT, &(Mem[obj_type].num_obj_inpool) );
- Stat_Group_Add_Member(sgroup, &(Mem[obj_type].num_obj_inpool) );
- }
- } /* if memstatus_init */
-#endif
-#endif
-
- if (mem_error) { return(MEM_ERR); }
- return(0);
-}
-
-
-/* Input: a valid type of object
- * Output: a pointer to memory which will hold an object
- * Effects: will only allocate an object from system if none exist in pool
- */
-void * new(int32u obj_type)
-{
-
- assert(Mem_valid_objtype(obj_type));
-
- if (Mem[obj_type].list_head == NULL)
- {
- mem_header * head_ptr;
-
- head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + sizeobj(obj_type) );
- if (head_ptr == NULL)
- {
- Alarm(MEMORY, "mem_alloc_object: Failure to calloc an object. Returning NULL object\n");
- return(NULL);
- }
- head_ptr->obj_type = obj_type;
- head_ptr->block_len = sizeobj(obj_type);
-
-#ifndef NDEBUG
- Mem[obj_type].num_obj++;
- Mem[obj_type].num_obj_inuse++;
- Mem[obj_type].bytes_allocated += (sizeobj(obj_type) + sizeof(mem_header));
- if (Mem[obj_type].bytes_allocated > Mem[obj_type].max_bytes)
- {
- Mem[obj_type].max_bytes = Mem[obj_type].bytes_allocated;
- }
- if (Mem[obj_type].num_obj > Mem[obj_type].max_obj)
- {
- Mem[obj_type].max_obj = Mem[obj_type].num_obj;
- }
- if (Mem[obj_type].num_obj_inuse > Mem[obj_type].max_obj_inuse)
- {
- Mem[obj_type].max_obj_inuse = Mem[obj_type].num_obj_inuse;
- }
-
- Mem_Bytes_Allocated += (sizeobj(obj_type) + sizeof(mem_header));
- Mem_Obj_Allocated++;
- Mem_Obj_Inuse++;
- if (Mem_Bytes_Allocated > Mem_Max_Bytes)
- {
- Mem_Max_Bytes = Mem_Bytes_Allocated;
- }
- if (Mem_Obj_Allocated > Mem_Max_Objects)
- {
- Mem_Max_Objects = Mem_Obj_Allocated;
- }
- if (Mem_Obj_Inuse > Mem_Max_Obj_Inuse)
- {
- Mem_Max_Obj_Inuse = Mem_Obj_Inuse;
- }
-
-#endif
-#ifdef TESTING
- printf("alloc:object = 0x%x\n", head_ptr + 1);
- printf("alloc:mem_headerptr = 0x%x\n", head_ptr);
- printf("alloc:objtype = %u:\n", head_ptr->obj_type);
- printf("alloc:blocklen = %u:\n", head_ptr->block_len);
-#endif
- Alarm(MEMORY, "new: creating pointer 0x%x to object type %d named %s\n", head_ptr + 1, obj_type, Objnum_to_String(obj_type));
-
- return((void *) (head_ptr + 1));
- } else
- {
- void ** body_ptr;
- assert(Mem[obj_type].num_obj_inpool > 0 );
-
- body_ptr = Mem[obj_type].list_head;
- Mem[obj_type].list_head = (void *) *(body_ptr);
- Mem[obj_type].num_obj_inpool--;
-#ifndef NDEBUG
- Mem[obj_type].num_obj_inuse++;
- if (Mem[obj_type].num_obj_inuse > Mem[obj_type].max_obj_inuse)
- {
- Mem[obj_type].max_obj_inuse = Mem[obj_type].num_obj_inuse;
- }
- Mem_Obj_Inuse++;
- if (Mem_Obj_Inuse > Mem_Max_Obj_Inuse)
- {
- Mem_Max_Obj_Inuse = Mem_Obj_Inuse;
- }
-
-#endif
-#ifdef TESTING
- printf("pool:object = 0x%x\n", body_ptr);
- printf("pool:mem_headerptr = 0x%x\n", mem_header_ptr((void *) body_ptr));
- printf("pool:objtype = %u:\n", mem_header_ptr((void *) body_ptr)->obj_type);
- printf("pool:blocklen = %u:\n", mem_header_ptr((void *) body_ptr)->block_len);
-#endif
- Alarm(MEMORY, "new: reusing pointer 0x%x to object type %d named %s\n", body_ptr, obj_type, Objnum_to_String(obj_type));
-
- return((void *) (body_ptr));
- }
-}
-
-
-/* Input: a size of memory block desired
- * Output: a pointer to memory which will hold the block
- * Effects:
- */
-void * Mem_alloc( unsigned int length)
-{
- mem_header * head_ptr;
-
- if (length == 0) { return(NULL); }
- if( !Mem[BLOCK_OBJECT].exist )
- {
- Mem[BLOCK_OBJECT].exist = TRUE;
- Mem[BLOCK_OBJECT].size = 0;
- Mem[BLOCK_OBJECT].threshold = 0;
- }
-
-
- head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + length);
- if (head_ptr == NULL)
- {
- Alarm(MEMORY, "mem_alloc: Failure to calloc a block. Returning NULL block\n");
- return(NULL);
- }
- head_ptr->obj_type = BLOCK_OBJECT;
- head_ptr->block_len = length;
-
-#ifndef NDEBUG
-
- Mem[BLOCK_OBJECT].num_obj++;
- Mem[BLOCK_OBJECT].num_obj_inuse++;
- Mem[BLOCK_OBJECT].bytes_allocated += (length + sizeof(mem_header));
- if (Mem[BLOCK_OBJECT].bytes_allocated > Mem[BLOCK_OBJECT].max_bytes)
- {
- Mem[BLOCK_OBJECT].max_bytes = Mem[BLOCK_OBJECT].bytes_allocated;
- }
- if (Mem[BLOCK_OBJECT].num_obj > Mem[BLOCK_OBJECT].max_obj)
- {
- Mem[BLOCK_OBJECT].max_obj = Mem[BLOCK_OBJECT].num_obj;
- }
- if (Mem[BLOCK_OBJECT].num_obj_inuse > Mem[BLOCK_OBJECT].max_obj_inuse)
- {
- Mem[BLOCK_OBJECT].max_obj_inuse = Mem[BLOCK_OBJECT].num_obj_inuse;
- }
-
- Mem_Bytes_Allocated += (length + sizeof(mem_header));
- Mem_Obj_Allocated++;
- Mem_Obj_Inuse++;
- if (Mem_Bytes_Allocated > Mem_Max_Bytes)
- {
- Mem_Max_Bytes = Mem_Bytes_Allocated;
- }
- if (Mem_Obj_Allocated > Mem_Max_Objects)
- {
- Mem_Max_Objects = Mem_Obj_Allocated;
- }
- if (Mem_Obj_Inuse > Mem_Max_Obj_Inuse)
- {
- Mem_Max_Obj_Inuse = Mem_Obj_Inuse;
- }
-
-#endif
- return((void *) (head_ptr + 1));
-}
-
-
-/* Input: a valid pointer to an object or block created by new or mem_alloc
- * Output: none
- * Effects: destroys the object and frees memory associated with it if necessary
- */
-void dispose(void *object)
-{
- int32u obj_type;
-
- if (object == NULL) { return; }
-
- obj_type = mem_header_ptr(object)->obj_type;
-#ifdef TESTING
- printf("disp:object = 0x%x\n", object);
- printf("disp:mem_headerptr = 0x%x\n", mem_header_ptr(object));
- printf("disp:objtype = %u:\n", mem_header_ptr(object)->obj_type);
- printf("disp:blocklen = %u:\n", mem_header_ptr(object)->block_len);
-#endif
- assert(Mem_valid_objtype(obj_type));
-#ifndef NDEBUG
- assert(Mem[obj_type].num_obj_inuse > 0);
- assert(Mem[obj_type].num_obj > 0);
- assert(Mem[obj_type].bytes_allocated >= mem_header_ptr(object)->block_len + sizeof(mem_header));
-
- Alarm(MEMORY, "dispose: disposing pointer 0x%x to object type %d named %s\n", object, obj_type, Objnum_to_String(obj_type));
-
- Mem[obj_type].num_obj_inuse--;
- Mem_Obj_Inuse--;
- if (obj_type == BLOCK_OBJECT)
- {
- assert(Mem[obj_type].num_obj_inpool == 0);
- assert(Mem[obj_type].threshold == 0);
- }
-
-#endif
- if ( Mem_obj_in_pool(obj_type) >= Mem[obj_type].threshold)
- {
-#ifndef NDEBUG
- Mem[obj_type].num_obj--;
- Mem[obj_type].bytes_allocated -= (sizeobj(obj_type) + sizeof(mem_header));
- Mem_Obj_Allocated--;
- Mem_Bytes_Allocated -= (sizeobj(obj_type) + sizeof(mem_header));
-#endif
- free(mem_header_ptr(object));
-
- } else
- {
- void ** body_ptr;
-
- body_ptr = (void **) object;
- *body_ptr = (void *) Mem[obj_type].list_head;
- Mem[obj_type].list_head = body_ptr;
- Mem[obj_type].num_obj_inpool++;
- }
-}
-/* Input: A valid pointer to an object/block created with new or mem_alloc
- * Output: the obj_type of this block of memory
- */
-int32u Mem_Obj_Type(const void *object)
-{
- int32u obj_type;
-
- assert(NULL != object);
- obj_type = mem_header_ptr(object)->obj_type;
- assert(Mem_valid_objtype(obj_type));
-
- return(obj_type);
-}
-
-/* Input: a valid pointer to an object/block created with memalloc_object or mem_alloc
- * Output: a pointer to an object/block which is an identical copy of the object input
- * Effects: same as memalloc_object or mem_alloc
- */
-void * Mem_copy(const void *object)
-{
- void * new_object;
- int32u obj_type;
-
- if (object == NULL) { return(NULL); }
-
- obj_type = mem_header_ptr(object)->obj_type;
- assert(Mem_valid_objtype(obj_type));
- if (obj_type == BLOCK_OBJECT)
- {
- new_object = (void *) Mem_alloc(mem_header_ptr(object)->block_len);
- } else
- {
- new_object =(void *) new(obj_type);
- }
- if (new_object == NULL) { return(NULL); }
-
- new_object =(void*)
- memcpy(new_object, object, mem_header_ptr(object)->block_len);
-
- mem_header_ptr(new_object)->obj_type = mem_header_ptr(object)->obj_type;
- mem_header_ptr(new_object)->block_len = mem_header_ptr(object)->block_len;
-
- return(new_object);
-
-}
-
-#if ( SPREAD_PROTOCOL == 3 )
-char *Objnum_to_String(int32u oid)
-{
-
- switch(oid)
- {
- case BASE_OBJ:
- return("base_obj");
- case PACK_HEAD_OBJ:
- return("pack_head_obj");
- case MESSAGE_OBJ:
- return("message_obj");
- case MSG_FRAG_OBJ:
- return("msg_frag_obj");
- case RET_REQ_OBJ:
- return("ret_req_obj");
- case LINK_ACK_OBJ:
- return("link_ack_obj");
- case ARU_UPDATE_OBJ:
- return("aru_update_obj");
- case TOKEN_HEAD_OBJ:
- return("token_head_obj");
- case TOKEN_BODY_OBJ:
- return("token_body_obj");
- case JOIN_OBJ:
- return("join_obj");
- case REFER_OBJ:
- return("refer_obj");
- case ALIVE_OBJ:
- return("alive_obj");
- case SCATTER:
- return("scatter");
- case QUEUE_ELEMENT:
- return("queue_element");
- case QUEUE:
- return("queue");
- case RETRANS_ENTRY:
- return("retrans_entry");
- case RING_LINK_OBJ:
- return("ring_link_obj");
- case HOP_LINK_OBJ:
- return("hop_link_obj");
- case MESSAGE_LINK:
- return("message_link");
- case DOWN_LINK:
- return("down_link");
- case TREE_NODE:
- return("tree_node");
- case MESSAGE_FRAG_LIST:
- return("message_frag_list");
- case LBUCKET:
- return("leaky_bucket");
- case GROUP:
- return("group");
- case MEMBER:
- return("member");
- case MSG_LIST_ENTRY:
- return("msg_list_entry");
- case SESS_SEQ_ENTRY:
- return("sess_seq_entry");
- case TIME_EVENT:
- return("time_event");
- case ROUTE_WEIGHTS:
- return("route_weights");
- case PROF_FUNCT:
- return("prof_funct");
- case QUEUE_SET:
- return("queue_set");
- case MQUEUE_ELEMENT:
- return("mqueue_element");
- case TCP_LINK_OBJ:
- return("tcp_link_object");
- case MESSAGE_META_OBJ:
- return("message_meta_object");
- case PROC_RECORD:
- return("proc_info");
- case SYS_SCATTER:
- return("sys_scatter");
- case STAT_RECORD:
- return("status_record");
- case STAT_GROUP:
- return("status_group");
- case STAT_REFRECORD:
- return("status_refrecord");
- case STATETRANS_OBJ:
- return("statetrans_obj");
- case PACKET_BODY:
- return("packet_body");
- case SESSION_AUTH_INFO:
- return("session_auth_info");
- default:
- return("Unknown_obj");
- }
-}
-#endif
-
Deleted: trunk/daemon/memory.h
===================================================================
--- trunk/daemon/memory.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/memory.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,130 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-#ifndef MEMORY_H
-#define MEMORY_H
-
-#include "arch.h"
-
-/*******************************************************************************
- * Special Object type used for
- * NON-OBJECT Oriented allocates (traditional Malloc/free with arbitrary sizes)
- * 0 is never a valid object type for any real object (they start at 1)
- *******************************************************************************/
-#define BLOCK_OBJECT 0
-
-
-/************************************
- * Function Declarations
- ************************************/
-
-/* Input: valid object type, size of object, threshold/watermark value for this object,
- * number of initial objects to create
- * Output: error code
- * Effects: registers type, sets watermark for type,creates initial memory buffers and updates global vars
- * Should ONLY be called once per execution of the program, but must be called before any other
- * memory management function is used on that object
- */
-int Mem_init_object(int32u obj_type, int32u size, unsigned int threshold, unsigned int initial);
-
-/* This calls Mem_init_object and if any error results it EXIT's with a printed error */
-void Mem_init_object_abort( int32u obj_type, int32u size, unsigned int threshold, unsigned int initial );
-
-/* This initializes the status reporting of the memory module and should be called from
- * status.c after the Group, Recod, and RefRecord objects are mem_init'ed.
- * After this is called each object created by Mem_init_object() will automatically
- * be added to the status reporting.
- * This function is needed to avoid a double-dependency loop where memory needs status working when
- * it starts, but status requires memory working for it to work.
- */
-void Mem_init_status();
-/* Input: a valid type of object
- * Output: a pointer to memory which will hold an object
- * Effects: will only allocate an object from system if none exist in pool
- */
-void * new(int32u obj_type);
-
-
-/* Input: a valid pointer to an object or block created by new or mem_alloc
- * Output: none
- * Effects: destroys the object and frees memory associated with it if necessary
- */
-void dispose(void *object);
-
-/***************************************************************************
- * These two functions are ONLY needed for dynamically sized allocations
- * like traditional malloc/free --NOT for object based allocations
- ***************************************************************************/
-
-/* Input: a size of memory block desired
- * Output: a pointer to memory which will hold the block
- * Effects:
- */
-void * Mem_alloc( unsigned int length);
-
-
-/* Input: a valid pointer to an object created with memalloc_object
- * Output: a pointer to an object which is an identical copy of the object input
- * Effects: same as memalloc_object
- */
-void * Mem_copy(const void *object);
-
-/************************
- * Query Functions
- ************************/
-
-int Mem_valid_objtype(int32u objtype);
-
-/* Input: A valid pointer to an object/block created with new or mem_alloc
- * Output: the obj_type of this block of memory
- */
-int32u Mem_Obj_Type(const void *object);
-
-extern LOC_INLINE unsigned int Mem_total_bytes(void);
-extern LOC_INLINE unsigned int Mem_total_max_bytes(void);
-extern LOC_INLINE unsigned int Mem_total_inuse(void);
-extern LOC_INLINE unsigned int Mem_total_max_inuse(void);
-extern LOC_INLINE unsigned int Mem_total_obj(void);
-extern LOC_INLINE unsigned int Mem_total_max_obj(void);
-extern LOC_INLINE unsigned int Mem_bytes(int32u objtype);
-extern LOC_INLINE unsigned int Mem_max_bytes(int32u objtype);
-extern LOC_INLINE unsigned int Mem_obj_in_pool(int32u objtype);
-extern LOC_INLINE unsigned int Mem_obj_in_app(int32u objtype);
-extern LOC_INLINE unsigned int Mem_max_in_app(int32u objtype);
-extern LOC_INLINE unsigned int Mem_obj_total(int32u objtype);
-extern LOC_INLINE unsigned int Mem_max_obj(int32u objtype);
-
-#endif /* MEMORY_H */
-
Modified: trunk/daemon/message.c
===================================================================
--- trunk/daemon/message.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/message.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -38,11 +38,11 @@
#include <assert.h>
#include "message.h"
-#include "memory.h"
+#include "spu_memory.h"
#include "net_types.h"
-#include "objects.h"
+#include "spu_objects.h"
#include "prot_objs.h"
-#include "alarm.h"
+#include "spu_alarm.h"
#include "session.h"
#include "spread_params.h"
Modified: trunk/daemon/monitor.c
===================================================================
--- trunk/daemon/monitor.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/monitor.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -63,13 +63,13 @@
#endif /* _REENTRANT */
-#include "scatter.h"
+#include "spu_scatter.h"
#include "configuration.h"
-#include "sp_events.h"
+#include "spu_events.h"
#include "status.h"
#include "net_types.h"
-#include "data_link.h"
-#include "alarm.h"
+#include "spu_data_link.h"
+#include "spu_alarm.h"
static channel SendChan;
static sp_time Send_partition_timeout = { 25, 0 };
Modified: trunk/daemon/net_types.h
===================================================================
--- trunk/daemon/net_types.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/net_types.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -37,7 +37,7 @@
#define INC_NET_TYPES
#include "arch.h" /* For int32, etc */
-#include "data_link.h" /* For MAX_PACKET_SIZE */
+#include "spu_data_link.h" /* For MAX_PACKET_SIZE */
/* Dont forget that 0x80000080 is kept for endians */
Modified: trunk/daemon/network.c
===================================================================
--- trunk/daemon/network.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/network.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -38,10 +38,10 @@
#include "spread_params.h"
#include "network.h"
#include "net_types.h"
-#include "data_link.h"
-#include "sp_events.h"
+#include "spu_data_link.h"
+#include "spu_events.h"
#include "status.h"
-#include "alarm.h"
+#include "spu_alarm.h"
#include "configuration.h"
/* for Memb_print_form_token() */
Deleted: trunk/daemon/objects.h
===================================================================
--- trunk/daemon/objects.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/objects.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -1,153 +0,0 @@
-/*
- * The Spread Toolkit.
- *
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Creators of Spread are:
- * Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- * Copyright (C) 1993-2009 Spread Concepts LLC <info at spreadconcepts.com>
- *
- * All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- * Ryan Caudy rcaudy at gmail.com - contributions to process groups.
- * Claudiu Danilov claudiu at acm.org - scalable wide area support.
- * Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- * Theo Schlossnagle jesus at omniti.com - Perl, autoconf, old skiplist.
- * Dan Schoenblum dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-/* objects.h
- * main declarations of objects
- * Copyright 1997 Jonathan Stanton <jonathan at cs.jhu.edu>
- * Center for Networking and Distributed Systems
- *
- * $Id$
- *
- */
-
-#ifndef OBJECTS_H
-#define OBJECTS_H
-
-#include "arch.h"
-#include "spread_params.h" /* For SPREAD_PROTOCOL used in memory.c */
-
-#define MAX_OBJECTS 200
-#define MAX_OBJ_USED 56
-
-/* Object types
- *
- * Object types must start with 1 and go up. 0 is reserved
- */
-
-#define BASE_OBJ 1
-#define PACK_HEAD_OBJ 2 /* net_objs.h */
-#define MESSAGE_OBJ 3 /* prot_objs.h */
-#define MSG_FRAG_OBJ 4 /* prot_objs.h */
-#define RET_REQ_OBJ 5 /* net_objs.h */
-#define LINK_ACK_OBJ 6 /* net_objs.h */
-#define ARU_UPDATE_OBJ 7 /* prot_objs.h */
-#define TOKEN_HEAD_OBJ 8 /* net_objs.h */
-#define TOKEN_BODY_OBJ 9 /* net_objs.h */
-#define ALIVE_OBJ 10 /* memb_objs.h */
-#define JOIN_OBJ 11 /* memb_objs.h */
-#define REFER_OBJ 12 /* memb_objs.h */
-#define STATETRANS_OBJ 13 /* memb_objs.h */
-
-/* Non-Transmitted objects */
-#define SCATTER 20
-#define QUEUE_ELEMENT 21
-#define QUEUE 22
-#define RETRANS_ENTRY 23
-#define RING_LINK_OBJ 24
-#define HOP_LINK_OBJ 25
-#define MESSAGE_LINK 26
-#define DOWN_LINK 27
-#define TREE_NODE 28
-#define MESSAGE_FRAG_LIST 29
-#define LBUCKET 30
-#define GROUP 31
-#define MEMBER 32
-#define MSG_LIST_ENTRY 33
-#define SESS_SEQ_ENTRY 34
-#define TIME_EVENT 35
-
-#define ROUTE_WEIGHTS 36
-#define PROF_FUNCT 37
-#define QUEUE_SET 38
-#define MQUEUE_ELEMENT 39
-#define TCP_LINK_OBJ 40
-#define MESSAGE_META_OBJ 41
-
-#define PROC_RECORD 42
-#define SYS_SCATTER 43
-#define STAT_RECORD 44
-#define STAT_GROUP 45
-#define STAT_REFRECORD 46
-
-#define MEMB_MISSING_SEQENTRY 47
-#define MEMB_MISSING_DAEMON 48
-#define MEMB_DEPEND_MESSL 49
-#define PACKET_BODY 50
-
-#define SESSION_AUTH_INFO 51
-
-#define GROUPS_BUF_LINK 52
-#define GROUPS_MESSAGE_LINK 53
-#define DAEMON_MEMBERS 54
-
-/* Special objects */
-#define UNKNOWN_OBJ 55 /* This represents an object of undertermined or
- * variable type. Can only be used when appropriate.
- * i.e. when internal structure of object is not accessed.
- * This is mainly used with queues
- */
-
-#define Is_Pack_Head_Obj( type ) ( (type) == PACK_HEAD_OBJ )
-#define Is_Message_Obj( type ) ( (type) == MESSAGE_OBJ )
-#define Is_Msg_Frag_Obj( type ) ( (type) == MSG_FRAG_OBJ )
-#define Is_Ret_Req_Obj( type ) ( (type) == RET_REQ_OBJ )
-#define Is_Link_Ack_Obj( type ) ( (type) == LINK_ACK_OBJ )
-#define Is_Aru_Update_Obj( type ) ( (type) == ARU_UPDATE_OBJ )
-#define Is_Msg_Meta_Obj( type ) ( (type) == MESSAGE_META_OBJ )
-#define Is_Statetrans_Obj( type ) ( (type) == STATETRANS_OBJ )
-
-
-typedef struct d_obj {
- int32u obj_type;
- int32 obj_ref_count; /* who is using it before we free it - should not be sent */
-} base_obj;
-
-
-/* Global Functions to manipulate objects */
-int Is_Valid_Object(int32u oid);
-
-char *Objnum_to_String(int32u obj_type);
-
-int32 Obj_Inc_Refcount(void *obj);
-int32 Obj_Dec_Refcount(void *obj);
-int32 Obj_Net_SizeP(void *obj);
-int32 Obj_Net_SizeT(int32u obj_type);
-int32 Obj_SizeP(void * obj);
-int32 min32(int32, int32);
-int32u min32u(int32u, int32u);
-
-#endif /* OBJECTS_H */
-
-
Modified: trunk/daemon/prot_body.h
===================================================================
--- trunk/daemon/prot_body.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/prot_body.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -39,7 +39,7 @@
#include "configuration.h"
#include "spread_params.h"
#include "net_types.h"
-#include "sp_events.h"
+#include "spu_events.h" /* for sp_time */
#include "protocol.h"
Modified: trunk/daemon/protocol.c
===================================================================
--- trunk/daemon/protocol.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/protocol.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -40,15 +40,15 @@
#include "spread_params.h"
#include "membership.h"
#include "flow_control.h"
-#include "sp_events.h"
+#include "spu_events.h"
#include "session.h"
#include "network.h"
#include "net_types.h"
#include "status.h"
#include "log.h"
-#include "objects.h"
-#include "memory.h"
-#include "alarm.h"
+#include "spu_objects.h"
+#include "spu_memory.h"
+#include "spu_alarm.h"
#include "sess_types.h" /* for message_header */
/* Prot variables */
@@ -98,11 +98,11 @@
channel *bcast_channels;
channel *token_channels;
- Mem_init_object( PACK_HEAD_OBJ, sizeof( packet_header ), MAX_PACKETS_IN_STRUCT, 0 );
- Mem_init_object( PACKET_BODY, sizeof( packet_body ), MAX_PACKETS_IN_STRUCT, 0 );
- Mem_init_object( TOKEN_HEAD_OBJ, sizeof( token_header ), 10, 0 );
- Mem_init_object( TOKEN_BODY_OBJ, sizeof( token_body ), 10, 0 );
- Mem_init_object( SCATTER, sizeof( scatter ), 200+MAX_PROCS_RING, 0 );
+ Mem_init_object( PACK_HEAD_OBJ, "pack_head", sizeof( packet_header ), MAX_PACKETS_IN_STRUCT, 0 );
+ Mem_init_object( PACKET_BODY, "packet_body", sizeof( packet_body ), MAX_PACKETS_IN_STRUCT, 0 );
+ Mem_init_object( TOKEN_HEAD_OBJ, "token_head", sizeof( token_header ), 10, 0 );
+ Mem_init_object( TOKEN_BODY_OBJ, "token_body", sizeof( token_body ), 10, 0 );
+ Mem_init_object( SCATTER, "scatter", sizeof( scatter ), 200+MAX_PROCS_RING, 0 );
My = Conf_my();
My_index = Conf_proc_by_id( My.id, &My );
Modified: trunk/daemon/r.c
===================================================================
--- trunk/daemon/r.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/r.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -37,8 +37,8 @@
#include <string.h>
-#include "alarm.h"
-#include "data_link.h"
+#include "spu_alarm.h"
+#include "spu_data_link.h"
#ifdef ARCH_PC_WIN95
Modified: trunk/daemon/s.c
===================================================================
--- trunk/daemon/s.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/s.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -37,9 +37,9 @@
#include <string.h>
-#include "alarm.h"
-#include "sp_events.h"
-#include "data_link.h"
+#include "spu_alarm.h"
+#include "spu_events.h"
+#include "spu_data_link.h"
#ifdef ARCH_PC_WIN95
Modified: trunk/daemon/sess_types.h
===================================================================
--- trunk/daemon/sess_types.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/sess_types.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -37,8 +37,8 @@
#define INC_SESS_TYPES
#include "spread_params.h" /* For MAX_GROUP_NAME */
-#include "scatter.h" /* For MAX_SCATTER_ELEMENTS */
-#include "data_link.h" /* For MAX_PACKET_SIZE */
+#include "spu_scatter.h" /* For MAX_SCATTER_ELEMENTS */
+#include "spu_data_link.h" /* For MAX_PACKET_SIZE */
#define MAX_MESSAGE_BODY_LEN (MAX_SCATTER_ELEMENTS * (MAX_PACKET_SIZE - 32)) /* 32 is sizeof(packet_header) */
Modified: trunk/daemon/session.c
===================================================================
--- trunk/daemon/session.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/session.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -67,9 +67,9 @@
#include "spread_params.h"
#include "net_types.h"
-#include "sp_events.h"
-#include "objects.h"
-#include "memory.h"
+#include "spu_events.h"
+#include "spu_objects.h"
+#include "spu_memory.h"
#include "session.h"
#include "sess_types.h"
@@ -80,8 +80,7 @@
#include "groups.h"
#include "log.h"
#include "status.h"
-#include "alarm.h"
-#include "objects.h"
+#include "spu_alarm.h"
#if ( SPREAD_PROTOCOL > 3 )
#include "queues.h"
#endif
@@ -327,13 +326,13 @@
#endif /* ARCH_PC_WIN95 */
- ret = Mem_init_object( MESSAGE_LINK, sizeof(message_link), 1000, 0);
+ ret = Mem_init_object( MESSAGE_LINK, "message_link", sizeof(message_link), 1000, 0);
if (ret < 0)
{
Alarm(EXIT, "Sess_init: Failure to Initialize MESSAGE_LINK memory objects\n");
}
- ret = Mem_init_object( DOWN_LINK, sizeof(down_link), 200, 0);
+ ret = Mem_init_object( DOWN_LINK, "down_link", sizeof(down_link), 200, 0);
if (ret < 0)
{
Alarm(EXIT, "Sess_Init: Failure to Initialize DOWN_LINK memory objects\n");
Modified: trunk/daemon/spread.c
===================================================================
--- trunk/daemon/spread.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/spread.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -40,10 +40,10 @@
#include "spread_params.h"
#include "session.h"
#include "configuration.h"
-#include "sp_events.h"
+#include "spu_events.h"
#include "status.h"
#include "log.h"
-#include "alarm.h"
+#include "spu_alarm.h"
#ifndef ARCH_PC_WIN95
#include <grp.h>
@@ -89,7 +89,7 @@
struct passwd *pwd;
#endif
- Alarm_set_types( CONF );
+ Alarm_set_types( CONF_SYS );
Alarm_set_priority( SPLOG_INFO );
Alarmp( SPLOG_PRINT, SYSTEM, "/===========================================================================\\\n");
Modified: trunk/daemon/spread_params.h
===================================================================
--- trunk/daemon/spread_params.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/spread_params.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -81,7 +81,7 @@
#define MAX_GROUP_NAME (1+MAX_PRIVATE_NAME+1+MAX_PROC_NAME)
/* #private_name#proc_name including the null */
-#include "sp_events.h"
+#include "spu_events.h"
#define MAX_SESSIONS ( ( MAX_FD_EVENTS-5 ) / 2 ) /* reserves 2 for each connection */
#define DEFAULT_MAX_SESSION_MESSAGES 1000
Modified: trunk/daemon/status.c
===================================================================
--- trunk/daemon/status.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/daemon/status.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -38,13 +38,13 @@
#include "arch.h"
#include "spread_params.h"
-#include "scatter.h"
+#include "spu_scatter.h"
#include "net_types.h"
-#include "data_link.h"
+#include "spu_data_link.h"
#include "configuration.h"
#include "status.h"
-#include "sp_events.h"
-#include "alarm.h"
+#include "spu_events.h"
+#include "spu_alarm.h"
static sp_time Start_time;
static channel Report_channel;
Modified: trunk/libspread/Makefile.in
===================================================================
--- trunk/libspread/Makefile.in 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/libspread/Makefile.in 2012-03-06 06:17:03 UTC (rev 495)
@@ -44,9 +44,12 @@
DEFINES= $(NO_DEBUG)
CFLAGS=@CFLAGS@ $(DEFINES)
+#libspread-util includes
+LIBSPREADUTIL_DIR=../libspread-util
+LIBSPREADUTIL_PATHS=-I$(LIBSPREADUTIL_DIR)/include -I$(top_srcdir)/libspread-util/include
#stdutil includes
FLUSH_INC_DIR = -I../stdutil/src -I$(top_srcdir)/stdutil/src -I$(srcdir)
-CPPFLAGS=-I$(top_srcdir)/daemon -I../daemon -I$(top_srcdir)/include $(FLUSH_INC_DIR) @CPPFLAGS@ $(PATHS) @DEFS@
+CPPFLAGS=-I$(top_srcdir)/daemon -I../daemon -I$(top_srcdir)/include $(FLUSH_INC_DIR) $(LIBSPREADUTIL_PATHS) @CPPFLAGS@ $(PATHS) @DEFS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
THLDFLAGS=@THLDFLAGS@
@@ -56,7 +59,7 @@
SHCC=@SHCC@
SHLD=@SHLD@
SHCFLAGS=@SHCFLAGS@ $(DEFINES)
-SHCPPFLAGS=@SHCPPFLAGS@ -I$(top_srcdir)/daemon -I../daemon -I$(top_srcdir)/include $(FLUSH_INC_DIR)
+SHCPPFLAGS=@SHCPPFLAGS@ -I$(top_srcdir)/daemon -I../daemon -I$(top_srcdir)/include $(FLUSH_INC_DIR) $(LIBSPREADUTIL_PATHS)
SHLDFLAGS=@SHLDFLAGS@
SHLIBS=@SHLIBS@
SHLDOPTION=@SHLDOPTION@
@@ -74,17 +77,17 @@
TARGETS=libspread-core.a libtspread-core.a libspread.a @LIBSPSO@ @LIBSPCORESO@ @LIBTSPCORESO@
-LIBSP_OBJS= $(SP_OBJ_DIR)/alarm.o $(SP_OBJ_DIR)/events.o $(SP_OBJ_DIR)/memory.o sp.o
+LIBSP_OBJS= sp.o
-LIBSP_SHOBJS= alarm.lo events.lo memory.lo sp.lo
+LIBSP_SHOBJS= sp.lo
-LIBTSP_OBJS= alarm.to events.to memory.to sp.to
+LIBTSP_OBJS= sp.to
-LIBTSP_SHOBJS= alarm.tlo events.tlo memory.tlo sp.tlo
+LIBTSP_SHOBJS= sp.tlo
-LIBTFL_OBJS= fl.to scatp.to alarm.to events.to memory.to sp.to
+LIBTFL_OBJS= fl.to scatp.to sp.to
-LIBTFL_SHOBJS= fl.tlo scatp.tlo alarm.tlo events.tlo memory.tlo sp.tlo
+LIBTFL_SHOBJS= fl.tlo scatp.tlo sp.tlo
# A bit of a hack to grab the -fPIC threaded object files to merge into the shared spread library
# since the stdutil.so cannot be merged, and the stdutil.a is not compiled -fPIC
@@ -114,12 +117,14 @@
@echo "Skipping shared library installation."
# libspread-core is the core spread library without Flush or Stdutil
-libspread-core.a: $(LIBSP_OBJS)
+libspread-core.a: $(LIBSP_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
$(AR) rv $@ $(LIBSP_OBJS)
+ $(AR) x $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(AR) rv $@ alarm.o data_link.o memory.o events.o
$(RANLIB) $@
-libspread-core.dylib: $(LIBSP_SHOBJS)
- $(SHLD) -o libspread-core.$(LIBFULLVERSION).dylib $(LIBSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(SHLDNAME)libspread-core.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
+libspread-core.dylib: $(LIBSP_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o libspread-core.$(LIBFULLVERSION).dylib $(LIBSP_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(SHLDNAME)libspread-core.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
$(SOFTLINK) -f libspread-core.$(LIBFULLVERSION).dylib $@
install-libspread-core.dylib: libspread-core.dylib
@@ -130,8 +135,8 @@
install_name_tool -id $(DESTDIR)$(libdir)/libspread-core.$(LIBVERSION).dylib $(DESTDIR)$(libdir)/libspread-core.$(LIBFULLVERSION).dylib \
)
-libspread-core.so: $(LIBSP_SHOBJS)
- $(SHLD) -o $@ $(LIBSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
+libspread-core.so: $(LIBSP_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o $@ $(LIBSP_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
install-libspread-core.so: libspread-core.so
$(INSTALL) -m 0755 libspread-core.so $(DESTDIR)$(libdir)/libspread-core.so.$(LIBFULLVERSION)
@@ -140,12 +145,14 @@
$(SOFTLINK) -f libspread-core.so.$(LIBFULLVERSION) libspread-core.so.$(LIBVERSION) \
)
-libtspread-core.a: $(LIBTSP_OBJS)
+libtspread-core.a: $(LIBTSP_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
$(AR) rv $@ $(LIBTSP_OBJS)
+ $(AR) x $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(AR) rv $@ alarm.o data_link.o memory.o events.o
$(RANLIB) $@
-libtspread-core.dylib: $(LIBTSP_SHOBJS)
- $(SHLD) -o libtspread-core.$(LIBFULLVERSION).dylib $(LIBTSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(THLIBS) $(SHLDNAME)libtspread-core.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
+libtspread-core.dylib: $(LIBTSP_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o libtspread-core.$(LIBFULLVERSION).dylib $(LIBTSP_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(THLIBS) $(SHLDNAME)libtspread-core.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
$(SOFTLINK) -f libtspread-core.$(LIBFULLVERSION).dylib $@
install-libtspread-core.dylib: libtspread-core.dylib
@@ -156,8 +163,8 @@
install_name_tool -id $(DESTDIR)$(libdir)/libtspread-core.$(LIBVERSION).dylib $(DESTDIR)$(libdir)/libtspread-core.$(LIBFULLVERSION).dylib \
)
-libtspread-core.so: $(LIBTSP_SHOBJS)
- $(SHLD) -o $@ $(LIBTSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(THLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
+libtspread-core.so: $(LIBTSP_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o $@ $(LIBTSP_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(THLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
install-libtspread-core.so: libtspread-core.so
$(INSTALL) -m 0755 libtspread-core.so $(DESTDIR)$(libdir)/libtspread-core.so.$(LIBFULLVERSION)
@@ -167,14 +174,16 @@
)
# Full Spread library with Fl_, SP_, and support modules linked in
-libspread.a: $(LIBTFL_OBJS) ../stdutil/lib/libstdutil-threaded-release.a
+libspread.a: $(LIBTFL_OBJS) ../stdutil/lib/libstdutil-threaded-release.a $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
$(AR) rv $@ $(LIBTFL_OBJS)
$(AR) x ../stdutil/lib/libstdutil-threaded-release.a
$(AR) rv $@ std*.to
+ $(AR) x $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
+ $(AR) rv $@ alarm.o data_link.o memory.o events.o
$(RANLIB) $@
-libspread.dylib: $(LIBTFL_SHOBJS)
- $(SHLD) -o libspread.$(LIBFULLVERSION).dylib $(LIBTFL_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) ../stdutil/lib/libstdutil-threaded-release.a $(SHLDCONVERTSTATICEND) $(SHLIBS) $(THLIBS) $(SHLDNAME)libspread.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
+libspread.dylib: $(LIBTFL_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o libspread.$(LIBFULLVERSION).dylib $(LIBTFL_SHOBJS) $(SHLDFLAGS) $(SHLDCONVERTSTATIC) ../stdutil/lib/libstdutil-threaded-release.a $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(THLIBS) $(SHLDNAME)libspread.$(LIBVERSION).dylib -current_version $(LIBFULLVERSION) -compatibility_version $(LIBCOMPATVERSION)
$(SOFTLINK) -f libspread.$(LIBFULLVERSION).dylib $@
install-libspread.dylib: libspread.dylib
@@ -185,8 +194,8 @@
install_name_tool -id $(DESTDIR)$(libdir)/libspread.$(LIBVERSION).dylib $(DESTDIR)$(libdir)/libspread.$(LIBFULLVERSION).dylib \
)
-libspread.so: $(LIBTFL_SHOBJS)
- $(SHLD) -o $@ $(LIBTFL_SHOBJS) $(SHLDFLAGS) $(SHARED_STDUTIL) $(SHLIBS) $(THLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
+libspread.so: $(LIBTFL_SHOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa
+ $(SHLD) -o $@ $(LIBTFL_SHOBJS) $(SHLDFLAGS) $(SHARED_STDUTIL) $(SHLDCONVERTSTATIC) $(LIBSPREADUTIL_DIR)/lib/libspread-util.sa $(SHLDCONVERTSTATICEND) $(SHLIBS) $(THLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION)
install-libspread.so: libspread.so
$(INSTALL) -m 0755 libspread.so $(DESTDIR)$(libdir)/libspread.so.$(LIBFULLVERSION)
Modified: trunk/libspread/sp.c
===================================================================
--- trunk/libspread/sp.c 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/libspread/sp.c 2012-03-06 06:17:03 UTC (rev 495)
@@ -63,11 +63,11 @@
#endif /* ARCH_PC_WIN95 */
#include "mutex.h"
-#include "sp_events.h"
+#include "spu_events.h"
#include "spread_params.h"
#include "sess_types.h"
-#include "scatter.h"
-#include "alarm.h"
+#include "spu_scatter.h"
+#include "spu_alarm.h"
#include "acm.h"
/* SP functions need these types, but internal headers do not */
Modified: trunk/libspread-util/include/spu_objects_local.h
===================================================================
--- trunk/libspread-util/include/spu_objects_local.h 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/libspread-util/include/spu_objects_local.h 2012-03-06 06:17:03 UTC (rev 495)
@@ -52,7 +52,62 @@
#define MY_FIRST_OBJ = first_val
*/
+/* Note this assumes FIRST_APPLICATION_OBJECT_TYPE = 2 */
+#define PACK_HEAD_OBJ 2 /* net_objs.h */
+#define MESSAGE_OBJ 3 /* prot_objs.h */
+#define MSG_FRAG_OBJ 4 /* prot_objs.h */
+#define RET_REQ_OBJ 5 /* net_objs.h */
+#define LINK_ACK_OBJ 6 /* net_objs.h */
+#define ARU_UPDATE_OBJ 7 /* prot_objs.h */
+#define TOKEN_HEAD_OBJ 8 /* net_objs.h */
+#define TOKEN_BODY_OBJ 9 /* net_objs.h */
+#define ALIVE_OBJ 10 /* memb_objs.h */
+#define JOIN_OBJ 11 /* memb_objs.h */
+#define REFER_OBJ 12 /* memb_objs.h */
+#define STATETRANS_OBJ 13 /* memb_objs.h */
+/* Non-Transmitted objects */
+#define SCATTER 20
+#define QUEUE_ELEMENT 21
+#define QUEUE 22
+#define RETRANS_ENTRY 23
+#define RING_LINK_OBJ 24
+#define HOP_LINK_OBJ 25
+#define MESSAGE_LINK 26
+#define DOWN_LINK 27
+#define TREE_NODE 28
+#define MESSAGE_FRAG_LIST 29
+#define LBUCKET 30
+#define GROUP 31
+#define MEMBER 32
+#define MSG_LIST_ENTRY 33
+#define SESS_SEQ_ENTRY 34
+
+#define ROUTE_WEIGHTS 36
+#define PROF_FUNCT 37
+#define QUEUE_SET 38
+#define MQUEUE_ELEMENT 39
+#define TCP_LINK_OBJ 40
+#define MESSAGE_META_OBJ 41
+
+#define PROC_RECORD 42
+#define SYS_SCATTER 43
+#define STAT_RECORD 44
+#define STAT_GROUP 45
+#define STAT_REFRECORD 46
+
+#define MEMB_MISSING_SEQENTRY 47
+#define MEMB_MISSING_DAEMON 48
+#define MEMB_DEPEND_MESSL 49
+#define PACKET_BODY 50
+
+#define SESSION_AUTH_INFO 51
+
+#define GROUPS_BUF_LINK 52
+#define GROUPS_MESSAGE_LINK 53
+#define DAEMON_MEMBERS 54
+
+
/* Highest valid object number is defined in objects.h as UNKNOWN_OBJ */
#endif /* OBJECTS_LOCAL_H */
Modified: trunk/libspread-util/src/Makefile.in
===================================================================
--- trunk/libspread-util/src/Makefile.in 2012-03-06 06:11:25 UTC (rev 494)
+++ trunk/libspread-util/src/Makefile.in 2012-03-06 06:17:03 UTC (rev 495)
@@ -66,7 +66,7 @@
LIB_SHOBJS=$(LIB_OBJS:.o=.lo)
-all: $(TARGETS)
+all: $(TARGETS) binrelease
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -D_REENTRANT -c $<
More information about the Spread-cvs
mailing list