Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vpr::InetAddrBSD Class Reference

Cross-platform abstraction to Internet address structures. More...

#include <InetAddrBSD.h>

Inheritance diagram for vpr::InetAddrBSD:

Inheritance graph
[legend]
Collaboration diagram for vpr::InetAddrBSD:

Collaboration graph
[legend]
List of all members.

Public Types

typedef vpr::InetAddrHash hash

Public Methods

 InetAddrBSD ()
 Default constructor. More...

 InetAddrBSD (const InetAddrBSD &addr)
 Copy constructor. More...

vpr::ReturnStatus setAddress (const std::string &address)
 Constructs an address object using the given address. More...

vpr::ReturnStatus setAddress (const std::string &address, const Uint16 port)
 Sets the address for this object using the given address and port number. More...

vpr::ReturnStatus setAddress (const vpr::Uint32 address, const vpr::Uint16 port)
 Sets the address for this object using the given address and port number. More...

unsigned char getLength () const
 Gets the length of the address structure (if supported by the host OS). More...

void setLength (const unsigned char length)
 Sets the length of the address structure (if the host OS allows such an operation). More...

vpr::SocketTypes::Domain getFamily () const
 Gets the protocol family of this address structure. More...

void setFamily (const vpr::SocketTypes::Domain family)
 Sets the protocol family of this address structure. More...

vpr::Uint16 getPort () const
 Gets this address' port in host byte order. More...

void setPort (const vpr::Uint16 port)
 Sets this address' port. More...

vpr::Uint32 getAddressValue () const
 Gets this address's Internet address in host byte order. More...

std::string getAddressString () const
 Get the IP address associated with this structure as a human-readable string. More...

std::string getHostname () const
 Returns the fully qualified hostname for this address. More...

std::vector< std::string > getHostnames () const
 Returns the fully qualified primary hostname for this address and all known aliases. More...

InetAddrBSD & operator= (const InetAddrBSD &addr)
 Overloaded assignment operator to ensure that assignments work correctly. More...

bool operator== (const InetAddrBSD &addr) const
 Overloaded equality operator. More...

bool operator!= (const InetAddrBSD &addr) const
 Overloaded inequality operator. More...


Static Public Methods

vpr::ReturnStatus getLocalHost (vpr::InetAddrBSD &host_addr)
 Returns the local host's address via the given object reference. More...


Static Public Attributes

const InetAddrBSD AnyAddr

Protected Methods

 InetAddrBSD (const struct sockaddr *addr)
 Constructs a vpr::InetAddrBSD object from a pointer to a sockaddr struct. More...

void copyAddressValue (const char *addr_value)
 Copies the given array of bytes (an A record) into this structure's IP address value. More...

void setAddressValue (const vpr::Uint32 addr_value)
 Sets this objects's IP address. More...

size_t size () const
 Gets the size of this object's encapsulated address structure. More...

size_t addressSize () const
 Gets the size of this object's IP address value. More...

void setSockaddr (const struct sockaddr *addr)
 Initializes the internal socket address structure using the given sockaddr* object. More...

sockaddr_in toSockaddrInet ()
 Converts this object to a sockaddr_in struct. More...

void copy (const InetAddrBSD &addr)
 Makes a copy of the given vpr::InetAddrBSD object in this object. More...

vpr::ReturnStatus lookupAddress (const std::string &addr)
 Look up the given address and store the address in mAddr. More...


Protected Attributes

sockaddr_in mAddr
 The Ineternet address structure. More...


Friends

class vpr::SocketImplBSD
class vpr::SocketDatagramImplBSD
class vpr::SocketStreamImplBSD

Detailed Description

Cross-platform abstraction to Internet address structures.

Definition at line 68 of file InetAddrBSD.h.


Member Typedef Documentation

typedef vpr::InetAddrHash vpr::InetAddrBSD::hash
 

Definition at line 73 of file InetAddrBSD.h.


Constructor & Destructor Documentation

vpr::InetAddrBSD::InetAddrBSD  
 

Default constructor.

This initializes the memory for the encapsulated address structure.

Precondition:
None.
Postcondition:
The mAddr structure has its memory zeroed, and the port and internet address are set to wildcard values.

Definition at line 67 of file InetAddrBSD.cpp.

References mAddr, setAddressValue, setFamily, and setPort.

Referenced by InetAddrBSD, operator!=, and operator=.

00068 {
00069    memset(&mAddr, 0, sizeof(mAddr));
00070    setAddressValue(INADDR_ANY);
00071    setPort(0);
00072    setFamily(SocketTypes::INET);
00073 }

