iFun Engine API  1.0.0-b5388
Great Technology for Great Games
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
fun::HardwareInfo Class Reference

Class to access hardware information.

#include <hardware_info.h>

Inheritance diagram for fun::HardwareInfo:

Classes

struct  NicInfo
 Datastructure to hold IP-capable Network Interface Card (NIC) information. More...
 

Public Types

enum  FunapiProtocol {
  kTcpPbuf = 0, kTcpJson, kUdpPbuf, kUdpJson,
  kHttpPbuf, kHttpJson, kWebSocketPbuf, kWebSocketJson
}
 
typedef std::map< string, const NicInfoNicInfoMap
 NIC name to NIC information mapping.
 
typedef std::map< FunapiProtocol, uint16_t > ProtocolPortMap
 

Public Member Functions

 DEPRECATED (static boost::asio::ip::address_v4 GetAwsPublicIpv4())
 Returns a public IP if the server is on AWS. More...
 

Static Public Member Functions

static const std::vector< NicInfo::AddressMaskPair > & GetAddressList (const std::string &nic_name)
 Returns the ALL IP address for a given NIC.
 
static std::string GetExternalHostname ()
 Returns an hostname or IP address for the server. More...
 
static boost::asio::ip::address GetExternalIp ()
 Returns an external IP the server is assigned. More...
 
static ProtocolPortMap GetExternalPorts ()
 Returns <protocol, port> tuples. More...
 
static const NicInfoMapGetNicInfo ()
 Returns available NICs. More...
 

Member Function Documentation

◆ DEPRECATED()

fun::HardwareInfo::DEPRECATED ( static boost::asio::ip::address_v4   GetAwsPublicIpv4())

IP is obtained from http://169.254.169.254/latest/meta-data/public-ipv4 gflag "--discover_public_ip_from_aws_instance" must be on.

◆ GetExternalHostname()

static std::string fun::HardwareInfo::GetExternalHostname ( )
static

The hostname is obatined from the external_ip_resolvers" in MANIFEST.json

◆ GetExternalIp()

static boost::asio::ip::address fun::HardwareInfo::GetExternalIp ( )
static

The public IP is obtained from the "external_ip_resolvers" in MANIFEST.json or through gflag.

◆ GetExternalPorts()

static ProtocolPortMap fun::HardwareInfo::GetExternalPorts ( )
static
Returns
ProtocolPortMap instance.

◆ GetNicInfo()

static const NicInfoMap& fun::HardwareInfo::GetNicInfo ( )
static
Returns
NicInfoMap