B2BITS FIX Antenna C++  2.31.0
Public Member Functions | Static Public Member Functions | List of all members
System::InetAddress Class Reference

This class represents an Internet Protocol (IP) address. More...

#include <B2BITS_InetAddress.h>

Public Member Functions

struct in_addr getAddress (void) const
 Returns a low level system usable struct in_addr object. More...
 
std::string getHostAddress () const
 Returns the IP address std::string "%d.%d.%d.%d". More...
 
std::string getHostName () const
 Gets the host name for this IP address. More...
 
 InetAddress ()
 
 InetAddress (struct in_addr aAddr)
 
bool operator!= (const InetAddress &aRhs) const
 
bool operator== (const InetAddress &aRhs) const
 
IPAddr toIPAddr () const
 Converts internal storage to IPAddr. More...
 

Static Public Member Functions

static InetAddress Any ()
 Returns IP address for INADDR_ANY. More...
 
static void cleanup ()
 Cleanups resources. More...
 
static InetAddress getByName (const std::string &aHost)
 Determines the IP address of a host, given the host's name. More...
 
static InetAddress getByName (char const *aHost)
 Determines the IP address of a host, given the host's name. More...
 
static void getByName (const std::string &aHost, std::vector< InetAddress > *dest)
 Determines the IP address of a host, given the host's name. More...
 
static void getByName (char const *aHost, std::vector< InetAddress > *dest)
 Determines the IP address of a host, given the host's name. More...
 
static InetAddress getLocalHost ()
 Returns the local host. More...
 
static void getLocalHost (std::vector< InetAddress > *dest)
 Returns the local host. More...
 
static void init (bool enableDnsEntrySpoofingDetection=false)
 Inits all methods. More...
 
static bool isDnsEntrySpoofingDetectionEnabled () throw ()
 
static bool isLocalAddress (in_addr const &addr)
 Returns true if passed address is local IP address. More...
 
static bool isLocalAddress (InetAddress const &addr)
 Returns true if passed address is local IP address. More...
 
static bool validateIpAddress (const std::string &ipAddress)
 
static bool validateIpPort (int port)
 

Detailed Description

This class represents an Internet Protocol (IP) address.

Constructor & Destructor Documentation

◆ InetAddress() [1/2]

System::InetAddress::InetAddress ( )

◆ InetAddress() [2/2]

System::InetAddress::InetAddress ( struct in_addr  aAddr)
inline

Member Function Documentation

◆ Any()

static InetAddress System::InetAddress::Any ( )
static

Returns IP address for INADDR_ANY.

◆ cleanup()

static void System::InetAddress::cleanup ( )
static

Cleanups resources.

◆ getAddress()

struct in_addr System::InetAddress::getAddress ( void  ) const
inline

Returns a low level system usable struct in_addr object.

Referenced by isLocalAddress().

◆ getByName() [1/4]

static InetAddress System::InetAddress::getByName ( const std::string &  aHost)
inlinestatic

Determines the IP address of a host, given the host's name.

The host name can either be a machine name, such as "www.yahoo.com", or a string representing its IP address, such as "192.168.0.100".

Exceptions
SystemException

◆ getByName() [2/4]

static InetAddress System::InetAddress::getByName ( char const *  aHost)
static

Determines the IP address of a host, given the host's name.

The host name can either be a machine name, such as "www.yahoo.com", or a string representing its IP address, such as "192.168.0.100".

Exceptions
SystemException

◆ getByName() [3/4]

static void System::InetAddress::getByName ( const std::string &  aHost,
std::vector< InetAddress > *  dest 
)
inlinestatic

Determines the IP address of a host, given the host's name.

The host name can either be a machine name, such as "www.yahoo.com", or a string representing its IP address, such as "192.168.0.100".

Exceptions
SystemException

◆ getByName() [4/4]

static void System::InetAddress::getByName ( char const *  aHost,
std::vector< InetAddress > *  dest 
)
static

Determines the IP address of a host, given the host's name.

The host name can either be a machine name, such as "www.yahoo.com", or a std::string representing its IP address, such as "192.168.0.100".

Exceptions
SystemException

◆ getHostAddress()

std::string System::InetAddress::getHostAddress ( ) const

Returns the IP address std::string "%d.%d.%d.%d".

◆ getHostName()

std::string System::InetAddress::getHostName ( ) const

Gets the host name for this IP address.

Exceptions
SystemException

◆ getLocalHost() [1/2]

static InetAddress System::InetAddress::getLocalHost ( )
static

Returns the local host.

Exceptions
SystemException

◆ getLocalHost() [2/2]

static void System::InetAddress::getLocalHost ( std::vector< InetAddress > *  dest)
static

Returns the local host.

Exceptions
SystemException

◆ init()

static void System::InetAddress::init ( bool  enableDnsEntrySpoofingDetection = false)
static

Inits all methods.

Must be the first InetAddress method called by an application.

Exceptions
SystemException

◆ isDnsEntrySpoofingDetectionEnabled()

static bool System::InetAddress::isDnsEntrySpoofingDetectionEnabled ( )
throw (
)
inlinestatic

◆ isLocalAddress() [1/2]

static bool System::InetAddress::isLocalAddress ( in_addr const &  addr)
static

Returns true if passed address is local IP address.

◆ isLocalAddress() [2/2]

static bool System::InetAddress::isLocalAddress ( InetAddress const &  addr)
inlinestatic

Returns true if passed address is local IP address.

References getAddress().

◆ operator!=()

bool System::InetAddress::operator!= ( const InetAddress aRhs) const

◆ operator==()

bool System::InetAddress::operator== ( const InetAddress aRhs) const

◆ toIPAddr()

IPAddr System::InetAddress::toIPAddr ( ) const

Converts internal storage to IPAddr.

◆ validateIpAddress()

static bool System::InetAddress::validateIpAddress ( const std::string &  ipAddress)
static

◆ validateIpPort()

static bool System::InetAddress::validateIpPort ( int  port)
static