Index: source/ariba/overlay/LinkDescriptor.h
===================================================================
--- source/ariba/overlay/LinkDescriptor.h	(revision 5284)
+++ source/ariba/overlay/LinkDescriptor.h	(revision 5870)
@@ -39,20 +39,18 @@
 		// default values
 		this->up = false;
-		this->dropWhenRelaysLeft = false;
 		this->fromRemote = false;
 		this->remoteNode = NodeID::UNSPECIFIED;
-		this->overlayId  = LinkID::UNSPECIFIED;
+		this->overlayId  = LinkID::create();
 		this->communicationUp = false;
 		this->communicationId = LinkID::UNSPECIFIED;
 		this->keepAliveTime = time(NULL);
 		this->keepAliveMissed = 0;
-		this->usedAsRelay     = false;
-		this->timeUsedAsRelay = time(NULL);
+		this->relaying     = false;
+		this->timeRelaying = time(NULL);
+		this->dropAfterRelaying = false;
 		this->service  = ServiceID::UNSPECIFIED;
 		this->listener = &CommunicationListener::DEFAULT;
-		this->relay = false;
-		this->localRelay   = NodeID::UNSPECIFIED;
-		this->remoteRelay  = NodeID::UNSPECIFIED;
-		this->remoteLinkId = LinkID::UNSPECIFIED;
+		this->relayed = false;
+		this->remoteLink = LinkID::UNSPECIFIED;
 		this->autolink = false;
 		this->lastuse = time(NULL);
@@ -64,78 +62,77 @@
 	}
 
-	// general information about the link ---------------------------------
+	// general information about the link --------------------------------------
+	bool up;           ///< flag whether this link is up and running
+	bool fromRemote;   ///< flag, whether this link was requested from remote
+	NodeID remoteNode; ///< remote end-point node
 
-	bool up; ///< flag wheter this link is up and running
-	bool dropWhenRelaysLeft;
-	bool fromRemote; ///<flag, wheter this link was requested from remote
+	// link identifiers --------------------------------------------------------
+	LinkID overlayId;       ///< the base overlay link id
+	LinkID communicationId; ///< the communication id
+	bool   communicationUp;   ///< flag, whether the communication is up
 
-	NodeID remoteNode; ///< remote endpoint node
-
-	LinkID overlayId; ///< the base overlay link id
-	LinkID communicationId; ///< the communication id
-	bool communicationUp; ///< flag, wheter the communication is up
-
+	// link alive information --------------------------------------------------
 	time_t keepAliveTime; ///< the last time a keep-alive message was received
-	int keepAliveMissed; ///< the number of missed keep-alive messages
-
-	void markAlive() {
+	int keepAliveMissed;  ///< the number of missed keep-alive messages
+	void setAlive() {
 		keepAliveMissed = 0;
 		keepAliveTime = time(NULL);
 	}
 
-	// relay state --------------------------------------------------------
+	// relay information -------------------------------------------------------
+	bool   relayed;    ///< flag whether this link is a relayed link
+	LinkID remoteLink; ///< the remote link id
+	vector<NodeID> routeRecord;
 
-	bool   usedAsRelay; ///< flag, wheter this link has been used as relay
-	time_t timeUsedAsRelay; ///< last time the link has been used as relay
-
-	void markAsRelay() {
-		usedAsRelay = true;
-		timeUsedAsRelay = time(NULL);
+	// relay state -------------------------------------------------------------
+	bool   relaying;     ///< flag, wheter this link has been used as relay
+	bool   dropAfterRelaying;
+	time_t timeRelaying; ///< last time the link has been used as relay
+	void setRelaying() {
+		relaying = true;
+		timeRelaying = time(NULL);
 	}
 
-	// owner --------------------------------------------------------------
+	// owner -------------------------------------------------------------------
 	ServiceID service; ///< service using this link
 	CommunicationListener* listener; ///< the listener using this node
 
-	// relay information --------------------------------------------------
-	bool relay;          ///< flag whether this link is a relay link
-	NodeID localRelay;   ///< the local relay node
-	NodeID remoteRelay;  ///< the remote relay node
-	LinkID remoteLinkId; ///< the remote link id
-
-	// auto links ---------------------------------------------------------
+	// auto links --------------------------------------------------------------
 	bool autolink;  ///< flag, whether this link is a auto-link
 	time_t lastuse; ///< time, when the link was last used
 	deque<Message*> messageQueue; ///< waiting messages to be delivered
-
-	/// updates the timestamp
-	void markAsUsed() {
-		lastuse = time(NULL);
+	void setAutoUsed() {
+		if (autolink) lastuse = time(NULL);
 	}
-
-	/// drops waiting messsages
+	/// drops waiting auto-link messages
 	void flushQueue() {
-		BOOST_FOREACH( Message* msg, messageQueue )
-			delete msg;
+		BOOST_FOREACH( Message* msg, messageQueue )	delete msg;
 		messageQueue.clear();
 	}
 
+	// string representation ---------------------------------------------------
 	std::string to_string() const {
 		std::ostringstream s;
 		s << "up=" << up << " ";
-		s << "fromRem=" << fromRemote << " ";
-		s << "remNode=" << remoteNode.toString().substr(0,6) << " ";
+		s << "init=" << !fromRemote << " ";
+		s << "id=" << overlayId.toString().substr(0,4) << " ";
 		s << "serv=" << service.toString() << " ";
-		s << "overId=" << overlayId.toString().substr(0,6) << " ";
-		s << "commUp=" << communicationUp << " ";
-		s << "commId=" << communicationId.toString().substr(0,6) << " ";
-		s << "usedAsRel=" << usedAsRelay << " ";
-		s << "KeepAliveMiss=" << keepAliveMissed << " ";
-		if ( !localRelay.isUnspecified() ) {
-			s << "locRel=" << localRelay.toString().substr(0,6) << " ";
-			s << "remRel=" << remoteRelay.toString().substr(0,6) << " ";
-			s << "remLink=" << remoteLinkId.toString().substr(0,6) << " ";
+		s << "node=" << remoteNode.toString().substr(0,4) << " ";
+		s << "relaying=" << relaying << " ";
+		s << "miss=" << keepAliveMissed << " ";
+		s << "auto=" << autolink << " ";
+		if ( relayed ) {
+			s << "| Relayed: ";
+			s << "remote link=" << remoteLink.toString().substr(0,4) << " ";
+			if (routeRecord.size()>0) {
+				cout << "route record=";
+				for (size_t i=0; i<routeRecord.size(); i++)
+					cout << routeRecord[i].toString().substr(0,4) << " ";
+			}
+		} else {
+			s << "| Direct: ";
+			s << "using id=" << communicationId.toString().substr(0,4) << " ";
+			s << "(up=" << communicationUp << ") ";
 		}
-		s << "auto=" << autolink;
 		return s.str();
 	}
