Index: source/ariba/overlay/BaseOverlay.h
===================================================================
--- source/ariba/overlay/BaseOverlay.h	(revision 12775)
+++ source/ariba/overlay/BaseOverlay.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 BASEOVERLAY_H_
@@ -43,15 +43,5 @@
 #include <iostream>
 #include <algorithm>
-#include <ctime>
-#include <list>
-#include <vector>
-#include <deque>
 #include <boost/foreach.hpp>
-
-#ifdef ECLIPSE_PARSER
-    #define foreach(a, b) for(a : b)
-#else
-    #define foreach(a, b) BOOST_FOREACH(a, b)
-#endif
 
 #include "ariba/utility/messages.h"
@@ -60,5 +50,4 @@
 #include "ariba/utility/misc/Demultiplexer.hpp"
 #include "ariba/utility/logging/Logging.h"
-#include "ariba/utility/system/Timer.h"
 
 #include "ariba/communication/EndpointDescriptor.h"
@@ -66,43 +55,30 @@
 #include "ariba/communication/CommunicationEvents.h"
 
+#include "ariba/interface/ServiceInterface.h"
+
 #include "ariba/overlay/modules/OverlayInterface.h"
 #include "ariba/overlay/modules/OverlayFactory.h"
 #include "ariba/overlay/modules/OverlayStructureEvents.h"
-#include "ariba/overlay/OverlayBootstrap.h"
-#include "ariba/overlay/SequenceNumber.h"
-#include "ariba/overlay/PublicExceptions.h"
-
-// forward declarations
-namespace ariba {
-  class NodeListener;
-  class CommunicationListener;
-  class SideportListener;
-}
-
-using std::vector;
-using std::list;
+#include "ariba/overlay/messages/OverlayMsg.h"
+#include "ariba/overlay/messages/JoinRequest.h"
+#include "ariba/overlay/messages/JoinReply.h"
+
+using std::cout;
 using std::map;
 using std::make_pair;
-using std::pair;
-using std::find;
-using std::deque;
-
-// ariba interface
-using ariba::NodeListener;
-using ariba::SideportListener;
-using ariba::CommunicationListener;
-
-// overlay
-using ariba::overlay::OverlayBootstrap;
-
-// communication
+
 using ariba::communication::EndpointDescriptor;
 using ariba::communication::BaseCommunication;
 using ariba::communication::CommunicationEvents;
 
-// transport
-//using ariba::transport::system_priority;
-
-// utilities
+using ariba::interface::ServiceInterface;
+
+using ariba::overlay::OverlayMsg;
+using ariba::overlay::JoinRequest;
+using ariba::overlay::JoinReply;
+using ariba::overlay::OverlayInterface;
+using ariba::overlay::OverlayFactory;
+using ariba::overlay::OverlayStructureEvents;
+
 using ariba::utility::NodeID;
 using ariba::utility::SpoVNetID;
@@ -114,112 +90,76 @@
 using ariba::utility::Demultiplexer;
 using ariba::utility::MessageReceiver;
+using ariba::utility::MessageSender;
 using ariba::utility::seqnum_t;
