Index: source/ariba/communication/networkinfo/AddressDiscovery.hpp
===================================================================
--- source/ariba/communication/networkinfo/AddressDiscovery.hpp	(revision 5406)
+++ 	(revision )
@@ -1,102 +1,0 @@
-#ifndef ADDRESSDISCOVERY_HPP_
-#define ADDRESSDISCOVERY_HPP_
-
-#include "ariba/utility/addressing/addressing.hpp"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-
-#include <arpa/inet.h>
-
-#include <netinet/in.h>
-
-#include <net/if.h>
-
-#include <ifaddrs.h>
-
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/hci.h>
-#include <bluetooth/hci_lib.h>
-
-using namespace ariba::addressing;
-
-mac_address getMacFromIF( const char* name ) {
-	int s;
-	struct ifreq buffer;
-	s = socket(PF_INET, SOCK_DGRAM, 0);
-	memset(&buffer, 0x00, sizeof(buffer));
-	strcpy(buffer.ifr_name, name);
-	ioctl(s, SIOCGIFHWADDR, &buffer);
-	close(s);
-	mac_address addr;
-	addr.assign( (uint8_t*)buffer.ifr_hwaddr.sa_data, 6 );
-	return addr;
-}
-
-
-int dev_info(int s, int dev_id, long arg) {
-	endpoint_set* set = (endpoint_set*)arg;
-	struct hci_dev_info di;
-	di.dev_id = dev_id;
-	if (ioctl(s, HCIGETDEVINFO, (void *) &di)) return 0;
-	mac_address mac;
-	mac.bluetooth( di.bdaddr );
-	address_vf vf = mac;
-	set->add(vf);
-	return 0;
-}
-
-void discover_bluetooth( endpoint_set& endpoints ) {
-	hci_for_each_dev(HCI_UP, &dev_info, (long)&endpoints );
-}
-
-void discover_ip_addresses( endpoint_set& endpoints ) {
-	struct ifaddrs* ifaceBuffer = NULL;
-	struct ifaddrs* tmpAddr     = NULL;
-	void*           tmpAddrPtr  = NULL;
-	char            straddr     [INET_ADDRSTRLEN];
-
-	int ret = getifaddrs( &ifaceBuffer );
-	if( ret != 0 ) return;
-
-	for( struct ifaddrs* i=ifaceBuffer; i != NULL; i=i->ifa_next ) {
-
-		// ignore devices that are disabled or have no ip
-		if(i == NULL) continue;
-		struct sockaddr* addr = i->ifa_addr;
-
-		// only look at IPv4, not IPv6 addresses
-		if (addr->sa_family == AF_INET) {
-			if (addr==NULL) continue;
-			tmpAddrPtr= &((struct sockaddr_in*)addr)->sin_addr;
-			inet_ntop( i->ifa_addr->sa_family, tmpAddrPtr, straddr, sizeof(straddr) );
-			ip_address ip = straddr;
-			if (ip.is_loopback()) continue;
-			address_vf vf = ip;
-			endpoints.add( vf );
-		} else
-		if (addr->sa_family == AF_INET6) {
-			if (addr==NULL) continue;
-			tmpAddrPtr= &((struct sockaddr_in6*)addr)->sin6_addr;
-			inet_ntop( i->ifa_addr->sa_family, tmpAddrPtr, straddr, sizeof(straddr) );
-			ip_address ip = straddr;
-			if (ip.is_loopback()) continue;
-			address_vf vf = ip;
-			endpoints.add( vf );
-		} else
-		if (i->ifa_name[0]=='p' && i->ifa_name[1]=='a' && i->ifa_name[2]=='n') {
-			mac_address mac = getMacFromIF(i->ifa_name);
-			address_vf vf = mac;
-//			endpoints.add( vf );
-		}
-	}
-}
-
-void discover_endpoints( endpoint_set& endpoints ) {
-	discover_ip_addresses( endpoints );
-	discover_bluetooth( endpoints );
-}
-
-#endif /* ADDRESSDISCOVERY_HPP_ */
Index: source/ariba/communication/networkinfo/AddressInformation.cpp
===================================================================
--- source/ariba/communication/networkinfo/AddressInformation.cpp	(revision 5406)
+++ 	(revision )
@@ -1,90 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#include "AddressInformation.h"
-
-#include <ifaddrs.h>
-
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/address_v4.hpp>
-
-namespace ariba {
-namespace communication {
-
-using namespace ariba::addressing;
-
-AddressInformation::AddressInformation(){
-}
-
-AddressInformation::~AddressInformation(){
-}
-
-AddressList AddressInformation::getAddresses(const NetworkInterface& interface){
-
-	AddressList retlist;
-
-	// gather transport addresses
-	struct ifaddrs* ifap;
-	getifaddrs( &ifap );
-
-	for( struct ifaddrs* p = ifap; p != NULL; p=p->ifa_next ){
-
-		// no name set? ->continue
-		if( interface.name.compare(string(p->ifa_name)) != 0 ) continue;
-
-		// handle IPv4 entry
-		struct sockaddr* addr = p->ifa_addr;
-		if( addr->sa_family == AF_INET ) {
-			// get address
-			const struct sockaddr_in& ipv4 = (const struct sockaddr_in&)*addr;
-			boost::asio::ip::address_v4::bytes_type bytes;
-			for( int i=0; i<4; i++ )
-				bytes[i] = (ipv4.sin_addr.s_addr >> (24-i*8)) & 0xff;
-
-			// add ipv4 address
-			boost::asio::ip::address boost_addr = boost::asio::ip::address_v4( bytes );
-			retlist.push_back( vcapsule<address_v>( ip_address(boost_addr) ) );
-		}
-	}
-
-	freeifaddrs( ifap );
-
-	return retlist;
-}
-
-}} // namespace ariba, communication
Index: source/ariba/communication/networkinfo/AddressInformation.h
===================================================================
--- source/ariba/communication/networkinfo/AddressInformation.h	(revision 5406)
+++ 	(revision )
@@ -1,66 +1,0 @@
-// [License]
-// The Ariba-Underlay Copyright
-//
-// Copyright (c) 2008-2009, Institute of Telematics, UniversitÃ€t Karlsruhe (TH)
-//
-// Institute of Telematics
-// UniversitÃ€t Karlsruhe (TH)
-// Zirkel 2, 76128 Karlsruhe
-// Germany
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE INSTITUTE OF TELEMATICS ``AS IS'' AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARIBA PROJECT OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The views and conclusions contained in the software and documentation
-// are those of the authors and should not be interpreted as representing
-// official policies, either expressed or implied, of the Institute of
-// Telematics.
-// [License]
-
-#ifndef __ADDRESS_INFORMATION_H
-#define __ADDRESS_INFORMATION_H
-
-#include <vector>
-
-#include "ariba/communication/networkinfo/NetworkInterface.h"
-#include "ariba/utility/addressing/addressing.hpp"
-
-namespace ariba {
-namespace communication {
-
-using namespace std;
-using namespace ariba::addressing;
-
-/// a list of addresses
-typedef vector<address_v*> AddressList;
-
-class AddressInformation {
-public:
-	AddressInformation();
-	~AddressInformation();
-
-	AddressList getAddresses(const NetworkInterface& interface);
-};
-
-}} // namespace ariba, communication
-
-#endif // __ADDRESS_INFORMATION_H
Index: source/ariba/communication/networkinfo/NetworkInformation.cpp
===================================================================
--- source/ariba/communication/networkinfo/NetworkInformation.cpp	(revision 5406)
+++ source/ariba/communication/networkinfo/NetworkInformation.cpp	(revision 5638)
@@ -38,4 +38,11 @@
 
 #include "NetworkInformation.h"