vpr::InetAddrBSD::InetAddrBSD const InetAddrBSD &    addr [inline]
 

Copy constructor.

Precondition:
None.
Postcondition:
A copy of the given vpr::InetAddrBSD object is made in this object.
Parameters:
addr  The vpr::InetAddrBSD object to be copied into this object.

Definition at line 94 of file InetAddrBSD.h.

References copy, and InetAddrBSD.

00095    {
00096       copy(addr);
00097    }

vpr::InetAddrBSD::InetAddrBSD const struct sockaddr *    addr [inline, protected]
 

Constructs a vpr::InetAddrBSD object from a pointer to a sockaddr struct.

This is not typically useful to users but may be very important internally.

Precondition:
The given pointer points to a valid sockaddr struct.
Postcondition:
The memory pointed to by addr is copied into mAddr.
Parameters:
addr  A pointer to a sockaddr struct containing a valid address.

Definition at line 296 of file InetAddrBSD.h.

References InetAddrBSD, and setSockaddr.

00297    {
00298       setSockaddr(addr);
00299    }


Member Function Documentation

vpr::ReturnStatus vpr::InetAddrBSD::getLocalHost vpr::InetAddrBSD &    host_addr [static]
 

Returns the local host's address via the given object reference.

Parameters:
host_addr  Storage for the returned address object.
Returns:
vpr::ReturnStatus::Succeed is returned if the local host has an an address. Otherwise, vpr::ReturnStatus::Fail is returned.

Definition at line 75 of file InetAddrBSD.cpp.

References vpr::ReturnStatus::Fail, setAddress, and vpr::ReturnStatus::setCode.

00076 {
00077    char local_host_name[MAXHOSTNAMELEN + 1];
00078    vpr::ReturnStatus status;
00079 
00080    if ( gethostname(local_host_name, MAXHOSTNAMELEN) == 0 )
00081    {
00082       host_addr.setAddress(std::string(local_host_name), 0);
00083    }
00084    else
00085    {
00086       status.setCode(vpr::ReturnStatus::Fail);
00087    }
00088 
00089    return status;
00090 }

vpr::ReturnStatus vpr::InetAddrBSD::setAddress const std::string &    address
 

Constructs an address object using the given address.

It must be of the form <address>:<port> where <address> can be a hostname or a dotted-decimal IP address.

Parameters:
address  A string giving the address and port number separated by a colon. The address can be a hostname or a dotted-decimal IP address.

Reimplemented from vpr::InetAddrBase.

Definition at line 97 of file InetAddrBSD.cpp.

References lookupAddress, setFamily, and setPort.

Referenced by getLocalHost.

00098 {
00099    std::string::size_type pos;
00100    std::string host_addr, host_port;
00101    vpr::Uint16 port;
00102    vpr::ReturnStatus retval;
00103 
00104    // Extract the address and the port number from the given string.
00105    pos       = address.find(":");
00106    host_addr = address.substr(0, pos);
00107    host_port = address.substr(pos + 1);
00108    port      = (Uint16) atoi(host_port.c_str());
00109 
00110    retval = lookupAddress(host_addr);
00111    setPort(port);
00112    setFamily(vpr::SocketTypes::INET);
00113 
00114    return retval;
00115 }

vpr::ReturnStatus vpr::InetAddrBSD::setAddress const std::string &    address,
const Uint16    port
 

Sets the address for this object using the given address and port number.

The address string can be a hostname or a dotted-decimal IP address.

Parameters:
address  A string giving the address (either hostname or IP address).
port  The port to associate with the IP address.

Reimplemented from vpr::InetAddrBase.

Definition at line 117 of file InetAddrBSD.cpp.

References lookupAddress, setFamily, setPort, and vpr::Uint16.

00119 {
00120    vpr::ReturnStatus retval;
00121 
00122    retval = lookupAddress(address);
00123    setPort(port);
00124    setFamily(SocketTypes::INET);
00125 
00126    return retval;
00127 }

vpr::ReturnStatus vpr::InetAddrBSD::setAddress const vpr::Uint32    address,
const vpr::Uint16    port
 

Sets the address for this object using the given address and port number.

The address must be the actual 32-bit integer value.

Parameters:
address  A 32-bit integer IP address.
port  The port to associate with the IP address.

Reimplemented from vpr::InetAddrBase.

Definition at line 129 of file InetAddrBSD.cpp.

References setAddressValue, setFamily, and setPort.

