Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 3071)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 3374)
@@ -42,4 +42,5 @@
 #include "ariba/NodeListener.h"
 #include "ariba/CommunicationListener.h"
+#include "ariba/SideportListener.h"
 
 namespace ariba {
@@ -49,7 +50,7 @@
 
 BaseOverlay::BaseOverlay()
-	: bc(NULL), overlayInterface(NULL),
-		nodeId(NodeID::UNSPECIFIED), spovnetId(SpoVNetID::UNSPECIFIED),
-		initiatorLink(LinkID::UNSPECIFIED), state(BaseOverlayStateInvalid){
+	: bc(NULL), overlayInterface(NULL), nodeId(NodeID::UNSPECIFIED),
+		spovnetId(SpoVNetID::UNSPECIFIED), initiatorLink(LinkID::UNSPECIFIED),
+		state(BaseOverlayStateInvalid), sideport(&SideportListener::DEFAULT){
 }
 
@@ -230,4 +231,6 @@
 
 	CommunicationListener* receiver = communicationListeners.get( service );
+	assert( receiver != NULL );
+
 	LinkItem item (link, NodeID::UNSPECIFIED, service, receiver);
 	linkMapping.insert( make_pair(link, item) );
@@ -251,6 +254,6 @@
 	bc->dropLink( link );
 
-	if( item.interface != NULL )
-		item.interface->onLinkDown( link, item.node );
+	item.interface->onLinkDown( link, item.node );
+	sideport->onLinkDown(link, this->nodeId, item.node, this->spovnetId );
 }
 
@@ -352,4 +355,13 @@
 	communicationListeners.registerItem( listener, sid );
 	return true;
+}
+
+bool BaseOverlay::registerSidePort(SideportListener* _sideport){
+	sideport = _sideport;
+	_sideport->configure( this );
+}
+
+bool BaseOverlay::unregisterSidePort(SideportListener* _sideport){
+	sideport = &SideportListener::DEFAULT;
 }
 
@@ -442,5 +454,5 @@
 	if( i == linkMapping.end() ){
 
-		LinkItem item (id, NodeID::UNSPECIFIED, ServiceID::UNSPECIFIED, NULL );
+		LinkItem item (id, NodeID::UNSPECIFIED, ServiceID::UNSPECIFIED, &CommunicationListener::DEFAULT );
 		linkMapping.insert( make_pair(id, item) );
 
@@ -487,6 +499,6 @@
 	}
 
-	if( i->second.interface != NULL )
-		i->second.interface->onLinkDown( id, i->second.node );
+	i->second.interface->onLinkDown( id, i->second.node );
+	sideport->onLinkDown( id, this->nodeId, i->second.node, this->spovnetId );
 
 	linkMapping.erase( i );
@@ -504,8 +516,8 @@
 	if( i == linkMapping.end() ) return;
 
-	if( i->second.interface != NULL ){
-		i->second.interface->onLinkChanged( id, i->second.node );
-		// call onLinkQoSChanged?
-	}
+	i->second.interface->onLinkChanged( id, i->second.node );
+	sideport->onLinkChanged( id, this->nodeId, i->second.node, this->spovnetId );
+
+	// TODO call onLinkQoSChanged?
 
 	i->second.markused();
@@ -523,6 +535,6 @@
 	if( i == linkMapping.end() ) return;
 
-	if( i->second.interface != NULL )
-		i->second.interface->onLinkFail( id, i->second.node );
+	i->second.interface->onLinkFail( id, i->second.node );
+	sideport->onLinkFail( id, this->nodeId, i->second.node, this->spovnetId );
 
 	i->second.markused();
@@ -541,7 +553,5 @@
 
 	// TODO: convert QoSParameterSet to the LinkProperties properties
-	if( i->second.interface != NULL ){
-		// TODO: currently not in the interface: i->second.interface->onLinkQoSChanged( id, i->second.node, LinkProperties::DEFAULT );
-	}
+	// TODO: currently not in the interface: i->second.interface->onLinkQoSChanged( id, i->second.node, LinkProperties::DEFAULT );
 
 	i->second.markused();
@@ -799,5 +809,5 @@
 
 		CommunicationListener* iface = communicationListeners.get( service );
-		if( iface == NULL ){
+		if( iface == NULL || iface == &CommunicationListener::DEFAULT ){
 			logging_warn( "linkup event for service that has been registered with a NULL interface" );
 			return true;
@@ -812,8 +822,12 @@
 
 		if( iface->onLinkRequest(sourcenode) ){
+
+			// call the notification functions
 			iface->onLinkUp( link, sourcenode );
+			sideport->onLinkUp( link, nodeId, sourcenode, this->spovnetId );
+
 		} else {
 			// prevent onLinkDown calls to the service
-			i->second.interface = NULL;
+			i->second.interface = &CommunicationListener::DEFAULT;
 			// drop the link
 			dropLink( link );
@@ -950,4 +964,17 @@
 }
 
+vector<LinkID> BaseOverlay::getLinkIDs( const NodeID& nid ) const {
+
+	vector<LinkID> linkvector;
+
+	BOOST_FOREACH( LinkPair item, linkMapping ){
+		if( item.second.node == nid || nid == NodeID::UNSPECIFIED ){
+			linkvector.push_back( item.second.link );
+		}
+	}
+
+	return linkvector;
+}
+
 void BaseOverlay::incomingRouteMessage(Message* msg){
 	// gets handled as normal data message
