[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LInternetAddress



Overview:

LInternetAddress is a PowerPlant class that is used for wrapping the IP addresses that are used internally by the Internet to describe another computer's location.

Methods :

The methods in this class are:

 

LInternetAddress()  
~LInternetAddress()  
Clone()  
GetDNSAddress()  
GetDNSDescriptor()  
GetHostPort()  
GetIPAddress()  
GetIPAddress()  
GetIPDescriptor()  
InternalLookupAddress()  
InternalLookupName()  
MakeOTDNSAddress()  
MakeOTIPAddress()  
SetDNSAddress()  
SetHostPort()  
SetIPAddress()  

Data Members:

The data members in this class are:

 

mIPAddress  
mDNSAddress  
mHostPort  
 

Operation:

DNS names (like "ftp.metrowerks.com") must be mapped to IP addresses (127.0.0.1) before connections are established. This object will handle such conversions automatically.

Source files:

(Networking Classes)

LInternetAddress.h

LInternetAddress.cp

LInternetAddress()

Purpose:

The constructor creates the object.

Access :

Public

Prototype:

LInternetAddress(

	UInt32 inHostAddress,

	UInt16 inHostPort );
  
LInternetAddress(

	ConstStringPtr inHostAddress,

	UInt16 inHostPort,

	Boolean inLookupNow );
  
LInternetAddress(

	UInt16	inHostPort );
  
LInternetAddress(

	const LInternetAddress& inOriginal );
Parameters:

The parameters for this method are:

 

UInt32 inHostAddress The host address.
UInt16 inHostPort The host port.
ConstStringPtr inHostAddress The host address.
Boolean inLookupNow Whether to do an immediate lookup.
LInternetAddress& inOriginal The address to copy.

~LInternetAddress()

Purpose:

The destructor destroys the LInternetAddress object.

Access :

Virtual, Public

Prototype:

virtual ~LInternetAddress();

Clone()

Purpose:

Create a new copy of the address using the new operator from this one.

Access :

Virtual, Public

Prototype:

virtual LInternetAddress* Clone();
Parameters:

None

Return:

A new copy of the internet address.

GetDNSAddress()

Purpose:

Retrieve the DNS address string.

Access :

Virtual, Public

Prototype:

virtual StringPtr GetDNSAddress(
   Str255 outDescriptor);
Parameters:

The parameters for this method are:

 

Str255 outDescriptor The address string.

Return:

Returns the address string.

GetDNSDescriptor()

Purpose:

Return the name of the specified host (and port number if available) Use GetDNSAddress() if you don't care if we have tried to do a DNS lookup.

Access :

Virtual, Public

Prototype:

StringPtr GetDNSDescriptor( Str255	outDescriptor, 
Boolean withPort);
Parameters:

The parameters for this method are:

 

Str255 outDescriptor The address string.
Boolean withPort Whether to add the port to the string or not.

Return:

A pointer to the descriptor.

GetHostPort()

Purpose:

Returns the value of mHostPort.

Access :

Virtual, Public

Prototype:

virtual UInt16 GetHostPort();
Parameters:

None

Return:

The value of mHostPort.

GetIPAddress()

Purpose:

Return the 32-bit IP address of the host.

Access :

Virtual, Public

Prototype:

virtual UInt32 GetIPAddress();
Parameters:

None

Return:

The 32-bit address.

GetIPAddress()

Purpose:

Return the 32-bit IP address of the host as well as dotted decimal format.

Access :

Virtual, Public

Prototype:

virtual UInt32 GetIPAddress(Str255	outDescriptor);
Parameters:

The parameters for this method are:

 

Str255 outDescriptor The address string.

Return:

The 32-bit address.

GetIPDescriptor()

Purpose:

Convert the IP address to dotted decimal format and return this string. If a port number is specified, optionally return that at the end of the string.

Access :

Virtual, Public

Prototype:

virtual StringPtr GetIPDescriptor(
   Str255 outDescriptor, Boolean withPort);
Parameters:

The parameters for this method are:

 

Str255 outDescriptor The address string.
Boolean withPort Add the port to the string or not.

Return:

A string pointer.

InternalLookupAddress()

Purpose:

Create mapper and lookup address from DNS name.

Access :

Private

Prototype:

void InternalLookupAddress();
Parameters:

None

Return:

None

InternalLookupName()

Purpose:

Create mapper and lookup name from IP Address.

Access :

Private

Prototype:

void InternalLookupName();
Parameters:

None

Return:

None

MakeOTDNSAddress()

Purpose:

Create an Open Transport (OT) DNS address.

Access :

Virtual, Public

Prototype:

virtual void MakeOTDNSAddress( TNetbuf& outAddress 
);
Parameters:

The parameters for this method are:

 

TNetbuf& outAddress The OT address.

Return:

None

MakeOTIPAddress()

Purpose:

Make an Open Transport (OT) IP address.

Access :

Virtual, Public

Prototype:

virtual void MakeOTIPAddress( 
   TNetbuf& outAddress );
Parameters:

The parameters for this method are:

 

TNetbuf& outAddress The OT address.

Return:

None

SetDNSAddress()

Purpose:

Set the value of the mDNSAddress data member.

Access :

Virtual, Public

Prototype:

virtual void SetDNSAddress(
   ConstStringPtr inHostAddress);
Parameters:

The parameters for this method are:

 

ConstStringPtr inHostAddress The DNS address.

Return:

None

SetHostPort()

Purpose:

Set the value of the mHostPort data member.

Access :

Virtual, Public

Prototype:

virtual void SetHostPort(UInt16 inHostPort);
Parameters:

The parameters for this method are:

 

UInt16 inHostPort The host port.

Return:

None

SetIPAddress()

Purpose:

Set the value of the mIPAddress data member.

Access :

Virtual, Public

Prototype:

virtual void SetIPAddress(UInt32 inHostAddress);
Parameters:

The parameters for this method are:

 

UInt32 inHostAddress The IP address.

Return:

None

mIPAddress

Purpose:

The IP address.

Access :

Protected

Prototype:

UInt32 mIPAddress;

mDNSAddress

Purpose:

The DNS address.

Access :

Protected

Prototype:

LStr255 mDNSAddress;

mHostPort

Purpose:

The host port.

Access :

Protected

Prototype:

UInt16 mHostPort;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000