Google

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

InetMaskAddress Class Reference

Internet addresses used specifically as masking addresses (such as " 255.255.255.0") are held in the InetMaskAddress derived object. Internet Address Mask such as subnet masks. More...

#include <socket.h>

Inheritance diagram for InetMaskAddress:

InetAddress List of all members.

Public Methods

 InetMaskAddress (const char *mask)
 Create the mask from a null terminated ASCII string such as "255.255.255.128". More...

InetAddressoperator= (unsigned long addr)
 Allows assignment from the return of functions like inet_addr() or htonl().


Friends

InetHostAddress operator & (const InetHostAddress &addr, const InetMaskAddress &mask)
 Masks are usually used to coerce host addresses into a specific router or class domain. More...


Detailed Description

Internet addresses used specifically as masking addresses (such as " 255.255.255.0") are held in the InetMaskAddress derived object. Internet Address Mask such as subnet masks.

The seperate class is used so that C++ type casting can automatically determine when an InetAddress object is really a mask address object rather than simply using the base class. This also allows manipulative operators for address masking to operate only when presented with a Masked address as well as providing cleaner and safer source.

Author(s):
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

InetMaskAddress::InetMaskAddress ( const char * mask )
 

Create the mask from a null terminated ASCII string such as "255.255.255.128".

Parameters:
mask   null terminated ASCII mask string.


Member Function Documentation

InetAddress & InetMaskAddress::operator= ( unsigned long addr ) [inline]
 

Allows assignment from the return of functions like inet_addr() or htonl().

Reimplemented from InetAddress.


Friends And Related Function Documentation

InetHostAddress operator & ( const InetHostAddress & addr,
const InetMaskAddress & mask ) [friend]
 

Masks are usually used to coerce host addresses into a specific router or class domain.

This can be done by taking the Inet Host Address object and "and"ing it with an address mask. This operation can be directly expressed in C++ through the & operator.

Returns:
a internet host address that has been masked.
Parameters:
addr   host address to be masked by subnet.
mask   inetnet mask address object to mask by.


The documentation for this class was generated from the following file:
Generated at Fri Mar 23 10:47:55 2001 for CommonC++ by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000