Module: Essential Networking Module Package: Networking
Does not inherit
addressAsString() getAddress() getAddresses() |
getAliases() getName() id() |
me() NameLookup operator |
operator==() prepare() RWInet6Host() |
#include <rw/network/RWInet6Host.h>
Encapsulates an Internet host IPv6 address and its names. You can construct an RWInet6Host from either an IPv6 address or a symbolic name.
RWInet6Host(void); RWInet6Host(struct in6_addr IPAddress); RWInet6Host(const RWCString& hostname); RWInet6Host(const char *);
An Internet host can be specified as an actual address or through a string. The string can be either the symbolic name of the host or an IPv6 hex address. The default constructor creates a special host that represents an unspecified IPv6 address on the current machine. This is useful when constructing servers.
enum
NameLookup {numeric};
bool operator==(const RWInet6Host& rhs) const; bool operator!=(const RWInet6Host& rhs) const;
Comparison operators.
struct in6_addr getAddress() const;
Returns the primary IPv6 address for this host entry as an in6_addr. If you want to print out an IPv6 address, use the addressAsString() static member function.
RWTValVector<struct in6_addr> getAddresses() const;
Returns a list of addresses for this host entry as in6_addr structs. If you want to print out an IPv6 address, use the addressAsString() static member function. The primary address is the first entry in the getAddresses() array. This call may block if prepare() has not been called.
RWTValVector<RWCString> getAliases() const;
Returns the list of aliases for this host entry. The official name is not included in the list of aliases. This call may block if prepare() has not been called.
RWCString getName() const;
Returns the official name for this host entry. This call may block if prepare() has not been called.
RWCString id(unsigned level=0) const;
Returns a string describing self. The verbosity of the output is controlled by level, where level=0 is the most basic output, and level=9 is the most verbose.
void prepare() const;
Ensures that no future operations block. The prepare() function calls the host database routines to gather information about this host. It is not necessary to explicitly call prepare() because it is called by other member functions if needed. No exceptions are thrown by prepare().
void prepare (NameLookup lookup) const;
Ensures that no future operations block. If lookup is RWInet6Host::numeric, a lookup will not occur in order to discover the name of the host, and the dotted decimal form of the address will be used for the name.
static RWCString addressAsString(struct in6_addr IPAddress);
Takes an address as an in6_addr and returns the IPv6 hex address string representation of the address. To go from an IPv6 hex address string to an address, build an RWInet6Host object from the IPv6 hex address string.
static RWInet6Host me();
Returns the host object for the host on which this program is currently running.
ostream& operator<<(ostream& strm, const RWInet6Host& host);
Outputs a representation of host on strm. The representation is generated using the member function host.id() with level=2.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.