00131 {
00132    setAddressValue(address);
00133    setPort(port);
00134    setFamily(SocketTypes::INET);
00135    return ReturnStatus();
00136 }

unsigned char vpr::InetAddrBSD::getLength   const
 

Gets the length of the address structure (if supported by the host OS).

Precondition:
None.
Postcondition:
The length of the address structure is returned if the OS supports that feature. Otherwise, 0 is returned.
Returns:
A value greather than 0 is return to indicate the length of the encapsulated address. 0 is returned if the OS does not support address structure length.

Definition at line 138 of file InetAddrBSD.cpp.

References mAddr.

00139 {
00140 #ifdef _HAVE_SIN_LEN
00141    return mAddr.sin_len;
00142 #else
00143    return 0;
00144 #endif
00145 }

void vpr::InetAddrBSD::setLength const unsigned char    length
 

Sets the length of the address structure (if the host OS allows such an operation).

Precondition:
None.
Postcondition:
The address strcture's length is set to the given value if the OS supports it. Otherwise, this is a no-op.
Parameters:
length  The length of the address structure.

Definition at line 147 of file InetAddrBSD.cpp.

References mAddr.

00148 {
00149 #ifdef _HAVE_SIN_LEN
00150    mAddr.sin_len = length;
00151 #else
00152    boost::ignore_unused_variable_warning(length);
00153 #endif
00154 }

vpr::SocketTypes::Domain vpr::InetAddrBSD::getFamily   const
 

Gets the protocol family of this address structure.

Precondition:
The protocol family has been properly initialized.
Postcondition:
The protocol family is returned as a vpr::SocketTypes::Domain value.
Returns:
A vpr::SocketTypes::Domain value representing this object's protocol family.

Reimplemented from vpr::InetAddrBase.

Definition at line 159 of file InetAddrBSD.cpp.

References mAddr.

Referenced by vpr::SocketImplNSPR::open, and vpr::SocketImplBSD::open.

00160 {
00161    vpr::SocketTypes::Domain family;
00162 
00163    switch ( mAddr.sin_family )
00164    {
00165 #ifdef PF_LOCAL
00166       case PF_LOCAL:
00167 #else
00168       case PF_UNIX:
00169 #endif
00170          family = SocketTypes::LOCAL;
00171          break;
00172       case PF_INET:
00173          family = SocketTypes::INET;
00174          break;
00175 #ifdef PF_INET6
00176       case PF_INET6:
00177          family = SocketTypes::INET6;
00178          break;
00179 #endif
00180 #if defined(PF_LINK) || defined(PF_RAW)
00181 #ifdef PF_LINK
00182       case PF_LINK:
00183 #else
00184       case PF_RAW:
00185 #endif
00186          family = SocketTypes::LINK;
00187          break;
00188 #endif
00189       default:
00190          family = SocketTypes::INET;
00191          break;
00192    }
00193 
00194    return family;
00195 }

void vpr::InetAddrBSD::setFamily const vpr::SocketTypes::Domain    family
 

Sets the protocol family of this address structure.

Precondition:
None.
Postcondition:
The given protocol family (a vpr::SocketTypes::Domain value) is mapped to the appropriate platform-specific protocol family value and stored.
Parameters:
family  The protocol family value.

Reimplemented from vpr::InetAddrBase.

Definition at line 200 of file InetAddrBSD.cpp.

References mAddr.

Referenced by InetAddrBSD, and setAddress.

00201 {
00202    switch ( family )
00203    {
00204       case SocketTypes::LOCAL:
00205 #ifdef PF_LOCAL
00206          mAddr.sin_family = PF_LOCAL;
00207 #else
00208          mAddr.sin_family = PF_UNIX;
00209 #endif
00210          break;
00211       case SocketTypes::INET:
00212          mAddr.sin_family = PF_INET;
00213          break;
00214       case SocketTypes::INET6:
00215 #ifdef PF_INET6
00216          mAddr.sin_family = PF_INET6;
00217 #else
00218          fprintf(stderr,
00219                  "[vpr::InetAddrBSD] WARNING: IPv6 not supported on this host!\n");
00220 #endif
00221          break;
00222 #if defined(PF_LINK) || defined(PF_RAW)
00223       case SocketTypes::LINK:
00224 #ifdef PF_LINK
00225          mAddr.sin_family = PF_LINK;
00226 #else
00227          mAddr.sin_family = PF_RAW;
00228 #endif
00229          break;
00230 #endif
00231       default:
00232          fprintf(stderr,
00233                  "[vpr::InetAddrBSD] ERROR: Unknown socket family value %d\n",
00234                  family);
00235          break;
00236    }
00237 }