-using ariba::utility::Timer;
+
+#define ovl OvlVis::instance()
+#define ovlId OvlVis::NETWORK_ID_BASE_OVERLAY
+
+// needed for friend decleration
+// in different namespace
+namespace ariba {
+namespace interface {
+	class UnderlayAbstraction;
+}}
 
 namespace ariba {
 namespace overlay {
 
-class LinkDescriptor;
-class OverlayMsg;
-class DHT;
-
-class BaseOverlay: public MessageReceiver,
-		public CommunicationEvents,
-		public OverlayStructureEvents,
-		protected Timer {
-
-//	friend class OneHop;  // DEPRECATED
-	friend class Chord;
-	friend class ariba::SideportListener;
+class BaseOverlay :
+	public MessageReceiver,
+	public CommunicationEvents,
+	public OverlayStructureEvents {
 
 	use_logging_h( BaseOverlay );
+	friend class ariba::interface::UnderlayAbstraction;
 
 public:
-	/**
-	 * Constructs an empty non-functional base overlay instance
-	 */
-	BaseOverlay();
-
-	/**
-	 * Destructs a base overlay instance
+
+	/**
+	 * Constructs a Base Overlay instance
+	 */
+	BaseOverlay( BaseCommunication& _basecomm, const NodeID& _nodeid );
+
+	/**
+	 * TODO
 	 */
 	virtual ~BaseOverlay();
 
 	/**
-	 * Starts the Base Overlay instance
-	 */
-	void start(BaseCommunication* _basecomm, const NodeID& _nodeid);
-
-	/**
-	 * Stops the Base Overlay instance
-	 */
-	void stop();
-
-	/**
-	 * Is the BaseOverlay instance started up yet
-	 */
-	bool isStarted();
-
-	/// Tries to establish a direct or overlay link
-	const LinkID establishLink(	const EndpointDescriptor& ep,
-		const NodeID& node, const ServiceID& service );
-
-	/**
 	 * Starts a link establishment procedure to the specfied node
-	 * for the service with id service
-	 * 
-	 * @param node Destination node id
-	 * @param service Service to connect to
-	 * @param linkid Link identifier to be used with this link
-	 */
-	const LinkID establishLink(	const NodeID& remote,
-		const ServiceID& service = OverlayInterface::OVERLAY_SERVICE_ID );
-
-	/**
-	 * Starts a link establishment procedure to the specified
-	 * endpoint and to the specified service
-	 */
-	const LinkID establishDirectLink( const EndpointDescriptor& endpoint,
-		const ServiceID& service = OverlayInterface::OVERLAY_SERVICE_ID );
-
-	/// drops a link
-	void dropLink( const LinkID& link );
-
-	
-	
-	/* +++++ Message sending +++++ */
-	
-	
-	/// sends a message over an existing link
-	const SequenceNumber& sendMessage(reboost::message_t message,
-	        const LinkID& link,
-	        uint8_t priority ) throw(message_not_sent);
-
-	/// sends a message to a node and a specific service
-    const SequenceNumber& sendMessage(reboost::message_t message,
-	        const NodeID& remote,
-	        uint8_t priority,
-	        const ServiceID& service = OverlayInterface::OVERLAY_SERVICE_ID);
-
-
-    /**
-     *  send a message to the closest directly known node to an address
-     *  
-     *  @return NodeID of the (closest) destination node; 
-     */
-	NodeID sendMessageCloserToNodeID(reboost::message_t message, const NodeID& address,
-	        uint8_t priority, const ServiceID& service = OverlayInterface::OVERLAY_SERVICE_ID);
-	
+	 *
+	 * @param node The node id
+	 */
+	const LinkID establishLink( const NodeID& node, const ServiceID& service );
+
+	/**
+	 * TODO
+	 */
+	const LinkID establishLink( const EndpointDescriptor& ep, const ServiceID& service );
+
+	/**
+	 * TODO
+	 */
+	void  dropLink( const LinkID& link );
+
+	/**
+	 * TODO
+	 */
+	seqnum_t sendMessage( const Message* message, const LinkID& link );
+
+	/**
+	 * TODO
+	 */
+	seqnum_t sendMessage( const Message* message, const NodeID& node, const ServiceID& service );
+
 	/**
 	 * Send out a message to all nodes that are known in the overlay structure.
 	 * Depending on the structure of the overlay, this can be very different.
 	 */
-	void broadcastMessage(reboost::message_t message, const ServiceID& service, uint8_t priority);
-
-	
-	/* +++++ [Message sending] +++++ */
-	
-	
-	
+	void broadcastMessage(
+		Message* message,
+		const ServiceID& service
+	);
+
 	/**
 	 * Returns the end-point descriptor of a link.
@@ -228,41 +168,24 @@
 	 * @return The end-point descriptor of the link's end-point
 	 */
-	const EndpointDescriptor& getEndpointDescriptor(
-		const LinkID& link = LinkID::UNSPECIFIED) const;
-
-	/**
-	 * Get a list of overlay neighbors.
-	 *
-	 * @return A list of overlay neighbors.
-	 */
-	vector<NodeID> getOverlayNeighbors(bool deep = true) const;
-
-	/**
-	 * Returns a end-endpoint descriptor of a overlay neighbor.
-	 * If the node is not known -- an unspecified endpoint descriptor is
-	 * returned.
-	 *
-	 * @param node The node identifer of a overlay neighbor.
-	 * @return The end-point descriptor of the node or unspecified.
-	 */
-	const EndpointDescriptor& getEndpointDescriptor(const NodeID& node) const;
-
-	// TODO: Doc
-	bool bind(CommunicationListener* listener, const ServiceID& sid);
-
-	// TODO: Doc
-	bool unbind(CommunicationListener* listener, const ServiceID& sid);
-
-	// TODO: Doc
-	bool bind(NodeListener* listener);
-
-	// TODO: Doc
-	bool unbind(NodeListener* listener);
-
-	// TODO: Doc
-	bool registerSidePort(SideportListener* _sideport);
-
-	// TODO: Doc
-	bool unregisterSidePort(SideportListener* _sideport);
+	const EndpointDescriptor& getEndpointDescriptor( const LinkID& link = LinkID::UNSPECIFIED ) const;
+
+	/**
+	 * TODO
+	 */
+	const EndpointDescriptor& getEndpointDescriptor( const NodeID& node ) const;
+
+	/**
+	 * Registers a receiver.
+	 *
+	 * @param receiver An implementation of the receiver interface
+	 */
+	bool bind( ServiceInterface* service, const ServiceID& sid );
+
+	/**
+	 * Unregister a receiver.
+	 *
+	 * @param receiver An implementation of the receiver interface
+	 */
+	bool unbind( ServiceInterface* service, const ServiceID& sid );
 
 	/**
@@ -272,313 +195,144 @@
 	 * @return The NodeID of the link
 	 */
-	const NodeID& getNodeID(const LinkID& lid = LinkID::UNSPECIFIED) const;
-
-	/**
-	 * Return all Links for the specified remote nodeid, or all links when
-	 * the node id given is set to unspecified
-	 *
-	 * @param nid The node id to request links for, or unspecified for all links
-	 * @return a vector that contains all the link ids requested
-	 */
-	vector<LinkID> getLinkIDs(const NodeID& nid = NodeID::UNSPECIFIED) const;
-
-	/**
-	 * Join a existing sponaneous virtual network (spovnet).
-	 *
-	 * @param id A spovnet identifier
-	 * @param boot A bootstrap node
-	 */
-	void joinSpoVNet(const SpoVNetID& id, const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED());
-
-	/**
-	 * Initiates a new spontaneous virtual network.
-	 * This makes this BaseOverlay to the SpoVNet-Initiator.
-	 *
-	 * @param id The spovnet identifier
-	 */
-	void createSpoVNet(const SpoVNetID& id, const OverlayParameterSet& param =
-			OverlayParameterSet::DEFAULT, const SecurityParameterSet& sec =
-			SecurityParameterSet::DEFAULT, const QoSParameterSet& qos =
-			QoSParameterSet::DEFAULT);
-
-	/**
-	 * Start the bootstrap modules
-	 */
-	void startBootstrapModules(vector<pair<BootstrapManager::BootstrapType,string> > modules);
-
-	/**
-	 * Stop the bootstrap modules
-	 */
-	void stopBootstrapModules();
-
-	/**
-	 * Let the node leave the SpoVNet.
-	 */
-	void leaveSpoVNet();
-	
-	
-	/* link status */
-	bool isLinkDirect(const ariba::LinkID& lnk) const;
-	int getHopCount(const ariba::LinkID& lnk) const;
-
-    bool isLinkVital(const LinkDescriptor* link) const;
-    bool isLinkDirectVital(const LinkDescriptor* link) const;
+	const NodeID& getNodeID( const LinkID& lid = LinkID::UNSPECIFIED ) const ;
 
 protected:
 
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     */
-    virtual bool onLinkRequest(const LinkID& id,
-            const addressing2::EndpointPtr local,
-            const addressing2::EndpointPtr remote);
-
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     */
-    virtual void onLinkUp(const LinkID& id,
-            const addressing2::EndpointPtr local, const addressing2::EndpointPtr remote);
-
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     */
-    virtual void onLinkDown(const LinkID& id,
-            const addressing2::EndpointPtr local, const addressing2::EndpointPtr remote);
-
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     */
-    virtual void onLinkChanged(const LinkID& id,
-        const addressing2::EndpointPtr oldlocal,  const addressing2::EndpointPtr newlocal,
-        const addressing2::EndpointPtr oldremote, const addressing2::EndpointPtr newremote);
-
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     * 
-     * NOTE: Just calls onLinkDown (at the moment..)
-     */
-    virtual void onLinkFail(const LinkID& id,
-            const addressing2::EndpointPtr local, const addressing2::EndpointPtr remote);
-
-    /**
-     * @see ariba::communication::CommunicationEvents.h
-     */
-//    virtual void onLinkQoSChanged(const LinkID& id,
-//            const addressing2::EndpointPtr local, const addressing2::EndpointPtr remote,
-//            const QoSParameterSet& qos);
-
-	
-	
-	
-	/**
-	 * Processes a received message from BaseCommunication
-	 *
-	 * In case of a message routed by the overlay the source identifies
-	 * the node the message came from!
-	 */
-	virtual bool receiveMessage( reboost::shared_buffer_t message,
-	        const LinkID& link,
-	        const NodeID&,
-	        bool bypass_overlay );
-
-	/**
-	 * This method is called, when a new node joined the network
-	 *
-	 * @see OverlayStructureEvents.h
-	 */
-	virtual void onNodeJoin(const NodeID& node);
-
-	/**
-	 * Timer Event method
-	 */
-	virtual void eventFunction();
-
-	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-	std::string getLinkHTMLInfo();
-
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+	void joinSpoVNet(
+		const SpoVNetID& id,
+		const EndpointDescriptor& bootstrapEp
+	);
+
+	void createSpoVNet(
+		const SpoVNetID& id,
+		const OverlayParameterSet& param = OverlayParameterSet::DEFAULT,
+		const SecurityParameterSet& sec  = SecurityParameterSet::DEFAULT,
+		const QoSParameterSet& qos = QoSParameterSet::DEFAULT
+	);
+
+	void leaveSpoVNet(
+	);
+
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+	virtual void onLinkUp( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
+
+	virtual void onLinkDown( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
+
+	virtual void onLinkChanged( const LinkID& id, const NetworkLocator* oldlocal, const NetworkLocator* newlocal, const NetworkLocator* oldremote, const NetworkLocator* newremote );
+
+	virtual void onLinkFail( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
+
+	virtual void onLinkQoSChanged( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote, const QoSParameterSet& qos );
+
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+	virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& ); // nodeid is not valid in this case!
+
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+	/**
+	 * see OverlayStructureEvents.h, called from specific OverlayInterface class
+	 */
+	virtual void incomingRouteMessage( Message* msg );
+	virtual void onNodeJoin( const NodeID& node );
 
 private:
-	/// NOTE: "id" is an Overlay-LinkID
-	void __onLinkEstablishmentFailed(const LinkID& id);
-	
-	/// called from typeLinkClose-handler
-    void __removeDroppedLink(const LinkID& link);
-	
-private:
-	/// is the base overlay started yet
-	bool started;
-    
-    /// Â»trueÂ« if we have neighbours, Â»falseÂ« otherwise
-    bool connected;
-
-	/// The state of the BaseOverlay
+
+	/**
+	 * The BaseCommunication the BaseOverlay
+	 * communicates over
+	 */
+	BaseCommunication& bc;
+
+	/**
+	 * The nodeid of this BaseOverlay instance.
+	 */
+	NodeID nodeId;
+
+	/**
+	 * The SpoVNetID that we are joined to
+	 * or that we have created.
+	 */
+	SpoVNetID spovnetId;
+
+	/**
+	 * A demultiplexer that maps listeners to service ids
+	 * to deliver upcoming messages to the correct service.
+	 */
+	Demultiplexer<ServiceInterface*, const ServiceID> listenerMux;
+
+	/**
+	 * The abstract overlay interface that implements
+	 * the overlay specific functionality.
+	 */
+	OverlayInterface* overlayInterface;
+
+	/**
+	 * The special link to the Initiator of the SpoVNet
+	 * or LinkID::UNDEFINED if we are the Initiator
+	 */
+	LinkID initiatorLink;
+
+	/**
+	 * The state of the BaseOverlay
+	 */
 	typedef enum _BaseOverlayState {
-		BaseOverlayStateInvalid = 0,
-		BaseOverlayStateCompleted = 1,
+		BaseOverlayStateInvalid        = 0,
+		BaseOverlayStateInitiator      = 1,
+		BaseOverlayStateJoinInitiated  = 2,
+		BaseOverlayStateCompleted      = 3,
 	} BaseOverlayState;
 
-	BaseOverlayState state;         ///< Current Base-Overlay state
-	BaseCommunication* bc;          ///< reference to the base communication
-	NodeID nodeId;                  ///< the node id of this node
-	SpoVNetID spovnetId;            ///< the spovnet id of the currently joined overlay
-	vector<LinkID> bootstrapLinks;  ///< the link id of the link to the initiator node
-	NodeID spovnetInitiator;        ///< The initiator node
-
-	/// the service id communication listeners
-	Demultiplexer<CommunicationListener*, ServiceID> communicationListeners;
-	CommunicationListener* getListener( const ServiceID& id );
-
-	/// the node listeners
-	typedef vector<NodeListener*> NodeListenerVector;
-	NodeListenerVector nodeListeners;
-
-	/// the sideport listener
-	SideportListener* sideport;
-
-	/// the used overlay structure
-	OverlayInterface* overlayInterface;
-
-	/// Bootstrapper for our spovnet
-	OverlayBootstrap overlayBootstrap;
-
-	// message handlers --------------------------------------------------------
-
-	/// demultiplexes a incoming message with link descriptor
-	bool handleMessage( reboost::shared_buffer_t message, LinkDescriptor* ld,
-		const LinkID bcLink = LinkID::UNSPECIFIED );
-
-	// handle data and signalling messages
-	bool handleData( reboost::shared_buffer_t message, OverlayMsg* msg, LinkDescriptor* ld );
-	bool handleLostMessage( reboost::shared_buffer_t message, OverlayMsg* msg );
-	bool handleSignaling( OverlayMsg* msg, LinkDescriptor* ld );
-
-	// handle join request / reply messages
-	bool handleJoinRequest( reboost::shared_buffer_t message, const NodeID& source, const LinkID& bcLink );
-	bool handleJoinReply( reboost::shared_buffer_t message, const LinkID& bcLink );
-
-	// handle link messages
-	bool handleLinkRequest( OverlayMsg* msg, LinkDescriptor* ld );
-	bool handleLinkReply( OverlayMsg* msg, reboost::shared_buffer_t sub_message, LinkDescriptor* ld );
-	bool handleLinkUpdate( OverlayMsg* msg, LinkDescriptor* ld );
-	bool handleLinkDirect( OverlayMsg* msg, LinkDescriptor* ld );
-	bool handleLinkAlive( OverlayMsg* msg, LinkDescriptor* ld );
-    
-    // ping-pong over overlaypath/routing
-    bool handlePing( OverlayMsg* overlayMsg, LinkDescriptor* ld );
-    bool handlePong( OverlayMsg* overlayMsg, LinkDescriptor* ld );
-
-
-	// link state handling -----------------------------------------------------
-
-	/// link state information counter
-	int counter;
-
-	/// The link mapping of the node
-	vector<LinkDescriptor*> links;
-
-	/// erases a link descriptor
-	void eraseDescriptor(const LinkID& link, bool communication = false);
-
-	/// returns a link descriptor for the given id
-	LinkDescriptor* getDescriptor(const LinkID& link,
-			bool communication = false);
-
-	/// returns a link descriptor for the given id
-	const LinkDescriptor* getDescriptor(const LinkID& link,
-			bool communication = false) const;
-
-	/// returns a auto-link descriptor for the given node and service id
-	LinkDescriptor* getAutoDescriptor(const NodeID& node, const ServiceID& service);
-
-	/// adds a new link descriptor or uses an existing one
-	LinkDescriptor* addDescriptor(const LinkID& link = LinkID::UNSPECIFIED);
-
-	/// stabilizes link information
-	void stabilizeLinks();
-
-	/// print the currently known links
-	void showLinks();
-
-	/// compares two arbitrary links to the same node
-	int compare( const LinkID& lhs, const LinkID& rhs );
-
-	// relay route management --------------------------------------------------
-
-	/// relay route definitions
-	class relay_route {
+	BaseOverlayState state;
+
+	/**
+	 * The initiator node
+	 */
+	NodeID spovnetInitiator;
+
+	/**
+	 * OvlVis
+	 */
+	NodeID min, max;
+	NodeID succ, pred;
+	void updateOvlVis( const NodeID& node );
+
+	/**
+	 * Link management
+	 */
+	class LinkItem {
 	public:
-		NodeID  node;
-		LinkID  link;
-		uint8_t hops;
-		time_t  used;
+		static const LinkItem UNSPECIFIED;
+
+		LinkItem( const LinkID& _link, const NodeID& _node,
+				const ServiceID& _service, ServiceInterface* _interface )
+			: link( _link ), node( _node ), service( _service ), interface( _interface ){
+		}
+
+		const LinkID link;
+		NodeID node;
+		ServiceID service;
+		ServiceInterface* interface;
 	};
-	vector<relay_route> relay_routes;
-
-	/// stabilize relay information
-	void stabilizeRelays();
-
-	/// refreshes relay information
-	void refreshRelayInformation( const OverlayMsg* message, LinkDescriptor* ld );
-
-	/// returns a known relay link
-	LinkDescriptor* getRelayLinkTo( const NodeID& remote );
-
-	/// removes relay link information
-	void removeRelayLink( const LinkID& link );
-
-	/// removes relay node information
-	void removeRelayNode( const NodeID& link );
-
-	// internal message delivery -----------------------------------------------
-
-    // Convert OverlayMessage into new format and give it down to BaseCommunication
-    seqnum_t send_overlaymessage_down( OverlayMsg* message, const LinkID& bc_link, uint8_t priority );
-
-    
-	/// routes a message to its destination node
-	void route( OverlayMsg* message, const NodeID& last_hop = NodeID::UNSPECIFIED );
-	
-	/// sends a raw message to another node, delivers it to the base overlay class
-	/// may throw "message_not_sent"-exception
-	seqnum_t send( OverlayMsg* message,
-                   const NodeID& destination,
-                   uint8_t priority,
-                const NodeID& last_hop = NodeID::UNSPECIFIED )
-    throw(message_not_sent);
-
-	/// send a raw message using a link descriptor, delivers it to the base overlay class
-	seqnum_t send( OverlayMsg* message,
-	        LinkDescriptor* ld,
-	        uint8_t priority ) throw(message_not_sent);
-
-	/// send a message using a node id using overlay routing
-	/// sets necessary fields in the overlay message!
-	/// may throw "message_not_sent"-exception
-	seqnum_t send_node( OverlayMsg* message, const NodeID& remote, uint8_t priority,
-		const ServiceID& service = OverlayInterface::OVERLAY_SERVICE_ID) throw(message_not_sent);
-
-	/// send a message using a node id using overlay routing using a link
-	/// sets necessary fields in the overlay message!
-	void send_link( OverlayMsg* message,
-	        const LinkID& link,
-	        uint8_t priority ) throw(message_not_sent);
-
-	
-	/// sends a notification to a sender from whom we just dropped a message
-	void report_lost_message( const OverlayMsg* message );
-	
-	// misc --------------------------------------------------------------------
-
-	std::string debugInformation();
-
-	/**
-	 * nodes with pending joines. TODO: should be cleaned every
-	 * some seconds, add timestamps to each, and check on occasion
-	 */
+
+	typedef map<const LinkID, LinkItem> LinkMapping;
+	LinkMapping linkMapping;
+
+	// nodes with pending joines. TODO: should be cleaned every some seconds
+	// add timestamps to each, and check on occasion
 	typedef vector<NodeID> JoiningNodes;
 	JoiningNodes joiningNodes;
 
-	void updateVisual();
 };
 
