---
 INSTALL              |  237 +++++++++++++++++++++++++++++++++++++++++++++++++-
 src/Makefile.am      |   21 ++++-
 src/configVariable.h |  225 ++++++++++++++++++++----------------------------
 src/remoteConfig.cc  |   67 ++++----------
 src/remoteConfig.h   |   22 +----
 src/start_awds       |  123 ++++++++++++++++++++++----
 src/stop_awds        |   13 ++--
 7 files changed, 484 insertions(+), 224 deletions(-)
 mode change 120000 => 100644 INSTALL

diff --git a/INSTALL b/INSTALL
deleted file mode 120000
index 81fa6ffa451ee21fd1c60d4ba33acd5c36bc6865..0000000000000000000000000000000000000000
--- a/INSTALL
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.9/INSTALL
\ No newline at end of file
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000000000000000000000000000000000000..23e5f25d0e5f85798dcfb368ecb2f04f59777f61
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/src/Makefile.am b/src/Makefile.am
index ad80bb6a41cd7e9741458991a4ac6b6c94c8abc2..9a2f53cedae3ed587c0409cbe2ad26a84448fc69 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,8 +28,10 @@ pkglib_LTLIBRARIES = \
 	ttmetric.la \
 	pktpair.la \
 	src_filter.la \
-	traffic.la
-
+	traffic.la \
+	remoteconfig.la \
+	testModul.la \
+	spp.la
 #	tapiface_crypto.la \
 #
 
@@ -100,6 +102,21 @@ topowatch_la_CPPFLAGS = -DMODULE_NAME=topowatch $(COMMON_CPPFLAGS)
 topowatch_la_LDFLAGS  = $(module_flags)
 topowatch_la_LIBADD = -lgea3 -lgea3-posix
 
+remoteconfig_la_SOURCES  = remoteConfig.cc remoteConfig.h configVariable.h
+remoteconfig_la_CPPFLAGS = -DMODULE_NAME=remoteconfig $(COMMON_CPPFLAGS)
+remoteconfig_la_LDFLAGS  = $(module_flags)
+remoteconfig_la_LIBADD = -lgea3 -lgea3-posix
+
+spp_la_SOURCES  = SPP.cc SPP.h SPP2.h History.h
+spp_la_CPPFLAGS = -DMODULE_NAME=spp $(COMMON_CPPFLAGS)
+spp_la_LDFLAGS  = $(module_flags)
+spp_la_LIBADD = -lgea3 -lgea3-posix 
+
+testModul_la_SOURCES  = testmodul.cc testmodul.h configVariable.h remoteConfig.h
+testModul_la_CPPFLAGS = -DMODULE_NAME=testModul $(COMMON_CPPFLAGS)
+testModul_la_LDFLAGS  = $(module_flags)
+testModul_la_LIBADD = -lgea3 -lgea3-posix
+
 shell_la_SOURCES  = shell.cc unixfdostream.h
 shell_la_CPPFLAGS = -DMODULE_NAME=shell $(COMMON_CPPFLAGS)
 shell_la_LDFLAGS  = $(module_flags)
diff --git a/src/configVariable.h b/src/configVariable.h
index 4859743f93ba63524735e770d57744f2ead5feec..388117dd4fadaf4a8fdc2004158eca8c508df7ca 100644
--- a/src/configVariable.h
+++ b/src/configVariable.h
@@ -5,17 +5,9 @@
 
 class RemoteConfig;
 
-typedef int (*variableSetHandler) (const void* value, void* thisref);
-typedef int (*variableGetHandler) (void* value, void* thisref);
+typedef int (*variableSetHandler) (void* classref,const void* value);
+typedef int (*variableGetHandler) (void* classref,void* value);
 
