ACE  6.3.3
Public Member Functions | Private Attributes | List of all members
ACE_Multihomed_INET_Addr Class Reference

Extends ACE_INET_Addr with support for multi-homed addresses. More...

#include <Multihomed_INET_Addr.h>

Inheritance diagram for ACE_Multihomed_INET_Addr:
Inheritance graph
[legend]
Collaboration diagram for ACE_Multihomed_INET_Addr:
Collaboration graph
[legend]

Public Member Functions

 ACE_Multihomed_INET_Addr (void)
 Default constructor. More...
 
 ACE_Multihomed_INET_Addr (const char address[])
 
 ACE_Multihomed_INET_Addr (u_short port_number, const char primary_host_name[], int encode=1, int address_family=AF_UNSPEC, const char *(secondary_host_names[])=0, size_t size=0)
 
 ACE_Multihomed_INET_Addr (u_short port_number, ACE_UINT32 primary_ip_addr=INADDR_ANY, int encode=1, const ACE_UINT32 *secondary_ip_addrs=0, size_t size=0)
 
 ACE_Multihomed_INET_Addr (u_short port_number, const wchar_t primary_host_name[], int encode=1, int address_family=AF_UNSPEC, const wchar_t *(secondary_host_names[])=0, size_t size=0)
 
int set (u_short port_number, const wchar_t primary_host_name[], int encode=1, int address_family=AF_UNSPEC, const wchar_t *(secondary_host_names[])=0, size_t size=0)
 
 ~ACE_Multihomed_INET_Addr (void)
 Use compiler-generated copy constructor. More...
 
int set (u_short port_number, const char primary_host_name[], int encode=1, int address_family=AF_UNSPEC, const char *(secondary_host_names[])=0, size_t size=0)
 
int set (u_short port_number, ACE_UINT32 primary_ip_addr=INADDR_ANY, int encode=1, const ACE_UINT32 *secondary_ip_addrs=0, size_t size=0)
 
void set_port_number (u_short port_number, int encode=1)
 
size_t get_num_secondary_addresses () const
 
int get_secondary_addresses (ACE_INET_Addr *secondary_addrs, size_t size) const
 
void get_addresses (sockaddr_in *addrs, size_t size) const
 
void get_addresses (sockaddr_in6 *addrs, size_t size) const
 IPV6 version of the above. More...
 
- Public Member Functions inherited from ACE_INET_Addr
 ACE_INET_Addr (void)
 Default constructor. More...
 
 ACE_INET_Addr (const ACE_INET_Addr &)
 Copy constructor. More...
 
 ACE_INET_Addr (const sockaddr_in *addr, int len)
 Creates an ACE_INET_Addr from a sockaddr_in structure. More...
 
 ACE_INET_Addr (u_short port_number, const char host_name[], int address_family=AF_UNSPEC)
 
 ACE_INET_Addr (const char address[], int address_family=AF_UNSPEC)
 
 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")
 
 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[], int address_family=AF_UNSPEC)
 
 ACE_INET_Addr (const wchar_t address[], int address_family=AF_UNSPEC)
 
 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. More...
 
ACE_INET_Addroperator= (const ACE_INET_Addr &rhs)
 
int set (const ACE_INET_Addr &)
 Initializes from another ACE_INET_Addr. More...
 
int set (u_short port_number, const char host_name[], int encode=1, int address_family=AF_UNSPEC)
 
int set (u_short port_number, ACE_UINT32 ip_addr=INADDR_ANY, int encode=1, int map=0)
 
int set (const char port_name[], const char host_name[], const char protocol[]="tcp")
 
int set (const char port_name[], ACE_UINT32 ip_addr, const char protocol[]="tcp")
 
int set (const char addr[], int address_family=AF_UNSPEC)
 
int set (const sockaddr_in *, int len)
 Creates an ACE_INET_Addr from a sockaddr_in structure. More...
 
int set (u_short port_number, const wchar_t host_name[], int encode=1, int address_family=AF_UNSPEC)
 
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[], int address_family=AF_UNSPEC)
 
