Index: source/ariba/utility/visual/DddVis.cpp
===================================================================
--- source/ariba/utility/visual/DddVis.cpp	(revision 6822)
+++ source/ariba/utility/visual/DddVis.cpp	(revision 6822)
@@ -0,0 +1,306 @@
+// [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 "DddVis.h"
+
+namespace ariba {
+namespace utility {
+
+const string DddVis::del = ":";
+use_logging_cpp(DddVis);
+
+DddVis::DddVis() : commandid(0) {
+	srand(time(NULL));
+}
+
+DddVis::~DddVis(){
+}
+
+void DddVis::sendMessage( const string msg, NETWORK_ID nid ) {
+	sendSocket( msg + "\n" );
+}
+
+long DddVis::getCommandID() {
+	return ++commandid;
+}
+
+long DddVis::getTimestamp() {
+	return 0; //time(NULL);
+}
+
+unsigned int DddVis::getNodeNumber(const NodeID& node){
+	NodeSet::iterator i = nodeSet.find(node);
+
+	if(i == nodeSet.end()){
+		unsigned int number = node.get(MAX_KEYLENGTH-16, 16);
+		nodeSet.insert(make_pair(node, number));
+		return number;
+	} else {
+		return i->second;
+	}
+}
+
+void DddVis::visCreate(
+		NETWORK_ID network,
+		NodeID& node,
+		string nodename,
+		string info
+){
+	//
+	// create layer first if not already done
+	//
+
+	if(layerSet.find(network) == layerSet.end()){
+
+		//
+		// create layer
+		//
+
+		{
+			ostringstream out;
+			out		<< CREATE_LAYER_TYPE		<< del
+					<< getCommandID()			<< del
+					<< getTimestamp()			<< del
+					<< getNetworkName(network)	<< del
+					<< 0						<< del;
+
+			sendMessage( out.str(), network );
+			layerSet.insert(network);
+		}
+
+		//
+		// set layer layout
+		//
+
+		{
+			LayoutType layout = FORCE_LAYOUT;
+			LayoutOrderStrategie order = ORDER_RANDOMLY;
+
+			switch(network){
+			case NETWORK_ID_BASE_COMMUNICATION:
+				layout = FORCE_LAYOUT;
+				order = ORDER_RANDOMLY;
+				break;
+			case NETWORK_ID_BASE_OVERLAY:
+				layout = CIRCULAR_LAYOUT;
+				order = ORDER_BY_ID;
+				break;
+			case NETWORK_ID_MCPO:
+				layout = FORCE_LAYOUT;
+				order = ORDER_RANDOMLY;
+				break;
+			}
+
+			ostringstream out;
+			out		<< SET_CLUSTER_LAYOUT_TYPE	<< del
+					<< getCommandID()			<< del
+					<< getTimestamp()			<< del
+					<< getNetworkName(network)	<< del
+					<< 0						<< del
+					<< layout					<< del
+					<< order					<< del;
+
+			sendMessage( out.str(), network );
+		}
+
+	} // if(layerSet.find(network) == layerSet.end())
+
+	//
+	// create node
+	//
+
+	ostringstream out;
+	out 	<< CREATE_NODE_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< 0						<< del
+			<< getNodeNumber(node) 		<< del
+			<< 0x00000000				<< del
+			<< "null" 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::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	<< CREATE_EDGE_TYPE 			<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< 0						<< del
+			<< getNodeNumber(srcnode) 	<< del
+			<< getNodeNumber(destnode) 	<< del
+			<< edgekey 					<< del
+			<< 0x00000000 				<< del
+			<< "null" 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::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	<< REMOVE_EDGE_TYPE 		<< del
+		<< getCommandID() 			<< del
+		<< getTimestamp() 			<< del
+		<< getNetworkName(network)	<< del
+		<< edgekey 					<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visShutdown(
+		NETWORK_ID network,
+		NodeID& node,
+		string info
+){
+	ostringstream out;
+
+	out	<< REMOVE_NODE_TYPE 		<< del
+		<< getCommandID() 			<< del
+		<< getTimestamp() 			<< del
+		<< getNetworkName(network) 	<< del
+		<< getNodeNumber(node) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::visChangeNodeColor (
+		NETWORK_ID network,
+		NodeID& node,
+		unsigned char r,
+		unsigned char g,
+		unsigned char b
+){
+	ostringstream out;
+
+	out	<< SET_NODE_COLOR_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< getNodeNumber(node) 		<< del
+			<< makeColor(r, g, b) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+int DddVis::makeColor(unsigned char r, unsigned char g, unsigned char b){
+	return ((r<<16)+(g<<8)+b);
+}
+
+void DddVis::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 DddVis::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	<< SET_EDGE_COLOR_TYPE 		<< del
+			<< getCommandID() 			<< del
+			<< getTimestamp() 			<< del
+			<< getNetworkName(network) 	<< del
+			<< edgekey 					<< del
+			<< makeColor(r, g, b) 		<< del;
+
+	sendMessage( out.str(), network );
+}
+
+void DddVis::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 );
+}
+
+}} // namespace ariba, common
Index: source/ariba/utility/visual/DddVis.h
===================================================================
--- source/ariba/utility/visual/DddVis.h	(revision 6822)
+++ source/ariba/utility/visual/DddVis.h	(revision 6822)
@@ -0,0 +1,224 @@
+// [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 DDDVIS_H__
+#define DDDVIS_H__
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <map>
+#include <set>
+#include <boost/utility.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"
+#include "ariba/utility/visual/ServerVis.h"
+
+using std::set;
+using std::string;
+using std::map;
+using std::pair;
+using std::make_pair;
+using std::cout;
+using std::ostringstream;
+using ariba::utility::NodeID;
+using ariba::utility::Configuration;
+using ariba::utility::KeyMapping;
+using ariba::utility::Timer;
+
+namespace ariba {
+namespace utility {
+
+class DddVis : public ServerVis, private boost::noncopyable {
+	use_logging_h(DddVis);
+public:
+	static DddVis& instance() { static DddVis the_inst; return the_inst; }
+
+	//****************************************************************
+	// 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
+	);
+
+	/**
+	 * 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
+	);
+
+	/**
+	 * 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
+	);
+
+	/**
+	 * Change the color of the node.
+	 */
+	void visChangeNodeColor (
+			NETWORK_ID network,
+			NodeID& node,
+			NODE_COLORS color
+	);
+
+	/**
+	 * 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
+	);
+
+protected:
+	DddVis();
+	virtual ~DddVis();
+
+private:
+
+	typedef enum _CommandType {
+		CREATE_LAYER_TYPE 			= 0,
+		CREATE_CLUSTER_TYPE 		= 1,
+		CREATE_NODE_TYPE 			= 2,
+		CREATE_EDGE_TYPE 			= 3,
+		REMOVE_LAYER_TYPE 			= 4,
+		REMOVE_CLUSTER_TYPE 		= 5,
+		REMOVE_NODE_TYPE 			= 6,
+		REMOVE_EDGE_TYPE 			= 7,
+		SET_CLUSTER_LAYOUT_TYPE 	= 8,
+		SET_NODE_COLOR_TYPE 		= 9,
+		SET_EDGE_COLOR_TYPE 		= 10,
+		SET_NODE_INFO_TYPE 			= 11,
+		SET_EDGE_INFO_TYPE 			= 12,
+		SET_LAYOUT_LEADER_TYPE 		= 13,
+	} CommandType;
+
+	typedef enum _LayoutType {
+		CIRCULAR_LAYOUT				= 0,
+		FORCE_LAYOUT				= 1,
+		LEADER_LAYOUT				= 2,
+		RANDOM_LAYOUT				= 3,
+	} LayoutType;
+
+	typedef enum _LayoutOrderStrategie {
+		ORDER_BY_ID					= 0,
+		ORDER_RANDOMLY				= 1,
+	} LayoutOrderStrategie;
+
+	long getCommandID();
+	long getTimestamp();
+	int makeColor(unsigned char r, unsigned char g, unsigned char b);
+	void sendMessage( const string msg, NETWORK_ID nid );
+	unsigned int getNodeNumber(const NodeID& node);
+
+	unsigned long commandid;
+	static const string del;
+
+	typedef set<ServerVis::NETWORK_ID> LayerSet;
+	LayerSet layerSet;
+
+	typedef map<NodeID,unsigned int> NodeSet;
+	NodeSet nodeSet;
+
+	typedef pair<NodeID, NodeID> NodePair;
+	typedef KeyMapping<NodePair> NetworkLinks;
+	NetworkLinks networkLinks;
+
+
+};
+
+}} // namespace ariba, common
+
+#endif // DDDVIS_H__
Index: source/ariba/utility/visual/OvlVis.cpp
===================================================================
--- source/ariba/utility/visual/OvlVis.cpp	(revision 6584)
+++ source/ariba/utility/visual/OvlVis.cpp	(revision 6822)
@@ -42,50 +42,10 @@
 namespace utility {
 
-//*****************************************************
-//*****************************************************
-//*****************************************************
-
 use_logging_cpp(OvlVis);
 
-OvlVis::OvlVis() : socket(io_service), socketOpened(false) {
-
-	if( ! Configuration::haveConfig() ) return;
-	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() {
 }
 
 OvlVis::~OvlVis(){
-
-	socket.close();
-
 }
 
@@ -115,9 +75,4 @@
 // 	}
 
-}
-
-void OvlVis::sendSocket(const string msg){
-	if( socket.is_open() && socketOpened )
-		socket.send( boost::asio::buffer(msg) );
 }
 
@@ -665,7 +620,3 @@
 }
 
-//*****************************************************
-//*****************************************************
-//*****************************************************
-
 }} // namespace ariba, common
Index: source/ariba/utility/visual/OvlVis.h
===================================================================
--- source/ariba/utility/visual/OvlVis.h	(revision 6584)
+++ source/ariba/utility/visual/OvlVis.h	(revision 6822)
@@ -45,11 +45,8 @@
 #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"
+#include "ariba/utility/visual/ServerVis.h"
 
 using std::string;
@@ -59,7 +56,4 @@
 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;
@@ -68,20 +62,9 @@
 namespace utility {
 
-class OvlVis : private boost::noncopyable {
+class OvlVis : public ServerVis, 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, ...
@@ -162,10 +145,4 @@
 			unsigned char b
 	);
-
-	typedef enum _NODE_COLORS {
-		NODE_COLORS_GREY,
-		NODE_COLORS_GREEN,
-		NODE_COLORS_RED,
-	} NODE_COLORS;
 
 	/**
@@ -385,16 +362,8 @@
 protected:
 	OvlVis();
-	~OvlVis();
+	virtual ~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;
Index: source/ariba/utility/visual/ServerVis.cpp
===================================================================
--- source/ariba/utility/visual/ServerVis.cpp	(revision 6822)
+++ source/ariba/utility/visual/ServerVis.cpp	(revision 6822)
@@ -0,0 +1,117 @@
+// [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 "ServerVis.h"
+
+namespace ariba {
+namespace utility {
+
+use_logging_cpp(ServerVis);
+
+
+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;
+
+string ServerVis::getNetworkName(NETWORK_ID network) const {
+	switch(network){
+		case NETWORK_ID_BASE_COMMUNICATION	: return "BaseCommunication";
+		case NETWORK_ID_BASE_OVERLAY 		: return "BaseOverlay";
+		case NETWORK_ID_EONSON 				: return "Eonson";
+		case NETWORK_ID_MCPO 				: return "Multicast/Multipeer Overlay";
+		case NETWORK_ID_CLIO 				: return "CLIO";
+		case NETWORK_ID_VIDEOSTREAM 		: return "Video";
+		case NETWORK_ID_GAME 				: return "Game";
+		case NETWORK_ID_SECURITY 			: return "Security";
+		default								: return "<undefined>";
+	}
+}
+
+void ServerVis::configure(string ip, unsigned int port){
+	if( ip.length() == 0 ) return;
+
+	ostringstream sport;
+	sport << port;
+	logging_debug( "connecting to visualization server " << ip << " on " << sport.str());
+
+	tcp::resolver resolver(io_service);
+	tcp::resolver::query query(
+			ip, sport.str(),
+			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( "visualization could not connect to visualization server" );
+	} else {
+		logging_info( "connected to visualization server on " << ip << ":" << port );
+		socketOpened = true;
+	}
+}
+
+ServerVis::ServerVis() : socket(io_service), socketOpened(false) {
+}
+
+ServerVis::~ServerVis(){
+	socket.close();
+}
+
+void ServerVis::sendSocket(const string& msg){
+	if( socket.is_open() && socketOpened ){
+		logging_error("SENDING VISUAL COMMAND: " << msg);
+		socket.send( boost::asio::buffer(msg) );
+	}
+}
+
+}} // namespace ariba, common
Index: source/ariba/utility/visual/ServerVis.h
===================================================================
--- source/ariba/utility/visual/ServerVis.h	(revision 6822)
+++ source/ariba/utility/visual/ServerVis.h	(revision 6822)
@@ -0,0 +1,120 @@
+// [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 SERVERVIS_H__
+#define SERVERVIS_H__
+
+#include <string>
+#include <sstream>
+#include <boost/utility.hpp>
+#include <boost/asio.hpp>
+#include "ariba/utility/logging/Logging.h"
+#include "ariba/utility/types/NodeID.h"
+
+using ariba::utility::NodeID;
+using std::ostringstream;
+using std::string;
+using boost::asio::ip::tcp;
+
+namespace ariba {
+namespace utility {
+
+class ServerVis {
+	use_logging_h(ServerVis);
+public:
+	void configure(string ip, unsigned int port);
+
+	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;
+
+	// get the name of the network
+	string getNetworkName(NETWORK_ID network) const;
+
+	/// Create a node
+	virtual void visCreate (NETWORK_ID network, NodeID& node, string nodename, string info) = 0;
+
+	/// Delete a node
+	virtual void visShutdown (NETWORK_ID network, NodeID& node, string info) = 0;
+
+	/// Connect two nodes
+	virtual void visConnect (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, string info) = 0;
+
+	/// Disconnect two nodes
+	virtual void visDisconnect (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, string info) = 0;
+
+	/// Node colors
+	typedef enum _NODE_COLORS {
+		NODE_COLORS_GREY,
+		NODE_COLORS_GREEN,
+		NODE_COLORS_RED,
+	} NODE_COLORS;
+
+	/// Change the node color
+	virtual void visChangeNodeColor (NETWORK_ID network, NodeID& node, unsigned char r, unsigned char g, unsigned char b) = 0;
+
+	/// Change the node color
+	virtual void visChangeNodeColor (NETWORK_ID network, NodeID& node, NODE_COLORS color) = 0;
+
+	/// Change the link color
+	virtual void visChangeLinkColor (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, unsigned char r, unsigned char g, unsigned char b) = 0;
+
+	/// Change the link color
+	virtual void visChangeLinkColor (NETWORK_ID network, NodeID& srcnode, NodeID& destnode, NODE_COLORS color) = 0;
+
+protected:
+	ServerVis();
+	virtual ~ServerVis();
+	void sendSocket( const string& msg );
+
+private:
+	boost::asio::io_service io_service;
+	tcp::socket socket;
+	volatile bool socketOpened;
+};
+
+}} // namespace ariba, common
+
+#endif // SERVERVIS_H__
