Index: source/ariba/AribaModule.cpp
===================================================================
--- source/ariba/AribaModule.cpp	(revision 7468)
+++ source/ariba/AribaModule.cpp	(revision 7532)
@@ -43,4 +43,5 @@
 #include <boost/regex.hpp>
 #include <boost/foreach.hpp>
+#include <boost/algorithm/string.hpp>
 
 // ariba includes
@@ -58,4 +59,5 @@
 
 use_logging_cpp(AribaModule);
+const string AribaModule::BootstrapMechanismNames[5] = {"invalid", "static", "broadcast", "mdns", "sdp"};
 
 AribaModule::AribaModule()
@@ -69,13 +71,22 @@
 string AribaModule::getBootstrapHints(const Name& spoVNetName) const {
 	std::ostringstream o;
+	int i=0;
 	BOOST_FOREACH( const BootstrapInfo& info, bootstrapNodes ) {
 		o << info.spovnetName.toString() << "{";
-		int i=0;
+		if (i!=0) o << ",";
+
 		BOOST_FOREACH( const BootstrapNode& node, info.nodes ) {
-			if (i!=0) o << ",";
-			if( node.desc != NULL ) o << node.desc->toString();
-			i++;
+			if( node.desc != NULL )
+				o << node.desc->toString();
+			else if(node.mechanism == BootstrapMechanismBroadcast
+					|| node.mechanism == BootstrapMechanismMulticastDNS
+					|| node.mechanism == BootstrapMechanismSDP){
+				o << BootstrapMechanismNames[node.mechanism];
+				if( !node.info.empty() ) o << "{" << node.info << "}";
+				o << ";";
+			}
 		}
 		o << "}";
+		i++;
 	}
 	return o.str();
@@ -87,4 +98,9 @@
 	using namespace ariba::utility::Helper;
 	using namespace std;
+
+	boost::erase_all(boot_info, " ");
+	boost::erase_all(boot_info, "\t");
+	boost::erase_all(boot_info, "\n");
+	boost::erase_all(boot_info, "\r");
 
 	smatch match;
@@ -96,18 +112,50 @@
 			data = data.substr(1, data.size() - 2);
 			Name name(type);
+
+			// find static bootstrap info --> BootstrapMechanismStatic
 			EndpointDescriptor* desc = EndpointDescriptor::fromString(data);
-			logging_debug("Added bootstap info for " << type << ": " << desc->toString() );
-			addBootstrapNode(name, desc);
-		}
-	}
+			addBootstrapNode(name, desc, "", BootstrapMechanismStatic);
+
+			// find automatic bootstrap info --> {BootstrapMechanismBroadcast,
+			// 					BootstrapMechanismMulticastDNS,BootstrapMechanismSDP}
+			typedef vector< string > split_vector_type;
+			split_vector_type splitvec;
+			boost::split( splitvec, data, boost::is_any_of(";") );
+			for(unsigned int i=0; i<splitvec.size(); i++){
+				string x = splitvec[i];
+				split_vector_type innervec;
+
+				boost::split( innervec, x, boost::is_any_of("{}") );
+				BootstrapNode node;
+				if(innervec.size() < 1) continue;
+
+				if(innervec[0] == BootstrapMechanismNames[BootstrapMechanismBroadcast])
+					node.mechanism = BootstrapMechanismBroadcast;
+				else if(innervec[0] == BootstrapMechanismNames[BootstrapMechanismMulticastDNS])
+					node.mechanism = BootstrapMechanismMulticastDNS;
+				else if(innervec[0] == BootstrapMechanismNames[BootstrapMechanismSDP])
+					node.mechanism = BootstrapMechanismSDP;
+				else
+					continue;
+
+				if(innervec.size() > 1)
+					node.info = innervec[1];
+
+				this->addBootstrapNode(name, node);
+			}
+		}
+	}
+
+	logging_info( "Added bootstrap hints: " << getBootstrapHints() );
 }
 
 void AribaModule::addBootstrapNode(const Name& spovnet,
-		communication::EndpointDescriptor* desc) {
-
-	// set bootstrap node
-	BootstrapNode node;
-	node.timestamp = 0;
-	node.desc = desc;
+		communication::EndpointDescriptor* desc, const string& info,
+		const BootstrapMechanism& mechanism) {
+	BootstrapNode node(0, desc, mechanism, info);
+	addBootstrapNode(spovnet, node);
+}
+
+void AribaModule::addBootstrapNode(const Name& spovnet, const BootstrapNode& node){
 	bool added = false;
 
@@ -128,18 +176,45 @@
 		bootstrapNodes.push_back(info);
 	}
-
-	logging_debug( "Added bootstrap info: " << getBootstrapHints() );
 }
 
 const communication::EndpointDescriptor* AribaModule::getBootstrapNode(
-		const Name& spovnet) const {
+		const Name& spovnet, const BootstrapMechanism mechanism) const {
 	BOOST_FOREACH( const BootstrapInfo& info, bootstrapNodes ) {
 		if( info.spovnetName == spovnet ) {
 			BOOST_FOREACH( const BootstrapNode& node, info.nodes ) {
-				if( node.desc != NULL ) return node.desc;
+				if( node.mechanism == mechanism && node.desc != NULL )
+					return node.desc;
 			}
 		}
 	}
 	return NULL;
+}
+
+string AribaModule::getBootstrapInfo(
+		const Name& spovnet, const BootstrapMechanism mechanism) const {
+	BOOST_FOREACH( const BootstrapInfo& info, bootstrapNodes ) {
+		if( info.spovnetName == spovnet ) {
+			BOOST_FOREACH( const BootstrapNode& node, info.nodes ) {
+				if( node.mechanism == mechanism && node.desc != NULL )
+					return node.info;
+			}
+		}
+	}
+
+	return string();
+}
+
+vector<AribaModule::BootstrapMechanism> AribaModule::getBootstrapMechanisms(
+		const Name& spovnet) const {
+	vector<AribaModule::BootstrapMechanism> ret;
+	BOOST_FOREACH( const BootstrapInfo& info, bootstrapNodes ) {
+		if( info.spovnetName == spovnet ) {
+			BOOST_FOREACH( const BootstrapNode& node, info.nodes ) {
+				if(std::find(ret.begin(), ret.end(), node.mechanism) == ret.end())
+					ret.push_back(node.mechanism);
+			}
+		}
+	}
+	return ret;
 }
 
