Changeset 5406 for source/ariba/communication
- Timestamp:
- Jul 29, 2009, 10:25:32 AM (15 years ago)
- Location:
- source/ariba/communication
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/BaseCommunication.cpp
r5284 r5406 84 84 85 85 logging_info( "Searching for local locators ..." ); 86 discover Endpoints(localDescriptor.getEndpoints());86 discover_endpoints(localDescriptor.getEndpoints()); 87 87 logging_info( "Done. Local endpoints = " << localDescriptor.toString() ); 88 88 -
source/ariba/communication/EndpointDescriptor.h
r5284 r5406 111 111 bool operator==(const EndpointDescriptor& rh) const { 112 112 if (rh.isUnspecified() && isUnspecified()) return true; 113 return false;113 return endpoints == rh.endpoints; 114 114 } 115 115 116 116 bool operator!=(const EndpointDescriptor& rh) const { 117 117 if (!rh.isUnspecified() && !isUnspecified()) return true; 118 return false;118 return endpoints != rh.endpoints; 119 119 } 120 120 -
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.