Index: source/ariba/CommunicationListener.cpp
===================================================================
--- source/ariba/CommunicationListener.cpp	(revision 3055)
+++ source/ariba/CommunicationListener.cpp	(revision 3056)
@@ -65,5 +65,5 @@
 bool CommunicationListener::onLinkRequest(const NodeID& remote,
 		const DataMessage& msg) {
-	return false;
+	return true;
 }
 
@@ -72,4 +72,5 @@
 }
 
+// --- extended message functionality ---
 // void CommunicationListener::onMessageSent(seqnum_t seq_num, bool failed,
 // 		const DataMessage& msg) {
Index: source/ariba/CommunicationListener.h
===================================================================
--- source/ariba/CommunicationListener.h	(revision 3055)
+++ source/ariba/CommunicationListener.h	(revision 3056)
@@ -40,9 +40,4 @@
 #define COMMUNICATIONLISTENER_H_
 
-namespace ariba {
-// forward declaration
-class CommunicationListener;
-}
-
 #include "Message.h"
 #include "Identifiers.h"
@@ -52,9 +47,14 @@
 namespace ariba {
 
+// forward decl
+namespace overlay {
+	class BaseOverlay;
+}
+
 /**
  * Listener for communication events on links.
  */
 class CommunicationListener {
-	friend class Node;
+	friend class ariba::overlay::BaseOverlay;
 protected:
 	CommunicationListener();
Index: source/ariba/NodeListener.h
===================================================================
--- source/ariba/NodeListener.h	(revision 3055)
+++ source/ariba/NodeListener.h	(revision 3056)
@@ -40,13 +40,12 @@
 #define NODELISTENER_H_
 
-// forward declaration
-namespace ariba {
-class NodeListener;
-class Node;
-}
-
 #include "Identifiers.h"
 
 namespace ariba {
+
+// forward decl
+namespace overlay {
+	class BaseOverlay;
+}
 
 /**
@@ -57,8 +56,9 @@
  */
 class NodeListener {
-	friend class Node;
+	friend class ariba::overlay::BaseOverlay;
 public:
 	NodeListener();
 	virtual ~NodeListener();
+
 protected:
 	/**
Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 3055)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 3056)
@@ -148,6 +148,6 @@
 	// inform all registered services of the event
 	BOOST_FOREACH( NodeListener* i, nodeListeners ){
-		if( ret ) i->onLeaveSuccess( spovnetId );
-		else      i->onLeaveFail( spovnetId );
+		if( ret ) i->onLeaveCompleted( spovnetId );
+		else      i->onLeaveFailed( spovnetId );
 	}
 }
@@ -178,5 +178,5 @@
 	overlayInterface->joinOverlay();
 	BOOST_FOREACH( NodeListener* i, nodeListeners ){
-		i->onJoinSuccess( spovnetId );
+		i->onJoinCompleted( spovnetId );
 	}
 
@@ -252,5 +252,5 @@
 
 	if( item.interface != NULL )
-		item.interface->onLinkDown( spovnetId, nodeId, item.node );
+		item.interface->onLinkDown( link, item.node );
 }
 
@@ -310,19 +310,18 @@
 
 void BaseOverlay::bind(CommunicationListener* listener, const ServiceID& sid){
-	logging_debug( "binding communication listener " << listener 
+	logging_debug( "binding communication listener " << listener
 		<< " on serviceid " << sid.toString() );
 
 	if( communicationListeners.contains( sid ) ){
-		logging_error( "some listener already registered for service id " 
+		logging_error( "some listener already registered for service id "
 			<< sid.toString() );
-		return false;
+		return;
 	}
 
 	communicationListeners.registerItem( listener, sid );
-	return true;
 }
 
 void BaseOverlay::unbind(CommunicationListener* listener, const ServiceID& sid){
-	logging_debug( "unbinding listener " << listener 
+	logging_debug( "unbinding listener " << listener
 		<< " from serviceid " << sid.toString() );
 
@@ -333,5 +332,5 @@
 
 	if( communicationListeners.get(sid) != listener ){
-		logging_warn( "listener bound to service id " << sid.toString() 
+		logging_warn( "listener bound to service id " << sid.toString()
 			<< " is different than listener trying to unbind" );
 		return;
@@ -344,10 +343,10 @@
 	logging_debug( "binding node listener " << listener );
 
-	NodeListenerVector::iterator i = nodeListeners.find( listener );
+	NodeListenerVector::iterator i = find( nodeListeners.begin(), nodeListeners.end(), listener );
 	if( i != nodeListeners.end() ){
 		logging_warn( "node listener " << listener << " is already bound, cannot bind" );
 		return;
 	}
-	
+
 	nodeListeners.push_back( listener );
 }
@@ -356,10 +355,10 @@
 	logging_debug( "unbinding node listener " << listener );
 
-	NodeListenerVector::iterator i = nodeListeners.find( listener );
+	NodeListenerVector::iterator i = find( nodeListeners.begin(), nodeListeners.end(), listener );
 	if( i == nodeListeners.end() ){
 		logging_warn( "node listener " << listener << " is not bound, cannot unbind" );
 		return;
 	}
-	
+
 	nodeListeners.erase( i );
 }
@@ -451,5 +450,5 @@
 
 	if( i->second.interface != NULL )
-		i->second.interface->onLinkDown( id, nodeId, i->second.node );
+		i->second.interface->onLinkDown( id, i->second.node );
 
 	linkMapping.erase( i );
@@ -468,5 +467,5 @@
 
 	if( i->second.interface != NULL )
-		i->second.interface->onLinkChanged( id, nodeId, i->second.node );
+		i->second.interface->onLinkChanged( id, i->second.node );
 
 	i->second.markused();
@@ -485,5 +484,5 @@
 
 	if( i->second.interface != NULL )
-		i->second.interface->onLinkFail( id, nodeId, i->second.node );
+		i->second.interface->onLinkFail( id, i->second.node );
 
 	i->second.markused();
@@ -501,6 +500,7 @@
 	if( i == linkMapping.end() ) return;
 
+	// TODO: convert QoSParameterSet to the LinkProperties properties
 	if( i->second.interface != NULL )
-		i->second.interface->onLinkQoSChanged( id, nodeId, i->second.node, qos );
+		i->second.interface->onLinkQoSChanged( id, i->second.node, LinkProperties::DEFAULT );
 
 	i->second.markused();
@@ -535,5 +535,5 @@
 
 		if( serviceListener != NULL )
-			serviceListener->receiveMessage( overlayMsg, link, overlayMsg->getSourceNode() );
+			serviceListener->onMessage( overlayMsg, overlayMsg->getSourceNode(), link );
 
 		return true;
@@ -571,9 +571,6 @@
 		//
 
+		// TODO: here you can implement mechanisms to deny joining of a node
 		bool allow = true;
-
-		BOOST_FOREACH( NodeListener* i, nodeListeners ){
-			allow &= i->isJoinAllowed( overlayMsg->getSourceNode(), spovnetId );
-		}
 
 		logging_info( "sending back join reply for spovnet " <<
@@ -644,6 +641,6 @@
 
 			// inform all registered services of the event
-			BOOST_FOREACH( NodeListener* i, nodeListeners{
-				i->onJoinFail( spovnetId );
+			BOOST_FOREACH( NodeListener* i, nodeListeners ){
+				i->onJoinFailed( spovnetId );
 			}
 
@@ -670,5 +667,5 @@
 			// inform all registered services of the event
 			BOOST_FOREACH( NodeListener* i, nodeListeners ){
-				i->onJoinFail( spovnetId );
+				i->onJoinFailed( spovnetId );
 			}
 
@@ -692,5 +689,5 @@
 		// inform all registered services of the event
 		BOOST_FOREACH( NodeListener* i, nodeListeners ){
-			i->onJoinSuccess( spovnetId );
+			i->onJoinCompleted( spovnetId );
 		}
 
@@ -758,5 +755,5 @@
 
 		i->second.interface = iface;
-		iface->onLinkUp( link, nodeId, sourcenode );
+		iface->onLinkUp( link, sourcenode );
 		i->second.markused();
 
@@ -792,5 +789,5 @@
 			// inform all registered services of the event
 			BOOST_FOREACH( NodeListener* i, nodeListeners ){
-				i->onLeaveFail( spovnetId );
+				i->onLeaveFailed( spovnetId );
 			}
 
@@ -802,8 +799,4 @@
 			logging_info( "node left " << overlayMsg->getSourceNode() );
 
-			// inform all registered services of the event
-			BOOST_FOREACH( NodeListener* i, nodeListeners ){
-				i->onNodeLeave( overlayMsg->getSourceNode(), spovnetId );
-			}
 		}
 
@@ -908,8 +901,4 @@
 				<< node.toString() );
 
-	BOOST_FOREACH( NodeListener* i, nodeListeners ){
-		i->onNodeJoin( node, spovnetId );
-	}
-
 	joiningNodes.erase( i );
 }
Index: source/ariba/overlay/BaseOverlay.h
===================================================================
--- source/ariba/overlay/BaseOverlay.h	(revision 3055)
+++ source/ariba/overlay/BaseOverlay.h	(revision 3056)
@@ -70,5 +70,4 @@
 	class NodeListener;
 	class CommunicationListener;
-
 	namespace utility {
 		class OvlVis;
@@ -204,15 +203,15 @@
 	 */
 	void bind(CommunicationListener* listener, const ServiceID& sid);
-	
+
 	/**
 	 * TODO
 	 */
 	void unbind(CommunicationListener* listener, const ServiceID& sid);
-	
+
 	/**
 	 * TODO
 	 */
 	void bind(NodeListener* listener);
-	
+
 	/**
 	 * TODO
@@ -289,5 +288,5 @@
 	 */
 	virtual void incomingRouteMessage( Message* msg );
-	
+
 	/**
 	 * see OverlayStructureEvents.h, called from specific OverlayInterface class
@@ -295,5 +294,5 @@
 	virtual void onNodeJoin( const NodeID& node );
 
-	
+
 	/**
 	 * TODO, for timer events
@@ -407,7 +406,7 @@
 	LinkMapping linkMapping;
 
-	
-	/**
-	 * nodes with pending joines. TODO: should be cleaned every 
+
+	/**
+	 * nodes with pending joines. TODO: should be cleaned every
 	 * some seconds, add timestamps to each, and check on occasion
 	 */
Index: source/ariba/overlay/modules/OverlayInterface.cpp
===================================================================
--- source/ariba/overlay/modules/OverlayInterface.cpp	(revision 3055)
+++ source/ariba/overlay/modules/OverlayInterface.cpp	(revision 3056)
@@ -57,5 +57,5 @@
 
 OverlayInterface::~OverlayInterface(){
-	baseoverlay.unbind( OVERLAY_SERVICE_ID );
+	baseoverlay.unbind( this, OVERLAY_SERVICE_ID );
 }
 