virtual void * get_addr (void) const
 Return a pointer to the underlying network address. More...
 
int get_addr_size (void) const
 
virtual void set_addr (const void *, int len)
 Set a pointer to the address. More...
 
virtual void set_addr (const void *, int len, int map)
 Set a pointer to the address. More...
 
virtual int addr_to_string (ACE_TCHAR buffer[], size_t size, int ipaddr_format=1) const
 
virtual int string_to_addr (const char address[], int address_family=AF_UNSPEC)
 
void set_port_number (u_short, int encode=1)
 
int set_address (const char *ip_addr, int len, int encode=1, int map=0)
 
int set_interface (const char *intf_name)
 
u_short get_port_number (void) const
 Return the port number, converting it into host byte-order. More...
 
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 (char *addr, int addr_size) const
 
const char * get_host_addr (void) const
 
ACE_UINT32 get_ip_address (void) const
 
bool is_any (void) const
 Return true if the IP address is INADDR_ANY or IN6ADDR_ANY. More...
 
bool is_loopback (void) const
 Return true if the IP address is IPv4/IPv6 loopback address. More...
 
bool is_multicast (void) const
 Return true if the IP address is IPv4/IPv6 multicast address. More...
 
bool is_linklocal (void) const
 Return true if the IP address is IPv6 linklocal address. More...
 
bool is_ipv4_mapped_ipv6 (void) const
 Return true if the IP address is IPv4-mapped IPv6 address. More...
 
bool is_ipv4_compat_ipv6 (void) const
 Return true if the IP address is IPv4-compatible IPv6 address. More...
 
bool operator< (const ACE_INET_Addr &rhs) const
 
bool operator== (const ACE_INET_Addr &SAP) const
 
bool operator!= (const ACE_INET_Addr &SAP) const
 Compare two addresses for inequality. More...
 
bool is_ip_equal (const ACE_INET_Addr &SAP) const
 
virtual u_long hash (void) const
 Computes and returns hash value. More...
 
bool next (void)
 
void reset (void)
 Reset the set of address so they can be scanned again using next(). More...
 
void dump (void) const
 Dump the state of an object. More...
 
- Public Member Functions inherited from ACE_Addr
 ACE_Addr (int type=-1, int size=-1)
 Initializes instance variables. More...
 
virtual ~ACE_Addr (void)
 Destructor. More...
 
int get_size (void) const
 Return the size of the address. More...
 
void set_size (int size)
 Sets the size of the address. More...
 
int get_type (void) const
 Get the type of the address. More...
 
void set_type (int type)
 Set the type of the address. More...
 
bool operator== (const ACE_Addr &sap) const
 Check for address equality. More...
 
bool operator!= (const ACE_Addr &sap) const
 Check for address inequality. More...
 
void base_set (int type, int size)
 Initializes instance variables. More...
 
void dump (void) const
 Dump the state of an object. More...
 

Private Attributes

ACE_Array< ACE_INET_Addrsecondaries_
 

Additional Inherited Members

- Public Attributes inherited from ACE_INET_Addr
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Public Attributes inherited from ACE_Addr
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 
- Static Public Attributes inherited from ACE_Addr
static const ACE_Addr sap_any
 Wild-card address. More...
 
- Protected Attributes inherited from ACE_Addr
int addr_type_
 e.g., AF_UNIX, AF_INET, AF_SPIPE, etc. More...
 
int addr_size_
 Number of bytes in the address. More...
 

Detailed Description

Extends ACE_INET_Addr with support for multi-homed addresses.

Constructor & Destructor Documentation

ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr ( void  )

Default constructor.

ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr ( const char  address[])
explicit

Initializes an ACE_Multihomed_INET_Addr from the address, 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 address it is assumed to be a port number, with the IP address being INADDR_ANY.

ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr ( u_short  port_number,
const char  primary_host_name[],
int  encode = 1,
int  address_family = AF_UNSPEC,
const char *  secondary_host_names[] = 0,
size_t  size = 0 
)

