The CIDR class is used to support routing tables and validate address policies.
More...
#include <address.h>
Collaboration diagram for IPV4Cidr:
Public Member Functions
Get network address associated with this cidr.
More...
Get network mask associated with this cidr.
More...
Compute the broadcast address associated with this cidr.
More...
void
set (const char *cidr)
Set the cidr from a full or partial hostname, or from an address/mask, or a host/bits specification.
More...
Construct a new cidr from a string.
More...
Construct a copy of a cidr.
More...
bool
isMember (const struct sockaddr *saddr) const
See if a socket address is a member of this cidr's network.
More...
bool
isMember (const struct in_addr &inaddr) const
See if a low level address object is a member of this cidr's net.
More...
Protected Member Functions
unsigned
getMask (const char *cp) const
Protected Attributes
Detailed Description
Constructor & Destructor Documentation
IPV4Cidr::IPV4Cidr
(
const char *
cidr )
Construct a new cidr from a string.
- Parameters
-
cidr string to use.
Construct a copy of a cidr.
- Parameters
-
cidr to copy from.
Member Function Documentation
struct in_addr IPV4Cidr::getBroadcast
(
void
)
const
Compute the broadcast address associated with this cidr.
- Returns
- system binary coded network address.
unsigned IPV4Cidr::getMask
(
const char *
cp )
const
protected
struct in_addr IPV4Cidr::getNetmask
(
void
)
const
inline
Get network mask associated with this cidr.
- Returns
- system binary coded network mask.
Definition at line 186 of file address.h.
struct in_addr IPV4Cidr::getNetwork
(
void
)
const
inline
Get network address associated with this cidr.
- Returns
- system binary coded address.
Definition at line 178 of file address.h.
bool 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 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 IPV4Cidr::operator==
(
const struct sockaddr *
a )
const
inline
bool IPV4Cidr::operator==
(
const struct in_addr &
a )
const
inline
void 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.
Field Documentation
struct in_addr netmask IPV4Cidr::network
protected
The documentation for this class was generated from the following file: