Represents a range of IP addresses.
More...
#include <shibsp/util/IPRange.h>
|
| IPRange (const std::bitset< 32 > &address, int maskSize) |
| Constructor. More...
|
|
| IPRange (const std::bitset< 128 > &address, int maskSize) |
| Constructor. More...
|
|
bool | contains (const char *address) const |
| Determines whether the given address is contained in the IP range. More...
|
|
bool | contains (const struct sockaddr *address) const |
| Determines whether the given address is contained in the IP range. More...
|
|
Represents a range of IP addresses.
◆ IPRange() [1/2]
shibsp::IPRange::IPRange |
( |
const std::bitset< 32 > & |
address, |
|
|
int |
maskSize |
|
) |
| |
Constructor.
- Parameters
-
address | address to base the range on; may be the network address or the address of a host within the network |
maskSize | the number of bits in the netmask |
◆ IPRange() [2/2]
shibsp::IPRange::IPRange |
( |
const std::bitset< 128 > & |
address, |
|
|
int |
maskSize |
|
) |
| |
Constructor.
- Parameters
-
address | address to base the range on; may be the network address or the address of a host within the network |
maskSize | the number of bits in the netmask |
◆ contains() [1/2]
bool shibsp::IPRange::contains |
( |
const char * |
address | ) |
const |
Determines whether the given address is contained in the IP range.
- Parameters
-
address | the address to check |
- Returns
- true iff the address is in the range
◆ contains() [2/2]
bool shibsp::IPRange::contains |
( |
const struct sockaddr * |
address | ) |
const |
Determines whether the given address is contained in the IP range.
- Parameters
-
address | the address to check |
- Returns
- true iff the address is in the range
◆ parseCIDRBlock()
static IPRange shibsp::IPRange::parseCIDRBlock |
( |
const char * |
cidrBlock | ) |
|
|
static |
Parses a CIDR block definition in to an IP range.
- Parameters
-
cidrBlock | the CIDR block definition |
- Returns
- the resultant IP range
The documentation for this class was generated from the following file: