Index: source/ariba/utility/CMakeLists.txt
===================================================================
--- source/ariba/utility/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,60 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    messages.h
-    serialization.h
-    types.h
-    )
-
-add_subdir_sources(
-    addressing
-    addressing2
-    bootstrap
-    configuration
-    internal
-    logging
-    messages
-    misc
-    serialization
-    system
-    transport
-    types
-    visual
-    vtypes
-    )
Index: source/ariba/utility/configuration/CMakeLists.txt
===================================================================
--- source/ariba/utility/configuration/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,47 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    ConfigFile.h
-    Configuration.h
-    )
-
-add_sources(
-    ConfigFile.cpp
-    Configuration.cpp
-    )
Index: source/ariba/utility/configuration/ConfigFile.cpp
===================================================================
--- source/ariba/utility/configuration/ConfigFile.cpp	(revision 12775)
+++ source/ariba/utility/configuration/ConfigFile.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // ConfigFile.h
 // Class for reading named values from configuration files
@@ -23,13 +23,9 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 // IN THE SOFTWARE.
-// [License]
+// [Licence]
 
 #include "ConfigFile.h"
 
 using std::string;
-
-namespace ariba {
-namespace utility {
-
 
 ConfigFile::ConfigFile( string filename, string delimiter,
@@ -169,4 +165,2 @@
 	return is;
 }
-
-}}
Index: source/ariba/utility/configuration/ConfigFile.h
===================================================================
--- source/ariba/utility/configuration/ConfigFile.h	(revision 12775)
+++ source/ariba/utility/configuration/ConfigFile.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // ConfigFile.h
 // Class for reading named values from configuration files
@@ -23,5 +23,5 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 // IN THE SOFTWARE.
-// [License]
+// [Licence]
 
 
@@ -54,7 +54,4 @@
 
 using std::string;
-
-namespace ariba {
-namespace utility {
 
 class ConfigFile {
@@ -238,6 +235,4 @@
 }
 
-}}
-
 #endif  // CONFIGFILE_H
 
Index: source/ariba/utility/configuration/Configuration.cpp
===================================================================
--- source/ariba/utility/configuration/Configuration.cpp	(revision 12775)
+++ source/ariba/utility/configuration/Configuration.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Configuration.h"
@@ -51,18 +51,9 @@
 void Configuration::setConfigFilename(string filename){
 	CONFIG_FILE = filename;
-	if(haveConfig())
-		instance().reload();
+	instance().reload();
 }
 
 Configuration::~Configuration(){
 	delete config;
-}
-
-bool Configuration::haveConfig(){
-	std::ifstream in( CONFIG_FILE.c_str() );
-	if( !in ) return false;
-
-	in.close();
-	return true;
 }
 
@@ -73,5 +64,4 @@
 
 bool Configuration::exists(const string& name){
-	if(config == NULL) return false;
 	return config->keyExists( name );
 }
Index: source/ariba/utility/configuration/Configuration.h
===================================================================
--- source/ariba/utility/configuration/Configuration.h	(revision 12775)
+++ source/ariba/utility/configuration/Configuration.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef __CONFIGURATION_H
@@ -63,5 +63,4 @@
 	static Configuration& instance();
 	static void setConfigFilename(string filename);
-	static bool haveConfig();
 
 	/**
Index: source/ariba/utility/internal/CMakeLists.txt
===================================================================
--- source/ariba/utility/internal/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,39 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(Utilities.hpp)
Index: source/ariba/utility/internal/Utilities.hpp
===================================================================
--- source/ariba/utility/internal/Utilities.hpp	(revision 12775)
+++ source/ariba/utility/internal/Utilities.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,10 +35,9 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef UTILITIES_HPP_
 #define UTILITIES_HPP_
 
-#include "ariba/config.h"
 #include <boost/cstdint.hpp>
 #include <boost/type_traits.hpp>
@@ -47,9 +46,5 @@
 /* force inline macro */
 #ifndef finline
-	#ifdef HAVE_MAEMO
-		#define finline inline
-	#else
-		#define finline inline __attribute__((always_inline))
-	#endif
+#define finline inline __attribute__((always_inline))
 #endif
 
@@ -65,6 +60,6 @@
 /* check whether X is a signed integer */
 #define if_int(X) \
-	typename boost::enable_if<boost::is_integral<X>,void*>::type __i##X = NULL,\
-	typename boost::enable_if<boost::is_signed<X>,void*>::type __s##X = NULL
+	typename boost::enable_if<boost::is_integral<X>,int>::type __i##X = 0,\
+	typename boost::enable_if<boost::is_signed<X>,int>::type __s##X = 0
 
 /* signature conversion */
@@ -79,4 +74,3 @@
 CONVERT_SIGN( uint32_t, int32_t );
 CONVERT_SIGN( uint64_t, int64_t );
-
 #endif /* UTILITIES_HPP_ */
Index: source/ariba/utility/logging/CMakeLists.txt
===================================================================
--- source/ariba/utility/logging/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,39 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(Logging.h)
Index: source/ariba/utility/logging/Logging.h
===================================================================
--- source/ariba/utility/logging/Logging.h	(revision 12775)
+++ source/ariba/utility/logging/Logging.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef LOGGING_H__
@@ -42,79 +42,25 @@
 #include <iostream>
 #include <cstdlib>
-#include "ariba/config.h"
+#include <log4cxx/logger.h>
+#include <log4cxx/basicconfigurator.h>
 
-#ifdef HAVE_LOG4CXX
-	#include <log4cxx/logger.h>
-	#include <log4cxx/basicconfigurator.h>
-#endif // HAVE_LOG4CXX
+#define colorDefault { std::cout << "\033[0m";  } /*reset*/
+#define colorDebug   { std::cout << "\033[37m"; } /*gray*/
+#define colorInfo    { std::cout << "\033[32m"; } /*green*/
+#define colorWarn    { std::cout << "\033[34m"; } /*blue*/
+#define colorError   { std::cout << "\033[31m"; } /*red*/
 
-#ifdef LOGCOLORS
-  #define colorDefault { std::cout << "\033[0m";    } /*reset*/
-  #define colorDebug   { std::cout << "\033[0;33m"; } /*cyan*/
-  #define colorInfo    { std::cout << "\033[0;32m"; } /*green*/
-  #define colorWarn    { std::cout << "\033[0;34m"; } /*blue*/
-  #define colorError   { std::cout << "\033[0;31m"; } /*red*/
-#else
-  #define colorDefault { }
-  #define colorDebug   { }
-  #define colorInfo    { }
-  #define colorWarn    { }
-  #define colorError   { }
-#endif // ENABLE_LOGCOLORS
+#define use_logging_h(x) \
+	private: static log4cxx::LoggerPtr logger;
 
-
-#ifdef HAVE_LOG4CXX
-
-  #define use_logging_h(x) \
-  	private: static log4cxx::LoggerPtr logger;
-
-  #define use_logging_cpp(x) \
+#define use_logging_cpp(x) \
 	log4cxx::LoggerPtr x::logger(log4cxx::Logger::getLogger(#x));
 
-  #define logging_trace(x)  {            LOG4CXX_TRACE(logger,x);                         }
-  #define logging_debug(x)  {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault;           }
-  #define logging_info(x)   {colorInfo;  LOG4CXX_INFO(logger,x);  colorDefault;           }
-  #define logging_warn(x)   {colorWarn;  LOG4CXX_WARN(logger,x);  colorDefault;           }
-  #define logging_error(x)  {colorError; LOG4CXX_ERROR(logger,x); colorDefault;           }
-  #define logging_fatal(x)  {colorError; LOG4CXX_FATAL(logger,x); colorDefault; exit(-1); }
-
-  #define logging_rootlevel_debug()	  {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getDebug()); }
-  #define logging_rootlevel_info()	  {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getInfo() ); }
-  #define logging_rootlevel_warn()	  {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getWarn() ); }
-  #define logging_rootlevel_error()	  {log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getError()); }
-
-  #define logging_classlevel_debug(x) {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(#x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getDebug()); }
-  #define logging_classlevel_info(x)  {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(#x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getInfo());  }
-  #define logging_classlevel_warn(x)  {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(#x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getWarn());  }
-  #define logging_classlevel_error(x) {log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(#x)); if(logger != NULL) logger->setLevel(log4cxx::Level::getError()); }
-
-#else // HAVE_LOG4CXX
-
-  #define use_logging_h(x)
-  #define use_logging_cpp(x)
-
-  #define logging_stdout(x) std::cout << x << std::endl;
-
-  static int __loglevel__ = 2; //default is info
-//  static int __loglevel__ = 1; // XXX use higher log level
-
-  #define logging_trace(x)  {                                   logging_stdout(x);                }
-  #define logging_debug(x)  {if(__loglevel__ <= 1){ colorDebug; logging_stdout(x); colorDefault; }}
-  #define logging_info(x)   {if(__loglevel__ <= 2){ colorInfo;  logging_stdout(x); colorDefault; }}
-  #define logging_warn(x)   {if(__loglevel__ <= 3){ colorWarn;  logging_stdout(x); colorDefault; }}
-  #define logging_error(x)  {                       colorError; logging_stdout(x); colorDefault;           }
-  #define logging_fatal(x)  {                       colorError; logging_stdout(x); colorDefault; exit(-1); }
-
-  #define logging_rootlevel_debug()	  {__loglevel__ = 1;}
-  #define logging_rootlevel_info()	  {__loglevel__ = 2;}
-  #define logging_rootlevel_warn()	  {__loglevel__ = 3;}
-  #define logging_rootlevel_error()	  {__loglevel__ = 4;}
-
-  #define logging_classlevel_debug(x) {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
-  #define logging_classlevel_info(x)  {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
-  #define logging_classlevel_warn(x)  {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
-  #define logging_classlevel_error(x) {std::cout << "individual class logging only available with log4cxx library" << std::endl;}
-
-#endif // HAVE_LOG4CXX
+#define logging_trace(x)  {            LOG4CXX_TRACE(logger,x);              }
+#define logging_debug(x)  {colorDebug; LOG4CXX_DEBUG(logger,x); colorDefault;}
+#define logging_info(x)   {colorInfo;  LOG4CXX_INFO(logger,x);  colorDefault;}
+#define logging_warn(x)   {colorWarn;  LOG4CXX_WARN(logger,x);  colorDefault;}
+#define logging_error(x)  {colorError; LOG4CXX_ERROR(logger,x); colorDefault;}
+#define logging_fatal(x)  {colorError; LOG4CXX_FATAL(logger,x); exit(-1);    }
 
 #endif //LOGGING_H__
Index: source/ariba/utility/measurement/PathloadMeasurement.cpp
===================================================================
--- source/ariba/utility/measurement/PathloadMeasurement.cpp	(revision 2378)
+++ source/ariba/utility/measurement/PathloadMeasurement.cpp	(revision 2378)
@@ -0,0 +1,188 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#include "PathloadMeasurement.h"
+
+namespace ariba {
+namespace utility {
+
+use_logging_cpp(PathloadMeasurement);
+
+PathloadMeasurement::PathloadMeasurement(BaseOverlay* _overlay)
+	: running( false ), resultNode( NodeID::UNSPECIFIED ),
+	  listener( NULL), serverpid( -1 ) {
+
+	if( _overlay != NULL ) // this is important due to the singleton interface!
+		baseoverlay = _overlay;
+
+	//
+	// start the pathload sender which acts as server
+	// the server is started in the child process
+	// if an instance is already running, the second
+	// will just fail starting up ...
+	//
+
+	const char* argv[4];
+	argv[0] = "pathload_snd";
+	argv[1] = "-q";
+	argv[2] = "-i";
+	argv[3] = 0;
+
+	if( (serverpid = vfork()) == 0 ){
+
+		// execute in child process
+		execvp( "pathload_snd", (char* const*)argv );
+
+		// if we reach here, the exec failed
+		// and we quit the child process
+		logging_warn( "no bandwidth measurement module found " <<
+				"(executing pathload_snd for bandwidth measurement server failed)" );
+	}
+}
+
+PathloadMeasurement::~PathloadMeasurement(){
+
+	// quit the pathload server
+	if( serverpid != -1 )
+		kill( serverpid, SIGQUIT );
+}
+
+void PathloadMeasurement::measure(const NodeID& destnode,  PathloadMeasurementListener* _listener){
+
+	if( running ){
+		logging_warn( "measurement already running" );
+		return;
+	}
+
+	logging_info( "starting new measurement for " << destnode.toString() );
+
+	listener = _listener;
+	resultNode = destnode;
+	resultMbps = -1;
+
+	runBlockingMethod();
+}
+
+void PathloadMeasurement::dispatchFunction(){
+	if( listener != NULL )
+		listener->onMeasurement( resultNode, resultMbps );
+}
+
+void PathloadMeasurement::blockingFunction(){
+
+	// get the endpoint for this node
+	const EndpointDescriptor& endp = baseoverlay->getEndpointDescriptor( resultNode );
+	if( endp == EndpointDescriptor::UNSPECIFIED ){
+		logging_warn( "can not measure node " << resultNode.toString() << ": can't resolve endpoint" );
+		return;
+	}
+
+	// if this is our local endpoint don't perform measurement
+	if( endp == baseoverlay->getEndpointDescriptor() ){
+		logging_debug( "don't perform measurement on local machine" );
+		resultMbps = -1;
+		dispatch();
+		return;
+	}
+
+	// currently we can be sure that this is
+	// an IPv4 and port format, or only IPv4
+	string endpoint = endp.toString();
+	string::size_type p = endpoint.find(':');
+	if( p != string::npos ) endpoint = endpoint.substr( 0, p );
+
+	logging_info( "measuring node " << resultNode.toString() <<
+					" on endpoint " << endpoint );
+
+	string cmdline = "pathload_rcv -s " + endpoint;
+
+	// execute the binary and open a stream to the executables output (stdout)
+	FILE* stream = popen( cmdline.c_str(), "r" );
+	if( stream == NULL || stream <= 0){
+		logging_warn( "no bandwidth measurement module found " <<
+				"(executing pathload_rvc for bandwidth measurement failed)" );
+		return;
+	}
+
+	char buf[128];
+	string content = "";
+	bool failed = true;
+
+	while( fgets(buf, 100, stream) != NULL ){
+		content += buf;
+	}
+
+	logging_debug("pathload measurment output:\n" << content );
+
+	//
+	// evaluate the output
+	//
+
+	if( content.find("Connection refused") != string::npos ){
+		logging_warn( "bandwidth measurement failed due to connection error" );
+		return;
+	}
+
+	if( content.find("Measurements terminated") != string::npos ){
+		logging_warn( "bandwidth measurement failed" );
+		return;
+	}
+
+	if( content.find("Measurements finished") == string::npos ){
+		logging_warn( "bandwidth measurement failed" );
+		return;
+	}
+
+	try {
+		content = content.substr( content.find("Available bandwidth range") );
+		content = content.substr( content.find("-")+2 );
+		content = content.erase( content.find("(")-1, string::npos );
+
+		resultMbps = strtod(content.c_str(), NULL);
+		logging_info( "measurement for node " << resultNode.toString() <<
+				" on endpoint " << endp.toString() << " ended with: " << resultMbps );
+	} catch(...) {
+		logging_warn( "bandwidth measurement failed" );
+	}
+
+	// dispatch into the main thread and async jump into
+	// void PathloadMeasurement::dispatchFunction()
+	dispatch();
+}
+
+}} // namespace ariba, utility
Index: source/ariba/utility/measurement/PathloadMeasurement.h
===================================================================
--- source/ariba/utility/measurement/PathloadMeasurement.h	(revision 2378)
+++ source/ariba/utility/measurement/PathloadMeasurement.h	(revision 2378)
@@ -0,0 +1,104 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#ifndef __PATHLOAD_MEASUREMENT_H
+#define __PATHLOAD_MEASUREMENT_H
+
+#include <unistd.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <sys/wait.h>
+#include <boost/utility.hpp>
+#include "ariba/utility/logging/Logging.h"
+#include "ariba/utility/types/NodeID.h"
+#include "ariba/utility/system/BlockingMethod.h"
+#include "ariba/communication/EndpointDescriptor.h"
+#include "ariba/overlay/BaseOverlay.h"
+
+using ariba::utility::NodeID;
+using ariba::utility::BlockingMethod;
+using ariba::communication::EndpointDescriptor;
+using ariba::overlay::BaseOverlay;
+
+namespace ariba {
+namespace utility {
+
+//*************************************************
+
+class PathloadMeasurementListener {
+	friend class PathloadMeasurement;
+protected:
+	// mbps hols the MBit/s as floating point and -1 if the
+	// measurement was triggered by two nodes on our local machines
+	virtual void onMeasurement( NodeID node, double mbps ) = 0;
+};
+
+//*************************************************
+
+class PathloadMeasurement : private boost::noncopyable, public BlockingMethod {
+	use_logging_h( PathloadMeasurement );
+private:
+	volatile bool running;
+	PathloadMeasurementListener* listener;
+
+	double resultMbps;
+	NodeID resultNode;
+	BaseOverlay* baseoverlay;
+	pid_t serverpid;
+
+protected:
+	PathloadMeasurement(BaseOverlay* _overlay);
+	virtual ~PathloadMeasurement();
+
+	virtual void dispatchFunction();
+	virtual void blockingFunction();
+
+public:
+	static PathloadMeasurement& instance(BaseOverlay* _overlay = NULL) {
+		static PathloadMeasurement the_inst( _overlay );
+		return the_inst;
+	}
+
+	void measure( const NodeID& destnode,  PathloadMeasurementListener* _listener );
+};
+
+//*************************************************
+
+}} // namespace ariba, utility
+
+#endif // __PATHLOAD_MEASUREMENT_H
Index: source/ariba/utility/messages.h
===================================================================
--- source/ariba/utility/messages.h	(revision 12775)
+++ source/ariba/utility/messages.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,18 +35,15 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef MESSAGES_H_
 #define MESSAGES_H_
 
-// TODO wÃŒrde sagen das brauchen wir nicht mehr
-//   ---> ÃŒberall dieses include rausnehmen und ggf  #include "messages/Message.h"   einfÃŒgen..
-
 #include "messages/Message.h"
-//#include "messages/MessageSender.h"  // TODO wird das noch genutzt..? Wenn nein, sollte es weg!
-//#include "messages/MessageReceiver.h"
-//#include "messages/MessageUtilities.h"
-////#include "messages/MessageProvider.h"  // DEPRECATED
-//#include "messages/TextMessage.h"
+#include "messages/MessageSender.h"
+#include "messages/MessageReceiver.h"
+#include "messages/MessageUtilities.h"
+#include "messages/MessageProvider.h"
+#include "messages/TextMessage.h"
 
 #endif /* MESSAGES_H_ */
Index: source/ariba/utility/messages/CMakeLists.txt
===================================================================
--- source/ariba/utility/messages/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,55 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    Message.h
-    MessageProvider.h
-    MessageReceiver.h
-    MessageSender.h
-    MessageUtilities.h
-    _namespace.h
-    TextMessage.h
-    )
-
-add_sources(
-    Message.cpp
-    MessageProvider.cpp
-    MessageReceiver.cpp
-    MessageSender.cpp
-    TextMessage.cpp
-    )
Index: source/ariba/utility/messages/Message.cpp
===================================================================
--- source/ariba/utility/messages/Message.cpp	(revision 12775)
+++ source/ariba/utility/messages/Message.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,11 +35,9 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Message.h"
 #include "ariba/utility/serialization/Data.hpp"
 #include "ariba/utility/serialization/DataStream.hpp"
-
-#include "ariba/utility/logging/Logging.h"
 
 NAMESPACE_BEGIN
@@ -54,5 +52,4 @@
 
 Message::~Message() {
-	dropPayload();
 //	if ( srcAddr != NULL) delete srcAddr;
 //	if ( destAddr != NULL) delete destAddr;
@@ -82,59 +79,15 @@
 }
 
-
-reboost::message_t Message::wrap_up_for_sending()
-{
-    assert( ! wrapped_up );
-    wrapped_up = true;
-    
-    //// Adapt to new message system ////
-    Data data = data_serialize(this, DEFAULT_V);
-    reboost::shared_buffer_t buf(data.getBuffer(), data.getLength() / 8);
-
-    newstyle_payload.push_front(buf);
-    
-    return newstyle_payload;
-}
-
-reboost::shared_buffer_t Message::serialize_into_shared_buffer()
-{
-    assert ( newstyle_payload.length() == 0 );
-    
-    //// Adapt to new message system ////
-    Data data = data_serialize(this, DEFAULT_V);
-    reboost::shared_buffer_t buf(data.getBuffer(), data.getLength() / 8);
-    
-    return buf;
-}
-
-
-reboost::shared_buffer_t Message::deserialize_from_shared_buffer(reboost::shared_buffer_t buff)
-{
-    // NOTE: legacy payload is not allowed when using shared buffers
-    this->legacy_payload_disabled = true;
-    
-    assert( buff.size() > 0 );
-    
-    // const_cast is necessary here, but without legacy payload we should be save here (more or less)
-    Data dat(const_cast<uint8_t*>(buff.data()), buff.size() * 8);
-    
-    size_t len = this->SERIALIZATION_METHOD_NAME(DESERIALIZE, dat) / 8;
-
-    // return remaining sub-buffer
-    return buff(len);
-}
-
-
-
 NAMESPACE_END
 
 std::ostream& operator<<(std::ostream& stream, const ariba::utility::Message& msg ) {
 	using_serialization;
-	stream << "msg(type=" << typeid(msg).name() << ",";
+	stream << "msg(type=" << typeid(msg).name();
 	stream << "len=" << (data_length(&msg)/8) << ",";
 	Data data = data_serialize(&msg);
-	stream << "data=" << data;
-	data.release();
+	stream << ",data=" << data;
+//	data.release();
 	stream << ")";
 	return stream;
 }
+
Index: source/ariba/utility/messages/Message.h
===================================================================
--- source/ariba/utility/messages/Message.h	(revision 12775)
+++ source/ariba/utility/messages/Message.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef MESSAGE_H_
@@ -45,4 +45,8 @@
 #include<iostream>
 #include<boost/shared_array.hpp>
+
+
+// local includes
+#include "MessageControlInfo.h"
 
 // forward declaration
@@ -61,8 +65,4 @@
 #include "ariba/utility/types/Address.h"
 #include "ariba/utility/serialization.h"
-
-// reboost messages
-#include "ariba/utility/transport/messages/message.hpp"
-
 
 std::ostream& operator<<(std::ostream& stream, const ariba::utility::Message& msg );
@@ -86,16 +86,15 @@
 	friend std::ostream& ::operator<<(std::ostream& stream, const ariba::utility::Message& msg );
 
+	// root binary data
+	shared_array<uint8_t> root;
+
 	// payload
-	bool legacy_payload_disabled;
 	bool releasePayload;
 	Data payload; //< messages binary data
-	
-	// XXX testing...
-	reboost::message_t newstyle_payload;
-	bool wrapped_up;
 
 	// addresses and control info
 	const Address* srcAddr;
 	const Address* destAddr;
+	const MessageControlInfo* ctrlInfo;
 
 public:
@@ -104,6 +103,5 @@
 	 */
 	inline Message() :
-	    legacy_payload_disabled(false), releasePayload(true), payload(),
-	    newstyle_payload(), wrapped_up(false), srcAddr(NULL),destAddr(NULL) {
+		root(), releasePayload(true), payload(), srcAddr(NULL),destAddr(NULL),ctrlInfo(NULL) {
 	}
 
@@ -112,7 +110,6 @@
 	 * data.
 	 */
-	explicit inline Message( const Data& data ) :
-        legacy_payload_disabled(false), releasePayload(true),
-        newstyle_payload(), wrapped_up(false), srcAddr(NULL),destAddr(NULL) {  // FIXME newstyle_payload..?
+	inline Message( const Data& data ) :
+		srcAddr(NULL),destAddr(NULL),ctrlInfo(NULL) {
 		this->payload = data.clone();
 //		this->root = shared_array<uint8_t>((uint8_t*)data.getBuffer());
@@ -176,4 +173,22 @@
 	inline const Address* getSourceAddress() const {
 		return srcAddr;
+	}
+
+	/**
+	 * Set optional control information
+	 *
+	 * @parm ctrlInfo The optional control information
+	 */
+	inline void setControlInfo(const MessageControlInfo* ctrlInfo) {
+		this->ctrlInfo = ctrlInfo;
+	}
+
+	/**
+	 * Returns the optional control information or NULL
+	 *
+	 * @return The optional control information or NULL
+	 */
+	inline const MessageControlInfo* getControlInfo() const {
+		return ctrlInfo;
 	}
 
@@ -221,49 +236,4 @@
 		return NULL;
 	}
-
-	/**
-	 * The same as decapsulate, but this function
-	 * is used in the samples to make the semantics easier
-	 * to understand. The semantics is shown to be: you get
-	 * a message and convert it to your type. Not as: you
-	 * get a message and have to extract your message from it.
-	 */
-	template<class T>
-	inline T* convert() {
-		return decapsulate<T>();
-	}
-	
-	
-	// XXX testing
-	void set_payload_message(reboost::message_t msg)
-	{
-	    newstyle_payload = msg;
-	}
-	
-	void append_buffer(reboost::shared_buffer_t buff)
-	{
-	    newstyle_payload.push_back(buff);
-	}
-	
-	
-	// XXX testing... packs this message into the payload message (do not use twice!!)
-	virtual reboost::message_t wrap_up_for_sending();
-	
-	
-	/**
-	 * Uses the old serialization system to serialize itself into a (new style) shared buffer.
-	 */
-	virtual reboost::shared_buffer_t serialize_into_shared_buffer();
-	
-	/*
-	 * XXX experimental
-	 * 
-	 * Uses the old serialization system to deserialize itself out of a (new style) shared buffer.
-	 * @return remaining sub-buffer (the "payload")
-	 * 
-	 * Note: This is some kind of a hack! handle with care.
-	 */
-	virtual reboost::shared_buffer_t deserialize_from_shared_buffer(reboost::shared_buffer_t buff);
-	
 
 protected:
@@ -287,5 +257,5 @@
 			} else {
 				if (msg->payload.isUnspecified()) {
-					size_t l = ((len == ~(size_t)0) ? X.getRemainingLength() : len);
+					size_t l = ((len == ~0) ? X.getRemainingLength() : len);
 					msg->payload = X.getRemainingData(l);
 					msg->releasePayload = false;
@@ -303,8 +273,5 @@
 	 * @return A explicit payload serializer
 	 */
-	finline PayloadSerializer Payload( size_t length = ~0 )
-	{
-//	    assert( ! legacy_payload_disabled );  // FIXME aktuell
-	    
+	finline PayloadSerializer Payload( size_t length = ~0 ) {
 		return PayloadSerializer( this, length );
 	}
Index: source/ariba/utility/messages/MessageControlInfo.cpp
===================================================================
--- source/ariba/utility/messages/MessageControlInfo.cpp	(revision 2378)
+++ source/ariba/utility/messages/MessageControlInfo.cpp	(revision 2378)
@@ -0,0 +1,58 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#include "MessageControlInfo.h"
+
+NAMESPACE_BEGIN
+
+MessageControlInfo::MessageControlInfo() {
+}
+
+MessageControlInfo::~MessageControlInfo() {
+}
+
+/**
+ * Returns true, if this object needs to be deleted
+ *
+ * @return True, if this object needs to be deleted
+ */
+bool MessageControlInfo::needsDeletion() {
+	return true;
+}
+
+NAMESPACE_END
Index: source/ariba/utility/messages/MessageControlInfo.h
===================================================================
--- source/ariba/utility/messages/MessageControlInfo.h	(revision 2378)
+++ source/ariba/utility/messages/MessageControlInfo.h	(revision 2378)
@@ -0,0 +1,62 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#ifndef MESSAGECONTROLINFO_H_
+#define MESSAGECONTROLINFO_H_
+
+#include "_namespace.h"
+
+NAMESPACE_BEGIN
+
+class MessageControlInfo {
+public:
+	MessageControlInfo();
+
+	virtual ~MessageControlInfo();
+
+	/**
+	 * Returns true, if this object needs to be deleted
+	 *
+	 * @return True, if this object needs to be deleted
+	 */
+	virtual bool needsDeletion();
+};
+
+NAMESPACE_END
+
+#endif /* MESSAGECONTROLINFO_H_ */
Index: source/ariba/utility/messages/MessageProvider.cpp
===================================================================
--- source/ariba/utility/messages/MessageProvider.cpp	(revision 12775)
+++ source/ariba/utility/messages/MessageProvider.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,34 +35,34 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
-//#include "MessageProvider.h"
-//
-//NAMESPACE_BEGIN
-//
-//MessageProvider::MessageProvider() {
-//}
-//
-//MessageProvider::~MessageProvider() {
-//}
-//
-//bool MessageProvider::sendMessageToReceivers( const Message* message ) {
-//	bool sent =  false;
-//	for (size_t i=0; i<receivers.size(); i++)
-//		if (receivers[i]->receiveMessage(message, LinkID::UNSPECIFIED, NodeID::UNSPECIFIED)) sent = true;
-//	return sent;
-//}
-//
-//void MessageProvider::addMessageReceiver( MessageReceiver* receiver ) {
-//	receivers.push_back(receiver);
-//}
-//
-//void MessageProvider::removeMessageReceiver( MessageReceiver* receiver ) {
-//	for (size_t i=0; i<receivers.size(); i++)
-//		if (receivers[i]==receiver) {
-//			receivers.erase( receivers.begin()+i );
-//			break;
-//		}
-//}
-//
-//NAMESPACE_END
+#include "MessageProvider.h"
+
+NAMESPACE_BEGIN
+
+MessageProvider::MessageProvider() {
+}
+
+MessageProvider::~MessageProvider() {
+}
+
+bool MessageProvider::sendMessageToReceivers( const Message* message ) {
+	bool sent =  false;
+	for (int i=0; i<receivers.size(); i++)
+		if (receivers[i]->receiveMessage(message, LinkID::UNSPECIFIED, NodeID::UNSPECIFIED)) sent = true;
+	return sent;
+}
+
+void MessageProvider::addMessageReceiver( MessageReceiver* receiver ) {
+	receivers.push_back(receiver);
+}
+
+void MessageProvider::removeMessageReceiver( MessageReceiver* receiver ) {
+	for (int i=0; i<receivers.size(); i++)
+		if (receivers[i]==receiver) {
+			receivers.erase( receivers.begin()+i );
+			break;
+		}
+}
+
+NAMESPACE_END
Index: source/ariba/utility/messages/MessageProvider.h
===================================================================
--- source/ariba/utility/messages/MessageProvider.h	(revision 12775)
+++ source/ariba/utility/messages/MessageProvider.h	(revision 2378)
@@ -1,5 +1,3 @@
-// XXX DEPRECATED
-
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -37,64 +35,62 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
-
-// XXX DEPRECATED
+// [Licence]
 
 #ifndef MESSAGEPROVIDER_H_
 #define MESSAGEPROVIDER_H_
 
-//#include "_namespace.h"
-//#include "MessageReceiver.h"
-//#include "ariba/utility/types/LinkID.h"
-//#include "ariba/utility/types/NodeID.h"
-//#include <vector>
-//
-//using std::vector;
-//using ariba::utility::LinkID;
-//using ariba::utility::NodeID;
-//
-//NAMESPACE_BEGIN
-//
-//
-///**
-// * This class defines an interface for message providers.
-// * Implementing classes must allow receivers to register themselves.
-// *
-// * @author Sebastian Mies
-// */
-//class MessageProvider {
-//private:
-//	vector<MessageReceiver*> receivers;
-//
-//protected:
-//	bool sendMessageToReceivers( const Message* message );
-//
-//public:
-//	/**
-//	 * Constructor.
-//	 */
-//	MessageProvider();
-//
-//	/**
-//	 * Destructor.
-//	 */
-//	~MessageProvider();
-//
-//	/**
-//	 * Adds a message receiver.
-//	 *
-//	 * @param receiver The receiver.
-//	 */
-//	void addMessageReceiver( MessageReceiver* receiver );
-//
-//	/**
-//	 * Removes a message receiver.
-//	 *
-//	 * @param receiver The receiver.
-//	 */
-//	void removeMessageReceiver( MessageReceiver* receiver );
-//};
-//
-//NAMESPACE_END
+#include "_namespace.h"
+#include "MessageReceiver.h"
+#include "ariba/utility/types/LinkID.h"
+#include "ariba/utility/types/NodeID.h"
+#include <vector>
+
+using std::vector;
+using ariba::utility::LinkID;
+using ariba::utility::NodeID;
+
+NAMESPACE_BEGIN
+
+
+/**
+ * This class defines an interface for message providers.
+ * Implementing classes must allow receivers to register themselves.
+ *
+ * @author Sebastian Mies
+ */
+class MessageProvider {
+private:
+	vector<MessageReceiver*> receivers;
+
+protected:
+	bool sendMessageToReceivers( const Message* message );
+
+public:
+	/**
+	 * Constructor.
+	 */
+	MessageProvider();
+
+	/**
+	 * Destructor.
+	 */
+	~MessageProvider();
+
+	/**
+	 * Adds a message receiver.
+	 *
+	 * @param receiver The receiver.
+	 */
+	void addMessageReceiver( MessageReceiver* receiver );
+
+	/**
+	 * Removes a message receiver.
+	 *
+	 * @param receiver The receiver.
+	 */
+	void removeMessageReceiver( MessageReceiver* receiver );
+};
+
+NAMESPACE_END
 
 #endif /* MESSAGEPROVIDER_H_ */
Index: source/ariba/utility/messages/MessageReceiver.cpp
===================================================================
--- source/ariba/utility/messages/MessageReceiver.cpp	(revision 12775)
+++ source/ariba/utility/messages/MessageReceiver.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "MessageReceiver.h"
@@ -49,8 +49,8 @@
 }
 
-//bool MessageReceiver::receiveMessage( reboost::shared_buffer_t message, const LinkID& link, const NodeID& node ) {
-//	//std::cout << "UNIMPLEMENTED MessageReceiver got Message:" << (Message*)message << std::endl;
-//	return false;
-//}
+bool MessageReceiver::receiveMessage( const Message* message, const LinkID& link, const NodeID& node ) {
+	std::cout << "UNIMPLEMENTED MessageReceiver got Message:" << (Message*)message << std::endl;
+	return false;
+}
 
 NAMESPACE_END
Index: source/ariba/utility/messages/MessageReceiver.h
===================================================================
--- source/ariba/utility/messages/MessageReceiver.h	(revision 12775)
+++ source/ariba/utility/messages/MessageReceiver.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,12 +35,10 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef MESSAGERECEIVER_H__
 #define MESSAGERECEIVER_H__
 
-//#include "ariba/utility/messages/Message.h"
-// reboost messages
-#include "ariba/utility/transport/messages/message.hpp"
+#include "ariba/utility/messages/Message.h"
 #include "ariba/utility/types/LinkID.h"
 #include "ariba/utility/types/NodeID.h"
@@ -75,8 +73,5 @@
 	 * @return True, when the message has been accepted.
 	 */
-	virtual bool receiveMessage( reboost::shared_buffer_t message,
-	        const LinkID& link,
-	        const NodeID& node,
-	        bool bypass_overlay ) = 0;
+	virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& node );
 };
 
Index: source/ariba/utility/messages/MessageSender.cpp
===================================================================
--- source/ariba/utility/messages/MessageSender.cpp	(revision 12775)
+++ source/ariba/utility/messages/MessageSender.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "MessageSender.h"
Index: source/ariba/utility/messages/MessageSender.h
===================================================================
--- source/ariba/utility/messages/MessageSender.h	(revision 12775)
+++ source/ariba/utility/messages/MessageSender.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef MESSAGESENDER_H_
Index: source/ariba/utility/messages/MessageUtilities.h
===================================================================
--- source/ariba/utility/messages/MessageUtilities.h	(revision 12775)
+++ source/ariba/utility/messages/MessageUtilities.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef MESSAGEUTILITIES_H_
Index: source/ariba/utility/messages/TextMessage.cpp
===================================================================
--- source/ariba/utility/messages/TextMessage.cpp	(revision 12775)
+++ source/ariba/utility/messages/TextMessage.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "TextMessage.h"
Index: source/ariba/utility/messages/TextMessage.h
===================================================================
--- source/ariba/utility/messages/TextMessage.h	(revision 12775)
+++ source/ariba/utility/messages/TextMessage.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef TEXTMESSAGE_H_
Index: source/ariba/utility/messages/_namespace.h
===================================================================
--- source/ariba/utility/messages/_namespace.h	(revision 12775)
+++ source/ariba/utility/messages/_namespace.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #undef NAMESPACE_BEGIN
Index: source/ariba/utility/misc/CMakeLists.txt
===================================================================
--- source/ariba/utility/misc/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,51 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    Demultiplexer.hpp
-    Helper.h
-    KeyMapping.hpp
-    sha1.h
-    StringFormat.h
-    )
-
-add_sources(
-    Helper.cpp
-    sha1.cpp
-    StringFormat.cpp
-    )
Index: source/ariba/utility/misc/Demultiplexer.hpp
===================================================================
--- source/ariba/utility/misc/Demultiplexer.hpp	(revision 12775)
+++ source/ariba/utility/misc/Demultiplexer.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef DEMULTIPLEXER_H__
@@ -41,5 +41,4 @@
 
 #include <list>
-#include <iostream>
 #include <map>
 #include <boost/thread/mutex.hpp>
@@ -47,5 +46,4 @@
 #include "ariba/utility/messages/Message.h"
 
-using std::cout;
 using std::list;
 using std::map;
@@ -75,24 +73,4 @@
 	boost::mutex						mapMutex;
 
-	void debugprint() {
-		cout << "-------------start--------" << std::endl;
-		{
-			LISTENER_SERVICE_MAP_CITERATOR i = mapListenerService.begin();
-			LISTENER_SERVICE_MAP_CITERATOR iend = mapListenerService.end();
-
-			for( ; i != iend; i++ )
-				cout << "xxx" << i->first.toString() << " -> " << i->second << std::endl;
-		}
-		cout << "-----------------------" << std::endl;
-		{
-			SERVICE_LISTENER_MAP_CITERATOR i = mapServiceListener.begin();
-			SERVICE_LISTENER_MAP_CITERATOR iend = mapServiceListener.end();
-
-			for( ; i != iend; i++ )
-				cout << "xxx" << i->first << " -> " << i->second.toString() << std::endl;
-		}
-		cout << "-------------end---------" << std::endl;
-	}
-
 public:
 
@@ -105,14 +83,15 @@
 	void registerItem( S id, T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-
-		mapServiceListener.insert( SERVICE_LISTENER_PAIR( id, listener ) );
-		mapListenerService.insert( LISTENER_SERVICE_PAIR( listener, id ) );
+		{
+			mapServiceListener.insert( SERVICE_LISTENER_PAIR( id, listener ) );
+			mapListenerService.insert( LISTENER_SERVICE_PAIR( listener, id ) );
+		}
 	}
 
-	void unregisterItem( S id ) {
+	void unregisterItem( S id) {
 		T listener = get( id );
 
+		boost::mutex::scoped_lock lock( mapMutex );
 		{
-			boost::mutex::scoped_lock lock( mapMutex );
 			mapServiceListener.erase( id );
 			mapListenerService.erase( listener );
@@ -121,5 +100,5 @@
 
 	void unregisterItem( T listener ) {
-		S id = get( listener );
+		S id = get (listener);
 		unregisterItem( id );
 	}
@@ -127,29 +106,34 @@
 	S get( T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-
-		LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
-		return it->second;
+		{
+			LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
+			return it->second;
+		}
 	}
 
 	T get( S id ) {
 		boost::mutex::scoped_lock lock( mapMutex );
+		{
+			SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
 
-		SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
-		if( it == mapServiceListener.end() ) 	return 0;
-		else					return it->second;
+			if( it == mapServiceListener.end() ) 	return NULL;
+			else					return it->second;
+		}
 	}
 
 	bool contains( T listener ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-
-		LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
-		return ( it != mapListenerService.end() );
+		{
+			LISTENER_SERVICE_MAP_CITERATOR it = mapListenerService.find( listener );
+			return ( it != mapListenerService.end() );
+		}
 	}
 
 	bool contains( S id ) {
 		boost::mutex::scoped_lock lock( mapMutex );
-
-		SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
-		return ( it != mapServiceListener.end() );
+		{
+			SERVICE_LISTENER_MAP_CITERATOR it = mapServiceListener.find( id );
+			return ( it != mapServiceListener.end() );
+		}
 	}
 
@@ -157,6 +141,5 @@
 	typedef list<T> TwoList;
 
-	OneList getOneList() {
-		boost::mutex::scoped_lock lock( mapMutex );
+	OneList getOneList() const {
 		OneList ret;
 
@@ -168,6 +151,5 @@
 	}
 
-	TwoList getTwoList() {
-		boost::mutex::scoped_lock lock( mapMutex );
+	TwoList getTwoList() const {
 		TwoList ret;
 
Index: source/ariba/utility/misc/Helper.cpp
===================================================================
--- source/ariba/utility/misc/Helper.cpp	(revision 12775)
+++ source/ariba/utility/misc/Helper.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,10 +35,7 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Helper.h"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/algorithm/string/replace.hpp>
 
 namespace ariba {
@@ -52,5 +49,5 @@
 	_ultoa_s (val, buf, 16, 10);
 #else
-	sprintf (buf, "%lu", val);
+	sprintf (buf, "%u", val);
 #endif
 
@@ -65,5 +62,5 @@
 	_ltoa_s (val, buf, 16, 10);
 #else
-	sprintf (buf, "%li", val);
+	sprintf (buf, "%i", val);
 #endif
 
@@ -78,5 +75,5 @@
 	_ultoa_s (val, buf, 16, 16);
 #else
-	sprintf (buf, "%lx", val);
+	sprintf (buf, "%x", val);
 #endif
 
@@ -96,5 +93,5 @@
 	_ltoa_s (val, buf, 16, 16);
 #else
-	sprintf (buf, "%lx", val);
+	sprintf (buf, "%x", val);
 #endif
 
@@ -252,13 +249,5 @@
 unsigned long Helper::getElapsedMillis ()
 {
-	static unsigned long zero = 0;
-
-	struct timeb tp;
-	ftime( &tp );
-
-	unsigned long val = tp.time*1000 + tp.millitm;
-	if( zero == 0 ) zero = val;
-
-	return val-zero;
+	return static_cast<unsigned long>(((double)clock() / (double)(CLOCKS_PER_SEC)) * 1000.0);
 }
 
Index: source/ariba/utility/misc/Helper.h
===================================================================
--- source/ariba/utility/misc/Helper.h	(revision 12775)
+++ source/ariba/utility/misc/Helper.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef __HELPER_H
@@ -45,5 +45,4 @@
 #include <ctime>
 #include <ostream>
-#include <cstdio>
 #include <iomanip>
 #include <cassert>
@@ -53,5 +52,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/timeb.h>
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string/replace.hpp>
 
 #ifdef WIN32
@@ -67,4 +67,5 @@
 using std::setfill;
 using std::setw;
+using std::cout;
 using std::string;
 using std::ostream;
@@ -167,5 +168,5 @@
 
 	if (secondsSleep > 0)
-		::sleep(secondsSleep);
+		sleep(secondsSleep);
 
 	//
Index: source/ariba/utility/misc/KeyMapping.hpp
===================================================================
--- source/ariba/utility/misc/KeyMapping.hpp	(revision 12775)
+++ source/ariba/utility/misc/KeyMapping.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef KEY_MAPPING_H__
@@ -69,5 +69,5 @@
 public:
 	inline KeyMapping(){
-		srand( time(NULL) );
+		srand(time(0));
 	}
 
Index: source/ariba/utility/misc/OvlVis.cpp
===================================================================
--- source/ariba/utility/misc/OvlVis.cpp	(revision 2378)
+++ source/ariba/utility/misc/OvlVis.cpp	(revision 2378)
@@ -0,0 +1,670 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#include "OvlVis.h"
+
+namespace ariba {
+namespace utility {
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+use_logging_cpp(OvlVis);
+
+OvlVis::OvlVis() : socket(io_service), socketOpened(false) {
+
+	if( ! Configuration::instance().exists("DEMO_OvlVisIP") )   return;
+	if( ! Configuration::instance().exists("DEMO_OvlVisPort") ) return;
+
+	string serverIP = Configuration::instance().read<string>("DEMO_OvlVisIP");
+	string serverPort = Configuration::instance().read<string>("DEMO_OvlVisPort");
+	if( serverIP.length() == 0 || serverPort.length() == 0) return;
+
+	logging_debug( "connecting to ovlvis " + serverIP + " on " + serverPort );
+
+	tcp::resolver resolver(io_service);
+	tcp::resolver::query query(
+		serverIP,
+		serverPort,
+		tcp::resolver::query::passive |
+		tcp::resolver::query::address_configured |
+		tcp::resolver::query::numeric_service);
+
+	tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
+	tcp::resolver::iterator end;
+
+	boost::system::error_code error = boost::asio::error::host_not_found;
+	while (error && endpoint_iterator != end){
+		socket.close();
+		socket.connect(*endpoint_iterator++, error);
+	}
+
+	if (error){
+		logging_warn( "OvlVis could not connect to GUI" );
+	} else {
+		socketOpened = true;
+	}
+}
+
+OvlVis::~OvlVis(){
+
+	socket.close();
+
+}
+
+void OvlVis::sendMessage( const string msg, NETWORK_ID nid ) {
+
+	sendSocket( msg );
+
+// 	{
+// 		// auto layout
+// 		ostringstream out;
+//
+// 		out 	<< "VisMsgOptimizeView" << ";"
+// 			<< Helper::ultos(nid)     << ";" // network id is ignored in the message renderer, just renders the current viewed network
+// 			<< "0"                  << std::endl;
+//
+// 		sendSocket( out.str() );
+// 	}
+
+// 	{	// auto zoom
+// 		ostringstream out;
+//
+// 		out 	<< "VisMsgOptimizeView" << ";"
+// 			<< Helper::ultos(nid)     << ";" // network id is ignored in the message renderer, just renders the current viewed network
+// 			<< "1"                  << std::endl;
+//
+// 		sendSocket( out.str() );
+// 	}
+
+}
+
+void OvlVis::sendSocket(const string msg){
+	if( socket.is_open() && socketOpened )
+		socket.send( boost::asio::buffer(msg) );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+void OvlVis::visCreate(
+	NETWORK_ID network,
+	NodeID& node,
+	string nodename,
+	string info
+	){
+
+	ostringstream out;
+
+	out 	<< "VisMsgCreate"         << ";"
+		<< Helper::ultos(network) << ";"
+		<< node.toString()        << ";"
+		<< nodename               << ";"
+		<< "" /*netName*/         << ";"
+		<< "" /*ip*/              << ";"
+		<< "" /*port*/            << ";"
+		<< "0"                    << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visChangeStatus(
+	NETWORK_ID network,
+	NodeID& node,
+	bool enable,
+	string info
+	){
+
+	ostringstream out;
+
+	out 	<< "VisMsgChangeStatus"   << ";"
+		<< Helper::ultos(network) << ";"
+		<< node.toString()        << ";"
+		<< (enable ? "1" : "0")   << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visConnect(
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string info
+	){
+
+	// if we already have a link between the two nodes
+	// we just ignore the call and leave the old link
+
+	if( networkLinks.exists( network, NodePair(srcnode,destnode) )) return;
+
+	ostringstream out;
+	unsigned long edgekey = networkLinks.insert( network, NodePair(srcnode,destnode) );
+
+	out 	<< "VisMsgConnect"        << ";"
+		<< Helper::ultos(network) << ";"
+		<< edgekey 		  << ";"
+		<< srcnode.toString()     << ";"
+		<< destnode.toString()    << ";"
+		<< "0"                    << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visDisconnect(
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string info
+	){
+
+	if( !networkLinks.exists(network, NodePair(srcnode, destnode)) ) return;
+
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+	networkLinks.remove( network, NodePair(srcnode, destnode) );
+
+	ostringstream out;
+	out	<< "VisMsgDisconnect"     << ";"
+		<< Helper::ultos(network) << ";"
+		<< Helper::ultos(edgekey) << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visFailedConnect(
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string info
+	){
+
+	ostringstream out;
+
+	out 	<< "VisMsgFailedConnect"  << ";"
+		<< Helper::ultos(network) << ";"
+		<< srcnode.toString()     << ";"
+		<< destnode.toString()    << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visShutdown(
+	NETWORK_ID network,
+	NodeID& node,
+	string info
+	){
+
+	ostringstream out;
+
+	out	<< "VisMsgShutdown"       << ";"
+		<< Helper::ultos(network) << ";"
+		<< node.toString()        << ";"
+		<< info                   << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+void OvlVis::visChangeNodeColor (
+	NETWORK_ID network,
+	NodeID& node,
+	unsigned char r,
+	unsigned char g,
+	unsigned char b
+	){
+
+	ostringstream out;
+
+	out	<< "VisMsgChangeNodeColor"       	<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< node.toString()        		<< ";"
+		<< ariba::utility::Helper::ultos(r) 	<< ";"
+		<< ariba::utility::Helper::ultos(g) 	<< ";"
+		<< ariba::utility::Helper::ultos(b) 	<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visChangeNodeColor (
+	NETWORK_ID network,
+	NodeID& node,
+	NODE_COLORS color
+	){
+
+	unsigned char r = 0;
+	unsigned char g = 0;
+	unsigned char b = 0;
+
+	switch( color ) {
+		case NODE_COLORS_GREY: 	r = 128; g = 128; b = 128; break;
+		case NODE_COLORS_GREEN:	r = 0;   g = 200; b = 0;   break;
+		case NODE_COLORS_RED:	r = 255; g = 0;   b = 0;   break;
+	}
+
+	visChangeNodeColor( network, node, r, g, b );
+}
+
+void OvlVis::visChangeNodeIcon (
+                NETWORK_ID network,
+                NodeID& node,
+                ICON_ID icon
+                ){
+
+        ostringstream out;
+
+        out	<< "VisMsgChangeNodeIcon"               << ";"
+                << Helper::ultos(network) 		<< ";"
+                << node.toString()        		<< ";"
+                << Helper::ultos((unsigned int)icon)	<< std::endl;
+
+        sendMessage( out.str(), network );
+}
+
+void OvlVis::visShowNodeLabel (
+	NETWORK_ID network,
+	NodeID& node,
+	string label
+	){
+
+	ostringstream out;
+
+	out	<< "VisMsgShowNodeLabel"       		<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< node.toString()        		<< ";"
+		<< label				<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visDeleteNodeLabel (
+	NETWORK_ID network,
+	NodeID& node
+	){
+
+	ostringstream out;
+
+	out	<< "VisMsgDeleteNodeLable"       	<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< node.toString()        		<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visShowNodeBubble (
+                NETWORK_ID network,
+                NodeID& node,
+                string label
+                ){
+
+	unsigned long bubbleKey = nodeBubbles.insert( network, node );
+        ostringstream out;
+
+        out       << "VisMsgShowNodeBubble"     << ";"
+                  << Helper::ultos(network)     << ";"
+                  << Helper::ultos(bubbleKey)   << ";"
+                  << node.toString()            << ";"
+                  << label                      << std::endl;
+
+        sendMessage( out.str(), network );
+}
+
+
+void OvlVis::visDeleteNodeBubble (
+	NETWORK_ID network,
+	NodeID& node
+	){
+
+	if( !nodeBubbles.exists(network, node)) return;
+
+	unsigned long bubbleID = nodeBubbles.get( network, node );
+	nodeBubbles.remove( network, node );
+
+	ostringstream out;
+
+	out	<< "VisMsgDeleteBubble"         << ";"
+                << Helper::ultos(network) 	<< ";"
+                << Helper::ultos(bubbleID)      << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visShowShiftedNodeIcon (
+                NETWORK_ID network,
+                NodeID& node,
+                ICON_ID iconID,
+		unsigned int timeout
+                ){
+
+	unsigned long iconKey = shiftedNodeIcons.insert( network, node );
+
+        ostringstream out;
+
+        out	<< "VisMsgShowNodeIcon"      	<< ";"
+                << Helper::ultos(network)   	<< ";"
+                << Helper::ultos(iconKey)       << ";"
+                << node.toString()       	<< ";"
+                << Helper::ultos(iconID)	<< std::endl;
+
+        sendMessage( out.str(), network );
+
+	if( timeout > 0 ){
+		TimedoutIcon* obj = new TimedoutIcon( network, node, timeout );
+		obj->startIcon();
+	}
+}
+
+void OvlVis::visDeleteShiftedNodeIcon (
+                NETWORK_ID network,
+                NodeID& node
+                ){
+
+	if( !shiftedNodeIcons.exists(network, node) )return;
+
+	unsigned long iconKey = shiftedNodeIcons.get( network, node );
+	shiftedNodeIcons.remove( network, node );
+
+	ostringstream out;
+
+	out	<< "VisMsgDeleteIcon"           << ";"
+                << Helper::ultos(network) 	<< ";"
+                << Helper::ultos(iconKey)       << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+void OvlVis::visChangeLinkWidth (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	unsigned int width
+	){
+
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+
+	ostringstream out;
+	out	<< "VisMsgChangeLinkWidth"       	<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< Helper::ultos(edgekey)		<< ";"
+		<< Helper::ultos(width)			<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visChangeLinkColor (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	unsigned char r,
+	unsigned char g,
+	unsigned char b
+	){
+
+	ostringstream out;
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+
+	out	<< "VisMsgChangeLinkColor"       	<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< Helper::ultos(edgekey)			<< ";"
+		<< Helper::ultos(r)			<< ";"
+		<< Helper::ultos(g)			<< ";"
+		<< Helper::ultos(b)			<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visChangeLinkColor (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	NODE_COLORS color
+	){
+
+	unsigned char r = 0;
+	unsigned char g = 0;
+	unsigned char b = 0;
+
+	switch( color ) {
+		case NODE_COLORS_GREY: 	r = 128; g = 128; b = 128; break;
+		case NODE_COLORS_GREEN:	r = 0;   g = 200; b = 0;   break;
+		case NODE_COLORS_RED:	r = 255; g = 0;   b = 0;   break;
+	}
+
+	visChangeLinkColor( network, srcnode, destnode, r, g, b );
+}
+
+void OvlVis::visShowLinkLabel (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string label
+	){
+
+	ostringstream out;
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+
+	out	<< "VisMsgShowLinkLabel"       		<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< Helper::ultos(edgekey)			<< ";"
+		<< label				<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visDeleteLinkLabel (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode
+	){
+
+	if( !networkLinks.exists(network, NodePair(srcnode, destnode))) return;
+
+	unsigned long edgekey = networkLinks.get( network, NodePair(srcnode, destnode) );
+	ostringstream out;
+
+	out	<< "VisMsgDeleteLinkLabel"       	<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< Helper::ultos(edgekey)		<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visShowOnLinkIcon (
+                NETWORK_ID network,
+                NodeID& srcnode,
+                NodeID& destnode,
+                ICON_ID iconID
+                ){
+
+	unsigned long iconKey = onLinkIcons.insert(network, NodePair(srcnode, destnode));
+        ostringstream out;
+
+        out	<< "VisMsgShowLinkIcon"      	<< ";"
+                << Helper::ultos(network)   	<< ";"
+                << Helper::ultos(iconKey)       << ";"
+                << srcnode.toString()   	<< ";"
+                << destnode.toString()   	<< ";"
+                << Helper::ultos(iconID)	<< std::endl;
+
+        sendMessage( out.str(), network );
+}
+
+void OvlVis::visDeleteOnLinkIcon (
+                NETWORK_ID network,
+                NodeID& srcnode,
+		NodeID& destnode
+                ){
+
+	if( !onLinkIcons.exists(network, NodePair(srcnode, destnode))) return;
+
+	unsigned long iconKey = onLinkIcons.get( network, NodePair(srcnode, destnode) );
+	onLinkIcons.remove( network, NodePair(srcnode, destnode) );
+
+	ostringstream out;
+
+	out	<< "VisMsgDeleteIcon"           << ";"
+                << Helper::ultos(network) 	<< ";"
+                << Helper::ultos(iconKey)       << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visShowLinkBubble (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string label
+	){
+
+	ostringstream out;
+	unsigned long bubble = linkBubbles.insert( network, NodePair(srcnode, destnode) );
+
+	out	<< "VisMsgShowLinkBubble"	<< ";"
+		<< Helper::ultos(network)	<< ";"
+		<< Helper::ultos(bubble)	<< ";"
+		<< srcnode.toString()   	<< ";"
+		<< destnode.toString()   	<< ";"
+		<< label			<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visDeleteLinkBubble (
+	NETWORK_ID network,
+	NodeID& srcnode,
+	NodeID& destnode
+	){
+
+	if( !linkBubbles.exists(network, NodePair(srcnode, destnode))) return;
+
+	ostringstream out;
+	unsigned long bubble = linkBubbles.get( network, NodePair(srcnode, destnode) );
+	linkBubbles.remove( network, NodePair(srcnode, destnode) );
+
+	out	<< "VisMsgDeleteBubble"		<< ";"
+		<< Helper::ultos(network)	<< ";"
+		<< Helper::ultos(bubble)	<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+void OvlVis::visSendMessage (
+	NETWORK_ID network,
+	NodeID& startnode,
+	NodeID& endnode
+	){
+
+	ostringstream out;
+
+	out	<< "VisMsgSendMessage"       		<< ";"
+		<< Helper::ultos(network) 		<< ";"
+		<< startnode.toString()        		<< ";"
+		<< endnode.toString()			<< std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+void OvlVis::visCLIOInitMeasurement(
+	NETWORK_ID network,
+	unsigned long edgekey,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string info
+	){
+
+	ostringstream out;
+
+	out << "VisMsgCLIOInitMeasurement" << ";"
+		<< Helper::ultos(network)      << ";"
+		<< Helper::ultos(edgekey)      << ";"
+		<< srcnode.toString()          << ";"
+		<< destnode.toString()         << ";"
+		<< info                        << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+void OvlVis::visCLIOEndMeasurement(
+	NETWORK_ID network,
+	unsigned long edgekey,
+	NodeID& srcnode,
+	NodeID& destnode,
+	string info,
+	string value,
+	string unit
+	){
+
+	ostringstream out;
+
+	out << "VisMsgCLIOEndMeasurement" << ";"
+		<< Helper::ultos(network)     << ";"
+		<< Helper::ultos(edgekey)     << ";"
+		<< srcnode.toString()         << ";"
+		<< destnode.toString()        << ";"
+		<< info                       << ";"
+		<< value		      << ";"
+		<< unit			      << std::endl;
+
+	sendMessage( out.str(), network );
+}
+
+//*****************************************************
+//*****************************************************
+//*****************************************************
+
+}} // namespace ariba, common
Index: source/ariba/utility/misc/OvlVis.h
===================================================================
--- source/ariba/utility/misc/OvlVis.h	(revision 2378)
+++ source/ariba/utility/misc/OvlVis.h	(revision 2378)
@@ -0,0 +1,443 @@
+// [Licence]
+// The Ariba-Underlay Copyright
+//
+// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
+//
+// Institute of Telematics
+// UniversitÃ€t Karlsruhe (TH)
+// Zirkel 2, 76128 Karlsruhe
+// Germany
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and documentation
+// are those of the authors and should not be interpreted as representing
+// official policies, either expressed or implied, of the Institute of
+// Telematics.
+// [Licence]
+
+#ifndef OVLVIS_H__
+#define OVLVIS_H__
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <map>
+#include <boost/utility.hpp>
+#include <boost/asio.hpp>
+#include "ariba/utility/types/NodeID.h"
+#include "ariba/utility/logging/Logging.h"
+#include "ariba/utility/system/Timer.h"
+#include "ariba/utility/misc/Helper.h"
+#include "ariba/utility/misc/KeyMapping.hpp"
+#include "ariba/utility/configuration/Configuration.h"
+
+using std::string;
+using std::map;
+using std::pair;
+using std::make_pair;
+using std::cout;
+using std::ostringstream;
+using boost::asio::ip::tcp;
+using ariba::utility::NodeID;
+using ariba::utility::Configuration;
+using ariba::utility::KeyMapping;
+using ariba::utility::Timer;
+
+namespace ariba {
+namespace utility {
+
+class OvlVis : private boost::noncopyable {
+	use_logging_h(OvlVis);
+public:
+	static OvlVis& instance() { static OvlVis the_inst; return the_inst; }
+
+	typedef enum _NETWORK_ID {
+		NETWORK_ID_BASE_COMMUNICATION 	= 1,
+		NETWORK_ID_BASE_OVERLAY 	= 2,
+		NETWORK_ID_EONSON 		= 3,
+		NETWORK_ID_MCPO 		= 4,
+		NETWORK_ID_CLIO 		= 5,
+		NETWORK_ID_VIDEOSTREAM 		= 6,
+		NETWORK_ID_GAME 		= 7,
+		NETWORK_ID_SECURITY 		= 8,
+	} NETWORK_ID;
+
+	//****************************************************************
+	// Node creation, node connections, status, node deletion, ...
+	//****************************************************************
+
+	/**
+	 * Create a node in the network that is initially unconnected.
+	 */
+	void visCreate (
+		NETWORK_ID network,
+		NodeID& node,
+		string nodename,
+		string info
+		);
+
+	/**
+	 * Change the status of a node -> enable/disable a node.
+	 */
+	void visChangeStatus(
+		NETWORK_ID network,
+		NodeID& node,
+		bool enable,
+		string info
+		);
+
+	/**
+	 * Connect two nodes using a link.
+	 */
+	void visConnect (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+		);
+
+	/**
+	 * Disconnect the link between two nodes.
+	 */
+	void visDisconnect (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+		);
+
+	/**
+	 * Indicate that the connection procedure
+	 * between two nodes failed.
+	 */
+	void visFailedConnect (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+		);
+
+	/**
+	 * Delete a node from the network.
+	 */
+	void visShutdown (
+		NETWORK_ID network,
+		NodeID& node,
+		string info
+		);
+
+	//****************************************************************
+	// Node manipulation: change color, change icon
+	//****************************************************************
+
+	/**
+	 * Change the color of the node.
+	 */
+	void visChangeNodeColor (
+		NETWORK_ID network,
+		NodeID& node,
+		unsigned char r,
+		unsigned char g,
+		unsigned char b
+		);
+
+	typedef enum _NODE_COLORS {
+		NODE_COLORS_GREY,
+		NODE_COLORS_GREEN,
+		NODE_COLORS_RED,
+	} NODE_COLORS;
+
+	/**
+	 * Change the color of the node.
+	 */
+	void visChangeNodeColor (
+		NETWORK_ID network,
+		NodeID& node,
+		NODE_COLORS color
+		);
+
+	/**
+	 * The available icons for changing the
+	 * icon of a node, showing an icon besides
+	 * a node and showing an icon at a link.
+	 */
+	typedef enum _ICON_ID {
+		ICON_ID_DEFAULT_NODE 	= 0,
+		ICON_ID_PC 		= 1,
+		ICON_ID_PC_WORLD 	= 2,
+		ICON_ID_FAILURE 	= 3,
+		ICON_ID_RED_CROSS 	= 4,
+		ICON_ID_CHARACTER_A 	= 5,
+		ICON_ID_CHARACTER_W 	= 6,
+		ICON_ID_CAMERA          = 7,
+	} ICON_ID;
+
+	/**
+	 * Change the icon of a node.
+	 */
+        void visChangeNodeIcon (
+                NETWORK_ID network,
+                NodeID& node,
+                ICON_ID icon
+                );
+
+	/**
+	 * Show the label of the node.
+	 */
+	void visShowNodeLabel (
+		NETWORK_ID network,
+		NodeID& node,
+		string label
+		);
+
+	/**
+	 * Delete the label of the node.
+	 */
+	void visDeleteNodeLabel (
+		NETWORK_ID network,
+		NodeID& node
+		);
+
+	/**
+	 * Show a bubble at the node.
+	 */
+        void visShowNodeBubble (
+                NETWORK_ID network,
+                NodeID& node,
+                string label
+                );
+
+	/**
+	 * Delete a bubble at the node.
+	 */
+	void visDeleteNodeBubble (
+                NETWORK_ID network,
+		NodeID& node
+                );
+
+	/**
+	 * Show an icon besides the node.
+	 */
+        void visShowShiftedNodeIcon (
+                NETWORK_ID network,
+                NodeID& node,
+                ICON_ID iconID,
+		unsigned int timeout = 0
+                );
+
+	/**
+	 * Delete an icon besides the node
+	 */
+        void visDeleteShiftedNodeIcon (
+                NETWORK_ID network,
+                NodeID& node
+                );
+
+	//****************************************************************
+	// Link manipulation: change width, color, show bubbles, icons, ...
+	//****************************************************************
+
+	/**
+	 * Change the link width
+	 */
+	void visChangeLinkWidth (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		unsigned int width
+		);
+
+	/**
+	 * Change the link color
+	 */
+	void visChangeLinkColor (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		unsigned char r,
+		unsigned char g,
+		unsigned char b
+		);
+
+	/**
+	 * Change the link color
+	 */
+	void visChangeLinkColor (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		NODE_COLORS color
+		);
+
+	/**
+	 * Show a link label
+	 */
+	void visShowLinkLabel (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string label
+		);
+
+	/**
+	 * Delete a link label
+	 */
+	void visDeleteLinkLabel (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode
+		);
+
+	/**
+	 * Show an icon at the link
+	 */
+        void visShowOnLinkIcon (
+                NETWORK_ID network,
+                NodeID& srcnode,
+                NodeID& destnode,
+                ICON_ID iconID
+                );
+
+	/**
+	 * Delete an icon at the link
+	 */
+        void visDeleteOnLinkIcon (
+                NETWORK_ID network,
+                NodeID& srcnode,
+		NodeID& destnode
+                );
+
+	/**
+	 * Show a bubble besides the link
+	 */
+	void visShowLinkBubble (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string label
+		);
+
+	/**
+	 * Delete a bubble besides the link
+	 */
+	void visDeleteLinkBubble (
+		NETWORK_ID network,
+		NodeID& srcnode,
+		NodeID& destnode
+		);
+
+	//****************************************************************
+	// Send message between two nodes
+	//****************************************************************
+
+	/**
+	 * Animate the message sending between two nodes
+	 */
+	void visSendMessage (
+		NETWORK_ID network,
+		NodeID& startnode,
+		NodeID& endnode
+		);
+
+//*******************************************************
+//*
+	void visCLIOInitMeasurement (
+		NETWORK_ID network,
+		unsigned long edgekey,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info
+		);
+
+	void visCLIOEndMeasurement (
+		NETWORK_ID network,
+		unsigned long edgekey,
+		NodeID& srcnode,
+		NodeID& destnode,
+		string info,
+		string value,
+		string unit
+		);
+//*
+//*******************************************************
+
+protected:
+	OvlVis();
+	~OvlVis();
+
+private:
+	void sendMessage( const string msg, NETWORK_ID nid );
+	void sendSocket( const string msg );
+
+	/**
+	 * boost asio stuff for connecting to ovlvis
+	 */
+	boost::asio::io_service io_service;
+	tcp::socket socket;
+	volatile bool socketOpened;
+
+	typedef pair<NodeID, NodeID> NodePair;
+	typedef KeyMapping<NodePair> NetworkLinks;
+	typedef KeyMapping<NodePair> LinkBubbles;
+	typedef KeyMapping<NodeID>   NodeBubbles;
+	typedef KeyMapping<NodeID>   ShiftedNodeIcons;
+	typedef KeyMapping<NodePair> OnLinkIcons;
+
+	NetworkLinks 		networkLinks;
+	LinkBubbles 		linkBubbles;
+	NodeBubbles 		nodeBubbles;
+	ShiftedNodeIcons 	shiftedNodeIcons;
+	OnLinkIcons 		onLinkIcons;
+
+	class TimedoutIcon : public Timer {
+	private:
+		NETWORK_ID network;
+		NodeID node;
+		unsigned int timeout;
+	public:
+		TimedoutIcon(NETWORK_ID _network, NodeID _node, unsigned int _timeout) :
+			network(_network), node(_node), timeout(_timeout) {
+		}
+
+		virtual ~TimedoutIcon(){
+			Timer::stop();
+		}
+
+		void startIcon(){
+			Timer::setInterval( timeout, true );
+			Timer::start();
+		}
+
+	protected:
+		virtual void eventFunction(){
+			OvlVis::instance().visDeleteShiftedNodeIcon( network, node );
+			delete this;
+		}
+	};
+
+};
+
+}} // namespace ariba, common
+
+#endif // OVLVIS_H__
Index: source/ariba/utility/misc/StringFormat.cpp
===================================================================
--- source/ariba/utility/misc/StringFormat.cpp	(revision 12775)
+++ 	(revision )
@@ -1,48 +1,0 @@
-
-#include "StringFormat.h"
-
-#include "boost/xpressive/xpressive.hpp"
-
-namespace ariba {
-namespace utility {
-namespace string_format {
-
-using namespace boost::xpressive;
-
-// regex: string
-const sregex rstring = '"' >> keep(*~(boost::xpressive::set = '"'))
-		>> '"';
-
-// regex: base64 encoding
-const sregex rbase64 = '!' >> +(range('a', 'z') | range('A', 'Z')
-		| range('0', '9') | '/' | '+') >> *(boost::xpressive::set = '=');
-
-// regex: raw alphabet
-const sregex rchars = +(range('a', 'z') | range('A', 'Z'));
-
-// regex: integer
-const sregex rint = '0' | (range('1', '9') >> !(range('0', '9')));
-
-// regex: binary label
-const sregex rlabel = rchars | rstring | rbase64;
-
-// regex: dot separated identifier
-const sregex rid = rlabel >> *('.' >> rlabel) >> *('.' >> rint);
-
-// regex: "leaf" data
-const sregex rdata = !(boost::xpressive::set = '!') >> '{'
-		>> *(keep(+~(boost::xpressive::set = '{', '}')) | by_ref(rdata))
-		>> '}';
-
-// regex: fields
-const sregex rfield_label = rlabel >> '=';
-const sregex rfield = !rfield_label >> (rid | rdata);
-const sregex rfields = '(' >> rfield >> *(',' >> rfield) >> ')';
-
-// regex objects
-const sregex robject_data = (rdata | rfields);
-const sregex robject_id = rid;
-const sregex robject = robject_id >> robject_data;
-const sregex robjects = robject >> *(',' >> robject);
-
-}}}
Index: source/ariba/utility/misc/StringFormat.h
===================================================================
--- source/ariba/utility/misc/StringFormat.h	(revision 12775)
+++ 	(revision )
@@ -1,94 +1,0 @@
-
-#ifndef STRINGFORMAT_H_
-#define STRINGFORMAT_H_
-
-#include "boost/xpressive/xpressive.hpp"
-
-namespace ariba {
-namespace utility {
-namespace string_format {
-
-using boost::xpressive::sregex;
-
-class regex_nav {
-private:
-	typedef boost::xpressive::smatch _match;
-	typedef _match::nested_results_type nested_results;
-	typedef nested_results::const_iterator nested_iterator;
-	const _match& match;
-
-public:
-	regex_nav(const _match& match) :
-		match(match) {
-	}
-
-	regex_nav() :
-		match(*((const _match*) NULL)) {
-	}
-
-	bool matched() const {
-		return &match != NULL;
-	}
-
-	regex_nav operator[] (const sregex& type) const {
-		const nested_results& nr = match.nested_results();
-		for (nested_iterator i = nr.begin(); i != nr.end(); i++) {
-			if (i->regex_id() == type.regex_id()) return regex_nav(*i);
-		}
-		return regex_nav();
-	}
-
-	regex_nav operator[](int index) const {
-		const nested_results& nr = match.nested_results();
-		for (nested_iterator i = nr.begin(); i != nr.end() && index >= 0; i++) {
-			if (index == 0) return regex_nav(*i);
-			index--;
-		}
-		return regex_nav();
-	}
-
-	int size() const {
-		return match.nested_results().size();
-	}
-
-	std::string str() const {
-		if (!matched()) return std::string("<no match>");
-		return match[0].str();
-	}
-};
-
-// regex: string
-extern const sregex rstring;
-
-// regex: base64 encoding
-extern const sregex rbase64;
-
-// regex: raw alphabet
-extern const sregex rchars;
-
-// regex: integer
-extern const sregex rint;
-
-// regex: binary label
-extern const sregex rlabel;
-
-// regex: dot separated identifier
-extern const sregex rid;
-
-// regex: "leaf" data
-extern const sregex rdata;
-
-// regex: fields
-extern const sregex rfield_label;
-extern const sregex rfield;
-extern const sregex rfields;
-
-// regex: objects
-extern const sregex robject_data;
-extern const sregex robject_id;
-extern const sregex robject;
-extern const sregex robjects;
-
-}}}
-
-#endif /* STRINGFORMAT_H_ */
Index: source/ariba/utility/misc/sha1.cpp
===================================================================
--- source/ariba/utility/misc/sha1.cpp	(revision 12775)
+++ source/ariba/utility/misc/sha1.cpp	(revision 2378)
@@ -1,6 +1,6 @@
-// [License]
+// [licence]
 // 100% free public domain implementation of the SHA-1 algorithm
 // by Dominik Reichl <dominik.reichl@t-online.de>
-// [License]
+// [licence]
 /*
       Version 1.5 - 2005-01-01
@@ -242,16 +242,11 @@
     }
 
-	bool ret = true;
-	size_t rets = -1;
-
     for(i = 0; i < ulBlocks; i++) {
-        rets = fread(uData, 1, SHA1_MAX_FILE_BUFFER, fIn);
-        ret &= (rets > 0 );
+        fread(uData, 1, SHA1_MAX_FILE_BUFFER, fIn);
         Update((UINT_8 *)uData, SHA1_MAX_FILE_BUFFER);
     }
 
     if(ulRest != 0) {
-        rets = fread(uData, 1, ulRest, fIn);
-        ret &= (rets > 0 );
+        fread(uData, 1, ulRest, fIn);
         Update((UINT_8 *)uData, ulRest);
     }
@@ -259,5 +254,5 @@
     fclose(fIn);
     fIn = NULL;
-    return ret;
+    return true;
 }
 #endif
Index: source/ariba/utility/misc/sha1.h
===================================================================
--- source/ariba/utility/misc/sha1.h	(revision 12775)
+++ source/ariba/utility/misc/sha1.h	(revision 2378)
@@ -1,6 +1,6 @@
-// [License]
+// [licence]
 // 100% free public domain implementation of the SHA-1 algorithm
 // by Dominik Reichl <dominik.reichl@t-online.de>
-// [License]
+// [licence]
 /*
         Version 1.5 - 2005-01-01
Index: source/ariba/utility/serialization.h
===================================================================
--- source/ariba/utility/serialization.h	(revision 12775)
+++ source/ariba/utility/serialization.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SERIALIZATION_H_
Index: source/ariba/utility/serialization/CMakeLists.txt
===================================================================
--- source/ariba/utility/serialization/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,50 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    Data.hpp
-    DataStream.hpp
-    DataUtilities.hpp
-    Serialization.hpp
-    TestSerialization.h
-    )
-
-add_sources(
-    Serialization.cpp
-    TestSerialization.cpp
-    )
Index: source/ariba/utility/serialization/Data.hpp
===================================================================
--- source/ariba/utility/serialization/Data.hpp	(revision 12775)
+++ source/ariba/utility/serialization/Data.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef DATA_HPP_
@@ -41,9 +41,7 @@
 
 //== library includes ==
-#include <string.h>
 #include <stdlib.h>
 #include <iostream>
 #include <boost/cstdint.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
 
 // forward declaration
@@ -51,5 +49,5 @@
 template<typename T = uint8_t, typename DataModel = DefaultDataModel<uint8_t> > class DataTpl;
 typedef DataTpl<> Data;
-template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data);
+template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data);
 
 //== internal includes ==
@@ -121,6 +119,5 @@
 		template<typename X>
 		finline void get(X& value, size_t length = sizeof(X) * 8, if_int(X)) const {
-			typedef typename boost::make_unsigned<X>::type unsigned_type;
-			_unsigned(value) = bitget<unsigned_type> (bits.buffer(), index, length);
+			_unsigned(value) = bitget<X> (bits.buffer(), index, length);
 		}
 
@@ -326,4 +323,18 @@
 	}
 };
+
+/* default human readable text output */
+template<typename T, typename DataModel>
+std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data) {
+	stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
+			<< "|'";
+	char* buffer = (char*) data.getBuffer();
+	for (size_t i = 0; i < data.getLength() / 8; i++) {
+		char c = buffer[i] < 32 ? '.' : buffer[i];
+		stream << c;
+	}
+	stream << "']";
+	return stream;
+}
 
 /* unspecified type */
@@ -386,5 +397,5 @@
 
 	finline int32_t length() const {
-		return (bufferLen == -1) ? 0 : bufferLen;
+		return bufferLen;
 	}
 
@@ -397,25 +408,17 @@
 		size_t res_length = calcLength(new_length);
 		if (old_length != res_length) {
-
-			if(res_length <= 0){
-				if (bufferPtr != NULL) delete [] bufferPtr;
-				bufferPtr = NULL;
-				bufferLen = 0;
-			}else{
-				T* new_buffer = new T[res_length];
-				if (new_buffer != NULL) memset(new_buffer, 0, res_length*sizeof(T));
-				if (bufferPtr != NULL) {
-					size_t clength = res_length < old_length ? res_length : old_length;
-					memcpy( new_buffer, bufferPtr, clength*sizeof(T) );
-					delete [] bufferPtr;
-				}
-				bufferPtr = new_buffer;
-				bufferLen = new_length;
+			T* new_buffer = new T[res_length];
+			if (bufferPtr != NULL) {
+				size_t clength = res_length < old_length ? res_length : old_length;
+				memcpy( new_buffer, bufferPtr, clength*sizeof(T) );
+				delete [] bufferPtr;
 			}
+			bufferPtr = new_buffer;
+			bufferLen = new_length;
 		}
 	}
 
 	finline void release() {
-		if (bufferPtr!=NULL && bufferLen>=0) delete [] bufferPtr;
+		delete [] bufferPtr;
 		bufferPtr = NULL;
 		bufferLen = -1;
@@ -439,16 +442,3 @@
 }sznEnd();
 
-/* default human readable text output */
-template<typename T, typename DataModel>
-std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data) {
-	stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
-			<< "|'";
-	const char* buffer = (const char*) data.getBuffer();
-	for (size_t i = 0; i < data.getLength() / 8; i++) {
-		char c = buffer[i] < 32 ? '.' : buffer[i];
-		stream << c;
-	}
-	stream << "']";
-	return stream;
-}
 #endif /* DATA_HPP_ */
Index: source/ariba/utility/serialization/DataStream.hpp
===================================================================
--- source/ariba/utility/serialization/DataStream.hpp	(revision 12775)
+++ source/ariba/utility/serialization/DataStream.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef DATASTREAM_HPP_
@@ -42,7 +42,4 @@
 //== Library includes ==
 #include <boost/cstdint.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
-
-#include <cassert>
 #include <iostream>
 #include <vector>
@@ -150,6 +147,5 @@
 	finline void add(X& obj, if_uint(X)) {
 		if (!isMeasure())
-//			bitcpy( obj, 0, bits.getBuffer(), index);
-			bitcpy( obj, 0, bits.getBuffer(), index, sizeof(X)*8 );
+		bitcpy( obj, 0, bits.getBuffer(), index);
 		index += sizeof(X) * 8;
 	}
@@ -157,24 +153,4 @@
 	template<typename X>
 	finline void remove(X& obj, if_uint(X)) {
-		//if (!isMeasure()) bits[index].get(obj);
-		if (!isMeasure())
-			bitcpy( bits.getBuffer(), index, obj, 0, sizeof(X)*8 );
-		index += sizeof(X) * 8;
-	}
-
-	/* support signed ints */
-	template<typename X>
-	finline void add(X& sobj, if_int(X)) {
-		typedef typename boost::make_unsigned<X>::type UX;
-		UX& obj = *((UX*)&sobj);
-		if (!isMeasure())
-		bitcpy( sobj, 0, bits.getBuffer(), index);
-		index += sizeof(X) * 8;
-	}
-
-	template<typename X>
-	finline void remove(X& sobj, if_int(X)) {
-		typedef typename boost::make_unsigned<X>::type UX;
-		UX& obj = *((UX*)&sobj);
 		if (!isMeasure()) bits[index].get(obj);
 		index += sizeof(X) * 8;
@@ -332,17 +308,4 @@
 		bits.setLength(index);
 		return bits;
-	}
-
-	finline uint8_t* bytes( size_t length ) {
-		assert((index%bits.word_width)==0);
-		if (!isMeasure()) {
-			bits.ensureLength( index + length * 8);
-			uint8_t* buffer = (uint8_t*)bits.getBuffer()+(index/bits.word_width);
-			index += length*8;
-			return buffer;
-		} else {
-			index += length*8;
-			return NULL;
-		}
 	}
 
@@ -509,6 +472,5 @@
 				i++;
 			}
-			if (isCharP) *text = strdup(s.c_str());
-			else string->assign(s);
+			if (isCharP) *text = strdup(s.c_str()); else *string = s;
 		}
 		sznMethodEnd()
@@ -524,24 +486,9 @@
 	public:
 		finline ArrayTpl( T*& array, size_t length ) :
-		v(array), l(length) {}
+		v(0), l(length) {}
 
 		sznMethodBegin(X)
 		if (X.isDeserializer()) v = new T[l];
 		for (size_t i=0; i<l; i++) X && v[i];
-		sznMethodEnd()
-	};
-
-	template<typename T>
-	class StaticArrayTpl : public ExplicitSerializer {
-	private:
-		T* v;
-		size_t l;
-
-	public:
-		finline StaticArrayTpl( T* array, size_t length ) :
-		v(array), l(length) {}
-
-		sznMethodBegin(X)
-			for (size_t i=0; i<l; i++) X && v[i];
 		sznMethodEnd()
 	};
@@ -571,9 +518,4 @@
 	finline ArrayTpl<T> A( T*& array, size_t length ) {
 		return ArrayTpl<T>(array,length);
-	}
-
-	template<typename T>
-	finline StaticArrayTpl<T> static_A( T* array, size_t length ) {
-		return StaticArrayTpl<T>(array,length);
 	}
 
Index: source/ariba/utility/serialization/DataUtilities.hpp
===================================================================
--- source/ariba/utility/serialization/DataUtilities.hpp	(revision 12775)
+++ source/ariba/utility/serialization/DataUtilities.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 /* This file implements some common bit operations for unsigned integer types
@@ -71,14 +71,4 @@
 #include <string>
 
-template<typename X> finline
-static X shr( const X& value, unsigned int bits ) {
-	return (sizeof(X)*8 == bits) ? 0 : (value >> bits);
-}
-
-template<typename X> finline
-static X shl( const X& value, unsigned int bits ) {
-	return (sizeof(X)*8 == bits) ? 0 : (value << bits);
-}
-
 /**
  * TODO: Doc
@@ -87,5 +77,5 @@
 static X bitblk(size_t index, size_t length, bool value, if_uint(X)) {
 	if (index == 0 && length >= sizeof(X) * 8) return value ? ~0 : 0;
-	X x = shl(( shl( ((X) 1), length) - 1), index);
+	X x = ((((X) 1) << length) - 1) << index;
 	return value ? x : ~x;
 }
@@ -117,5 +107,5 @@
 	if (srcInvert) srcIdx = sizeof(X) * 8 - srcIdx - len;
 	if (dstInvert) dstIdx = sizeof(Y) * 8 - dstIdx - len;
-	Y value = ((Y)shr(src, srcIdx)) << dstIdx;
+	Y value = ((Y) (src >> srcIdx)) << dstIdx;
 	Y mask = bitblk<Y, 0> (dstIdx, len);
 	return (dst & mask) | (value & ~mask);
@@ -146,5 +136,5 @@
 	// check if first word only is affected
 	if ((dwp + len) <= w) {
-		X fw = shl(src[0],swp) | shr(src[1],iswp);
+		X fw = (src[0] << swp) | (src[1] >> iswp);
 		*dst = bitcpy(fw, 0, *dst, dwp, len, true, true);
 		return;
@@ -153,6 +143,6 @@
 	// set first word
 	if (idwp != 0) {
-		X fw = shl(src[0],swp) | shr(src[1],iswp);
-		*dst = (*dst & ~(((X) 1 << idwp) - 1)) | shr(fw,dwp);
+		X fw = (src[0] << swp) | (src[1] >> iswp);
+		*dst = (*dst & ~(((X) 1 << idwp) - 1)) | (fw >> dwp);
 
 		// recalculate indexes & lengths
@@ -179,5 +169,5 @@
 		a = src[0], b = src[1];
 		while (len >= w) {
-			*dst = shl(a,swp) | shr(b,iswp);
+			*dst = (a << swp) | (b >> iswp);
 			dst++;
 			src++;
@@ -189,9 +179,7 @@
 
 	// set last word
-	X lw = shl(a,swp) | shr(b,iswp), lm = (shl((X) 1,(w - len)) - 1);
+	X lw = (a << swp) | (b >> iswp), lm = (((X) 1 << (w - len)) - 1);
 	*dst = (*dst & lm) | (lw & ~lm);
 }
-
-
 
 /**
@@ -217,5 +205,5 @@
 		src++;
 		while (len >= w) {
-			X x = shl(a,swp) | shr(b,iswp);
+			X x = (a << swp) | (b >> iswp);
 			value <<= w;
 			value |= x;
@@ -228,5 +216,5 @@
 		if ( len> 0 ) {
 			value <<= len;
-			value |= ((shl(a,swp) | shr(b,iswp)) >> (w - len)) & (shl(1,len)-1);
+			value |= (((a << swp) | (b >> iswp)) >> (w - len)) & ((1 << len)-1);
 		}
 
@@ -266,8 +254,8 @@
 		size_t idwp = w - dwp;
 		src >>= srcIdx;
-		X mask1 = ~(shl(1,idwp) - 1);
-		dst[0] = (dst[0] & mask1) | (shr(src,(len - idwp)) & ~mask1);
-		X mask2 = shl(1,(w - len + idwp)) - 1;
-		dst[1] = (dst[1] & mask2) | (shl(src, (w - len + idwp)) & ~mask2);
+		X mask1 = ~((1 << idwp) - 1);
+		dst[0] = (dst[0] & mask1) | ((src >> (len - idwp)) & ~mask1);
+		X mask2 = (1 << (w - len + idwp)) - 1;
+		dst[1] = (dst[1] & mask2) | ((src << (w - len + idwp)) & ~mask2);
 	}
 }
@@ -289,9 +277,9 @@
 		// check inversion
 		if (srcInvert) srcIdx = sizeof(Y) * 8 - srcIdx - len;
-		src = shr(src, srcIdx);
+		src >>= srcIdx;
 
 		const size_t dw = sizeof(X)*8;
 		while (len >= dw) {
-			X word = (X)shr(src,(len-dw));
+			X word = (X)(src >> (len-dw));
 			bitcpy(word,0,dst,dstIdx,dw);
 			dstIdx += dw;
Index: source/ariba/utility/serialization/Serialization.cpp
===================================================================
--- source/ariba/utility/serialization/Serialization.cpp	(revision 12775)
+++ source/ariba/utility/serialization/Serialization.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Serialization.hpp"
Index: source/ariba/utility/serialization/Serialization.hpp
===================================================================
--- source/ariba/utility/serialization/Serialization.hpp	(revision 12775)
+++ source/ariba/utility/serialization/Serialization.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SERIALIZATION_HPP_
@@ -200,5 +200,4 @@
 #include <typeinfo>
 #include <iostream>
-#include <cstdio>
 
 //---------------------------------------------------------------------------
Index: source/ariba/utility/serialization/TestSerialization.cpp
===================================================================
--- source/ariba/utility/serialization/TestSerialization.cpp	(revision 12775)
+++ source/ariba/utility/serialization/TestSerialization.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,7 +35,6 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
-#include "TestSerialization.h"
 #include "Data.hpp"
 #include "DataStream.hpp"
@@ -55,10 +54,7 @@
 	Aclass* vclass;
 	bool vcls;
-	uint8_t* static_array;
 
 	Aclass(bool vcls = false) {
 		text = new char[80];
-		static_array = new uint8_t[20];
-		for (size_t i=0; i<20; i++) static_array[i] = i;
 		strcpy(text, "Hallo!");
 		str = "std::string:)";
@@ -98,8 +94,5 @@
 
 sznBeginDefault( Aclass, X ){
-	double xpos;
 	X && x && b && I(y,6) && T(text) && T(str) && A(v,4) && I(z) && vcls;
-	X && static_A(static_array,20);
-	X && static_A( (uint8_t*)&xpos, 8 );
 	if (vcls) X && VO(vclass);
 }sznEnd()
@@ -107,5 +100,5 @@
 vsznDefault( Aclass );
 
-int test_serialization() {
+int main() {
 	using namespace std;
 
Index: source/ariba/utility/serialization/TestSerialization.h
===================================================================
--- source/ariba/utility/serialization/TestSerialization.h	(revision 12775)
+++ 	(revision )
@@ -1,8 +1,0 @@
-// TestSerialization.h, created on 13.11.2009 by Sebastian Mies
-
-#ifndef TESTSERIALIZATION_H_
-#define TESTSERIALIZATION_H_
-
-int test_serialization();
-
-#endif /* TESTSERIALIZATION_H_ */
Index: source/ariba/utility/system/BlockingMethod.cpp
===================================================================
--- source/ariba/utility/system/BlockingMethod.cpp	(revision 12775)
+++ source/ariba/utility/system/BlockingMethod.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "BlockingMethod.h"
@@ -80,7 +80,3 @@
 }
 
-void BlockingMethod::joinThread(){
-	this->threadObj->join();
-}
-
 }} // namespace ariba, common
Index: source/ariba/utility/system/BlockingMethod.h
===================================================================
--- source/ariba/utility/system/BlockingMethod.h	(revision 12775)
+++ source/ariba/utility/system/BlockingMethod.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef BLOCKING_METHOD_H__
@@ -63,7 +63,4 @@
 	void runBlockingMethod();
 
-	// block until thread ended
-	void joinThread();
-
 protected:
 
@@ -82,5 +79,4 @@
 	virtual void blockingFunction() = 0;
 
-
 private:
 	boost::thread* threadObj;
Index: source/ariba/utility/system/CMakeLists.txt
===================================================================
--- source/ariba/utility/system/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,60 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    BlockingMethod.h
-    EnterMethod.h
-    StartupInterface.h
-    StartupWrapper.h
-    SystemEvent.h
-    SystemEventListener.h
-    SystemEventType.h
-    SystemQueue.h
-    Timer.h
-    )
-
-add_sources(
-    BlockingMethod.cpp
-    EnterMethod.cpp
-    StartupWrapper.cpp
-    SystemEvent.cpp
-    SystemEventListener.cpp
-    SystemEventType.cpp
-    SystemQueue.cpp
-    Timer.cpp
-    )
Index: source/ariba/utility/system/EnterMethod.cpp
===================================================================
--- source/ariba/utility/system/EnterMethod.cpp	(revision 12775)
+++ 	(revision )
@@ -1,90 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#include "EnterMethod.h"
-
-namespace ariba {
-namespace utility {
-
-//SystemEventType EnterMethodType("EnterMethod");
-
-EnterMethod::EnterMethod(){
-}
-
-EnterMethod::~EnterMethod(){
-}
-
-void EnterMethod::enter(){
-
-	SystemQueue::instance().enterMethod();
-
-	/*
-	{ boost::mutex::scoped_lock lock( waitForEnterMutex );
-
-		SystemQueue::instance().scheduleEvent(
-			SystemEvent( this, EnterMethodType, NULL), 0 );
-		waitForEnter.wait( lock );
-	}
-	*/
-}
-
-void EnterMethod::leave(){
-
-	SystemQueue::instance().leaveMethod();
-
-	/*
-	{ boost::mutex::scoped_lock lock( waitForLeaveMutex );
-		waitForLeave.notify_one();
-	}
-	*/
-}
-
-/*
-void EnterMethod::handleSystemEvent( const SystemEvent& event ){
-
-	{ boost::mutex::scoped_lock lock( waitForLeaveMutex );
-
-		{ boost::mutex::scoped_lock lock2( waitForEnterMutex );
-			waitForEnter.notify_one();
-		}
-
-		waitForLeave.wait( lock );
-	}
-}
-*/
-}} // namespace ariba, common
Index: source/ariba/utility/system/EnterMethod.h
===================================================================
--- source/ariba/utility/system/EnterMethod.h	(revision 12775)
+++ 	(revision )
@@ -1,80 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#ifndef ENTER_METHOD_H__
-#define ENTER_METHOD_H__
-
-#include "ariba/utility/system/SystemEventListener.h"
-#include "ariba/utility/system/SystemQueue.h"
-#include "ariba/utility/system/SystemEvent.h"
-#include "ariba/utility/system/SystemEventType.h"
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-
-using ariba::utility::SystemEventType;
-using ariba::utility::SystemQueue;
-using ariba::utility::SystemEventListener;
-
-namespace ariba {
-namespace utility {
-
-class EnterMethod /*: public SystemEventListener */{
-public:
-	EnterMethod();
-	virtual ~EnterMethod();
-
-	void enter();
-	void leave();
-	
-protected:
-	//void handleSystemEvent(const SystemEvent& event);
-	
-private:
-	/*
-	boost::condition_variable waitForEnter;
-	boost::condition_variable waitForLeave;
-
-	boost::mutex waitForEnterMutex;
-	boost::mutex waitForLeaveMutex;
-	*/
-};
-
-}} // namespace ariba, common
-
-#endif // ENTER_METHOD_H__
Index: source/ariba/utility/system/OldSystemQueue.cpp
===================================================================
--- source/ariba/utility/system/OldSystemQueue.cpp	(revision 12775)
+++ 	(revision )
@@ -1,469 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-
-#include "SystemQueue.h"
-#include <stdexcept>
-
-namespace ariba {
-namespace utility {
-
-use_logging_cpp(SystemQueue);
-
-// /// Singleton
-// SystemQueue::_inst(NULL);
-
-
-SystemQueue::SystemQueue()
-#ifndef UNDERLAY_OMNET
- : delayScheduler( &directScheduler ),
-   systemQueueRunning( false )
-#endif
-{
-	logging_info("Creating SystemQueue at: " << this);
-}
-
-SystemQueue::~SystemQueue()
-{
-}
-
-
-SystemQueue& SystemQueue::instance()
-{
-	static SystemQueue _inst;
-	return _inst;
-
-// 	/// create singleton instance
-// 	if ( _inst == NULL )
-// 	{
-// 		_inst = new SystemQueue();
-// 		
-// 		logging_info("Creating SystemQueue at: " << _inst);
-// 	}
-// 	
-// 	return *_inst;
-}
-
-
-void SystemQueue::scheduleEvent( const SystemEvent& event, uint32_t delay ) {
-#ifndef UNDERLAY_OMNET
-	if( delay == 0 ) directScheduler.insert( event, delay );
-	else delayScheduler.insert ( event, delay );
-#else
-	Enter_Method_Silent();
-	cMessage* msg = new cMessage();
-	msg->setContextPointer( new SystemEvent(event) );
-
-	if( delay == 0 )
-		cSimpleModule::scheduleAt( cSimpleModule::simTime(), msg );
-	else
-		cSimpleModule::scheduleAt( cSimpleModule::simTime()+((double)delay/1000.0), msg );
-#endif
-}
-
-// maps to function call internally to the Event-system
-void SystemQueue::scheduleCall( const boost::function0<void>& function, uint32_t delay)
-{
-    // copy function object
-    boost::function0<void>* function_ptr = new boost::function0<void>();
-    (*function_ptr) = function; 
-
-    // schedule special call-event
-    scheduleEvent( SystemEvent(&internal_function_caller, SystemEventType::DEFAULT, function_ptr), delay );
-
-}
-
-#ifdef UNDERLAY_OMNET
-void SystemQueue::handleMessage(cMessage* msg){
-	SystemEvent* event = (SystemEvent*)msg->contextPointer();
-
-	event->listener->handleSystemEvent( *event );
-
-	delete event; delete msg;
-}
-#endif
-
-void SystemQueue::run() {
-	systemQueueRunning = true;
-	directScheduler.run();
-	delayScheduler.run();
-}
-
-void SystemQueue::cancel() {
-#ifndef UNDERLAY_OMNET
-	systemQueueRunning = false;
-	directScheduler.cancel();
-	delayScheduler.cancel();
-#endif
-}
-
-void SystemQueue::dropAll( const SystemEventListener* mlistener){
-#ifndef UNDERLAY_OMNET
-	directScheduler.dropAll(mlistener);
-	delayScheduler.dropAll(mlistener);
-#endif
-}
-
-bool SystemQueue::isEmpty() {
-#ifndef UNDERLAY_OMNET
-	return directScheduler.isEmpty() || delayScheduler.isEmpty();
-#else
-	return false;
-#endif
-}
-
-bool SystemQueue::isRunning() {
-#ifndef UNDERLAY_OMNET
-	return systemQueueRunning;
-#else
-	return true;
-#endif
-}
-
-void SystemQueue::enterMethod(){
-	// TODO: omnet case and delay scheduler
-	directScheduler.enter();
-}
-
-void SystemQueue::leaveMethod(){
-	// TODO: omnet case and delay scheduler
-	directScheduler.leave();
-}
-
-//***************************************************************
-#ifndef UNDERLAY_OMNET
-
-SystemQueue::QueueThread::QueueThread(QueueThread* _transferQueue)
-	: transferQueue( _transferQueue ), running( false ) {
-}
-
-SystemQueue::QueueThread::~QueueThread(){
-}
-
-void SystemQueue::QueueThread::run(){
-	running = true;
-
-	queueThread = new boost::thread(
-		boost::bind(&QueueThread::threadFunc, this) );
-}
-
-void SystemQueue::QueueThread::cancel(){
-
-	logging_debug("cancelling system queue");
-
-	// cause the thread to exit
-	{
-		// get the lock, when we got the lock the
-		// queue thread must be in itemsAvailable.wait()
-		boost::mutex::scoped_lock lock(queueMutex);
-
-		// set the running indicator and signal to run on
-		// this will run the thread and quit it
-		running = false;
-		itemsAvailable.notify_all();
-	}
-
-	// wait until the thread has exited
-	logging_debug("joining system queue thread");
-	queueThread->join();
-
-	// delete pending events
-	logging_debug("deleting pending system queue events");
-	while( eventsQueue.size() > 0 ){
-		eventsQueue.erase( eventsQueue.begin() );
-	}
-
-	// delete the thread, so that a subsuquent run() can be called
-	delete queueThread;
-	queueThread = NULL;
-}
-
-bool SystemQueue::QueueThread::isEmpty(){
-	boost::mutex::scoped_lock lock( queueMutex );
-	return eventsQueue.empty();
-}
-
-void SystemQueue::QueueThread::insert( const SystemEvent& event, uint32_t delay ){
-
-	// if this is called from a module that is currently handling
-	// a thread (called from SystemQueue::onNextQueueItem), the
-	// thread is the same anyway and the mutex will be already
-	// aquired, otherwise we aquire it now
-
-	boost::mutex::scoped_lock lock( queueMutex );
-
-	if ( delay > 0 )
-	{
-		logging_debug("SystemQueue(" << this << ") : Schedule event in: " << delay << " ms; Events in queue (before insert): " << eventsQueue.size() );
-	}
-
-	eventsQueue.push_back( event );
-	eventsQueue.back().scheduledTime = boost::posix_time::microsec_clock::local_time();
-	eventsQueue.back().delayTime = delay;
-	eventsQueue.back().remainingDelay = delay;
-	
-	if ( delay > 0 )
-	{
-		logging_debug("SystemQueue(" << this << ") : Events in queue (after insert): " << eventsQueue.size() );
-	}
-
-	onItemInserted( event );
-	itemsAvailable.notify_all();
-}
-
-void SystemQueue::QueueThread::dropAll( const SystemEventListener* mlistener) {
-	boost::mutex::scoped_lock lock( queueMutex );
-
-	bool deleted;
-	do{
-		deleted = false;
-		EventQueue::iterator i = eventsQueue.begin();
-		EventQueue::iterator iend = eventsQueue.end();
-
-		for( ; i != iend; i++){
-			if((*i).getListener() == mlistener){
-				eventsQueue.erase(i);
-				deleted = true;
-				break;
-			}
-		}
-	}while(deleted);
-}
-
-void SystemQueue::QueueThread::threadFunc( QueueThread* obj ) {
-
-	boost::mutex::scoped_lock lock( obj->queueMutex );
-
-	while( obj->running ) {
-
-		// wait until an item is in the queue or we are notified
-		// to quit the thread. in case the thread is about to
-		// quit, the queueThreadRunning variable will indicate
-		// this and cause the thread to exit
-
-		while ( obj->running && obj->eventsQueue.empty() ){
-
-//			const boost::system_time duration =
-//					boost::get_system_time() +
-//					boost::posix_time::milliseconds(100);
-//			obj->itemsAvailable.timed_wait( lock, duration );
-
-			obj->itemsAvailable.wait( lock );
-		}
-
-		//
-		// work all the items that are currently in the queue
-		//
-
-		while( obj->running && (!obj->eventsQueue.empty()) ) {
-
-			// fetch the first item in the queue
-			// and deliver it to the queue handler
-			SystemEvent ev = obj->eventsQueue.front();
-
-			// XXX debugging the delay-scheduler..
-			if ( ev.delayTime > 0 )
-				logging_debug("SystemQueue(" << obj << ") : Events in queue (before execution): " << obj->eventsQueue.size());
-
-			obj->eventsQueue.erase( obj->eventsQueue.begin() );
-
-			// call the queue and this will
-			// call the actual event handler
-			obj->queueMutex.unlock();
-			obj->onNextQueueItem( ev );
-			obj->queueMutex.lock();
-
-			// XXX debugging the delay-scheduler..
-			if ( ev.delayTime > 0 )
-				logging_debug("SystemQueue(" << obj << ") : Remaining events in queue (after execution): " << obj->eventsQueue.size());
-
-		} // !obj->eventsQueue.empty() )
-	} // while (obj->running)
-
-	logging_debug("system queue exited");
-}
-
-void SystemQueue::QueueThread::enter(){
-	queueMutex.lock();
-}
-
-void SystemQueue::QueueThread::leave(){
-	queueMutex.unlock();
-}
-
-
-//***************************************************************
-
-SystemQueue::QueueThreadDirect::QueueThreadDirect(){
-}
-
-SystemQueue::QueueThreadDirect::~QueueThreadDirect(){
-}
-
-void SystemQueue::QueueThreadDirect::onItemInserted( const SystemEvent& event ){
-	// do nothing here
-}
-
-void SystemQueue::QueueThreadDirect::onNextQueueItem( const SystemEvent& event ){
-	// directly deliver the item to the
-	event.getListener()->handleSystemEvent( event );
-}
-
-//***************************************************************
-
-SystemQueue::QueueThreadDelay::QueueThreadDelay(QueueThread* _transferQueue)
-	: QueueThread( _transferQueue ), isSleeping( false ) {
-
-	assert( _transferQueue != NULL );
-}
-
-SystemQueue::QueueThreadDelay::~QueueThreadDelay(){
-}
-
-void SystemQueue::QueueThreadDelay::onItemInserted( const SystemEvent& event ){
-
-	if( !isSleeping)
-	{
-		logging_warn("SystemQueue(" << this << ") : No, I'm not asleep!! New item inserted."); 
-		return;  // TODO Mario: shouldn't we sort anyway..?
-	}
-
-	// break an existing sleep and
-	// remember the time that was actually slept for
-	// and change it for every event in the queue
-
-	assert( !eventsQueue.empty());
-	sleepCond.notify_all();
-
-	ptime sleepEnd = boost::posix_time::microsec_clock::local_time();
-	boost::posix_time::time_duration duration = sleepEnd - sleepStart;
-	uint32_t sleptTime = duration.total_milliseconds();
-
-	EventQueue::iterator i = eventsQueue.begin();
-	EventQueue::iterator iend = eventsQueue.end();
-
-	logging_debug("SystemQueue(" << this << ") : Adjusting remaining delays:");
-	
-	// TODO Mario: What about the just inserted event..?
-	for( ; i != iend; i++ ) {
-
-		if( sleptTime >= i->remainingDelay)
-			i->remainingDelay = 0;
-		else
-		{
-			i->remainingDelay -= sleptTime;
-			
-			// XXX Mario: Testcode, just to find a bug...
-			boost::posix_time::time_duration time_passed = sleepEnd - i->getScheduledTime();
-			logging_debug("SystemQueue(" << this << ") : Total: " <<
-					i->delayTime << ", remainingDelay: " << i->remainingDelay <<
-					", time already passed: " << time_passed.total_milliseconds() );
-		}
-
-	} // for( ; i != iend; i++ )
-
-	// now we have to reorder the events
-	// in the queue with respect to their remaining delay
-	// the SystemQueue::operator< takes care of the
-	// ordering with respect to the remaining delay
-
-	std::sort( eventsQueue.begin(), eventsQueue.end() );
-
-}
-
-void SystemQueue::QueueThreadDelay::onNextQueueItem( const SystemEvent& event ){
-
-	// sleeps will be cancelled in the
-	// onItemInserted function when a new
-	// event arrives during sleeping
-
-	assert( !isSleeping );
-
-	// the given item is the one with the least
-	// amount of sleep time left. because all
-	// items are reordered in onItemInserted
-
-	if( event.remainingDelay > 0 ) {
-
-		const boost::system_time duration =
-			boost::get_system_time() +
-			boost::posix_time::milliseconds(event.remainingDelay);
-
-		logging_debug("SystemQueue(" << this << ") : Sleeping for: " << event.remainingDelay << " ms");
-		
-		{
-			boost::unique_lock<boost::mutex> lock( sleepMutex );
-
-			sleepStart = boost::posix_time::microsec_clock::local_time();
-			isSleeping = true;
-			
-			sleepCond.timed_wait( lock, duration );
-
-			isSleeping = false;
-		}
-
-	} // if( event.remainingDelay > 0 )
-
-	// if the sleep succeeded and was not
-	// interrupted by a new incoming item
-	// we can now deliver this event
-
-	ptime sleepEnd = boost::posix_time::microsec_clock::local_time();
-	boost::posix_time::time_duration duration = sleepEnd - sleepStart;
-	uint32_t sleptTime = duration.total_milliseconds();
-
-	logging_debug("SystemQueue(" << this << ") : Slept for: " << sleptTime << " ms; until: " << sleepEnd);
-	
-	// TODO MARIO: find the bug that loses events...
-	if (event.remainingDelay <= sleptTime)
-	{
-		logging_debug("SystemQueue(" << this << ") : Transferring scheduled event into the direct queue. Scheduled time: " << event.getScheduledTime() );
-		transferQueue->insert( event, 0 );
-	}
-	else
-	{
-		logging_warn("SystemQueue(" << this << ") : Scheduled event lost!! :-(   (Sleep should have been " << event.remainingDelay - sleptTime << " ms longer..)");
-		logging_debug("SystemQueue(" << this << ") : Total delay: " << event.delayTime << "; remaining delay: " << event.remainingDelay);
-		
-// 		throw std::logic_error("Scheduled event lost!! :-(");
-	}
-}
-
-#endif // #ifndef UNDERLAY_OMNET
-
-//***************************************************************
-
-}} // spovnet, common
Index: source/ariba/utility/system/OldSystemQueue.h
===================================================================
--- source/ariba/utility/system/OldSystemQueue.h	(revision 12775)
+++ 	(revision )
@@ -1,284 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#ifndef SYSTEMQUEUE_H_
-#define SYSTEMQUEUE_H_
-
-#include <vector>
-#include <cassert>
-#include "SystemEvent.h"
-#include "SystemEventListener.h"
-#include "ariba/utility/logging/Logging.h"
-#include <boost/date_time.hpp>
-#include <boost/cstdint.hpp>
-
-#ifdef UNDERLAY_OMNET
-  #include <csimplemodule.h>
-  #include <cmessage.h>
-  #include <macros.h>
-#else
-  #include <boost/thread/mutex.hpp>
-  #include <boost/thread/thread.hpp>
-  #include <boost/thread/condition_variable.hpp>
-  #include <boost/utility.hpp>
-  #include <boost/bind.hpp>
-#endif
-
-#include <boost/function.hpp>
-
-
-using std::vector;
-using boost::posix_time::ptime;
-
-namespace ariba {
-namespace utility {
-
-/**
- * This class implements a simple system event queue to allow
- * a simulation of cooperative multitasking. It also allows
- * events to be scheduled from other tasks. This allows
- * dispatching asynchronous tasks.
- *
- * @author Christoph Mayer, Sebastian Mies
- */
-
-class SystemQueue : private boost::noncopyable
-{
-	use_logging_h(SystemQueue);
-	friend class EnterMethod;
-public:
-	/**
-	 * Get the SystemQueue singleton instance.
-	 */
-	static SystemQueue& instance();
-
-	/**
-	 * This methods schedules a given event.
-	 *
-	 * @param The event to be scheduled
-	 * @param The delay in milli-seconds
-	 */
-	void scheduleEvent( const SystemEvent& event, uint32_t delay = 0 );
-	
-	/**
-	 * This method schedules a function call in the SystemQueue.
-	 * (Like scheduleEvent, but to be used with boost::bind.)
-	 * 
-	 * @param function: The function to be called [void function()]
-	 * @param The delay in milli-seconds
-	 */
-	void scheduleCall( const boost::function0<void>& function, uint32_t delay = 0 );
-
-	/**
-	 * Starts the processing and waiting for events.
-	 * Use <code>cancel()</code> to end system queue processing and
-	 * <code>isEmpty()</code> to check wheter the queue is empty.
-	 */
-	void run();
-
-	/**
-	 * Cancels the system queue and ends the processing after the
-	 * currently processed event is processed.
-	 *
-	 * This method is thread-safe.
-	 */
-	void cancel();
-
-	/**
-	 * Drop all queued events for that listener
-	 */
-	void dropAll( const SystemEventListener* mlistener);
-
-	/**
-	 * Check wheter this queue has items or not.
-	 *
-	 * @return True, if this queue is empty.
-	 */
-	bool isEmpty();
-
-	/**
-	 * Is the system queue already started and running?
-	 *
-	 * @return True, if the system queue is running.
-	 */
-	bool isRunning();
-
-protected:
-
-	/**
-	 * Aqcuire the mutex
-	 */
-	void enterMethod();
-
-	/**
-	 * Leave the mutex
-	 */
-	void leaveMethod();
-
-	/**
-	 * Constructs a system queue.
-	 */
-	SystemQueue();
-
-	/**
-	 * Destroys the system queue. Beware that all events
-	 * are canceled
-	 */
-	~SystemQueue();
-	
-	
-private:
-
-#ifndef UNDERLAY_OMNET
-	typedef vector<SystemEvent> EventQueue;
-
-	//********************************************************
-
-	class QueueThread {
-	public:
-		QueueThread(QueueThread* _transferQueue = NULL);
-		virtual ~QueueThread();
-		void run();
-		void cancel();
-		bool isEmpty();
-		void insert( const SystemEvent& event, uint32_t delay );
-		void enter();
-		void leave();
-		void dropAll( const SystemEventListener* mlistener);
-
-	protected:
-		virtual void onItemInserted( const SystemEvent& event ) = 0;
-		virtual void onNextQueueItem( const SystemEvent& event ) = 0;
-		QueueThread* transferQueue;
-		EventQueue eventsQueue;
-		boost::mutex queueMutex;
-	private:
-		boost::thread* queueThread;
-		static void threadFunc( QueueThread* obj );
-		boost::condition_variable itemsAvailable;
-		volatile bool running;
-	}; // class QueueThread
-
-	//********************************************************
-
-	class QueueThreadDirect : public QueueThread {
-	public:
-		QueueThreadDirect();
-		~QueueThreadDirect();
-	protected:
-		virtual void onItemInserted( const SystemEvent& event );
-		virtual void onNextQueueItem( const SystemEvent& event );
-	}; // class QueueThreadDirect
-
-	//********************************************************
-
-	class QueueThreadDelay : public QueueThread {
-	public:
-		QueueThreadDelay(QueueThread* _transferQueue = NULL);
-		~QueueThreadDelay();
-	protected:
-		virtual void onItemInserted( const SystemEvent& event );
-		virtual void onNextQueueItem( const SystemEvent& event );
-	private:
-		volatile bool isSleeping;
-		ptime sleepStart;
-		boost::mutex sleepMutex;
-		boost::condition_variable sleepCond;
-	}; // class QueueThreadDelay
-
-	//********************************************************
-
-	
-// 	/// Singleton
-// 	static SystemQueue* _inst;
-
-	QueueThreadDirect directScheduler;
-	QueueThreadDelay delayScheduler;
-	volatile bool systemQueueRunning;
-#endif
-	
-	
-private:
-    /**
-     * This inner class handles the function-call events.
-     * @see SystemQueue::scheduleCall
-     */
-    class FunctionCaller  :  public SystemEventListener
-    {
-        void handleSystemEvent(const SystemEvent& event)
-        {
-            boost::function0<void>* function_ptr = event.getData< boost::function0<void> >();
-            (*function_ptr)();
-            delete function_ptr;
-        }
-    };
-
-    FunctionCaller internal_function_caller;
-}; // class SystemQueue
-
-#ifdef UNDERLAY_OMNET
-
-#if 0
-	//
-	// the system queue must be a singleton in simulations, too.
-	// and to include it in the simulation the module is defined
-	// as submodule in every SpoVNet host. Therefore we hack the
-	// Define_Module (see omnet/includes/macros.h) the way we need
-	// it with our singleton ...
-	//
-	// this is the macro definition from macros.h
-	//
-	// #define Define_Module(CLASSNAME) /backslash
-	//   static cModule *CLASSNAME##__create() {return new CLASSNAME();} /backslash
-	//   EXECUTE_ON_STARTUP(CLASSNAME##__mod, modtypes.instance()->add(new cModuleType(#CLASSNAME,#CLASSNAME,(ModuleCreateFunc)CLASSNAME##__create));)
-	//
-	// and this is how we do it :)
-	//
-#endif
-
-  	static cModule* SystemQueue__create() {
-		return &SystemQueue::instance();
-	}
-
- 	EXECUTE_ON_STARTUP(SystemQueue__mod, modtypes.instance()->add(new cModuleType("SystemQueue","SystemQueue",(ModuleCreateFunc)SystemQueue__create));)
-
-#endif
-
-}} // spovnet, common
-
-#endif /* SYSTEMQUEUE_H_ */
Index: source/ariba/utility/system/README
===================================================================
--- source/ariba/utility/system/README	(revision 2378)
+++ source/ariba/utility/system/README	(revision 2378)
@@ -0,0 +1,6 @@
+This directory contains utility classes that help to adapt ariba
+to realworld and simulation environments. This especially includes
+a SystemQueue for scheduling. A timer class for commonly used timers. A 
+StartupWrapper that is used to start the initial application or service, 
+as well as some convenience classes, like BlockingMethod, that allows
+an easier integration of blocking calls in real world applications.
Index: source/ariba/utility/system/StartupInterface.h
===================================================================
--- source/ariba/utility/system/StartupInterface.h	(revision 12775)
+++ source/ariba/utility/system/StartupInterface.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef __STARTUP_INTERFACE_H
@@ -45,8 +45,16 @@
 
 namespace ariba {
+namespace interface {
+	class UnderlayAbstraction;
+}}
+
+using ariba::interface::UnderlayAbstraction;
+
+namespace ariba {
 namespace utility {
 
-class StartupWrapper;
-
+/**
+ * TODO: Mies -- to be replaced by a general Module!
+ */
 class StartupInterface
 #ifdef UNDERLAY_OMNET
@@ -59,9 +67,7 @@
 	virtual ~StartupInterface(){};
 
+protected:
 	virtual void startup() = 0;
 	virtual void shutdown() = 0;
-
-protected:
-	StartupWrapper* wrapper;
 };
 
Index: source/ariba/utility/system/StartupWrapper.cpp
===================================================================
--- source/ariba/utility/system/StartupWrapper.cpp	(revision 12775)
+++ source/ariba/utility/system/StartupWrapper.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,15 +35,7 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
-
-// XXX NOTE: Use this class with caution! Config support is outdated.
+// [Licence]
 
 #include "StartupWrapper.h"
-#include "ariba/config.h"
-
-#ifdef HAVE_LOG4CXX
-	#include <log4cxx/logger.h>
-	#include <log4cxx/basicconfigurator.h>
-#endif // HAVE_LOG4CXX
 
 namespace ariba {
@@ -55,7 +47,8 @@
 #endif
 
-SystemEventType StartupWrapperEventStartup("StartupWrapperEventStartup");
+SystemEventType StartupWrapperEventType("StartupWrapperEventType");
 
-StartupWrapper::StartupWrapper(StartupInterface* _service) : service( _service ){
+StartupWrapper::StartupWrapper(StartupInterface* _service, bool _block)
+	: blocking( _block ), service( _service ){
 }
 
@@ -80,11 +73,9 @@
 #endif
 
-void StartupWrapper::startSystem(){
+void StartupWrapper::initSystem(){
 
-	//
-	// having seeded the pseudo rng is always good
-	//
-
-	srand( time(NULL) );
+	static bool initialized = false;
+	if( initialized ) return;
+	initialized = true;
 
 	//
@@ -98,18 +89,24 @@
 	// init the logging system
 	//
-
-#ifdef HAVE_LOG4CXX
-	log4cxx::BasicConfigurator::configure();
-#endif //HAVE_LOG4CXX
-
-	//
-	// configure the default logging level to info
+	// configure the logging
 	//
 
-	logging_rootlevel_info();
-}
+	log4cxx::BasicConfigurator::configure();
 
-void StartupWrapper::stopSystem(){
-	SystemQueue::instance().cancel();
+	// set the global log level
+	{
+		log4cxx::LoggerPtr logger(log4cxx::Logger::getRootLogger());
+		logger->setLevel(log4cxx::Level::getDebug());
+	}
+
+	// set up again an individual level if you like
+	{
+ 		// log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("BaseOverlay"));
+ 		// logger->setLevel(log4cxx::Level::getInfo());
+	}
+
+	//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+	// DON'T SVN COMMIT YOUR CHANTED LOGGING! THE ABOVE CODE MUST REMAIN AS IS!
+	//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
 }
 
@@ -119,68 +116,51 @@
 }
 
-void StartupWrapper::handleSystemEvent(const SystemEvent& event){
-
-	if( event.getType() == StartupWrapperEventStartup ){
-
-		if(!configurations.empty()){
-			string config = configurations.front();
-			configurations.pop();
-			Configuration::setConfigFilename( config );
-		}
-
-		//
-		// start the actual application
-		//
-
-		// TODO: im falle von omnet ist service = null, da von SpoVNetOmnetModule so ÃŒbergeben
-		// wie wird im Falle von omnet die anwendung erstellt?
-
-		service->startup();
-
-	}
-
-}
-
 void StartupWrapper::startup(StartupInterface* service, bool block){
 
-	StartupWrapper* startup = new StartupWrapper(service);
-	service->wrapper = startup;
+	StartupWrapper* spovnet = new StartupWrapper(service, block);
 
+#ifdef UNDERLAY_OMNET
 	SystemQueue::instance().scheduleEvent(
-		SystemEvent( startup, StartupWrapperEventStartup, NULL), 0 );
-
-#ifndef UNDERLAY_OMNET
-	if( block ) getchar();
+		SystemEvent( spovnet, StartupWrapperEventType, NULL), 0 );
+#else
+	spovnet->handleSystemEvent(
+		SystemEvent( spovnet, StartupWrapperEventType, NULL));
 #endif
 }
 
-void StartupWrapper::shutdown(StartupInterface* service, bool block){
+void StartupWrapper::handleSystemEvent(const SystemEvent& event){
 
-	if( service == NULL || service->wrapper == NULL ) return;
+	string config = configurations.front();
+	configurations.pop();
+	Configuration::setConfigFilename( config );
 
+	//
+	// start the actual application
+	//
+
+	// TODO: im falle von omnet ist service = null, da von SpoVNetOmnetModule so ÃŒbergeben
+	// wie wird im Falle von omnet die anwendung erstellt?
+
+	service->startup();
+	waitForExit();
+
+#ifndef UNDERLAY_OMNET
+	service->shutdown();
+	delete event.getListener();
+#endif
+}
+
+void StartupWrapper::waitForExit(){
+#ifndef UNDERLAY_OMNET
+	if( blocking ) getchar();
+#endif
+}
+
+void StartupWrapper::shutdown(){
 #ifdef UNDERLAY_OMNET
 	//TODO: service->shutdown();
 #endif
 
-	if(block){
-		// call directly
-		service->shutdown();
-	}else{
-		// call async, but not using systemqueue! // TODO: mem leak
-		AsyncShutdown* async = new AsyncShutdown(service);
-		async->runBlockingMethod();
-	}
-}
-
-StartupWrapper::AsyncShutdown::AsyncShutdown(StartupInterface* _service)
-	: service(_service){
-}
-
-void StartupWrapper::AsyncShutdown::blockingFunction(){
-	service->shutdown();
-}
-
-void StartupWrapper::AsyncShutdown::dispatchFunction(){
-	//unused
+	SystemQueue::instance().cancel();
 }
 
Index: source/ariba/utility/system/StartupWrapper.h
===================================================================
--- source/ariba/utility/system/StartupWrapper.h	(revision 12775)
+++ source/ariba/utility/system/StartupWrapper.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,7 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
-
-// XXX NOTE: Use this class with caution! Config support is outdated.
+// [Licence]
 
 #ifndef __STARTUP_WRAPPER_H
@@ -46,6 +44,5 @@
 #include "SystemQueue.h"
 #include "StartupInterface.h"
-#include "ariba/utility/configuration/Configuration.h"
-#include "BlockingMethod.h"
+#include "../configuration/Configuration.h"
 
 #ifdef UNDERLAY_OMNET
@@ -72,10 +69,8 @@
 class StartupWrapper : public SystemEventListener {
 public:
-	static void startSystem();
-	static void stopSystem();
-
+	static void initSystem();
 	static void initConfig(string filename);
 	static void startup(StartupInterface* service, bool block = true);
-	static void shutdown(StartupInterface* service, bool block = true);
+	static void shutdown();
 
 #ifdef UNDERLAY_OMNET
@@ -85,5 +80,5 @@
 
 protected:
-	StartupWrapper(StartupInterface* _service);
+	StartupWrapper(StartupInterface* _service, bool _block);
 	virtual ~StartupWrapper();
 
@@ -99,17 +94,7 @@
 #endif
 
+	volatile bool blocking;
 	void waitForExit();
 	StartupInterface* service;
-
-	class AsyncShutdown : public BlockingMethod {
-	public:
-		AsyncShutdown(StartupInterface* _service);
-	protected:
-		virtual void dispatchFunction();
-		virtual void blockingFunction(); // unused
-	private:
-		StartupInterface* service;
-	};
-
 };
 
Index: source/ariba/utility/system/SystemEvent.cpp
===================================================================
--- source/ariba/utility/system/SystemEvent.cpp	(revision 12775)
+++ source/ariba/utility/system/SystemEvent.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "SystemEvent.h"
Index: source/ariba/utility/system/SystemEvent.h
===================================================================
--- source/ariba/utility/system/SystemEvent.h	(revision 12775)
+++ source/ariba/utility/system/SystemEvent.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SYSTEMEVENT_H_
@@ -49,10 +49,14 @@
 namespace utility {
 
-class SystemQueue;
 class SystemEventListener;
 
 class SystemEvent {
 	friend class SystemQueue;
+
 private:
+	ptime scheduledTime; //< time the event was originally given to the queue
+	uint32_t delayTime; //< time the event is scheduled at, or 0 if it is to be fired immediately
+	uint32_t remainingDelay; //< remaining delay time for sleeping
+
 	SystemEventListener* listener; //< handler of the event
 	SystemEventType type; //< type of the event
@@ -60,40 +64,32 @@
 
 public:
-	// TODO: these should be private, but the gcc 3.4 in scratchbox for cross-compiling
-	// for Maemo (Nokia N810) gets confused when the friend class SystemQueue has a 
-	// private class that accesses these variables. Therefore they are public for now.
-	ptime scheduledTime; //< time the event was originally given to the queue
-	ptime deadline; //< time when the event should be executed  TODO Mario 
-	uint32_t delayTime; //< time the event is scheduled at, or 0 if it is to be fired immediately
-	uint32_t remainingDelay; //< remaining delay time for sleeping
-
-public:
-	inline SystemEvent(SystemEventListener* mlistener, SystemEventType mtype =
-			SystemEventType::DEFAULT, void* mdata = NULL) :
-		listener(mlistener), 
-		type(mtype), 
-		data(mdata), 
-		scheduledTime(boost::posix_time::not_a_date_time),
-		deadline(boost::posix_time::not_a_date_time),
-		delayTime(0),
-		remainingDelay(0)
-	{
+	inline SystemEvent(
+			SystemEventListener* mlistener,
+			SystemEventType mtype = SystemEventType::DEFAULT,
+			void* mdata = NULL)
+			:	scheduledTime(boost::posix_time::not_a_date_time),
+				delayTime(0),
+				remainingDelay(0),
+				listener(mlistener),
+				type(mtype),
+				data(mdata) {
 	}
 
 	template<typename T>
-	inline SystemEvent(SystemEventListener* mlistener, SystemEventType mtype =
-			SystemEventType::DEFAULT, T* mdata = NULL) :
-		listener(mlistener), 
-		type(mtype), 
-		data((void*) mdata), 
-		scheduledTime(boost::posix_time::not_a_date_time),
-		deadline(boost::posix_time::not_a_date_time),
-		delayTime(0),
-		remainingDelay(0) {
+	inline SystemEvent( SystemEventListener* mlistener,
+			SystemEventType mtype = SystemEventType::DEFAULT,
+			T* mdata = NULL)
+				:	scheduledTime(boost::posix_time::not_a_date_time),
+					delayTime(0),
+					remainingDelay(0),
+					listener(mlistener),
+					type(mtype),
+					data((void*)mdata) {
 	}
+
+
 
 	inline SystemEvent(const SystemEvent& copy) {
 		this->scheduledTime = copy.scheduledTime;
-        this->deadline = copy.deadline;
 		this->delayTime = copy.delayTime;
 		this->remainingDelay = copy.remainingDelay;
@@ -105,5 +101,4 @@
 	inline void operator=(const SystemEvent& right) {
 		this->scheduledTime = right.scheduledTime;
-        this->deadline = right.deadline;
 		this->delayTime = right.delayTime;
 		this->remainingDelay = right.remainingDelay;
@@ -121,5 +116,5 @@
 	}
 
-	inline SystemEventListener* getListener() const {
+	inline const SystemEventListener* getListener() const {
 		return listener;
 	}
@@ -127,5 +122,5 @@
 	template<typename T>
 	inline T* getData() const {
-		return (T*) *this;
+		return (T*)*this;
 	}
 
@@ -142,18 +137,11 @@
 	}
 
-	bool operator<(const SystemEvent& right) const
-	{
-		return this->deadline < right.deadline;
+	inline bool operator<(const SystemEvent& right) const {
+		return remainingDelay < right.remainingDelay;
 	}
-
-    bool operator>(const SystemEvent& right) const
-    {
-        return this->deadline > right.deadline;
-    }
 
 };
 
-}
-} // spovnet, common
+}} // spovnet, common
 
 #endif /* SYSTEMEVENT_H_ */
Index: source/ariba/utility/system/SystemEventListener.cpp
===================================================================
--- source/ariba/utility/system/SystemEventListener.cpp	(revision 12775)
+++ source/ariba/utility/system/SystemEventListener.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "SystemEventListener.h"
Index: source/ariba/utility/system/SystemEventListener.h
===================================================================
--- source/ariba/utility/system/SystemEventListener.h	(revision 12775)
+++ source/ariba/utility/system/SystemEventListener.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SYSTEMEVENTLISTENER_H_
@@ -51,5 +51,5 @@
 	virtual ~SystemEventListener() = 0;
 
-public: // should be private, see comments in SystemEvent.h
+protected:
 	virtual void handleSystemEvent( const SystemEvent& event ) = 0;
 };
Index: source/ariba/utility/system/SystemEventType.cpp
===================================================================
--- source/ariba/utility/system/SystemEventType.cpp	(revision 12775)
+++ source/ariba/utility/system/SystemEventType.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "SystemEventType.h"
Index: source/ariba/utility/system/SystemEventType.h
===================================================================
--- source/ariba/utility/system/SystemEventType.h	(revision 12775)
+++ source/ariba/utility/system/SystemEventType.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,16 +35,13 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SYSTEMEVENTTYPE_H_
 #define SYSTEMEVENTTYPE_H_
 
-#include <iostream>
-#include <vector>
-#include <string>
-#include <boost/cstdint.hpp>
-#include <boost/foreach.hpp>
+#include<iostream>
+#include<vector>
+#include<boost/cstdint.hpp>
 
-using std::string;
 using std::vector;
 using std::ostream;
@@ -64,16 +61,9 @@
 	class Descriptor {
 	public:
-		string description;
+		const char* description;
 		eventid_t parent;
 
-		Descriptor(string _d, eventid_t _p = 0) :
+		Descriptor(const char* _d, eventid_t _p = 0) :
 			description(_d), parent(_p) {
-		}
-		
-		Descriptor(const Descriptor& rh) 
-			: description( rh.description ), parent( rh.parent ) {
-		}
-
-		~Descriptor() {
 		}
 	};
@@ -85,5 +75,5 @@
 
 public:
-	inline SystemEventType(string description,
+	inline SystemEventType(const char* description,
 			const SystemEventType parent = DEFAULT) {
 		if (ids.size() == 0) ids.push_back(Descriptor(
@@ -104,7 +94,8 @@
 
 	inline ~SystemEventType() {
+
 	}
 
-	inline string getDescription() const {
+	inline const char* getDescription() const {
 		return ids[id].description;
 	}
@@ -156,5 +147,5 @@
 
 	inline bool isDefault() {
-		return ( id == 0 );
+		return (id == 0);
 	}
 
Index: source/ariba/utility/system/SystemQueue.cpp
===================================================================
--- source/ariba/utility/system/SystemQueue.cpp	(revision 12775)
+++ source/ariba/utility/system/SystemQueue.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -37,165 +37,83 @@
 
 #include "SystemQueue.h"
-#include <ariba/utility/misc/sha1.h>
-#include <stdexcept>
-
-// TODO Mario:
-// check if there is any debug out left to remove
 
 namespace ariba {
 namespace utility {
-    
-typedef boost::mutex::scoped_lock scoped_lock;
-
-using boost::posix_time::microsec_clock;
-using boost::posix_time::time_duration;
-using boost::date_time::not_a_date_time;
-using boost::scoped_ptr;
-    
 
 use_logging_cpp(SystemQueue);
 
-SystemQueue::SystemQueue() :
-    SysQ( new QueueThread() )
+SystemQueue::SystemQueue()
+#ifndef UNDERLAY_OMNET
+ : delayScheduler( &directScheduler ), systemQueueRunning( false )
+#endif
 {
-	logging_debug("Creating SystemQueue at: " << this);
-}
-
-SystemQueue::~SystemQueue()
-{
-}
-
-
-SystemQueue& SystemQueue::instance()
-{
-	static SystemQueue _inst;
-	return _inst;
-}
-
-
-void SystemQueue::scheduleEvent( const SystemEvent& event, uint32_t delay )
-{
-//     assert ( SysQ->running );  // should we really enforce this?
-    if ( ! SysQ->running )
-    {
-        logging_debug("/// WARNING: The SystemQueue is NOT RUNNING!");
-    }
-    
-    // copy
-    SystemEvent ev(event);
-    
-    SysQ->insert(ev, delay);
-}
-
-// maps to function call internally to the Event-system
-void SystemQueue::scheduleCall( const boost::function0<void>& function, uint32_t delay)
-{
-    // copy function object
-    boost::function0<void>* function_ptr = new boost::function0<void>();
-    (*function_ptr) = function; 
-
-    // schedule special call-event
-    scheduleEvent( SystemEvent(&internal_function_caller, SystemEventType::DEFAULT, function_ptr), delay );
-}
-
-
-
-
-void SystemQueue::run()
-{
-    // TODO should these be assertion or exceptions..? (exceptions => unit test)
-    assert ( ! SysQ->running );
-    assert ( ! SysQ->unclean );
-    
-    SysQ->running = true;
-    
-    // start thread
-    sysq_thread.reset( new boost::thread(boost::ref(*SysQ)) );
-}
-
-void SystemQueue::cancel()
-{
-    // CHECK: this function must not be called from within a SystemQueue-Event
-    if ( am_I_in_the_SysQ_thread() )
-//     if ( sysq_thread && boost::this_thread::get_id() == sysq_thread->get_id() )
-    {
-        logging_warn("SystemQueue::cancel() was called from within a SystemQueue-Event. This is not allowed!");
-        throw std::logic_error("SystemQueue::cancel() was called from within a SystemQueue-Event. This is not allowed!");
-    }
-
-    
-    // signal SysQ to quit (and abort queued events)
-    SysQ->cancel();
-    
-    // wait till actually completes
-    //   (should be fast, but the current event is allowed to finish)
-    if ( sysq_thread )
-    {
-        logging_debug("/// ... joining SysQ thread");
-        sysq_thread->join();
-    }
-    
-    // delete thread object
-    sysq_thread.reset();
-    
-    assert ( ! SysQ->isRunning() );
-
-    
-    // clean up and respawn
-    logging_debug("/// respawning SysQ");
-    SysQ.reset( new QueueThread() );
-}
-
-
-void SystemQueue::leave()
-{
-    // signal SysQ to quit (and abort queued events)
-    SysQ->cancel();
-}
-
-void SystemQueue::join()
-{
-    if ( sysq_thread )
-    {
-        logging_debug("/// ... joining SysQ thread");
-        sysq_thread->join();
-    }
-}
-
-
-
-void SystemQueue::dropAll( const SystemEventListener* mlistener)
-{
-//  TODO
-// 	directScheduler.dropAll(mlistener);
-// 	delayScheduler.dropAll(mlistener);
-}
-
-bool SystemQueue::isEmpty()
-{
-    return SysQ->isEmpty();
-}
-
-bool SystemQueue::isRunning()
-{
-    return SysQ->isRunning();
-}
-
-bool SystemQueue::am_I_in_the_SysQ_thread()
-{
-    return sysq_thread && boost::this_thread::get_id() == sysq_thread->get_id();
-}
-
-
-//********************************************************
-
-
-/// constructor
-SystemQueue::QueueThread::QueueThread() : 
-    processing_event( false ),
-    running( false ),
-    aborted( false ),
-    unclean( false )
-{
+}
+
+SystemQueue::~SystemQueue() {
+}
+
+void SystemQueue::scheduleEvent( const SystemEvent& event, uint32_t delay ) {
+#ifndef UNDERLAY_OMNET
+	if( delay == 0 ) directScheduler.insert( event, delay );
+	else delayScheduler.insert ( event, delay );
+#else
+	Enter_Method_Silent();
+	cMessage* msg = new cMessage();
+	msg->setContextPointer( new SystemEvent(event) );
+
+	if( delay == 0 )
+		cSimpleModule::scheduleAt( cSimpleModule::simTime(), msg );
+	else
+		cSimpleModule::scheduleAt( cSimpleModule::simTime()+((double)delay/1000.0), msg );
+#endif
+}
+
+#ifdef UNDERLAY_OMNET
+void SystemQueue::handleMessage(cMessage* msg){
+	SystemEvent* event = (SystemEvent*)msg->contextPointer();
+
+	event->listener->handleSystemEvent( *event );
+
+	delete event; delete msg;
+}
+#endif
+
+void SystemQueue::run() {
+#ifndef UNDERLAY_OMNET
+	systemQueueRunning = true;
+	directScheduler.run();
+	delayScheduler.run();
+#endif
+}
+
+void SystemQueue::cancel() {
+#ifndef UNDERLAY_OMNET
+	systemQueueRunning = false;
+	directScheduler.cancel();
+	delayScheduler.cancel();
+#endif
+}
+
+bool SystemQueue::isEmpty() {
+#ifndef UNDERLAY_OMNET
+	return directScheduler.isEmpty() || delayScheduler.isEmpty();
+#else
+	return false;
+#endif
+}
+
+bool SystemQueue::isRunning() {
+#ifndef UNDERLAY_OMNET
+	return systemQueueRunning;
+#else
+	return true;
+#endif
+}
+
+//***************************************************************
+#ifndef UNDERLAY_OMNET
+
+SystemQueue::QueueThread::QueueThread(QueueThread* _transferQueue)
+	: running( false ), transferQueue( _transferQueue ) {
 }
 
@@ -203,248 +121,199 @@
 }
 
-
-void SystemQueue::QueueThread::operator()()
-{
-    logging_debug( "/// SysQ thread is alive." );
-    
-    assert( running );  // this is set before the thread starts
-    
-    // main loop
-    while ( ! aborted )
-    {
-        // run next immediate event (only one)
-        run_immediate_event();
-        
-        // maintain timed events (move to immediateEventsQ, when deadline expired)
-        check_timed_queue();
-        
-        // wait for next deadline (if no immediate events pending)
-        wait_for_next_deadline();
-    }
-    
-    logging_debug( "/// SysQ thread is quitting." );
-    
-    unclean = true;
-    running = false;
-}
-
-
-
-
-
-/// main loop functions
-
-void SystemQueue::QueueThread::run_immediate_event()
-{
-    // get next event and process it
-    if ( ! immediateEventsQ.empty() )
-    {
-        scoped_ptr<SystemEvent> currently_processed_event;
-        
-        /* dequeue event */
-        // SYNCHRONIZED
-        {
-            scoped_lock lock( queue_mutex );
-            
-            this->processing_event = true;
-            
-            // * dequeue first event *
-            currently_processed_event.reset( new SystemEvent(immediateEventsQ.front()) );   // copy
-            immediateEventsQ.pop_front();
-        }
-        
-        /* dispatch event */
-//         logging_debug("/// SysQ: dispatching event");
-        
-        // measure execution time (1/2)
-        ptime start_time = get_clock();
-
-        // * dispatch event *
-        currently_processed_event->getListener()->handleSystemEvent( *currently_processed_event );
-        
-        // measure execution time (2/2)
-        time_duration execution_time = get_clock() - start_time;
-        
-        // DEBUG OUTPUT: warning when execution takes too much time
-        //   [ TODOx how long is "too much time"? ]
-        if ( execution_time.total_milliseconds() > 50 )
-        {
-            logging_info("WARNING: Last event took " << execution_time.total_milliseconds() << " ms to complete.");
-        }
-
-        /*  [ TODOx ]
-        * 
-        *  - we could also measure how long an event has been waiting in the queue before it's dispatched
-        *  (in order to detect overload)
-        * 
-        *  - especially for timed events, the displacement could be calculated
-        *  (and, e.g., put in relation with the actual intended sleep time)
-        */
-    }
-    
-    this->processing_event = false;
-}
-
-void SystemQueue::QueueThread::check_timed_queue()
-{
-    // this whole function is SYNCHRONIZED
-    scoped_lock lock( queue_mutex );
-
-    ptime now = get_clock();
-    bool not_expired_events_reached = false;
-    
-    // move all expired events into the immediateEventsQ
-    while ( ! timedEventsQ.empty() && ! not_expired_events_reached )
-    {
-        const SystemEvent& ev = timedEventsQ.top();
-        
-        time_duration remaining_sleep_time = ev.deadline - now;
-        
-        // BRANCH: deadline reached
-        if ( remaining_sleep_time.is_negative() )
-        {
-            // move to immediateEventsQ
-            immediateEventsQ.push_back(ev);
-            timedEventsQ.pop();
-        }
-        // BRANCH: deadline not reached
-        else
-        {
-            // okay, that's all for now.
-            not_expired_events_reached = true;
-        }
-    } // while
-}
-
-void SystemQueue::QueueThread::wait_for_next_deadline()
-{
-    // SYNCHRONIZED
-    boost::mutex::scoped_lock lock(queue_mutex);
-
-    if ( immediateEventsQ.empty() )
-    {
-         // don't sleep when the SystemQueue is not already canceled
-        if ( aborted )
-            return;
-
-        
-        // BRANCH: no timed events: sleep "forever" (until new events are scheduled)
-        if ( timedEventsQ.empty() )
-        {
-//             logging_debug("/// SysQ is going to sleep.");
-            
-            this->system_queue_idle.wait( lock );
-        }
-        // BRANCH: sleep till next timed event
-        else
-        {
-//             logging_debug( "/// SysQ is going to sleep for "
-//                         << ( timedEventsQ.top().deadline - get_clock() ).total_milliseconds()
-//                         << "ms. Deadline: " 
-//                         << timedEventsQ.top().deadline
-//                         << ", Clock: "
-//                         << get_clock() );
-
-            this->system_queue_idle.timed_wait( lock, timedEventsQ.top().deadline );
-        }
-    }
-}
-
-
-/// uniform clock interface
-ptime SystemQueue::QueueThread::get_clock()
-{
-    return microsec_clock::universal_time();
-}
-
-
-
-/// external interface
-
-bool SystemQueue::QueueThread::isRunning()
-{
-    return running;
-}
-
-
-void SystemQueue::QueueThread::cancel()
-{
-    logging_debug("/// Cancelling system queue... ");
-
-    // SYNCHRONIZED
-    {
-        scoped_lock lock(queue_mutex);
-        aborted = true;
-    }
-    
-    logging_debug("/// SysQ: " << immediateEventsQ.size() << " immediate event(s) + "
-                              << timedEventsQ.size() << " timed event(s) left.");
-    
-    system_queue_idle.notify_all();
-}
-
-
-void SystemQueue::QueueThread::insert( SystemEvent& event, uint32_t delay )
-{
-    event.scheduledTime = get_clock();
-    
-    // SYNCHRONIZED
-    {
-        scoped_lock lock( queue_mutex );
-        
-        // BRANCH: immediate event
-        if ( delay == 0 )
-        {
-            immediateEventsQ.push_back(event);
-        }
-        // BRANCH: timed event
-        else
-        {
-            event.deadline = event.scheduledTime + boost::posix_time::milliseconds(delay);
-            event.delayTime = delay;  // ( I think this is no longer needed.. )
-            
-//             // debug output
-//             logging_debug("/// inserting timed event, due at: " << event.deadline << " (in " << delay << " ms)");
-            
-            timedEventsQ.push(event);
-        }
-    }
-    
-    // wake SysQ thread
-    system_queue_idle.notify_one();  // NOTE: there is only one thread
-                                     // (so it doesn't matter whether to call notify_one, or notify_all)
-}
-
-
-bool SystemQueue::QueueThread::isEmpty()
-{
-    // SYNCHRONIZED
-    scoped_lock lock( queue_mutex );
-    
-    return immediateEventsQ.empty() && timedEventsQ.empty() && ! processing_event;
-}
-
-
-
-// FIXME
-void SystemQueue::enterMethod()
-{
-    assert( false );
-}
-void SystemQueue::leaveMethod()
-{
-    assert( false );
-}
-
-
-
-// XXX code from old system queue
-// void SystemQueue::QueueThread::enter(){
-// 	queueMutex.lock();
-// }
-// 
-// void SystemQueue::QueueThread::leave(){
-// 	queueMutex.unlock();
-// }
+void SystemQueue::QueueThread::run(){
+	running = true;
+	queueThread = new boost::thread(
+		boost::bind(&QueueThread::threadFunc, this) );
+}
+
+void SystemQueue::QueueThread::cancel(){
+
+	// cause the thread to exit
+	running = false;
+	itemsAvailable.notify_all();
+
+	// wait that the thread has exited
+	// and delete it, so that a subsuquent run() can be called
+
+	queueThread->join();
+	delete queueThread;
+	queueThread = NULL;
+
+	while( eventsQueue.size() > 0 ){
+		eventsQueue.erase( eventsQueue.begin() );
+	}
+}
+
+bool SystemQueue::QueueThread::isEmpty(){
+	boost::mutex::scoped_lock lock( queueMutex );
+	return eventsQueue.empty();
+}
+
+void SystemQueue::QueueThread::insert( const SystemEvent& event, uint32_t delay ){
+	{
+		boost::mutex::scoped_lock lock( queueMutex );
+
+		eventsQueue.push_back( event );
+		eventsQueue.back().scheduledTime = boost::posix_time::microsec_clock::local_time();
+		eventsQueue.back().delayTime = delay;
+		eventsQueue.back().remainingDelay = delay;
+
+		onItemInserted( event );
+		itemsAvailable.notify_all();
+	}
+}
+
+void SystemQueue::QueueThread::threadFunc( QueueThread* obj ) {
+
+	boost::mutex::scoped_lock lock( obj->queueMutex );
+
+	while( obj->running ) {
+
+		// wait until an item is in the queue or we are notified
+		// to quit the thread. in case the thread is about to
+		// quit, the queueThreadRunning variable will indicate
+		// this and cause the thread to exit
+
+		while ( obj->eventsQueue.empty() && obj->running ){
+
+			const boost::system_time duration =
+					boost::get_system_time() +
+					boost::posix_time::milliseconds(40);
+
+			obj->itemsAvailable.wait( lock );
+//			obj->itemsAvailable.timed_wait( lock, duration );
+		}
+
+		// work all the items that are currently in the queue
+
+		while( !obj->eventsQueue.empty() ) {
+
+			// fetch the first item in the queue and deliver it to the
+			// queue handler
+			SystemEvent ev = obj->eventsQueue.front();
+			obj->eventsQueue.erase( obj->eventsQueue.begin() );
+
+			{
+				// unlock the queue to that an event handler
+				// can insert new items into the queue
+//				obj->queueMutex.unlock();
+				obj->onNextQueueItem( ev );
+//				obj->queueMutex.lock();
+			}
+
+		} // !obj->eventsQueue.empty() )
+	} // while (obj->running)
+}
+
+//***************************************************************
+
+SystemQueue::QueueThreadDirect::QueueThreadDirect(){
+}
+
+SystemQueue::QueueThreadDirect::~QueueThreadDirect(){
+}
+
+void SystemQueue::QueueThreadDirect::onItemInserted( const SystemEvent& event ){
+	// do nothing here
+}
+
+void SystemQueue::QueueThreadDirect::onNextQueueItem( const SystemEvent& event ){
+	// directly deliver the item to the
+	event.listener->handleSystemEvent( event );
+}
+
+//***************************************************************
+
+SystemQueue::QueueThreadDelay::QueueThreadDelay(QueueThread* _transferQueue)
+	: QueueThread( _transferQueue ), isSleeping( false ) {
+
+	assert( _transferQueue != NULL );
+}
+
+SystemQueue::QueueThreadDelay::~QueueThreadDelay(){
+}
+
+void SystemQueue::QueueThreadDelay::onItemInserted( const SystemEvent& event ){
+
+	if( !isSleeping) return;
+
+	// break an existing sleep and
+	// remember the time that was actually slept for
+	// and change it for every event in the queue
+
+	assert( !eventsQueue.empty());
+	sleepCond.notify_all();
+
+	ptime sleepEnd = boost::posix_time::microsec_clock::local_time();
+	boost::posix_time::time_duration duration = sleepEnd - sleepStart;
+	uint32_t sleptTime = duration.total_milliseconds();
+
+	EventQueue::iterator i = eventsQueue.begin();
+	EventQueue::iterator iend = eventsQueue.end();
+
+	for( ; i != iend; i++ ) {
+
+		if( sleptTime >= i->remainingDelay)
+			i->remainingDelay = 0;
+		else
+			i->remainingDelay -= sleptTime;
+
+	} // for( ; i != iend; i++ )
+
+	// now we have to reorder the events
+	// in the queue with respect to their remaining delay
+	// the SystemQueue::operator< takes care of the
+	// ordering with respect to the remaining delay
+
+	std::sort( eventsQueue.begin(), eventsQueue.end() );
+
+}
+
+void SystemQueue::QueueThreadDelay::onNextQueueItem( const SystemEvent& event ){
+
+	// sleeps will be cancelled in the
+	// onItemInserted function when a new
+	// event arrives during sleeping
+
+	assert( !isSleeping );
+
+	// the given item is the one with the least
+	// amount of sleep time left. because all
+	// items are reordered in onItemInserted
+
+	if( event.remainingDelay > 0 ) {
+
+		const boost::system_time duration =
+			boost::get_system_time() +
+			boost::posix_time::milliseconds(event.remainingDelay);
+
+		{
+			boost::unique_lock<boost::mutex> lock( sleepMutex );
+
+			sleepStart = boost::posix_time::microsec_clock::local_time();
+			isSleeping = true;
+
+			sleepCond.timed_wait( lock, duration );
+
+			isSleeping = false;
+		}
+
+	} // if( event.remainingDelay > 0 )
+
+	// if the sleep succeeded and was not
+	// interrupted by a new incoming item
+	// we can now deliver this event
+
+	ptime sleepEnd = boost::posix_time::microsec_clock::local_time();
+	boost::posix_time::time_duration duration = sleepEnd - sleepStart;
+	uint32_t sleptTime = duration.total_milliseconds();
+
+	if (event.remainingDelay <= sleptTime)
+		transferQueue->insert( event, 0 );
+}
+
+#endif // #ifndef UNDERLAY_OMNET
+
+//***************************************************************
 
 }} // spovnet, common
Index: source/ariba/utility/system/SystemQueue.h
===================================================================
--- source/ariba/utility/system/SystemQueue.h	(revision 12775)
+++ source/ariba/utility/system/SystemQueue.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,37 +35,34 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SYSTEMQUEUE_H_
 #define SYSTEMQUEUE_H_
 
+#include <vector>
+#include <cassert>
 #include "SystemEvent.h"
 #include "SystemEventListener.h"
 #include "ariba/utility/logging/Logging.h"
-
-#include <cassert>
-#include <list>
-#include <vector>
-#include <queue>          // std::priority_queue
-#include <functional>     // std::greater
-
 #include <boost/date_time.hpp>
 #include <boost/cstdint.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/thread.hpp>
-#include <boost/thread/condition_variable.hpp>
-#include <boost/utility.hpp>
-#include <boost/bind.hpp>
-
-#include <boost/function.hpp>
+
+#ifdef UNDERLAY_OMNET
+  #include <csimplemodule.h>
+  #include <cmessage.h>
+  #include <macros.h>
+#else
+  #include <boost/thread/mutex.hpp>
+  #include <boost/thread/thread.hpp>
+  #include <boost/thread/condition_variable.hpp>
+  #include <boost/utility.hpp>
+  #include <boost/bind.hpp>
+#endif
+
+using std::vector;
+using boost::posix_time::ptime;
 
 namespace ariba {
 namespace utility {
-
-using std::list;
-using boost::posix_time::ptime;
-
 
 /**
@@ -77,16 +74,28 @@
  * @author Christoph Mayer, Sebastian Mies
  */
-/**  XXX Mario Hock  --  reworking the entire module  **/
-
-
-class SystemQueue : private boost::noncopyable
-{
+
+#ifndef UNDERLAY_OMNET
+class SystemQueue : private boost::noncopyable {
+#else
+class SystemQueue : public cSimpleModule {
+#endif
 	use_logging_h(SystemQueue);
-	friend class EnterMethod;
 public:
 	/**
 	 * Get the SystemQueue singleton instance.
 	 */
-	static SystemQueue& instance();
+	static SystemQueue& instance() {
+		static SystemQueue _inst;
+		return _inst;
+	}
+
+#ifdef UNDERLAY_OMNET
+	/**
+	 * Prevent deletion of this module
+	 * by implementing the virtual method
+	 * and doing nothing in it
+	 */
+	virtual void deleteModule(){}
+#endif
 
 	/**
@@ -97,13 +106,4 @@
 	 */
 	void scheduleEvent( const SystemEvent& event, uint32_t delay = 0 );
-	
-	/**
-	 * This method schedules a function call in the SystemQueue.
-	 * (Like scheduleEvent, but to be used with boost::bind.)
-	 * 
-	 * @param function: The function to be called [void function()]
-	 * @param The delay in milli-seconds
-	 */
-	void scheduleCall( const boost::function0<void>& function, uint32_t delay = 0 );
 
 	/**
@@ -117,37 +117,8 @@
 	 * Cancels the system queue and ends the processing after the
 	 * currently processed event is processed.
-     * 
-     * NOTE: Do not call this function from within a SystemQueue-Event.
-     *   Use SystemQueue::leave() instead.
 	 *
 	 * This method is thread-safe.
 	 */
 	void cancel();
-    
-    /**
-     * Like SystemQueue::cancel(), but may only be called from within a SystemQueue-Event.
-     * 
-     * NOTE: In this case some cleanup can not be made. -- If the SystemQueue is 
-     *   restarted, SystemQueue::cancel() must be called before SystemQueue::run()
-     *   can be called again.
-     */
-    void leave();
-    
-    /**
-     * Join the SystemQueue thread -- the current thread is blocked until the
-     * SystemQueue finishes.
-     * 
-     * NOTE: Use this only in combination with SystemQueue::leave()
-     * 
-     * [ There is a possible race condition with SystemQueue::cancel(), but 
-     *   SystemQueue::join() should not be used at the same time as 
-     *   SystemQueue::cancel() anyway. (SystemQueue::leave() is fine, though.)
-     */
-    void join();
-
-	/**
-	 * Drop all queued events for that listener
-	 */
-	void dropAll( const SystemEventListener* mlistener);
 
 	/**
@@ -161,27 +132,9 @@
 	 * Is the system queue already started and running?
 	 *
-	 * @return TRUE, if the system queue is running. | FALSE otherwise
+	 * @return True, if the system queue is running.
 	 */
 	bool isRunning();
-    
-    /**
-     *  NOTE: This function is for debugging and asserts only!!
-     * 
-     *  @return TRUE if called from the SysQ thread (from inside a SystemEvent)
-     *          | FALSE if it's called from another thread
-     */
-    bool am_I_in_the_SysQ_thread();
 
 protected:
-
-	/**
-	 * Aqcuire the mutex
-	 */
-	void enterMethod();
-
-	/**
-	 * Leave the mutex
-	 */
-	void leaveMethod();
 
 	/**
@@ -195,95 +148,100 @@
 	 */
 	~SystemQueue();
-	
-
-/**
- *  inner class of class SystemQueue:
- * 
- *  QueueThread  --  the class the does the actual work
- */
+
+#ifdef UNDERLAY_OMNET
+	virtual void handleMessage( cMessage* msg );
+#endif
+
 private:
 
-typedef list<SystemEvent> EventQueue;
-typedef std::priority_queue<SystemEvent, 
-                            std::vector<SystemEvent>,  // [ TODO is vector the best underlay? ]
-                            std::greater<SystemEvent> > PriorityEventQueue;
-
-	//********************************************************
-
-	class QueueThread
-	{
-        friend class SystemQueue;
-        
+#ifndef UNDERLAY_OMNET
+	typedef vector<SystemEvent> EventQueue;
+
+	//********************************************************
+
+	class QueueThread {
 	public:
-		QueueThread();
+		QueueThread(QueueThread* _transferQueue = NULL);
 		virtual ~QueueThread();
-        
-        /// main loop -- called from boost::thread
-        void operator()();
-        
-// 		void run();
+		void run();
 		void cancel();
 		bool isEmpty();
-		void insert( SystemEvent& event, uint32_t delay );
-		void enter();
-		void leave();
-		void dropAll( const SystemEventListener* mlistener);
-        bool isRunning();
-
-    private:
-        
-        /// main loop functions
-        void run_immediate_event();
-        void check_timed_queue();
-        void wait_for_next_deadline();
-        
-        /// makes sure that always the same clock is used
-        ptime get_clock();
-        
-        
+		void insert( const SystemEvent& event, uint32_t delay );
+
+	protected:
+		virtual void onItemInserted( const SystemEvent& event ) = 0;
+		virtual void onNextQueueItem( const SystemEvent& event ) = 0;
+		QueueThread* transferQueue;
+		EventQueue eventsQueue;
+		boost::mutex queueMutex;
 	private:
-        EventQueue immediateEventsQ;
-        PriorityEventQueue timedEventsQ;
-        
-        boost::condition_variable system_queue_idle;
-        boost::mutex queue_mutex;
-
-        bool processing_event;
-        
+		boost::thread* queueThread;
+		static void threadFunc( QueueThread* obj );
+		boost::condition_variable itemsAvailable;
 		volatile bool running;
-        volatile bool aborted;
-        volatile bool unclean;
 	}; // class QueueThread
 
-	
-/// inner class of class SystemQueue
-private:
-    /**
-     * This inner class handles the function-call events.
-     * @see SystemQueue::scheduleCall
-     */
-    class FunctionCaller  :  public SystemEventListener
-    {
-        void handleSystemEvent(const SystemEvent& event)
-        {
-            boost::function0<void>* function_ptr = event.getData< boost::function0<void> >();
-            (*function_ptr)();
-            delete function_ptr;
-        }
-    };
-
-    FunctionCaller internal_function_caller;
-    
-    
-    
-    /// member variables of class SystemQueue
-private:
-    boost::scoped_ptr<QueueThread> SysQ;
-    boost::scoped_ptr<boost::thread> sysq_thread;
-    
-//  volatile bool systemQueueRunning;
+	//********************************************************
+
+	class QueueThreadDirect : public QueueThread {
+	public:
+		QueueThreadDirect();
+		~QueueThreadDirect();
+	protected:
+		virtual void onItemInserted( const SystemEvent& event );
+		virtual void onNextQueueItem( const SystemEvent& event );
+	}; // class QueueThreadDirect
+
+	//********************************************************
+
+	class QueueThreadDelay : public QueueThread {
+	public:
+		QueueThreadDelay(QueueThread* _transferQueue = NULL);
+		~QueueThreadDelay();
+	protected:
+		virtual void onItemInserted( const SystemEvent& event );
+		virtual void onNextQueueItem( const SystemEvent& event );
+	private:
+		volatile bool isSleeping;
+		ptime sleepStart;
+		boost::mutex sleepMutex;
+		boost::condition_variable sleepCond;
+	}; // class QueueThreadDelay
+
+	//********************************************************
+
+	QueueThreadDirect directScheduler;
+	QueueThreadDelay delayScheduler;
+	volatile bool systemQueueRunning;
+#endif
 
 }; // class SystemQueue
 
+#ifdef UNDERLAY_OMNET
+
+	//
+	// the system queue must be a singleton in simulations, too.
+	// and to include it in the simulation the module is defined
+	// as submodule in every SpoVNet host. Therefore we hack the
+	// Define_Module (see omnet/includes/macros.h) the way we need
+	// it with our singleton ...
+	//
+	// this is the macro definition from macros.h
+	//
+	// #define Define_Module(CLASSNAME) \
+	//   static cModule *CLASSNAME##__create() {return new CLASSNAME();} \
+	//   EXECUTE_ON_STARTUP(CLASSNAME##__mod, modtypes.instance()->add(new cModuleType(#CLASSNAME,#CLASSNAME,(ModuleCreateFunc)CLASSNAME##__create));)
+	//
+	// and this is how we do it :)
+	//
+
+  	static cModule* SystemQueue__create() {
+		return &SystemQueue::instance();
+	}
+
+ 	EXECUTE_ON_STARTUP(SystemQueue__mod, modtypes.instance()->add(new cModuleType("SystemQueue","SystemQueue",(ModuleCreateFunc)SystemQueue__create));)
+
+#endif
+
 }} // spovnet, common
 
Index: source/ariba/utility/system/Timer.cpp
===================================================================
--- source/ariba/utility/system/Timer.cpp	(revision 12775)
+++ source/ariba/utility/system/Timer.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Timer.h"
@@ -55,6 +55,8 @@
 Timer::~Timer() {
 #ifndef UNDERLAY_OMNET
-	stop();
-	if(timerThread != NULL){
+	if( running ){
+		running = false;
+
+		timerThread->join();
 		delete timerThread;
 		timerThread = NULL;
@@ -82,27 +84,10 @@
 }
 
-void Timer::reset(){
-#ifndef UNDERLAY_OMNET
-	if(timerThread == NULL) return;
-	timerThread->interrupt();
-#else
-	#error timer interruption not implemented for omnet
-#endif
-}
-
-bool Timer::isRunning(){
-	return running;
-}
-
 void Timer::stop() {
 	running = false;
-	reset(); // cause the sleep to abort
-	SystemQueue::instance().dropAll(this);
-	if(timerThread != NULL)
-		timerThread->join();
 }
 
 void Timer::eventFunction() {
-	logging_warn("unimplemented eventFunction Timer(" << millis << ")");
+	std::cout << "Timer(" << millis << ")" << std::endl;
 }
 
@@ -112,29 +97,16 @@
 
 	while( obj->running ) {
-
-		try{
-
-			boost::this_thread::sleep( boost::posix_time::milliseconds(obj->millis) );
-			if (obj->running)
-				SystemQueue::instance().scheduleEvent( SystemEvent( obj, TimerEventType, NULL), 0 );
-
-		}catch(boost::thread_interrupted e){
-			// exception called when Timer::reset is called
-			// don't need to handle the exception
-		}
-
+		boost::this_thread::sleep( boost::posix_time::milliseconds(obj->millis) );
+		if (obj->running) SystemQueue::instance().scheduleEvent( SystemEvent( obj, TimerEventType, NULL), 0 );
 		if( obj->oneshot ) break;
 	}
 
-	if(! obj->oneshot )
-		obj->running = false;
+	obj->running = false;
 }
 #endif // UNDERLAY_OMNET
 
 void Timer::handleSystemEvent( const SystemEvent& event ) {
-	if( running ){
-		if( oneshot ) running = false;
+	if( running )
 		eventFunction();
-	}
 
 #ifdef UNDERLAY_OMNET
Index: source/ariba/utility/system/Timer.h
===================================================================
--- source/ariba/utility/system/Timer.h	(revision 12775)
+++ source/ariba/utility/system/Timer.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,10 +35,9 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef __TIMER_H
 #define __TIMER_H
 
-#include <stdint.h>
 #include "ariba/utility/system/SystemEventListener.h"
 #include "ariba/utility/system/SystemQueue.h"
@@ -64,35 +63,9 @@
 public:
 	Timer();
-	virtual ~Timer();
+	~Timer();
 
-	/**
-	 * Set the interval for the timer
-	 *
-	 * @param millis Timer interval in milliseconds
-	 * @param oneshot Is this a one-shot or periodic timer
-	 */
 	void setInterval(unsigned int millis, bool oneshot=false);
-
-	/**
-	 * Start the timer
-	 */
 	void start();
-
-	/**
-	 * Stop the timer
-	 */
 	void stop();
-
-	/**
-	 * Reset a running timer and ignore the remaining interval
-	 * time. Does not fire the timer event and start the timer
-	 * with a new interval.
-	 */
-	void reset();
-
-	/**
-	 * Is the timer already running?
-	 */
-	bool isRunning();
 
 protected:
Index: source/ariba/utility/types.h
===================================================================
--- source/ariba/utility/types.h	(revision 12775)
+++ source/ariba/utility/types.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef TYPES_H_
Index: source/ariba/utility/types/Address.cpp
===================================================================
--- source/ariba/utility/types/Address.cpp	(revision 12775)
+++ source/ariba/utility/types/Address.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Address.h"
Index: source/ariba/utility/types/Address.h
===================================================================
--- source/ariba/utility/types/Address.h	(revision 12775)
+++ source/ariba/utility/types/Address.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef ADDRESS_H_
Index: source/ariba/utility/types/CMakeLists.txt
===================================================================
--- source/ariba/utility/types/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,67 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    Address.h
-    Data.hpp
-    Identifier.h
-    LinkID.h
-    Locator.h
-    _namespace.h
-    NodeID.h
-    OverlayParameterSet.h
-    PeerID.h
-    QoSParameterSet.h
-    SecurityParameterSet.h
-    ServiceID.h
-    SpoVNetID.h
-    )
-
-add_sources(
-    Address.cpp
-    Identifier.cpp
-    LinkID.cpp
-    Locator.cpp
-    NodeID.cpp
-    OverlayParameterSet.cpp
-    PeerID.cpp
-    QoSParameterSet.cpp
-    SecurityParameterSet.cpp
-    ServiceID.cpp
-    SpoVNetID.cpp
-    )
Index: source/ariba/utility/types/Data.hpp
===================================================================
--- source/ariba/utility/types/Data.hpp	(revision 12775)
+++ source/ariba/utility/types/Data.hpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "../serialization/Data.hpp"
Index: source/ariba/utility/types/Identifier.cpp
===================================================================
--- source/ariba/utility/types/Identifier.cpp	(revision 12775)
+++ source/ariba/utility/types/Identifier.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Identifier.h"
@@ -70,5 +70,5 @@
 
 void Identifier::clearAddress() {
-	for (size_t i = 0; i < array_size; i++)
+	for (int i = 0; i < array_size; i++)
 		key[i] = 0;
 	isUnspec = false;
@@ -77,5 +77,5 @@
 
 bool Identifier::setAddress(string address) {
-	return false;
+	// TODO
 }
 
@@ -204,5 +204,5 @@
 	if (isUnspec) return std::string("<unspec>");
 
-	char temp[250];
+	char temp[80];
 	if (base == 16) {
 		int k = 0;
@@ -238,5 +238,4 @@
 }
 #endif
-	return "<not supported>";
 }
 
@@ -320,9 +319,5 @@
 }
 bool Identifier::operator==(const Identifier& compKey) const {
-
-	if( this->isUnspecified() && compKey.isUnspecified() )
-		return true;
-	else
-		return compareTo(compKey) == 0;
+	return compareTo(compKey) == 0;
 }
 bool Identifier::operator!=(const Identifier& compKey) const {
@@ -601,27 +596,27 @@
 Identifier Identifier::random() {
 	Identifier newKey = ZERO;
-	newKey.clearAddress();
 
 	//as mpn_random has no seeding function
-	// we mess aroung here a little to achive some randomness
-	// using the rand function that _is_ seeded in the
-	// StartupWrapper::initSystem function
-
+	// we mess aroung here a little to achive randomness
 	Identifier keyRandom = ZERO;
 	mpn_random(keyRandom.key, aSize);
-	Identifier keyrnd( rand() );
-	mpn_mul_1( newKey.key, keyRandom.key, aSize, *keyrnd.key );
+	Identifier keyTime( time(NULL) );
+	mpn_mul_1( newKey.key, keyRandom.key, aSize, *keyTime.key );
 
 	newKey.trim();
-	assert(!newKey.isUnspecified());
-
 	return newKey;
 }
 
+
+// README: due to some problems with serialization the keylength
+// was changed to 192 bit! As none of the hashing functions
+// can provide 160 bit output, and we currently don't use any
+// hashing for identifiers in the demo at all ... this is all commented out!!
+
+
+// generate sha1 hash
 Identifier Identifier::sha1(const string& input) {
 	Identifier newKey;
-	newKey.clearAddress();
-	uint8_t temp[40];
-	for (int i=0; i<40; i++) temp[i] = 0;
+	uint8_t temp[20];
 	const char* c_str = input.c_str();
 
@@ -641,6 +636,5 @@
 Identifier Identifier::sha1(const uint8_t* value, size_t length ) {
 	Identifier newKey;
-	uint8_t temp[40];
-	for (int i=0; i<40; i++) temp[i] = 0;
+	uint8_t temp[20];
 
 	CSHA1 sha;
@@ -655,4 +649,6 @@
 }
 
+
+
 // generate a key=2**exponent
 Identifier Identifier::pow2(uint exponent) {
Index: source/ariba/utility/types/Identifier.h
===================================================================
--- source/ariba/utility/types/Identifier.h	(revision 12775)
+++ source/ariba/utility/types/Identifier.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef IDENTIFIER_H_
@@ -42,6 +42,4 @@
 #include <memory>
 #include <string>
-#include <cassert>
-#include <iostream>
 #include <gmp.h>
 #include <boost/cstdint.hpp>
@@ -49,7 +47,4 @@
 #include "ariba/utility/types/Address.h"
 #include "ariba/utility/serialization.h"
-
-// XXX EXPERIMENTAL
-#include "ariba/utility/transport/messages/shared_buffer.hpp"
 
 /**< maximum length of the key */
@@ -72,24 +67,4 @@
 	use_logging_h( Identifier );
 public:
-	
-	// XXX EXPERIMENTAL
-	reboost::shared_buffer_t serialize() const
-	{
-	    Data data = data_serialize(this, DEFAULT_V);
-	    reboost::shared_buffer_t buf(data.getBuffer(), data.getLength() / 8);
-	    
-	    return buf;
-	}
-	
-	reboost::shared_buffer_t deserialize(reboost::shared_buffer_t buff)
-	{
-	    Data dat(const_cast<uint8_t*>(buff.data()), buff.size() * 8);
-	    
-	    size_t len = this->SERIALIZATION_METHOD_NAME(DESERIALIZE, dat) / 8;
-
-	    // return remaining sub-buffer
-	    return buff(len);
-	}
-	
 
 	//-------------------------------------------------------------------------
@@ -592,5 +567,4 @@
 /* serializers */
 sznBeginDefault( ariba::utility::Identifier, X ) {
-
 	// calculate length of key
 	uint16_t len = array_size*sizeof(mp_limb_t);
@@ -603,9 +577,6 @@
 	for (int i=array_size-1; i>=0; i--) X && key[i];
 
-	// when deserializing set unspec flag
-	if (X.isDeserializer()){
-		isUnspec = unspec;
-	}
-
+	// when deserializing reset unspec flag
+	if (X.isDeserializer()) isUnspec = unspec;
 } sznEnd();
 
Index: source/ariba/utility/types/LinkID.cpp
===================================================================
--- source/ariba/utility/types/LinkID.cpp	(revision 12775)
+++ source/ariba/utility/types/LinkID.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "LinkID.h"
Index: source/ariba/utility/types/LinkID.h
===================================================================
--- source/ariba/utility/types/LinkID.h	(revision 12775)
+++ source/ariba/utility/types/LinkID.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef LINKID_H_
Index: source/ariba/utility/types/Locator.cpp
===================================================================
--- source/ariba/utility/types/Locator.cpp	(revision 12775)
+++ source/ariba/utility/types/Locator.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "Locator.h"
Index: source/ariba/utility/types/Locator.h
===================================================================
--- source/ariba/utility/types/Locator.h	(revision 12775)
+++ source/ariba/utility/types/Locator.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef LOCATOR_H_
Index: source/ariba/utility/types/NodeID.cpp
===================================================================
--- source/ariba/utility/types/NodeID.cpp	(revision 12775)
+++ source/ariba/utility/types/NodeID.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "NodeID.h"
Index: source/ariba/utility/types/NodeID.h
===================================================================
--- source/ariba/utility/types/NodeID.h	(revision 12775)
+++ source/ariba/utility/types/NodeID.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef __NODEID_H
Index: source/ariba/utility/types/OverlayParameterSet.cpp
===================================================================
--- source/ariba/utility/types/OverlayParameterSet.cpp	(revision 12775)
+++ source/ariba/utility/types/OverlayParameterSet.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "OverlayParameterSet.h"
@@ -55,5 +55,5 @@
 }
 
-void OverlayParameterSet::setOverlayStructure(OverlayStructure _structure){
+void OverlayParameterSet::getOverlayStructure(OverlayStructure _structure){
 	structure = (uint8_t)_structure;
 }
Index: source/ariba/utility/types/OverlayParameterSet.h
===================================================================
--- source/ariba/utility/types/OverlayParameterSet.h	(revision 12775)
+++ source/ariba/utility/types/OverlayParameterSet.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef OVERLAYPARAMETERSET_H_
@@ -53,13 +53,14 @@
 
 	typedef enum _OverlayStructure {
-		OverlayStructureOneHop   = 0,   // DEPRECATED, DO NOT USE
-		OverlayStructureChord    = 1,
+		OverlayStructureOneHop   = 1,
+		OverlayStructureChord    = 2,
+		OverlayStructureKademlia = 3,
 	} OverlayStructure;
 
-	OverlayParameterSet(OverlayStructure _structure = OverlayStructureChord);
+	OverlayParameterSet(OverlayStructure _structure = OverlayStructureOneHop);
 	virtual ~OverlayParameterSet();
 
 	OverlayStructure getOverlayStructure() const;
-	void setOverlayStructure( OverlayStructure _structure );
+	void getOverlayStructure( OverlayStructure _structure );
 
 private:
Index: source/ariba/utility/types/PeerID.cpp
===================================================================
--- source/ariba/utility/types/PeerID.cpp	(revision 12775)
+++ 	(revision )
@@ -1,55 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#include "PeerID.h"
-
-namespace ariba {
-namespace utility {
-
-const PeerID PeerID::UNSPECIFIED;
-
-PeerID::PeerID() {
-}
-
-PeerID::PeerID(const Identifier& identifier) : Identifier(identifier){
-}
-
-PeerID::~PeerID() {
-}
-
-}} // namespace ariba, common
Index: source/ariba/utility/types/PeerID.h
===================================================================
--- source/ariba/utility/types/PeerID.h	(revision 12775)
+++ 	(revision )
@@ -1,60 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#ifndef __PEERID_H
-#define __PEERID_H
-
-#include "ariba/utility/types/Identifier.h"
-
-namespace ariba {
-namespace utility {
-
-class PeerID : public Identifier {
-public:
-
-	static const PeerID UNSPECIFIED;
-
-	PeerID();
-	PeerID(const Identifier& identifier);
-	virtual ~PeerID();
-
-};
-
-}} // namespace ariba, common
-
-#endif // __PEERID_H
Index: source/ariba/utility/types/QoSParameterSet.cpp
===================================================================
--- source/ariba/utility/types/QoSParameterSet.cpp	(revision 12775)
+++ source/ariba/utility/types/QoSParameterSet.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "QoSParameterSet.h"
Index: source/ariba/utility/types/QoSParameterSet.h
===================================================================
--- source/ariba/utility/types/QoSParameterSet.h	(revision 12775)
+++ source/ariba/utility/types/QoSParameterSet.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef QOS_PARAMETER_SET_H__
Index: source/ariba/utility/types/SecurityParameterSet.cpp
===================================================================
--- source/ariba/utility/types/SecurityParameterSet.cpp	(revision 12775)
+++ source/ariba/utility/types/SecurityParameterSet.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "SecurityParameterSet.h"
Index: source/ariba/utility/types/SecurityParameterSet.h
===================================================================
--- source/ariba/utility/types/SecurityParameterSet.h	(revision 12775)
+++ source/ariba/utility/types/SecurityParameterSet.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SECURITY_PARAMETER_SET_H
Index: source/ariba/utility/types/ServiceID.cpp
===================================================================
--- source/ariba/utility/types/ServiceID.cpp	(revision 12775)
+++ source/ariba/utility/types/ServiceID.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -24,5 +24,5 @@
 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL	 DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "ServiceID.h"
@@ -50,5 +50,5 @@
 }
 
-ServiceID::ServiceID(uint32_t _id) : id( _id ){
+ServiceID::ServiceID(unsigned int _id) : id( _id ){
 }
 
@@ -57,9 +57,4 @@
 
 ServiceID::~ServiceID() {
-}
-
-ServiceID& ServiceID::operator=(const ServiceID &rh) {
-	id = rh.id;
-	return *this;
 }
 
@@ -76,9 +71,5 @@
 }
 
-string ServiceID::toString() const
-{
-    if ( *this == ServiceID::UNSPECIFIED )
-        return "UNSPEC";
-    
+string ServiceID::toString() const {
 	return ariba::utility::Helper::ultos( id );
 }
Index: source/ariba/utility/types/ServiceID.h
===================================================================
--- source/ariba/utility/types/ServiceID.h	(revision 12775)
+++ source/ariba/utility/types/ServiceID.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SERVICEID_H_
@@ -72,8 +72,7 @@
 	bool operator<(const ServiceID& rh) const;
 	bool operator!=(const ServiceID& rh) const;
-	ServiceID& operator=(const ServiceID &rh);
 
 	inline bool isUnspecified() const {
-		return (id==~(uint32_t)0);
+		return (id==~0);
 	}
 
Index: source/ariba/utility/types/SpoVNetID.cpp
===================================================================
--- source/ariba/utility/types/SpoVNetID.cpp	(revision 12775)
+++ source/ariba/utility/types/SpoVNetID.cpp	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #include "SpoVNetID.h"
Index: source/ariba/utility/types/SpoVNetID.h
===================================================================
--- source/ariba/utility/types/SpoVNetID.h	(revision 12775)
+++ source/ariba/utility/types/SpoVNetID.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #ifndef SPOVNETID_H_
Index: source/ariba/utility/types/_namespace.h
===================================================================
--- source/ariba/utility/types/_namespace.h	(revision 12775)
+++ source/ariba/utility/types/_namespace.h	(revision 2378)
@@ -1,3 +1,3 @@
-// [License]
+// [Licence]
 // The Ariba-Underlay Copyright
 //
@@ -35,5 +35,5 @@
 // official policies, either expressed or implied, of the Institute of
 // Telematics.
-// [License]
+// [Licence]
 
 #undef NAMESPACE_BEGIN
Index: source/ariba/utility/vtypes/CMakeLists.txt
===================================================================
--- source/ariba/utility/vtypes/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,45 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    varray.hpp
-    vfacade.hpp
-    vint.hpp
-    )
-
-add_subdir_sources(detail)
Index: source/ariba/utility/vtypes/detail/CMakeLists.txt
===================================================================
--- source/ariba/utility/vtypes/detail/CMakeLists.txt	(revision 12775)
+++ 	(revision )
@@ -1,43 +1,0 @@
-# [License]
-# The Ariba-Underlay Copyright
-#
-# Copyright (c) 2008-2012, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-#
-# Institute of Telematics
-# UniversitÃ€t Karlsruhe (TH)
-# Zirkel 2, 76128 Karlsruhe
-# Germany
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OF TELEMATICS OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation
-# are those of the authors and should not be interpreted as representing
-# official policies, either expressed or implied, of the Institute of
-# Telematics.
-# [License]
-
-add_headers(
-    helper.hpp
-    vint_big.hpp
-    vint_small.hpp
-    )
