Changeset 5406 for source/ariba/communication/networkinfo
- Timestamp:
- Jul 29, 2009, 10:25:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/networkinfo/AddressDiscovery.hpp
r5284 r5406 6 6 #include <sys/types.h> 7 7 #include <sys/socket.h> 8 #include <sys/ioctl.h> 9 #include <sys/socket.h> 10 8 11 #include <arpa/inet.h> 12 9 13 #include <netinet/in.h> 14 10 15 #include <net/if.h> 16 11 17 #include <ifaddrs.h> 18 19 #include <bluetooth/bluetooth.h> 20 #include <bluetooth/hci.h> 21 #include <bluetooth/hci_lib.h> 12 22 13 23 using namespace ariba::addressing; … … 26 36 } 27 37 28 void discoverEndpoints( endpoint_set& endpoints ) { 38 39 int dev_info(int s, int dev_id, long arg) { 40 endpoint_set* set = (endpoint_set*)arg; 41 struct hci_dev_info di; 42 di.dev_id = dev_id; 43 if (ioctl(s, HCIGETDEVINFO, (void *) &di)) return 0; 44 mac_address mac; 45 mac.bluetooth( di.bdaddr ); 46 address_vf vf = mac; 47 set->add(vf); 48 return 0; 49 } 50 51 void discover_bluetooth( endpoint_set& endpoints ) { 52 hci_for_each_dev(HCI_UP, &dev_info, (long)&endpoints ); 53 } 54 55 void discover_ip_addresses( endpoint_set& endpoints ) { 29 56 struct ifaddrs* ifaceBuffer = NULL; 30 57 struct ifaddrs* tmpAddr = NULL; … … 63 90 mac_address mac = getMacFromIF(i->ifa_name); 64 91 address_vf vf = mac; 65 endpoints.add( vf );92 // endpoints.add( vf ); 66 93 } 67 94 } 68 95 } 69 96 97 void discover_endpoints( endpoint_set& endpoints ) { 98 discover_ip_addresses( endpoints ); 99 discover_bluetooth( endpoints ); 100 } 101 70 102 #endif /* ADDRESSDISCOVERY_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.