9 #ifndef INCLUDE_FUNAPI_SYSTEM_HARDWARE_INFO_H_ 10 #define INCLUDE_FUNAPI_SYSTEM_HARDWARE_INFO_H_ 12 #include <boost/array.hpp> 13 #include <boost/asio.hpp> 14 #include <boost/noncopyable.hpp> 25 class FUNAPI_DLL_VISIBILITY
HardwareInfo :
private boost::noncopyable {
32 boost::array<uint8_t, 6> hw_address_;
36 typedef std::pair<boost::asio::ip::address ,
38 std::vector<AddressMaskPair> addresses_;
56 typedef std::map<FunapiProtocol, uint16_t> ProtocolPortMap;
60 static const NicInfoMap &GetNicInfo();
65 static boost::asio::ip::address GetExternalIp();
69 static std::string GetExternalHostname();
73 static ProtocolPortMap GetExternalPorts();
78 DEPRECATED(
static boost::asio::ip::address_v4 GetAwsPublicIpv4());
81 static const std::vector<NicInfo::AddressMaskPair> &
82 GetAddressList(
const std::string &nic_name);
86 FUNAPI_DLL_VISIBILITY
bool ResolveIpFromHostname(
87 const std::string &hostname, boost::asio::ip::address *addr);
91 #endif // INCLUDE_FUNAPI_SYSTEM_HARDWARE_INFO_H_
boost::asio::ip::address netmask_
Netmask applying to the NIC.
Definition: hardware_info.h:31
std::map< string, const NicInfo > NicInfoMap
NIC name to NIC information mapping.
Definition: hardware_info.h:53
Datastructure to hold IP-capable Network Interface Card (NIC) information.
Definition: hardware_info.h:28
std::pair< boost::asio::ip::address, boost::asio::ip::address > AddressMaskPair
NIC's hardware address.
Definition: hardware_info.h:37
string name_
NIC name.
Definition: hardware_info.h:29
boost::asio::ip::address address_
IP address associated with the NIC.
Definition: hardware_info.h:30
Class to access hardware information.
Definition: hardware_info.h:25