Encapsulates an Internet host IPv6 address and its names.
More...
#include <rw/network/RWInet6Host.h>
|
(Note that these are not member symbols.)
|
std::ostream & | operator<< (std::ostream &strm, const RWInet6Host &host) |
|
Encapsulates an Internet host IPv6 address and its names. You can construct an RWInet6Host from either an IPv6 address or a symbolic name.
◆ NameLookup
Attributes to change name lookup behavior.
Enumerator |
---|
numeric | If the host address is already known, a lookup will not be used to discover the host name. The colon-hexadecimal form of the host address will be used as the host name.
|
◆ RWInet6Host() [1/4]
RWInet6Host::RWInet6Host |
( |
void | | ) |
|
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.
◆ RWInet6Host() [2/4]
RWInet6Host::RWInet6Host |
( |
struct in6_addr | IPAddress | ) |
|
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.
◆ RWInet6Host() [3/4]
RWInet6Host::RWInet6Host |
( |
const RWCString & | hostname | ) |
|
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.
◆ RWInet6Host() [4/4]
RWInet6Host::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.
◆ addressAsString()
static RWCString RWInet6Host::addressAsString |
( |
struct in6_addr | IPAddress | ) |
|
|
static |
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.
◆ getAddress()
struct in6_addr RWInet6Host::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.
◆ getAddresses()
RWTValVector< struct in6_addr > RWInet6Host::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.
◆ getAliases()
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.
- Note
- This method is provided only for compatibility with RWInetHost, and will return an empty collection.
◆ getName()
Returns the official name for this host entry. This call may block if prepare() has not been called.
◆ id()
RWCString RWInet6Host::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.
Depending on the level and input provided, the output may contain the host name or IP address, and known aliases for that name and aliased IP addresses.
Grammar Definitions
ip-address ::= <ip address in colon hexadecimal notation>
ip-address-list ::= ip-address ("," ip-address)*
hostname ::= <domain name>
host ::= hostname | ip-address
alias-list ::= "(" hostname ("," hostname)* ")"
level | Calls prepare() | Output Grammar | Sample Output for id(level) given RWInet6Host("localhost") |
0 | | host | localhost |
1 | | host | localhost |
2 | | host | localhost |
3 | X | host | localhost |
4 | X | host "(" ip-address ")" | localhost(::1) |
5 | X | host "(" ip-address ")" | localhost(::1) |
6 | X | host | localhost |
7 | X | host "(" ip-address ")" | localhost(::1) |
8 | X | host "(" ip-address ")" | localhost(::1) |
9 | X | host (alias-list)? "(" ip-address-list ")" | localhost(::1) |
◆ me()
Returns the host object for the host on which this program is currently running.
◆ operator!=()
bool RWInet6Host::operator!= |
( |
const RWInet6Host & | rhs | ) |
const |
Return true or false to indicate whether two hosts objects are equal or not.
◆ operator==()
bool RWInet6Host::operator== |
( |
const RWInet6Host & | rhs | ) |
const |
Return true or false to indicate whether two hosts objects are equal or not.
◆ prepare() [1/2]
void RWInet6Host::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().
◆ prepare() [2/2]
void RWInet6Host::prepare |
( |
NameLookup | lookup | ) |
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().
◆ operator<<()
std::ostream & operator<< |
( |
std::ostream & | strm, |
|
|
const RWInet6Host & | host ) |
|
related |
Outputs a representation of host on strm. The representation is generated using the member function host.id()
with level=0
.