vpr::Uint16 vpr::InetAddrBSD::getPort   const
 

Gets this address' port in host byte order.

Precondition:
The port has been initialized properly in network byte order.
Postcondition:
The port associated with this address is returned to the caller in host byte order.
Returns:
An unsigned 16-bit integer giving the port for this address in host byte order.

Reimplemented from vpr::InetAddrBase.

Definition at line 239 of file InetAddrBSD.cpp.

References mAddr.

Referenced by vpr::sim::NetworkNode::addSocket, vpr::InetAddrHash::operator(), vpr::SocketDatagramImplBSD::recvfrom, vpr::sim::NetworkNode::removeSocket, and vpr::SocketDatagramImplBSD::sendto.

00240 {
00241    return ntohs(mAddr.sin_port);
00242 }

void vpr::InetAddrBSD::setPort const vpr::Uint16    port
 

Sets this address' port.

The given port must be in host byte order.

Precondition:
The given port number is in host byte order.
Postcondition:
The given port number is stored in the address.
Parameters:
port  An unsigned 16-bit integer port number for this address in host byte order.

Reimplemented from vpr::InetAddrBase.

Definition at line 244 of file InetAddrBSD.cpp.

References mAddr.

Referenced by vpr::SocketStreamImplSIM::accept, InetAddrBSD, and setAddress.

00245 {
00246    mAddr.sin_port = htons(port);
00247 }

vpr::Uint32 vpr::InetAddrBSD::getAddressValue   const
 

Gets this address's Internet address in host byte order.

Precondition:
The IP address has been initialized properly in network byte order.
Postcondition:
The IP address associated with this address structure is returned to the caller in host byte order.
Returns:
An unsigned 32-bit integer giving the IP address for this object in host byte order.

Reimplemented from vpr::InetAddrBase.

Definition at line 249 of file InetAddrBSD.cpp.

References mAddr.

Referenced by vpr::sim::NetworkNode::addSocket, vpr::InetAddrHash::operator(), and vpr::sim::NetworkNode::removeSocket.

00250 {
00251    return ntohl(mAddr.sin_addr.s_addr);
00252 }

std::string vpr::InetAddrBSD::getAddressString   const
 

Get the IP address associated with this structure as a human-readable string.

Precondition:
The object contains a valid IP address.
Postcondition:
The integer IP address is converted to dotted-decmial notation and returned as a string.
Returns:
A std::string object containing this structure's IP address in the human-readable "dotted-decimal" notation.

Reimplemented from vpr::InetAddrBase.

Definition at line 258 of file InetAddrBSD.cpp.

References mAddr, and vpr::Uint8.

Referenced by vpr::SocketImplBSD::connect, vpr::SocketImplBSD::open, vpr::SocketDatagramImplBSD::recvfrom, vpr::SocketDatagramImplBSD::sendto, vpr::SocketImplBSD::SocketImplBSD, and vpr::SocketImplNSPR::SocketImplNSPR.

00259 {
00260    char ip_addr[sizeof("255.255.255.255")];
00261    std::string ip_str;
00262    union
00263    {
00264       char c[sizeof(vpr::Uint32)];
00265       vpr::Uint32 value;
00266    } addr;
00267 
00268    addr.value = mAddr.sin_addr.s_addr;
00269 
00270    snprintf(ip_addr, sizeof(ip_addr), "%u.%u.%u.%u", (Uint8) addr.c[0],
00271             (Uint8) addr.c[1], (Uint8) addr.c[2], (Uint8) addr.c[3]);
00272    ip_str = ip_addr;
00273 
00274    return ip_str;
00275 }

std::string vpr::InetAddrBSD::getHostname   const
 

Returns the fully qualified hostname for this address.

Reimplemented from vpr::InetAddrBase.

Definition at line 277 of file InetAddrBSD.cpp.

References mAddr.

00278 {
00279    std::string hostname;
00280    struct hostent* entry;
00281 
00282    entry = gethostbyaddr((const char*) &mAddr.sin_addr,
00283                          sizeof(mAddr.sin_addr), mAddr.sin_family);
00284 
00285    if ( NULL == entry )
00286    {
00287       hostname = std::string("<hostname lookup failed>");
00288    }
00289    else
00290    {
00291       hostname = entry->h_name;
00292    }
00293 
00294    return hostname;
00295 }

