shibboleth-3.5.0

Public Member Functions | Static Public Member Functions | List of all members
shibsp::IPRange Class Reference

Represents a range of IP addresses. More...

`#include <shibsp/util/IPRange.h>`

## Public Member Functions
| 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...

## Static Public Member Functions
static IPRange | parseCIDRBlock (const char *cidrBlock)
| Parses a CIDR block definition in to an IP range. More...

## Detailed Description

Represents a range of IP addresses.

## Constructor & Destructor Documentation

## ◆ 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

## Member Function Documentation

## ◆ 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:

- shibsp/util/IPRange.h