-enum ConfigVariableType
-{
-	CONFIG_VARIABLE_TYPE_INT=0,
-	CONFIG_VARIABLE_TYPE_STRING=1,
-	CONFIG_VARIABLE_TYPE_BOOL=2,
-	CONFIG_VARIABLE_TYPE_FLOAT=3,
-	CONFIG_VARIABLE_TYPE_DOUBLE=4
-};
 enum
 {
 	CONFIG_VARIABLE_SUCCESS  = 0,
@@ -29,22 +21,21 @@ class ConfigVariable
 
 
 	private:
-		typedef void ( ConfigVariable::*FType)(const char*,const unsigned int, void*, void*);
 	protected:
 		char* m_name;
 		unsigned int m_namelength;
-		FType m_get;//(const char* name,const unsigned int nameLength, void* thisref, void* fp);
-		FType m_set;//(const char* name,const unsigned int nameLength, void* thisref, void* fp);
+
 		variableGetHandler m_vgh;
 		variableSetHandler m_vsh;
+
 		void* m_thisref;
 	public:
 
-		ConfigVariable(const char* name,variableGetHandler vgh,variableSetHandler vsh,void* thisref)
+		ConfigVariable(const char* name,variableGetHandler vgh,variableSetHandler vsh,void* classref)
 		{
 			m_vgh=vgh;
 			m_vsh=vsh;	
-			m_thisref=thisref;
+			m_thisref=classref;
 			if(name)
 			{
 				int length=strlen(name);
@@ -81,111 +72,68 @@ class ConfigVariable
 
 		virtual int get(void* value)
 		{
-			m_vgh(value,m_thisref);
+			m_vgh(m_thisref,value);
 			return 0;
 
 		}
 		virtual int set(void* value)
 		{
-			m_vsh(value,m_thisref);
+			m_vsh(m_thisref,value);
 			return 0;
 		}
 		void setFromString(const char * value)
 		{
 			this->fromString(value);
-			m_vsh(value,m_thisref);
+			m_vsh(m_thisref,value);
 		}
-//		virtual int setdefaultValue(void* value)=0;
+
 		virtual char* toString(char* &buffer)=0;
 		virtual void fromString(const char * value)=0;
 
 		char* getName(){return m_name;}
 };
 
-template <class T> class MemberCallFunction
-{
-		
-	private:
-		typedef void ( T::*FType)(const char*,const unsigned int, void*, void*);
-		FType m_function;
-	public:
-		MemberCallFunction(FType f)
-		{
-			m_function = f;
-		}
-		ConfigVariable::FType get()
-		{
-			union
-			{
-				FType f1;
-				ConfigVariable::FType f2;
-			}function;
-			function.f1=m_function;
-			return function.f2;
-		}
-		void call()
-		{
-			union
-			{
-				FType f1;
-				ConfigVariable::FType f2;
-			}function;
-			function.f1=m_function;
-		}
-
-};
-
-
-
-
 class ConfigVariableInt : public ConfigVariable
 {
 	private:
-/*
-	enum
-	{
-		CONFIG_VARIABLE_SUCCESS  = 0,
-		CONFIG_VARIABLE_FAILURE  = 0,
-		CONFIG_VARIABLE_READONLY = 0
-	};
-*/
 	protected:
-		int m_value;
-
 	public:
 		
 		virtual int get(void* value)
 		{
-			*((int*)(value))=m_value;
-			m_vgh(value,m_thisref);
+			//*((int*)(value))=m_value;
+			m_vgh(m_thisref,value);
 			return 0;
 
 		}
 		virtual int set(void* value)
 		{
-			m_value=*((int*)value);
-			m_vsh(value,m_thisref);
+			//m_value=*((int*)value);
+			m_vsh(m_thisref,value);
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 
-		ConfigVariableInt(const char* name, const int value, variableGetHandler vgh,variableSetHandler vsh,void* thisref): ConfigVariable(name,vgh,vsh,thisref)
+		ConfigVariableInt(const char* name, const int value, variableGetHandler vgh,variableSetHandler vsh,void* classref): ConfigVariable(name,vgh,vsh,classref)
 		{
-			m_value=value;
+			//m_value=value;
 		}
 		ConfigVariableInt(const ConfigVariableInt &c): ConfigVariable(c)
 		{
-			m_value=c.m_value;
+			//m_value=c.m_value;
 		}
 		virtual char* toString(char* &buffer)
 		{
 			//char buffer[256];
 			memset(buffer,0,256);
-			int retval = sprintf(buffer,"%i",m_value);
+			int value=0;
+			m_vgh(m_thisref,&value);
+			int retval = sprintf(buffer,"%i",value);
 			return buffer;
 		}
 		virtual void fromString(const char * value)
 		{
-			m_value=atoi(value);
+			int mvalue=atoi(value);
+			m_vsh(m_thisref,&mvalue);
 		}
 
 };
@@ -196,16 +144,17 @@ class ConfigVariableString : public ConfigVariable
 	private:
 
 	protected:
-		char* m_value;
-		unsigned int m_valueLength;
+		//char* m_value;
+		//unsigned int m_valueLength;
 	public:
 
 		virtual int get(void* value)
 		{
 			//*((int*)(value))=m_value;
-			value = new char[m_valueLength];
-			memcpy(value,m_value,m_valueLength);
-			m_vgh(value,m_thisref);
+			//value = new char[m_valueLength];
+			//m_vgh(m_thisref,&value);
+			//memcpy(value,m_value,m_valueLength);
+			m_vgh(m_thisref,value);
 
 
 			return CONFIG_VARIABLE_SUCCESS;
@@ -213,62 +162,67 @@ class ConfigVariableString : public ConfigVariable
 		virtual int set(void* value)
 		{
 //			m_value=*((int*)value);
-			int m_valueLength = strlen((char*)value);
-			if(m_valueLength>0)
+			int valueLength = strlen((char*)value);
+			if(valueLength>0)
 			{
-				m_vsh(value,m_thisref);
-				m_value=new char[m_valueLength];
-				memcpy(m_value,value,m_valueLength);
+				m_vsh(m_thisref,value);
+				//char* value=new char[valueLength];
+				//memcpy(m_value,value,m_valueLength);
 			}
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 
-		ConfigVariableString(const char* name,  const char* value,variableGetHandler vgh,variableSetHandler vsh,void* thisref): ConfigVariable(name,vgh,vsh,thisref)
+		ConfigVariableString(const char* name,  const char* value,variableGetHandler vgh,variableSetHandler vsh,void* classref): ConfigVariable(name,vgh,vsh,classref)
 		{
 			if(value)
 			{
 				unsigned int length = strlen(value);
-				m_value = new char[length+1];
-				memcpy(m_value,value,length);
-				m_value[length]=0;
-				m_valueLength=length+1;
+				//m_value = new char[length+1];
+			//	memcpy(m_value,value,length);
+			//	m_value[length]=0;
+			//	m_valueLength=length+1;
 			}
 		}
 		ConfigVariableString(const ConfigVariableString &c): ConfigVariable(c)
 		{
-			if(c.m_value)
+			//if(c.m_value)
 			{
-				m_value = new char[c.m_valueLength];
-				memcpy(m_value,c.m_value,c.m_valueLength);
-				m_value[c.m_valueLength]=0;
-				m_valueLength=c.m_valueLength;
+			//	m_value = new char[c.m_valueLength];
+			//	memcpy(m_value,c.m_value,c.m_valueLength);
+			//	m_value[c.m_valueLength]=0;
+			//	m_valueLength=c.m_valueLength;
 			}
 		}
 
 		virtual ~ConfigVariableString()
 		{
-			if(m_value)
+			//if(m_value)
 			{
-				delete m_value;
-				m_value=NULL;
-				m_valueLength=0;
+			//	delete m_value;
+			//	m_value=NULL;
+			//	m_valueLength=0;
 			}
 		}
 		virtual char* toString(char* &buffer)
 		{	
-			buffer = new char[m_valueLength];
-			memcpy(buffer,m_value,m_valueLength);
+			
+			buffer = new char[1024];
+			//memcpy(buffer,m_value,m_valueLength);
+			memset(buffer,0,1024);
+			m_vgh(m_thisref,buffer);
 			return buffer;
 		}
 		virtual void fromString(const char * value)
 		{
-			int m_valueLength = strlen(value);
-			if(m_valueLength>0)
+			int valueLength = strlen(value);
+			
+			if(valueLength>0)
 			{
-				if(m_value)
-					delete m_value;
-				m_value = new char[m_valueLength];
-				memcpy(m_value,value,m_valueLength);
+				m_vsh(m_thisref,value);
+				//if(m_value)
+				//	delete m_value;
+				//m_value = new char[m_valueLength];
+				//memcpy(m_value,value,m_valueLength);
 			}
 			
 		}
@@ -286,31 +240,39 @@ class ConfigVariableBool : public ConfigVariable
 
 		virtual int get(void* value)
 		{
-			*((bool*)(value))=m_value;
-			m_vgh(value,m_thisref);
+			//*((bool*)(value))=m_value;
+			m_vgh(m_thisref,value);
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 		virtual int set(void* value)
 		{
-			m_value=*((bool*)value);
-			m_vsh(value,m_thisref);
+			//m_value=*((bool*)value);
+			m_vsh(m_thisref,value);
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 
-		ConfigVariableBool(const char* name,  const bool value,variableGetHandler vgh,variableSetHandler vsh,void* thisref): ConfigVariable(name,vgh,vsh,thisref)
+		ConfigVariableBool(const char* name,  const bool value,variableGetHandler vgh,variableSetHandler vsh,void* classref): ConfigVariable(name,vgh,vsh,classref)
 		{
-			m_value=value;
+			//m_value=value;
 		}
 		ConfigVariableBool(const ConfigVariableBool &c): ConfigVariable(c)
 		{
-			m_value=c.m_value;
+			//m_value=c.m_value;
 		}
 
 		virtual char* toString(char* &buffer)
 		{
 			//char buffer[256];
-			memset(buffer,0,256);
-			sprintf(buffer,"%i",m_value);
+			
+			buffer = new char[16];
+			//memcpy(buffer,m_value,m_valueLength);
+			memset(buffer,0,16);
+			bool value=false;
+			m_vgh(m_thisref,&value);
+			if(value)
+				sprintf(buffer,"true",value);
+			else
+				sprintf(buffer,"false",value);
 			return buffer;
 		}
 
@@ -334,36 +296,39 @@ class ConfigVariableFloat : public ConfigVariable
 		virtual int get(void* value)
 		{
 			*((float*)(value))=m_value;
-			m_vgh(value,m_thisref);
+			m_vgh(m_thisref,value);
 			return 0;
 		}
 		virtual int set(void* value)
 		{
 			m_value=*((float*)value);
-			m_vsh(value,m_thisref);
+			m_vsh(m_thisref,value);
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 		virtual char* toString(){}
 
-		ConfigVariableFloat(const char* name, const float value,variableGetHandler vgh,variableSetHandler vsh,void* thisref): ConfigVariable(name,vgh,vsh,thisref)
+		ConfigVariableFloat(const char* name, const float value,variableGetHandler vgh,variableSetHandler vsh,void* classref): ConfigVariable(name,vgh,vsh,classref)
 		{
-			m_value=value;
 		}
 		ConfigVariableFloat(const ConfigVariableFloat &c): ConfigVariable(c)
 		{
-			m_value=c.m_value;
 		}
 
 		virtual char* toString(char* &buffer)
 		{
 			//char buffer[256];
-			memset(buffer,0,256);
-			sprintf(buffer,"%f",m_value);
+			float value;
+			m_vgh(m_thisref,&value);
+			buffer = new char[1024];
+			memset(buffer,0,1024);
+			
+			sprintf(buffer,"%f",value);
 			return buffer;
 		}
 		virtual void fromString(const char * value)
 		{
-			m_value = atof(value);
+			float mvalue = atof(value);
+			m_vsh(m_thisref,&mvalue);
 		}
 };
 
@@ -379,26 +344,22 @@ class ConfigVariableDouble : public ConfigVariable
 		virtual int get(void* value)
 		{
 			*((float*)(value))=m_value;
-			m_vgh(value,m_thisref);
+			m_vgh(m_thisref,value);
 			return 0;
 
 		}
 		virtual int set(void* value)
 		{
 			m_value=*((float*)value);
-			m_vsh(value,m_thisref);
+			m_vsh(m_thisref,value);
 			return CONFIG_VARIABLE_SUCCESS;
 		}
 		virtual char* toString(){}
 
-		ConfigVariableDouble(const char* name, const double value,variableGetHandler vgh,variableSetHandler vsh,void* thisref): ConfigVariable(name,vgh,vsh,thisref)
-		{
-			m_value=value;
-		}
+		ConfigVariableDouble(const char* name, const double value,variableGetHandler vgh,variableSetHandler vsh,void* classref): ConfigVariable(name,vgh,vsh,classref)
+		{}
 		ConfigVariableDouble(const ConfigVariableDouble &c): ConfigVariable(c)
-		{
-			m_value=c.m_value;
-		}
+		{}
 
 		virtual char* toString(char* &buffer)
 		{
diff --git a/src/remoteConfig.cc b/src/remoteConfig.cc
index 8ab14911b582043bcccd0e7b2479dea2d9ddd73d..66cddeaff3e7fe7f82ae59ff1ffd97501a41ce69 100644
--- a/src/remoteConfig.cc
+++ b/src/remoteConfig.cc
@@ -11,10 +11,9 @@ using namespace awds;
 
 RemoteConfig::RemoteConfig()
 {
-	REP_MAP_OBJ(RemoteConfig *,variableGetHandler);
 
 }
-
+/*
 int RemoteConfig::remoteConfigAnnounce(char* name,ConfigVariableType cvt,void* thisref,variableGetHandler vgh,variableSetHandler vsh,void* value)
 {
 	REP_MAP_OBJ(RemoteConfig *,remoteConfig);
@@ -27,11 +26,14 @@ int RemoteConfig::remoteConfigAnnounce(char* name,ConfigVariableType cvt,void* t
 		else if(cvt==CONFIG_VARIABLE_TYPE_DOUBLE) remoteConfig->remoteVariables[name]=new ConfigVariableDouble(name,*((double*)value),vgh,vsh,thisref);
 	}
 	return 0;
+}*/
+int RemoteConfig::remoteConfigAnnounce(char* name,ConfigVariable* cv)
+{
+	//REP_MAP_OBJ(RemoteConfig *,remoteConfig);remoteConfig->
+	remoteVariables[name]=cv;
+	return 0;
 }
-/*
-remoteConfig.cc:91: error: no matching function for call to ‘SppManager2::sendRequestAll(int, char*&, <unresolved overloaded function type>, gea::AbsTime*&, int ()(void*, ReadMarshalStream*, WriteMarshalStream*, const awds::NodeId&), gea::AbsTime*&, void ()(void*))’
-./SPP2.h:143: note: candidates are: virtual int SppManager2::sendRequestAll(uint32_t, void*, void (*)(void*, WriteMarshalStream*), void*, int (*)(void*, ReadMarshalStream*, const awds::NodeId&), void*, void (*)(void*))
-*/
+
 void RemoteConfig::requestCreator (void *data, WriteMarshalStream* msOut)
 {
 	unsigned int* pidata = (unsigned int*) data;
@@ -76,7 +78,7 @@ int RemoteConfig::remoteConfigAddCommand() {
     if (!shell)
 	return -1;
 
-    shell->add_command("topolock", remoteconfig_command_fn, this,
+    shell->add_command("rc", remoteconfig_command_fn, this,
 		       "remote manipulation of all topologies",
 		       config_cmd_usage);
 
@@ -87,7 +89,7 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 {
 	REP_MAP_OBJ(SppManager2 *,sppManager);
     	int cmd;
-    	if ( (argc >= 2) && !strcmp(argv[1], "set")) 
+    	if ( (argc >= 2) && !strcmp(argv[1], "set")) //TODO das set entfernen!
 	{
 		cmd = 1;
 		if(!strcmp(argv[2], "[..]")) // FUER ALLE KNOTEN
@@ -106,9 +108,6 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 					memcpy(pbuffer,&i,sizeof(unsigned int));pbuffer+=sizeof(unsigned int);
 					memcpy(pbuffer,argv[3],length);pbuffer+=length;
 					memcpy(pbuffer,argv[4],length1);pbuffer+=length1;
-//int SppManager2::sendRequestAll(  uint32_t spp_id,  void * data1, spp_request_creator  h1, void * data2, spp_response_handler h2,  void * data3, spp_finished_handler h3) 
-
-//remoteConfig.cc:94: error: invalid conversion from ‘int (*)(void*, ReadMarshalStream*, WriteMarshalStream*, const awds::NodeId&)’ to ‘int (*)(void*, ReadMarshalStream*, const awds::NodeId&)’
 
 					gea::AbsTime *t_start = new gea::AbsTime(GEA.lastEventTime);
 					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
@@ -128,17 +127,16 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 					sppManager->sendRequestAll( 9876, buffer, RemoteConfig::requestCreator, t_start, RemoteConfig::responseHandler,t_start,RemoteConfig::finishedHandler);
 				}
 
-				//requestcreate einfach die parameter leerzeichengetrennt reindumpen und so weiterleiten!
 				//sppManager->sendRequestAll( 9761, &v, create_req, t_start, get_response);
 			}
 			
 		}
 		else // einzeln parsen
-		{}
-    	} else if ( (argc >= 2) && !strcmp(argv[1], "get"))
-	{
-		cmd = 2;
-    	} else
+		{
+			//TODO nochmal überarbeiten Knotenliste wurde falsch geparsed!!
+		}
+    	}
+	else
 	{
 		*sc.sockout << config_cmd_usage << endl;
 		return 0;
@@ -148,34 +146,15 @@ int RemoteConfig::remoteconfig_command_fn(ShellClient &sc, void *data, int argc,
 
 void RemoteConfig::finishedHandler (void *data)
 {
-
+//TODO zusammen mit dem einzelnen Knoten zum senden neu implementieren
 
 }
 int RemoteConfig::responseHandler (void *data, ReadMarshalStream*  msIn, const awds::NodeId& src) 
 {
+	//TODO zusammen mit dem einzelnen Knoten zum senden neu implementieren
     return 0;
 }
-/*
-
-    typedef int  (*spp_request_handler) (void *data, 
-					 ReadMarshalStream*  msIn, WriteMarshalStream* msOut, 
-					 const awds::NodeId& src);
-    
-    typedef int  (*spp_response_handler)(void *data, ReadMarshalStream*  msIn, 
-					 const awds::NodeId& src);
 
-    typedef void (*spp_request_creator) (void *data, WriteMarshalStream* msOut);
-    
-    typedef void (*spp_finished_handler) (void *data);
-
-	*msIn >>v2;
-	std::map<char[VARIABLE_NAME_LENGTH],void*>::iterator it = remoteObjects.find(rrv.name);
-	if(it!=remoteObjects.end())
-		it->remoteConfigHandler(data, msIn, msOut,src);* /
-
-    GEA.dbg() << "SPP: Got request " << a << " " << b << endl;
-    *msOut << (a+b);
-*/
 int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src) 
 {
 	uint32_t length;
@@ -191,6 +170,7 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 	char * pch;
 	int i=0;
 	for(int i=0;i<3;i++)modulename[i]=NULL;
+	//TODO mehrere streams auslesen? allerdings muessten dann mehrere ints übertragen werden wegen der länge?
 	pch = strtok (&(names[0])," ");
 	while (pch != NULL&&i<3)
 	{
@@ -246,11 +226,7 @@ int RemoteConfig::requestHandler (void *data, ReadMarshalStream*  msIn, WriteMar
 	delete names;
     return 0;
 }
-/*
-remoteConfig.cc:92: error: no matching function for call to ‘SppManager2::sendRequestAll(int, char*&, <unresolved overloaded function type>, gea::AbsTime*&, int ()(void*, ReadMarshalStream*, WriteMarshalStream*, const awds::NodeId&), void*, void ()(void*))’
-./SPP2.h:143: note: candidates are: virtual int SppManager2::sendRequestAll(uint32_t, void*, void (*)(void*, WriteMarshalStream*), void*, int (*)(void*, ReadMarshalStream*, const awds::NodeId&), void*, void (*)(void*))
 
-*/
 GEA_MAIN(argc, argv)
 {
 
@@ -267,11 +243,6 @@ GEA_MAIN(argc, argv)
 		sppManager->registerHandler(9876, 0, RemoteConfig::requestHandler);
 		GEA.dbg() << "Handler registered with SPP" << endl;
 	}
-/*
-		else {
-			uint32_t v = 12;
-			sppManager->sendRequestAll(9876, &v, createRequest, t_start, getResponse);
-    }
-    */
+
     return 0;
 }
\ No newline at end of file
diff --git a/src/remoteConfig.h b/src/remoteConfig.h
index 62eccfcbf7614e1d22707a45dc58856b7c7f4a7b..06cceaec9061181e389b6e202b047679b2752896 100644
--- a/src/remoteConfig.h
+++ b/src/remoteConfig.h
@@ -5,27 +5,26 @@
 
 #include <awds/ext/Shell.h>
 #include "configVariable.h"
-//typedef void ( RemoteConfig::*FType)(const char*,const unsigned int, void*, void*);
+
 class RemoteConfig
 {
 
 private:
-	//FType m_fType;
+
 
 
 protected:
-//	std::map<char[VARIABLE_NAME_LENGTH], FType > remoteVariables;
+
 	std::map<char*, ConfigVariable* > remoteVariables;
-	//std::map<char[VARIABLE_NAME_LENGTH], void* > remoteObjects;
 	std::map<unsigned int,unsigned int> requests;
 
 public:
 
-//typedef int  (*spp_request_handler) (void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src);
 
 
 	RemoteConfig();
-	int remoteConfigAnnounce(char* name,ConfigVariableType cvt,void* thisref,variableGetHandler vgh,variableSetHandler vsh,void* value=NULL);
+	//int remoteConfigAnnounce(char* name,ConfigVariableType cvt,void* thisref,variableGetHandler vgh,variableSetHandler vsh,void* value=NULL);
+	int remoteConfigAnnounce(char* name,ConfigVariable* cv);
 	int remoteConfigAddCommand();
 	static int remoteconfig_command_fn(ShellClient &sc, void *data, int argc, char **argv);
 	static int requestHandler (void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src);
@@ -34,17 +33,6 @@ public:
 	static void finishedHandler (void *data);
 
 
-
-/*
-	int remotePluginConfigHandler(void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src);
-	int remoteConfigHandler(void *data, ReadMarshalStream*  msIn, WriteMarshalStream* msOut, const awds::NodeId& src);
-	int  addRemoteConfigCmd();
-	void createRequest(void *data, WriteMarshalStream* msOut);
-	int  getResponse(void *data, ReadMarshalStream*  msIn,const awds::NodeId& src);
-
-	int attachVariable(char* name,variableSetHandler,variableGetHandler);
-	static int remoteconfig_command_fn(ShellClient &sc, void *data, int argc, char **argv);
-*/
 };
 
 #endif
\ No newline at end of file
diff --git a/src/start_awds b/src/start_awds
index 489bf430a06d6e47e3482d37da177e2eed0380bc..52d81a35503748c7ed3175be2064358acf7add26 100755
--- a/src/start_awds
+++ b/src/start_awds
@@ -1,15 +1,61 @@
 #!/bin/sh
 
-CONF_FILE=/etc/awds.conf
-[ -e $CONF_FILE ] && source $CONF_FILE
+CONF_DIR=/usr/local/etc
+MODULES_DIR=/usr/local/lib/awds
 
-modprobe tun
+CONF_FILE=$CONF_DIR/awds.conf
+[ -e $CONF_FILE ] && . $CONF_FILE
+
+
+print_help()
+{
+echo "\
+use: $0 [options]
+where [options] is one or more of:
+  -i <if>	set the interface (ath0, wlan0, etc.)
+  -N		run in foreground
+  -v		verbose debug output
+  -p <prefix>	prepend <prefix> (e.g. 'strace', 'valgrind')"
+}
+
+
+PARAM_DEV=''
+PREFIX=''
+VERBOSE=''
+while [ $# -gt 0 ]; do
+  case "$1" in
+    -i) [ "$2" = "" ] && print_help && exit -1
+        PARAM_DEV=$2
+        shift 2
+        ;;
+    -N) DAEMONIZE="no"
+        shift
+        ;;
+    -v) VERBOSE="--verbose"
+        shift
+        ;;
+    -p) [ "$2" = "" ] && print_help && exit -1
+        PREFIX=$2
+        shift 2
+        ;;
+    -h) print_help
+        exit 0
+        ;;
+    *)  print_help
+        exit -1
+        ;;
+  esac
+done
+
+grep -q tun /proc/modules || find /lib/modules/$(uname -r) -name tun.*o -exec insmod {} \;
 
 # use this for early detection of wrong configured stack:
 export LD_BIND_NOW=1
-export LD_LIBRARY_PATH=.libs
+test -n "$LD_LIBRARY_PATH" && LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}$MODULES_DIR
 
-cd $(dirname $0)
+# go to / to sanitize daemon and not block mounts
+cd /
 
 if [ $NET_DEV = auto ]
 then
@@ -19,25 +65,68 @@ AUTODEV=$NET_DEV
 fi
 
 # argv1 can override the setting
-DEVICE=${1:-$AUTODEV}
+DEVICE=${PARAM_DEV:-$AUTODEV}
 
 AESCCM=''
 if [ x$USE_ENCRYPTION = xyes ]
-then 
+then
 AESCCM="aesccm.so -k $KEY_FILE"
 fi
 
-echo Starting AWDS on $DEVICE
+AWDS_SHELL=''
+[ "$USE_AWDS_SHELL" = yes ] && AWDS_SHELL='shell.so'
 
-exec gea_start -i <<END
-shell.so
-daemon.so --pidfile /var/run/awds.pid
-rawbasic.so $DEVICE
-awdsrouting.so --name $HOSTNAME
-.libs/pinger.so
+AWDS_TOPO=''
+[ "$USE_TOPO_EXPORT" = yes ] && AWDS_TOPO='topowatch.so'
+
+AWDS_DAEMON=''
+PIDFILE=${PIDFILE:-/var/run/awds.pid}
+[ "$DAEMONIZE" = yes ] && AWDS_DAEMON="daemon.so --pidfile $PIDFILE"
+
+
+
+if [ "$DEV_CHANGE_WIRELESS_SETTINGS" = yes ]
+then
+    ifconfig $DEVICE down
+    iwconfig $DEVICE mode ad-hoc channel $DEV_WIRELESS_CHANNEL essid $DEV_WIRELESS_ESSID
+    ifconfig $DEVICE mtu 2000
+    ifconfig $DEVICE up
+
+    # madwifi bug workaround:
+    # set uapsd option to zero, if available
+    iwpriv $DEVICE 2>&1 | grep -q uapsd && iwpriv $DEVICE uapsd 0
+fi
+
+# Files in etc/awds.d/ or other scripts can utilize the AWDS_EXTENSIONS
+# environment variable to also load other gea modules when starting awds.
+if [ -d ${CONF_DIR}/awds.d ]
+then
+    FILES=$(find ${CONF_DIR}/awds.d/ -xtype f | sort )
+    for i in $FILES; do
+	source $i
+    done
+fi
+
+
+name="$HOSTNAME"
+[ -z "$name" -a -x /bin/hostname ] && name=$(/bin/hostname)
+[ -z "$name" -a -f /proc/sys/kernel/hostname ] && name=$(cat /proc/sys/kernel/hostname)
+
+# echo Starting AWDS on $DEVICE
+
+exec $PREFIX gea3_start -i <<END
+$AWDS_SHELL
+$AWDS_DAEMON
+rawbasic.so --raw-device $DEVICE
+awdsrouting.so --name $name $VERBOSE
+etxmetric.so
+pinger.so
 $AESCCM
-tapiface2.so
-topowatch.so
+tapiface.so
+$AWDS_TOPO
 topolock.so
+$AWDS_EXTENSIONS
+spp.so
+remoteConfig.so
+testModul.so
 END
-
diff --git a/src/stop_awds b/src/stop_awds
index c22bfdfc0f82da710a30f6875ee855e7e197fdca..cc331d6d0f80414772ab7a533e3f355cdbcfc3be 100755
--- a/src/stop_awds
+++ b/src/stop_awds
@@ -1,18 +1,17 @@
 #!/bin/sh
 
-CONF_FILE=/etc/awds.conf
-[ -e $CONF_FILE ] && source $CONF_FILE
+CONF_FILE=/usr/local/etc/awds.conf
+[ -e $CONF_FILE ] && . $CONF_FILE
 
-modprobe tun
 
 # use this for early detection of wrong configured stack:
 export LD_BIND_NOW=1
-export LD_LIBRARY_PATH=.libs
+test -n "$LD_LIBRARY_PATH" && LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}/usr/local/lib/awds
 
 cd $(dirname $0)
 
 ACTION=--kill
-ACTION=-t
-exec gea_start daemon.so $ACTION --pidfile /var/run/awds.pid
-
+test "$1" = "--test" && ACTION=-t
 
+exec gea3_start daemon.so $ACTION --pidfile /var/run/awds.pid
-- 
1.6.2.1


