activemq-cpp-3.4.0
|
Represents an IP address. More...
#include <src/main/decaf/net/InetAddress.h>
Public Member Functions | |
virtual | ~InetAddress () |
virtual decaf::lang::ArrayPointer < unsigned char > | getAddress () const |
Returns the Raw IP address in Network byte order. | |
virtual std::string | getHostAddress () const |
Returns a textual representation of the IP Address. | |
virtual std::string | getHostName () const |
Get the host name associated with this InetAddress instance. | |
virtual std::string | toString () const |
Returns a string representation of the InetAddress in the form 'hostname / ipaddress'. | |
virtual InetAddress * | clone () const |
Returns a newly allocated copy of this InetAddress. | |
virtual bool | isAnyLocalAddress () const |
Check if this InetAddress is a valid wildcard address. | |
virtual bool | isLoopbackAddress () const |
Check if this InetAddress is a valid loopback address. | |
virtual bool | isMulticastAddress () const |
Check if this InetAddress is a valid Multicast address. | |
virtual bool | isLinkLocalAddress () const |
Check if this InetAddress is a valid link local address. | |
virtual bool | isSiteLocalAddress () const |
Check if this InetAddress is a valid site local address. | |
virtual bool | isMCGlobal () const |
Check if this InetAddress is Multicast and has Global scope. | |
virtual bool | isMCNodeLocal () const |
Check if this InetAddress is Multicast and has Node Local scope. | |
virtual bool | isMCLinkLocal () const |
Check if this InetAddress is Multicast and has Link Local scope. | |
virtual bool | isMCSiteLocal () const |
Check if this InetAddress is Multicast and has Site Local scope. | |
virtual bool | isMCOrgLocal () const |
Check if this InetAddress is Multicast and has Organization scope. | |
Static Public Member Functions | |
static InetAddress | getByAddress (const unsigned char *bytes, int numBytes) |
Given a raw IP Address in byte array form, create and return a new InetAddress instance. | |
static InetAddress | getByAddress (const std::string &hostname, const unsigned char *bytes, int numBytes) |
Given a host name and IPAddress return a new InetAddress. | |
static InetAddress | getLocalHost () |
Gets an InetAddress that is the local host address. | |
Protected Member Functions | |
InetAddress () | |
InetAddress (const unsigned char *ipAddress, int numBytes) | |
InetAddress (const std::string &hostname, const unsigned char *ipAddress, int numBytes) | |
Static Protected Member Functions | |
static unsigned int | bytesToInt (const unsigned char *bytes, int start) |
Converts the bytes in an address array to an int starting from the value start treating the start value as the high order byte. | |
static InetAddress | getAnyAddress () |
static InetAddress | getLoopbackAddress () |
Protected Attributes | |
std::string | hostname |
bool | reached |
decaf::lang::ArrayPointer < unsigned char > | addressBytes |
Static Protected Attributes | |
static const unsigned char | loopbackBytes [4] |
static const unsigned char | anyBytes [4] |
Represents an IP address.
decaf::net::InetAddress::InetAddress | ( | ) | [protected] |
decaf::net::InetAddress::InetAddress | ( | const unsigned char * | ipAddress, |
int | numBytes | ||
) | [protected] |
decaf::net::InetAddress::InetAddress | ( | const std::string & | hostname, |
const unsigned char * | ipAddress, | ||
int | numBytes | ||
) | [protected] |
virtual decaf::net::InetAddress::~InetAddress | ( | ) | [virtual] |
static unsigned int decaf::net::InetAddress::bytesToInt | ( | const unsigned char * | bytes, |
int | start | ||
) | [static, protected] |
Converts the bytes in an address array to an int starting from the value start treating the start value as the high order byte.
bytes | The array of bytes to convert to an int. |
start | The index in the array to treat as the high order byte. |
virtual InetAddress* decaf::net::InetAddress::clone | ( | ) | const [virtual] |
Returns a newly allocated copy of this InetAddress.
The caller owns the resulting copy and must delete it.
Reimplemented in decaf::net::Inet4Address, and decaf::net::Inet6Address.
virtual decaf::lang::ArrayPointer<unsigned char> decaf::net::InetAddress::getAddress | ( | ) | const [virtual] |
Returns the Raw IP address in Network byte order.
The returned address is a copy of the bytes contained in this InetAddress.
static InetAddress decaf::net::InetAddress::getAnyAddress | ( | ) | [static, protected] |
static InetAddress decaf::net::InetAddress::getByAddress | ( | const std::string & | hostname, |
const unsigned char * | bytes, | ||
int | numBytes | ||
) | [static] |
Given a host name and IPAddress return a new InetAddress.
There is no name service checking or address validation done on the provided host name. The host name can either be machine name or the text based representation of the IP Address.
An IPV4 address must be only four bytes in length and an IPV6 address must be 16 bytes in length.
UnknownHostException | if the address array length is invalid. |
static InetAddress decaf::net::InetAddress::getByAddress | ( | const unsigned char * | bytes, |
int | numBytes | ||
) | [static] |
Given a raw IP Address in byte array form, create and return a new InetAddress instance.
An IPV4 address must be only four bytes in length and an IPV6 address must be 16 bytes in length.
UnknownHostException | if the address array length is invalid. |
virtual std::string decaf::net::InetAddress::getHostAddress | ( | ) | const [virtual] |
Returns a textual representation of the IP Address.
virtual std::string decaf::net::InetAddress::getHostName | ( | ) | const [virtual] |
Get the host name associated with this InetAddress instance.
If a host name was set upon construction then that value is returned, otherwise a reverse name lookup with be performed to attempt to get the host name associated with the set IP Address. If the host name cannot be resolved the textual representation of the IP Address is returned instead.
static InetAddress decaf::net::InetAddress::getLocalHost | ( | ) | [static] |
Gets an InetAddress that is the local host address.
If the localhost value cannot be resolved than the InetAddress for Loopback is returned.
UnknownHostException | if the address for local host is not found. |
static InetAddress decaf::net::InetAddress::getLoopbackAddress | ( | ) | [static, protected] |
virtual bool decaf::net::InetAddress::isAnyLocalAddress | ( | ) | const [inline, virtual] |
Check if this InetAddress is a valid wildcard address.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isLinkLocalAddress | ( | ) | const [inline, virtual] |
Check if this InetAddress is a valid link local address.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isLoopbackAddress | ( | ) | const [inline, virtual] |
Check if this InetAddress is a valid loopback address.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMCGlobal | ( | ) | const [inline, virtual] |
Check if this InetAddress is Multicast and has Global scope.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMCLinkLocal | ( | ) | const [inline, virtual] |
Check if this InetAddress is Multicast and has Link Local scope.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMCNodeLocal | ( | ) | const [inline, virtual] |
Check if this InetAddress is Multicast and has Node Local scope.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMCOrgLocal | ( | ) | const [inline, virtual] |
Check if this InetAddress is Multicast and has Organization scope.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMCSiteLocal | ( | ) | const [inline, virtual] |
Check if this InetAddress is Multicast and has Site Local scope.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isMulticastAddress | ( | ) | const [inline, virtual] |
Check if this InetAddress is a valid Multicast address.
Reimplemented in decaf::net::Inet4Address.
virtual bool decaf::net::InetAddress::isSiteLocalAddress | ( | ) | const [inline, virtual] |
Check if this InetAddress is a valid site local address.
Reimplemented in decaf::net::Inet4Address.
virtual std::string decaf::net::InetAddress::toString | ( | ) | const [virtual] |
Returns a string representation of the InetAddress in the form 'hostname / ipaddress'.
If the hostname is not resolved than it appears as empty.
decaf::lang::ArrayPointer<unsigned char> decaf::net::InetAddress::addressBytes [mutable, protected] |
const unsigned char decaf::net::InetAddress::anyBytes[4] [static, protected] |
std::string decaf::net::InetAddress::hostname [mutable, protected] |
const unsigned char decaf::net::InetAddress::loopbackBytes[4] [static, protected] |
bool decaf::net::InetAddress::reached [mutable, protected] |