std::vector< std::string > vpr::InetAddrBSD::getHostnames   const
 

Returns the fully qualified primary hostname for this address and all known aliases.

Reimplemented from vpr::InetAddrBase.

Definition at line 297 of file InetAddrBSD.cpp.

References mAddr.

00298 {
00299    std::vector<std::string> names;
00300    struct hostent* entry;
00301 
00302    entry = gethostbyaddr((const char*) &mAddr.sin_addr,
00303                          sizeof(mAddr.sin_addr), mAddr.sin_family);
00304 
00305    if ( NULL != entry )
00306    {
00307       names.push_back(std::string(entry->h_name));
00308 
00309       for ( char** ptr = entry->h_aliases; *ptr != NULL; ptr++ )
00310       {
00311          names.push_back(std::string(*ptr));
00312       }
00313    }
00314 
00315    return names;
00316 }

InetAddrBSD& vpr::InetAddrBSD::operator= const InetAddrBSD &    addr [inline]
 

Overloaded assignment operator to ensure that assignments work correctly.

Precondition:
None.
Postcondition:
A copy of the given vpr::InetAddrBSD object is made in this object which is then returned to the caller.
Parameters:
addr  The vpr::InetAddrBSD object to be copied into this object.
Returns:
A reference to this object.

Definition at line 262 of file InetAddrBSD.h.

References copy, and InetAddrBSD.

00263    {
00264       copy(addr);
00265       return *this;
00266    }

bool vpr::InetAddrBSD::operator== const InetAddrBSD &    addr const
 

Overloaded equality operator.

Definition at line 319 of file InetAddrBSD.cpp.

References mAddr.

00320 {
00321    return (mAddr.sin_addr.s_addr == addr.mAddr.sin_addr.s_addr) &&
00322           (mAddr.sin_port == addr.mAddr.sin_port) &&
00323           (mAddr.sin_family == addr.mAddr.sin_family);
00324 }

bool vpr::InetAddrBSD::operator!= const InetAddrBSD &    addr const [inline]
 

Overloaded inequality operator.

Definition at line 276 of file InetAddrBSD.h.

References InetAddrBSD.

00277    {
00278       return ! (*this == addr);
00279    }

void vpr::InetAddrBSD::copyAddressValue const char *    addr_value [protected]
 

Copies the given array of bytes (an A record) into this structure's IP address value.

The record must be in network byte order. This method is useful when working with host entries returned by gethostname(3).

Precondition:
The given array of bytes represents an A record in network byte order.
Postcondition:
The bytes are copied into this structure's IP address value.
Parameters:
addr_value  The A record contianing an IP address in network byte order.

Definition at line 326 of file InetAddrBSD.cpp.

References mAddr, and vprASSERT.

Referenced by lookupAddress.

00327 {
00328    vprASSERT(addr_value != NULL);
00329    memcpy((void*) &mAddr.sin_addr.s_addr, (void*) addr_value,
00330           sizeof(mAddr.sin_addr.s_addr));
00331 }

void vpr::InetAddrBSD::setAddressValue const vpr::Uint32    addr_value [protected]
 

Sets this objects's IP address.

The given address must be in host byte order.

Precondition:
The given IP address is in host byte order.
Postcondition:
The given IP address is stored.
Parameters:
port  An unsigned 32-bit integer IP address for this object in host byte order.

Definition at line 333 of file InetAddrBSD.cpp.

References mAddr.

Referenced by InetAddrBSD, lookupAddress, and setAddress.

00334 {
00335    mAddr.sin_addr.s_addr = htonl(addr_value);
00336 }

size_t vpr::InetAddrBSD::size   const [protected]
 

Gets the size of this object's encapsulated address structure.

Precondition:
None.
Postcondition:
The static size of mAddr is returned to the caller.
Returns:
A value of type size_t giving the size of the encapsualted address structure.

Definition at line 338 of file InetAddrBSD.cpp.

Referenced by vpr::SocketDatagramImplBSD::recvfrom.

00339 {
00340    return sizeof(mAddr);
00341 }

size_t vpr::InetAddrBSD::addressSize   const [protected]
 

Gets the size of this object's IP address value.

Precondition:
None.
Postcondition:
The static size of the IP address is returned to the caller.
Returns:
A value of type size_t giving the size of this object's IP address.

Definition at line 343 of file InetAddrBSD.cpp.

References mAddr.

00344 {
00345    return sizeof(mAddr.sin_addr.s_addr);
00346 }

