Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

TNL::Address Struct Reference

Representation of a network address. More...

#include <tnlUDP.h>

List of all members.

Public Types

enum  NamedAddress
 Constants specify.


Public Methods

 Address (TransportProtocol type=IPProtocol, NamedAddress name=Any, U16 port=0)
 Constructs an address using a protocol, named address type and port.

 Address (const char *string)
 Constructs an address from a string, of the form "transport:address:port" where transport is one of ip, ipx, or (in the future) ipv6.

 Address (const IPAddress &theAddress)
 Constructs an address from an IP address.

bool set (const char *string)
 Sets the address to the specified string, returning true if the string was a valid address.

void set (const IPAddress &address)
 Sets the address to the specified IPAddress.

const char * toString () const
 returns the formatted string corresponding to the address.

bool operator== (const Address &theAddress) const
 returns true if theAddress is equal to this.

bool operator!= (const Address &theAddress) const
 returns true if theAddress is not equal to this.

bool isEqualAddress (const Address &theAddress) const
 returns true if the addresses are equal, not including the port.

U32 hash () const
 Returns a 32-bit hash of this network address.

IPAddress toIPAddress () const
 Returns a packed IPAddress of this address.


Public Attributes

U16 transport
 One of: IPXAddress, IPAddress.

U16 port
 For IP: sin_port For IPX: sa_socket

U32 netNum [4]
 Address data, sized for future IPv6 usage.


Detailed Description

Representation of a network address.

Definition at line 62 of file tnlUDP.h.


Member Function Documentation

bool TNL::Address::set const char *    string
 

Sets the address to the specified string, returning true if the string was a valid address.

Note that this call may block if the address portion of the string requires a DNS lookup.

Definition at line 648 of file udp.cpp.

References TNL::IPXProtocol, netNum, port, TNL::TCPProtocol, transport, and TNL::U32.

Referenced by Address().


The documentation for this struct was generated from the following files:
Generated on Thu Aug 18 16:03:36 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18