iFun Engine API  1.0.0-b3630
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
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
}
 
typedef std::map< string,
const NicInfo
NicInfoMap
 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 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

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.

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

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

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.

static ProtocolPortMap fun::HardwareInfo::GetExternalPorts ( )
static
Returns
ProtocolPortMap instance.
static const NicInfoMap& fun::HardwareInfo::GetNicInfo ( )
static
Returns
NicInfoMap