void vpr::InetAddrBSD::setSockaddr const struct sockaddr *    addr [protected]
 

Initializes the internal socket address structure using the given sockaddr* object.

This will overwrite a previously set address.

Postcondition:
The memory pointed to by the given object is copied into this object's mAddr structure.
Parameters:
addr  A pointer to the sockaddr object being used to initialize this object's address.

Definition at line 348 of file InetAddrBSD.cpp.

References mAddr.

Referenced by vpr::SocketImplBSD::connect, and InetAddrBSD.

00349 {
00350    memcpy((void*) &mAddr, (void*) addr, sizeof(mAddr));
00351 }

struct sockaddr_in vpr::InetAddrBSD::toSockaddrInet   [protected]
 

Converts this object to a sockaddr_in struct.

Precondition:
None.
Postcondition:
A copy of a sockaddr_in struct equivalent to this object is returned to the caller.

Definition at line 353 of file InetAddrBSD.cpp.

00354 {
00355    return mAddr;
00356 }

void vpr::InetAddrBSD::copy const InetAddrBSD &    addr [protected]
 

Makes a copy of the given vpr::InetAddrBSD object in this object.

Precondition:
None.
Postcondition:
The memory in mAddr is overwritten with that of the given object's mAddr structure.
Parameters:
addr  The vpr::InetAddrBSD object to be copied into this object.

Definition at line 358 of file InetAddrBSD.cpp.

References mAddr.

Referenced by InetAddrBSD, and operator=.

00359 {
00360    memcpy((void*) &mAddr, (void*) &addr.mAddr, sizeof(mAddr));
00361 }

vpr::ReturnStatus vpr::InetAddrBSD::lookupAddress const std::string &    addr [protected]
 

Look up the given address and store the address in mAddr.

Precondition:
None.
Postcondition:
The given address string is converted into a 32-bit INET address. The mAddr member variable is populated accordingly.
Returns:
vpr::ReturnStatus::Succeed is returned if the address lookup was successful. vpr::ReturnStatus::Fail is returned otherwise.

Definition at line 366 of file InetAddrBSD.cpp.

References copyAddressValue, errno, INADDR_NONE, setAddressValue, and vpr::ReturnStatus::setCode.

Referenced by setAddress.

00367 {
00368    vpr::ReturnStatus retval;
00369    struct hostent* host_entry;
00370 
00371    // First, try looking the host up by name.
00372    host_entry = gethostbyname(address.c_str());
00373 
00374    // If that succeeded, put the result in mRemoteAddr.
00375    if ( host_entry != NULL )
00376    {
00377       copyAddressValue(host_entry->h_addr);
00378    }
00379    // If gethostbyname(3) failed, the address string may be an IP address.
00380    else
00381    {
00382       in_addr_t addr;
00383 
00384       // Try looking it up with inet_addr(3).
00385       addr = inet_addr(address.c_str());
00386 
00387       // If the address string could not be found using inet_addr(3), then
00388       // return error status.
00389       if ( addr == INADDR_NONE )
00390       {
00391          fprintf(stderr,
00392                  "[vpr::InetAddrBSD] Could not find address for '%s': %s\n",
00393                  address.c_str(), strerror(errno));
00394          retval.setCode(ReturnStatus::Fail);
00395       }
00396       // Otherwise, we found the integer address successfully.
00397       else
00398       {
00399          setAddressValue(addr);
00400       }
00401    }
00402 
00403    return retval;
00404 }


Friends And Related Function Documentation

friend class vpr::SocketImplBSD [friend]
 

Definition at line 282 of file InetAddrBSD.h.

friend class vpr::SocketDatagramImplBSD [friend]
 

Definition at line 283 of file InetAddrBSD.h.

friend class vpr::SocketStreamImplBSD [friend]
 

Definition at line 284 of file InetAddrBSD.h.


Member Data Documentation

const InetAddrBSD vpr::InetAddrBSD::AnyAddr [static]
 

Definition at line 65 of file InetAddrBSD.cpp.

struct sockaddr_in vpr::InetAddrBSD::mAddr [protected]
 

The Ineternet address structure.

Definition at line 393 of file InetAddrBSD.h.

Referenced by addressSize, copy, copyAddressValue, getAddressString, getAddressValue, getFamily, getHostname, getHostnames, getLength, getPort, InetAddrBSD, operator==, setAddressValue, setFamily, setLength, setPort, and setSockaddr.


The documentation for this class was generated from the following files:
Generated on Sun May 2 14:47:03 2004 for VR Juggler Portable Runtime by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002