coral
A C++ library for distributed co-simulation
Classes | Functions
coral::net::ip Namespace Reference

Functions and classes used for communication over the Internet Protocol. More...

Classes

class  Address
 An object which identifies an internet host or network interface as either an IPv4 address or a textual name. More...
 
class  Endpoint
 An object which identifies an endpoint for Internet communication as a combination of an address and a port number. More...
 
struct  NetworkInterfaceInfo
 Information about a network interface. More...
 
class  Port
 An object which represents an internet port number. More...
 

Functions

bool operator== (const Address &a1, const Address &a2)
 Equality operator for coral::net::ip::Address. More...
 
bool operator!= (const Address &a1, const Address &a2)
 Inequality operator for coral::net::ip::Address. More...
 
std::vector< NetworkInterfaceInfoGetNetworkInterfaces ()
 Returns information about available network interfaces. More...
 
std::string IPAddressToString (in_addr address)
 Converts an IP address to a string in dotted-decimal format.
 
in_addr StringToIPAddress (const std::string &address)
 Converts an IP address in dotted-decimal string format to an in_addr.
 

Detailed Description

Functions and classes used for communication over the Internet Protocol.

Function Documentation

std::vector<NetworkInterfaceInfo> coral::net::ip::GetNetworkInterfaces ( )

Returns information about available network interfaces.

Note
On Windows, the loopback interface (typically 127.0.0.1) does not have a name, so the NetworkInterfaceInfo::name field will be empty.
Exceptions
std::runtime_erroron failure.
bool coral::net::ip::operator!= ( const Address a1,
const Address a2 
)
inline

Inequality operator for coral::net::ip::Address.

This is defined as the negation of operator==(const Address&, const Address&).

bool coral::net::ip::operator== ( const Address a1,
const Address a2 
)

Equality operator for coral::net::ip::Address.

This returns true if and only if the addresses themselves match. No host name resolution or interface lookup is performed.