Constructs an ACE_Multihomed_INET_Addr from a port_number, a primary_host_name, and an array of secondary_host_names. size is taken to be the length of the array. 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 is passed straight through. address_family can be used to select IPv4/IPv6 if the OS has IPv6 capability (ACE_HAS_IPV6 is defined). To specify IPv6, use the value AF_INET6. To specify IPv4, use AF_INET.

ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr ( u_short  port_number,
ACE_UINT32  primary_ip_addr = INADDR_ANY,
int  encode = 1,
const ACE_UINT32 *  secondary_ip_addrs = 0,
size_t  size = 0 
)

Constructs an ACE_Multihomed_INET_Addr from a port_number, a primary_ip_addr, and an array of secondary_ip_addrs. size is taken to be the length of the array. If encode is non-zero, then the port number and the IP addresses are converted into network byte order; otherwise they are assumed to be in network byte order already and are passed straight through.

ACE_Multihomed_INET_Addr::ACE_Multihomed_INET_Addr ( u_short  port_number,
const wchar_t  primary_host_name[],
int  encode = 1,
int  address_family = AF_UNSPEC,
const wchar_t *  secondary_host_names[] = 0,
size_t  size = 0 
)

WCHAR versions of the methods that take char's as arguments.

ACE_Multihomed_INET_Addr::~ACE_Multihomed_INET_Addr ( void  )

Use compiler-generated copy constructor.

Use compiler-generated assignment operator. Default destructor.

Member Function Documentation

void ACE_Multihomed_INET_Addr::get_addresses ( sockaddr_in *  addrs,
size_t  size 
) const

Initialize user-supplied array addrs with the the current primary and secondary addresses. size is taken as the size of this array.

void ACE_Multihomed_INET_Addr::get_addresses ( sockaddr_in6 *  addrs,
size_t  size 
) const

IPV6 version of the above.

size_t ACE_Multihomed_INET_Addr::get_num_secondary_addresses ( ) const
inline

Returns the number of secondary addresses.

int ACE_Multihomed_INET_Addr::get_secondary_addresses ( ACE_INET_Addr secondary_addrs,
size_t  size 
) const

Initialize user-supplied array secondary_addrs with the current secondary addresses. size is taken as the size of this array.

int ACE_Multihomed_INET_Addr::set ( u_short  port_number,
const wchar_t  primary_host_name[],
int  encode = 1,
int  address_family = AF_UNSPEC,
const wchar_t *  secondary_host_names[] = 0,
size_t  size = 0 
)
int ACE_Multihomed_INET_Addr::set ( u_short  port_number,
const char  primary_host_name[],
int  encode = 1,
int  address_family = AF_UNSPEC,
const char *  secondary_host_names[] = 0,
size_t  size = 0 
)

Initializes an ACE_Multihomed_INET_Addr from a port_number, a primary_host_name, and an array of secondary_host_names. size is taken to be the length of the array. 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 is passed straight through. address_family can be used to select IPv4/IPv6 if the OS has IPv6 capability (ACE_HAS_IPV6 is defined). To specify IPv6, use the value AF_INET6. To specify IPv4, use AF_INET.

int ACE_Multihomed_INET_Addr::set ( u_short  port_number,
ACE_UINT32  primary_ip_addr = INADDR_ANY,
int  encode = 1,
const ACE_UINT32 *  secondary_ip_addrs = 0,
size_t  size = 0 
)

Initializes an ACE_Multihomed_INET_Addr from a port_number, a primary_ip_addr, and an array of secondary_ip_addrs. size is taken to be the length of the array. If encode is non-zero, then the port number and the IP addresses are converted into network byte order; otherwise they are assumed to be in network byte order already and are passed straight through.

void ACE_Multihomed_INET_Addr::set_port_number ( u_short  port_number,
int  encode = 1 
)

Sets the port number without affecting the host name. The port numbers of the primary address, and of any and all secondary addresses, are affected. 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 is passed straight through.

Member Data Documentation

ACE_Array<ACE_INET_Addr> ACE_Multihomed_INET_Addr::secondaries_
private

The documentation for this class was generated from the following files: