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

ost::IPV4Cidr Class Reference

The CIDR class is used to support routing tables and validate address policies. Classless Internet Domain Routing. More...

#include <address.h>

List of all members.

Public Member Functions

in_addr getNetwork (void) const
 Get network address associated with this cidr.

in_addr getNetmask (void) const
 Get network mask associated with this cidr.

in_addr getBroadcast (void) const
 Compute the broadcast address associated with this cidr.

void set (const char *cidr)
 Set the cidr from a full or partial hostname, or from an address/mask, or a host/bits specification.

 IPV4Cidr (const char *cidr)
 Construct a new cidr from a string.

 IPV4Cidr ()
 Construct an empty cidr.

 IPV4Cidr (IPV4Cidr &)
 Construct a copy of a cidr.

bool isMember (const struct sockaddr *saddr) const
 See if a socket address is a member of this cidr's network.

bool isMember (const struct in_addr &inaddr) const
 See if a low level address object is a member of this cidr's net.

bool operator== (const struct sockaddr *a) const
bool operator== (const struct in_addr &a) const

Protected Member Functions

unsigned getMask (const char *cp) const

Protected Attributes

in_addr netmask network


Detailed Description

The CIDR class is used to support routing tables and validate address policies. Classless Internet Domain Routing.

Author:
David Sugar <dyfet@gnutelephony.org>


Constructor & Destructor Documentation

ost::IPV4Cidr::IPV4Cidr const char *  cidr  ) 
 

Construct a new cidr from a string.

Parameters:
cidr string to use.

ost::IPV4Cidr::IPV4Cidr  ) 
 

Construct an empty cidr.

ost::IPV4Cidr::IPV4Cidr IPV4Cidr  ) 
 

Construct a copy of a cidr.

Parameters:
cidr to copy from.


Member Function Documentation

struct in_addr ost::IPV4Cidr::getBroadcast void   )  const
 

Compute the broadcast address associated with this cidr.

Returns:
system binary coded network address.

unsigned ost::IPV4Cidr::getMask const char *  cp  )  const [protected]
 

struct in_addr ost::IPV4Cidr::getNetmask void   )  const [inline]
 

Get network mask associated with this cidr.

Returns:
system binary coded network mask.

struct in_addr ost::IPV4Cidr::getNetwork void   )  const [inline]
 

Get network address associated with this cidr.

Returns:
system binary coded address.

bool ost::IPV4Cidr::isMember const struct in_addr &  inaddr  )  const
 

See if a low level address object is a member of this cidr's net.

Parameters:
inaddr object to test.
Returns:
true if member of cidr.

bool ost::IPV4Cidr::isMember const struct sockaddr *  saddr  )  const
 

See if a socket address is a member of this cidr's network.

Parameters:
saddr pointer to test.
Returns:
true if member of cidr.

bool ost::IPV4Cidr::operator== const struct in_addr &  a  )  const [inline]
 

bool ost::IPV4Cidr::operator== const struct sockaddr *  a  )  const [inline]
 

void ost::IPV4Cidr::set const char *  cidr  ) 
 

Set the cidr from a full or partial hostname, or from an address/mask, or a host/bits specification.

Parameters:
cidr string to use.


Member Data Documentation

struct in_addr netmask ost::IPV4Cidr::network [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri May 30 14:45:05 2008 for GNU CommonC++ by doxygen 1.3.5