#include <INET_Addr.h>
Inheritance diagram for ACE_INET_Addr
Public Methods | |
ACE_INET_Addr (void) | |
Default constructor. | |
ACE_INET_Addr (const ACE_INET_Addr &) | |
Copy constructor. | |
ACE_INET_Addr (const sockaddr_in *, int len) | |
Creates an from a sockaddr_in structure. | |
ACE_INET_Addr (u_short port_number, const char host_name[]) | |
Creates an from a <port_number> and the remote <host_name>. The port number is assumed to be in host byte order. To set a port already in network byte order, please
| |
ACE_EXPLICIT | ACE_INET_Addr (const char address[]) |
ACE_INET_Addr (u_short port_number, ACE_UINT32 ip_addr = INADDR_ANY) | |
ACE_INET_Addr (const char port_name[], const char host_name[], const char protocol[] = "tcp") | |
Uses <getservbyname> to create an from a <port_name>, the remote <host_name>, and the <protocol>. | |
ACE_INET_Addr (const char port_name[], ACE_UINT32 ip_addr, const char protocol[] = "tcp") | |
ACE_INET_Addr (u_short port_number, const wchar_t host_name[]) | |
ACE_EXPLICIT | ACE_INET_Addr (const wchar_t address[]) |
ACE_INET_Addr (const wchar_t port_name[], const wchar_t host_name[], const wchar_t protocol[] = ACE_TEXT_WIDE ("tcp")) | |
ACE_INET_Addr (const wchar_t port_name[], ACE_UINT32 ip_addr, const wchar_t protocol[] = ACE_TEXT_WIDE ("tcp")) | |
~ACE_INET_Addr (void) | |
Default dtor. | |
int | set (const ACE_INET_Addr &) |
Initializes from another . | |
int | set (u_short port_number, const char host_name[], int encode = 1) |
int | set (u_short port_number, ACE_UINT32 ip_addr = INADDR_ANY, int encode = 1) |
int | set (const char port_name[], const char host_name[], const char protocol[] = "tcp") |
Uses <getservbyname> to initialize an from a <port_name>, the remote <host_name>, and the <protocol>. | |
int | set (const char port_name[], ACE_UINT32 ip_addr, const char protocol[] = "tcp") |
int | set (const char addr[]) |
int | set (const sockaddr_in *, int len) |
Creates an from a sockaddr_in structure. | |
int | set (u_short port_number, const wchar_t host_name[], int encode = 1) |
int | set (const wchar_t port_name[], const wchar_t host_name[], const wchar_t protocol[] = ACE_TEXT_WIDE ("tcp")) |
int | set (const wchar_t port_name[], ACE_UINT32 ip_addr, const wchar_t protocol[] = ACE_TEXT_WIDE ("tcp")) |
int | set (const wchar_t addr[]) |
virtual void* | get_addr (void) const |
Return a pointer to the underlying network address. | |
virtual void | set_addr (void *, int len) |
Set a pointer to the address. | |
virtual int | addr_to_string (ACE_TCHAR buffer[], size_t size, int ipaddr_format = 1) const |
virtual int | string_to_addr (const char address[]) |
void | set_port_number (u_short, int encode = 1) |
u_short | get_port_number (void) const |
Return the port number, converting it into host byte-order. | |
int | get_host_name (char hostname[], size_t hostnamelen) const |
int | get_host_name (wchar_t hostname[], size_t hostnamelen) const |
const char* | get_host_name (void) const |
const char* | get_host_addr (void) const |
Return the "dotted decimal" Internet address. | |
ACE_UINT32 | get_ip_address (void) const |
Return the 4-byte IP address, converting it into host byte order. | |
int | operator< (const ACE_INET_Addr &rhs) const |
int | operator== (const ACE_INET_Addr &SAP) const |
Compare two addresses for equality. The addresses are considered equal if they contain the same IP address and port number. | |
int | operator!= (const ACE_INET_Addr &SAP) const |
Compare two addresses for inequality. | |
virtual u_long | hash (void) const |
Computes and returns hash value. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Methods | |
int | get_host_name_i (char hostname[], size_t hostnamelen) const |
Insure that
| |
Private Attributes | |
sockaddr_in | inet_addr_ |
Underlying representation. |
|
Default constructor.
|
|
Copy constructor.
|
|
Creates an from a sockaddr_in structure.
|
|
Creates an from a <port_number> and the remote <host_name>. The port number is assumed to be in host byte order. To set a port already in network byte order, please
|
|
Initializes an from the , which can be "ip-number:port-number" (e.g., "tango.cs.wustl.edu:1234" or "128.252.166.57:1234"). If there is no ':' in the it is assumed to be a port number, with the IP address being INADDR_ANY. |
|
Creates an from a <port_number> and an Internet <ip_addr>. This method assumes that <port_number> and <ip_addr> are in host byte order. If you have addressing information in network byte order,
|
|
Uses <getservbyname> to create an from a <port_name>, the remote <host_name>, and the <protocol>.
|
|
Uses <getservbyname> to create an from a <port_name>, an Internet <ip_addr>, and the <protocol>. This method assumes that <ip_addr> is in host byte order. |
|
|
|
|
|
|
|
|
|
Default dtor.
|
|
Transform the current address into string format. If <ipaddr_format> is non-0 this produces "ip-number:port-number" (e.g., "128.252.166.57:1234"), whereas if <ipaddr_format> is 0 this produces "ip-name:port-number" (e.g., "tango.cs.wustl.edu:1234"). Returns -1 if the <size> of the <buffer> is too small, else 0. |
|
Dump the state of an object.
Reimplemented from ACE_Addr. |
|
Return a pointer to the underlying network address.
Reimplemented from ACE_Addr. |
|
Return the "dotted decimal" Internet address.
|
|
Return the character representation of the hostname (this version is non-reentrant since it returns a pointer to a static data area). |
|
|
|
Return the character representation of the name of the host, storing it in the <hostname> (which is assumed to be <hostnamelen> bytes long). This version is reentrant. If <hostnamelen> is greater than 0 then <hostname> will be NUL-terminated even if -1 is returned. |
|
Insure that
|
|
Return the 4-byte IP address, converting it into host byte order.
|
|
Return the port number, converting it into host byte-order.
|
|
Computes and returns hash value.
Reimplemented from ACE_Addr. |
|
Compare two addresses for inequality.
|
|
Returns true if <this> is less than <rhs>. In this context, "less than" is defined in terms of IP address and TCP port number. This operator makes it possible to use s in STL maps. |
|
Compare two addresses for equality. The addresses are considered equal if they contain the same IP address and port number.
|
|
|
|
|
|
|
|
|
|
Creates an from a sockaddr_in structure.
|
|
Initializes an from the , which can be "ip-number:port-number" (e.g., "tango.cs.wustl.edu:1234" or "128.252.166.57:1234"). If there is no ':' in the it is assumed to be a port number, with the IP address being INADDR_ANY. |
|
Uses <getservbyname> to initialize an from a <port_name>, an <ip_addr>, and the <protocol>. This assumes that <ip_addr> is already in network byte order. |
|
Uses <getservbyname> to initialize an from a <port_name>, the remote <host_name>, and the <protocol>.
|
|
Initializes an from a
|
|
Initializes an from a <port_number> and the remote <host_name>. If <encode> is non-zero then <port_number> is converted into network byte order, otherwise it is assumed to be in network byte order already and are passed straight through. |
|
Initializes from another .
|
|
Set a pointer to the address.
Reimplemented from ACE_Addr. |
|
Sets the port number without affecting the host name. If <encode> is enabled then <port_number> is converted into network byte order, otherwise it is assumed to be in network byte order already and are passed straight through. |
|
Initializes an from the , which can be "ip-addr:port-number" (e.g., "tango.cs.wustl.edu:1234"), "ip-addr:port-name" (e.g., "tango.cs.wustl.edu:telnet"), "ip-number:port-number" (e.g., "128.252.166.57:1234"), or "ip-number:port-name" (e.g., "128.252.166.57:telnet"). If there is no ':' in the it is assumed to be a port number, with the IP address being INADDR_ANY. |
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Addr. |
|
Underlying representation.
|