+#include "ariba/config.h"
+
+#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
+  #include <bluetooth/bluetooth.h>
+  #include <bluetooth/hci.h>
+  #include <bluetooth/hci_lib.h>
+#endif
 
 namespace ariba {
@@ -192,4 +199,57 @@
 	} // for( ; i != iend; i++ )*/
 
+	//
+	// not we try to get bluetooth interfaces
+	//
+
+#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
+
+	int btsock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+	if(btsock <  0){
+		logging_error("failed getting bluetooth raw socket");
+		return retlist;
+	}
+
+	struct hci_dev_list_req* btlist = NULL;
+	struct hci_dev_req* btdev = NULL;
+
+	btlist = (hci_dev_list_req*)malloc(HCI_MAX_DEV *
+			sizeof(struct hci_dev_list_req) + sizeof(struct hci_dev_req));
+
+	btlist->dev_num = HCI_MAX_DEV;
+	btdev = btlist->dev_req;
+
+	if(ioctl(btsock, HCIGETDEVLIST, btlist) < 0){
+		logging_error("failed getting requesting bluetooth devices");
+		free(btlist);
+		close(btsock);
+		return retlist;
+	}
+
+	btdev = btlist->dev_req;
+
+	for(int i=0; i<btlist->dev_num; i++, btdev++){
+		struct hci_dev_info di;
+		NetworkInterface interface;
+
+		if(hci_devinfo(btdev->dev_id, &di) < 0) continue;
+		if(hci_test_bit(HCI_RAW, &di.flags)) continue;
+
+		interface.name = string(di.name);
+		interface.index = di.dev_id;
+		interface.mtu = di.sco_mtu;
+		interface.isBroadcast = false;
+		interface.isLoopback = false;
+		interface.isMulticast = false;
+		interface.isUp = hci_test_bit(HCI_UP, &di.flags);
+		interface.isRunning = hci_test_bit(HCI_RUNNING, &di.flags);
+
+		retlist.push_back( interface );
+	}
+
+	free(btlist);
+	close(btsock);
+#endif
+
 	return retlist;
 }
Index: source/ariba/communication/networkinfo/NetworkInterface.h
===================================================================
--- source/ariba/communication/networkinfo/NetworkInterface.h	(revision 5406)
+++ source/ariba/communication/networkinfo/NetworkInterface.h	(revision 5638)
@@ -63,10 +63,23 @@
 	bool 	isBroadcast;
 	bool	isMulticast;
-	int	mtu;
-	int	txQueueLen;
+	int		mtu;
+	int		txQueueLen;
 
 	static NetworkInterface UNDEFINED;
 
-	inline bool operator==(const NetworkInterface& rh ){
+	NetworkInterface& operator=(const NetworkInterface& rh){
+		name 		= rh.name;
+		index 		= rh.index;
+		isRunning 	= rh.isRunning;
+		isUp 		= rh.isUp;
+		isLoopback 	= rh.isLoopback;
+		isBroadcast	= rh.isBroadcast;
+		isMulticast	= rh.isMulticast;
+		mtu 		= rh.mtu;
+		txQueueLen	= rh.txQueueLen;
+		return *this;
+	}
+
+	bool operator==(const NetworkInterface& rh ){
 		// equality means same name
 		return ( name.compare(rh.name) == 0 );
