EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
EIpAddress Class Reference

Represents an IP address with mask. More...

#include <eip.h>

Public Member Functions

 EIpAddress ()
 Default class constructor. More...
 
 EIpAddress (cpStr addr)
 Class constructor. More...
 
 EIpAddress (const std::string &addr)
 Class constructor. More...
 
 EIpAddress (const EIpAddress &ipaddr)
 Copy constructor. More...
 
 EIpAddress (const struct sockaddr_storage &saddr)
 Class constructor. More...
 
EIpAddressoperator= (cpStr addr)
 Assignment operator. More...
 
EIpAddressoperator= (const EIpAddress &ipaddr)
 Assignment operator. More...
 
EIpAddressoperator= (const struct sockaddr_storage &saddr)
 Assignment operator. More...
 
EIpAddressoperator= (const in_addr &addr)
 Assignment operator. More...
 
EIpAddressoperator= (const in6_addr &addr)
 Assignment operator. More...
 
Bool operator== (const EIpAddress &ip) const
 Assignment operator. More...
 
std::string address (Bool includeMask=True) const
 Retrieves a string object that is the string representation of the IP address. More...
 
const in_addr & ipv4Address () const
 Returns a reference to the in_addr structure that represents an IPv4 address. More...
 
const in6_addr & ipv6Address () const
 Returns a reference to the in6_addr structure that represents an IPv6 address. More...
 
const sa_family_t family () const
 Returns the address family associated with this address object. More...
 
UChar maskWidth () const
 Returns the mask width (number of signficant bits) for this address object. More...
 
EIpAddresssetFamily (const sa_family_t family)
 Assigns the address family for this address object. More...
 
EIpAddresssetMaskWidth (UChar maskWidth)
 Assigns the mask width, in number of bits, for this address object. More...
 
EIpAddresssetAny (sa_family_t family)
 Sets the IP address as "any" for the specified address family. More...
 
Bool isAny () const
 determines if this IP address represents "any". More...
 

Detailed Description

Represents an IP address with mask.

Constructor & Destructor Documentation

EIpAddress::EIpAddress ( )
inline

Default class constructor.

EIpAddress::EIpAddress ( cpStr  addr)
inline

Class constructor.

Parameters
addra NULL terminated string representing the IP address.
EIpAddress::EIpAddress ( const std::string &  addr)
inline

Class constructor.

Parameters
addra string object representing the IP address.
EIpAddress::EIpAddress ( const EIpAddress ipaddr)
inline

Copy constructor.

Parameters
ipaddrthe EIpAddress object to copy.
EIpAddress::EIpAddress ( const struct sockaddr_storage &  saddr)
inline

Class constructor.

Parameters
saddra reference to a sockaddr_storage used to initialize the object.

Member Function Documentation

std::string EIpAddress::address ( Bool  includeMask = True) const
inline

Retrieves a string object that is the string representation of the IP address.

Parameters
includeMaskif TRUE, the mask will be appended to the IP address.
Returns
the string representation of the IP address.
const sa_family_t EIpAddress::family ( ) const
inline

Returns the address family associated with this address object.

Returns
the address family associated with this address object.
const in_addr& EIpAddress::ipv4Address ( ) const
inline

Returns a reference to the in_addr structure that represents an IPv4 address.

Returns
a reference to the in_addr structure that represents an IPv4 address.
const in6_addr& EIpAddress::ipv6Address ( ) const
inline

Returns a reference to the in6_addr structure that represents an IPv6 address.

Returns
a reference to the in6_addr structure that represents an IPv6 address.
Bool EIpAddress::isAny ( ) const
inline

determines if this IP address represents "any".

Returns
True if address represents "any", otherwise False.
UChar EIpAddress::maskWidth ( ) const
inline

Returns the mask width (number of signficant bits) for this address object.

Returns
the mask width for this address object.
EIpAddress& EIpAddress::operator= ( cpStr  addr)
inline

Assignment operator.

Parameters
addra NULL terminated string representing the IP address.
EIpAddress& EIpAddress::operator= ( const EIpAddress ipaddr)
inline

Assignment operator.

Parameters
ipaddra string object representing the IP address to assign.
EIpAddress& EIpAddress::operator= ( const struct sockaddr_storage &  saddr)
inline

Assignment operator.

Parameters
saddra reference to a sockaddr_storage structure to assign.
EIpAddress& EIpAddress::operator= ( const in_addr &  addr)
inline

Assignment operator.

Parameters
addra reference to an in_addr structure representing an IPv4 address.
EIpAddress& EIpAddress::operator= ( const in6_addr &  addr)
inline

Assignment operator.

Parameters
addra reference to an in6_addr structure representing an IPv6 address.
Bool EIpAddress::operator== ( const EIpAddress ip) const
inline

Assignment operator.

Parameters
ipa reference to the EIpAddress object to copy.
EIpAddress& EIpAddress::setAny ( sa_family_t  family)
inline

Sets the IP address as "any" for the specified address family.

Parameters
familythe address family.
Returns
a reference to this object.
EIpAddress& EIpAddress::setFamily ( const sa_family_t  family)
inline

Assigns the address family for this address object.

Parameters
familythe new address family.
Returns
a reference to this object.
EIpAddress& EIpAddress::setMaskWidth ( UChar  maskWidth)
inline

Assigns the mask width, in number of bits, for this address object.

Parameters
maskWidththe number of signficant address bits..
Returns
a reference to this object.

Member Data Documentation

in_addr EIpAddress::ipv4
in6_addr EIpAddress::ipv6

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