Kea: isc::limits Namespace Reference

| Kea 3.2.0-git

isc::limits Namespace Reference

## Classes
struct | AddressLimitConfiguration
| the configuration manager for address limiting More...
struct | Configuration
| a datastore used for configuring functionally dedicated parts of the limits library More...
struct | LimitManager
| Provides the capability to limit the number of leases or the response rate. More...
struct | PrefixLimitConfiguration
| the configuration manager for prefix limiting More...
struct | ProtectedTimeSeries
| Holds a number of time points, used in limiting by a single criterion, and a mutex to protect concurrent reads and writes. More...
struct | RateLimit
| a single rate-limiting entry configured as "rate-limit": "<n> packet[s] per <time-unit>" More...
struct | RateLimitConfiguration
| the configuration manager for rate limiting More...

## Typedefs
typedef boost::shared_ptr< const Element > | ConstElementPtr
using | LeaseLimit = uint32_t
| a single lease-limiting entry configured as an integer
typedef std::shared_ptr< ProtectedTimeSeries > | ProtectedTimeSeriesPtr
| Defines a smart pointer to a ProtectedTimeSeries.
using | TimePoint = std::chrono::time_point<std::chrono::system_clock>
| a point in time
using | TimeSeries = boost::circular_buffer<TimePoint>
| Holds a number of time points, used in limiting by a single criterion.

## Functions
int | cb4_updated (CalloutHandle &handle)
| Callout at the cb4_updated hook point.
int | cb6_updated (CalloutHandle &handle)
| Callout at the cb6_updated hook point.
int | dhcp4_srv_configured (CalloutHandle &handle)
| dhcp4_srv_configured callout implementation
int | dhcp6_srv_configured (CalloutHandle &handle)
| dhcp6_srv_configured callout implementation
int | lease4_renew (CalloutHandle &handle)
| Callout at the leases4_renew hook point.
int | lease4_select (CalloutHandle &handle)
| Callout at the leases4_select hook point.
int | lease6_rebind (CalloutHandle &handle)
| Callout at the lease6_rebind hook point.
int | lease6_renew (CalloutHandle &handle)
| Callout at the lease6_renew hook point.
int | lease6_select (CalloutHandle &handle)
| Callout at the lease6_select hook point.
int | load (isc::hooks::LibraryHandle &handle)
| Called by the hooks library manager when the library is loaded.
int | multi_threading_compatible ()
| Return multi-threading compatibility.
int | pkt4_receive (CalloutHandle &handle)
| Callout at the pkt4_receive hook point.
int | pkt6_receive (CalloutHandle &handle)
| Callout at the pkt6_receive hook point.
int | subnet4_select (CalloutHandle &handle)
| Callout at the subnet4_select hook point.
int | subnet6_select (CalloutHandle &handle)
| Callout at the subnet6_select hook point.
int | unload ()
| Called by the hooks library manager when the library is unloaded.
int | version ()
| Version function required by Hooks API for compatibility checks.

## Variables
const int | DBGLVL_TRACE_BASIC
| Trace basic operations.
const isc::log::MessageID | LIMITS_CONFIGURATION_LEASE_BACKEND_NOT_AVAILABLE = "LIMITS_CONFIGURATION_LEASE_BACKEND_NOT_AVAILABLE"
const isc::log::MessageID | LIMITS_CONFIGURATION_LEASE_BACKEND_SHOULD_HAVE_BEEN_AVAILABLE = "LIMITS_CONFIGURATION_LEASE_BACKEND_SHOULD_HAVE_BEEN_AVAILABLE"
const isc::log::MessageID | LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_CLIENT_CLASS"
const isc::log::MessageID | LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_SUBNET"
const isc::log::MessageID | LIMITS_CONFIGURED_PREFIX_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_PREFIX_LIMIT_BY_CLIENT_CLASS"
const isc::log::MessageID | LIMITS_CONFIGURED_PREFIX_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_PREFIX_LIMIT_BY_SUBNET"
const isc::log::MessageID | LIMITS_CONFIGURED_RATE_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_RATE_LIMIT_BY_CLIENT_CLASS"
const isc::log::MessageID | LIMITS_CONFIGURED_RATE_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_RATE_LIMIT_BY_SUBNET"
const isc::log::MessageID | LIMITS_LEASE_LIMIT_EXCEEDED = "LIMITS_LEASE_LIMIT_EXCEEDED"
const isc::log::MessageID | LIMITS_LEASE_WITHIN_LIMITS = "LIMITS_LEASE_WITHIN_LIMITS"
isc::log::Logger | limits_logger ("limits-hooks")
const isc::log::MessageID | LIMITS_PACKET_WIIH_SUBNET_ID_RATE_NO_SUBNET = "LIMITS_PACKET_WIIH_SUBNET_ID_RATE_NO_SUBNET"
const isc::log::MessageID | LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_DROPPED = "LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_DROPPED"
const isc::log::MessageID | LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_HONORED = "LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_HONORED"
const isc::log::MessageID | LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_DROPPED = "LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_DROPPED"
const isc::log::MessageID | LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_HONORED = "LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_HONORED"

## Typedef Documentation

## ◆ ConstElementPtr

typedef boost::shared_ptr<const Element> isc::data::ConstElementPtr

Definition at line 30 of file data.h.

## ◆ LeaseLimit

using isc::limits::LeaseLimit = uint32_t

a single lease-limiting entry configured as an integer

Definition at line 41 of file configuration.h.

## ◆ ProtectedTimeSeriesPtr

typedef std::shared_ptr<ProtectedTimeSeries> isc::limits::ProtectedTimeSeriesPtr

Defines a smart pointer to a ProtectedTimeSeries.

Definition at line 53 of file limit_manager.h.

## ◆ TimePoint

using isc::limits::TimePoint = std::chrono::time_point<std::chrono::system_clock>

a point in time

Definition at line 36 of file limit_manager.h.

## ◆ TimeSeries

using isc::limits::TimeSeries = boost::circular_buffer<TimePoint>

Holds a number of time points, used in limiting by a single criterion.

It is important to use a data structure that ensures O(1) deletion.

Definition at line 40 of file limit_manager.h.

## Function Documentation

## ◆ cb4_updated()

int isc::limits::cb4_updated | ( | CalloutHandle & | handle | ) |

Callout at the cb4_updated hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success

Definition at line 35 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ cb6_updated()

int isc::limits::cb6_updated | ( | CalloutHandle & | handle | ) |

Callout at the cb6_updated hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success

Definition at line 35 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ dhcp4_srv_configured()

int isc::limits::dhcp4_srv_configured | ( | CalloutHandle & | handle | ) |

dhcp4_srv_configured callout implementation

Parameters

  handle | CalloutHandle

Returns
  0 on success, non-zero otherwise.

Definition at line 45 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ dhcp6_srv_configured()

int isc::limits::dhcp6_srv_configured | ( | CalloutHandle & | handle | ) |

dhcp6_srv_configured callout implementation

Parameters

  handle | CalloutHandle

Returns
  0 on success, non-zero otherwise.

Definition at line 45 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ lease4_renew()

int isc::limits::lease4_renew | ( | CalloutHandle & | handle | ) |

Callout at the leases4_renew hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 85 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ lease4_select()

int isc::limits::lease4_select | ( | CalloutHandle & | handle | ) |

Callout at the leases4_select hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 75 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ lease6_rebind()

int isc::limits::lease6_rebind | ( | CalloutHandle & | handle | ) |

Callout at the lease6_rebind hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 95 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ lease6_renew()

int isc::limits::lease6_renew | ( | CalloutHandle & | handle | ) |

Callout at the lease6_renew hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 85 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ lease6_select()

int isc::limits::lease6_select | ( | CalloutHandle & | handle | ) |

Callout at the lease6_select hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 75 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ load()

int isc::limits::load | ( | isc::hooks::LibraryHandle & | handle | ) |

Called by the hooks library manager when the library is loaded.

Parameters

  handle | LibraryHandle

Returns
  0 on success, non-zero otherwise.

Definition at line 35 of file limits/load_unload.cc.

References isc::dhcp::CfgMgr::getFamily(), isc::hooks::LibraryHandle::getParameters(), isc::process::Daemon::getProcName(), isc::limits::LimitManager::initialize(), isc::dhcp::CfgMgr::instance(), isc::limits::LimitManager::instance(), and isc_throw.

Here is the call graph for this function:

## ◆ multi_threading_compatible()

int isc::limits::multi_threading_compatible | ( |  | ) |

Return multi-threading compatibility.

Returns
  1 means compatible with multi-threading.

Definition at line 84 of file limits/load_unload.cc.

## ◆ pkt4_receive()

int isc::limits::pkt4_receive | ( | CalloutHandle & | handle | ) |

Callout at the pkt4_receive hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 55 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ pkt6_receive()

int isc::limits::pkt6_receive | ( | CalloutHandle & | handle | ) |

Callout at the pkt6_receive hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 55 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ subnet4_select()

int isc::limits::subnet4_select | ( | CalloutHandle & | handle | ) |

Callout at the subnet4_select hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 65 of file dhcpv4_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ subnet6_select()

int isc::limits::subnet6_select | ( | CalloutHandle & | handle | ) |

Callout at the subnet6_select hook point.

Parameters

  handle | CalloutHandle which provides access to context

Returns
  0 upon success, non-zero otherwise.

Definition at line 65 of file dhcpv6_callouts.cc.

References isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ unload()

int isc::limits::unload | ( |  | ) |

Called by the hooks library manager when the library is unloaded.

Returns
  0 on success, non-zero otherwise.

Definition at line 67 of file limits/load_unload.cc.

References isc::dhcp::LeaseMgr::clearClassLeaseCounts(), isc::dhcp::LeaseMgrFactory::haveInstance(), isc::limits::LimitManager::initialize(), isc::dhcp::LeaseMgrFactory::instance(), and isc::limits::LimitManager::instance().

Here is the call graph for this function:

## ◆ version()

int isc::limits::version | ( |  | ) |

Version function required by Hooks API for compatibility checks.

Definition at line 18 of file dhcp/limits/version.cc.

## Variable Documentation

## ◆ DBGLVL_TRACE_BASIC

const int isc::log::DBGLVL_TRACE_BASIC

Trace basic operations.

Definition at line 19 of file log_dbglevels.h.

Referenced by isc::limits::AddressLimitConfiguration::logClientClassLimit(), isc::limits::PrefixLimitConfiguration::logClientClassLimit(), isc::limits::RateLimitConfiguration::logClientClassLimit(), isc::limits::AddressLimitConfiguration::logSubnetLimit(), isc::limits::PrefixLimitConfiguration::logSubnetLimit(), and isc::limits::RateLimitConfiguration::logSubnetLimit().

## ◆ LIMITS_CONFIGURATION_LEASE_BACKEND_NOT_AVAILABLE

const isc::log::MessageID isc::limits::LIMITS_CONFIGURATION_LEASE_BACKEND_NOT_AVAILABLE = "LIMITS_CONFIGURATION_LEASE_BACKEND_NOT_AVAILABLE"
| extern

Definition at line 11 of file limits_messages.h.

Referenced by isc::limits::LimitManager::dhcp_srv_configured().

## ◆ LIMITS_CONFIGURATION_LEASE_BACKEND_SHOULD_HAVE_BEEN_AVAILABLE

const isc::log::MessageID isc::limits::LIMITS_CONFIGURATION_LEASE_BACKEND_SHOULD_HAVE_BEEN_AVAILABLE = "LIMITS_CONFIGURATION_LEASE_BACKEND_SHOULD_HAVE_BEEN_AVAILABLE"
| extern

Definition at line 12 of file limits_messages.h.

Referenced by isc::limits::LimitManager::dhcp_srv_configured().

## ◆ LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_CLIENT_CLASS

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_CLIENT_CLASS"
| extern

Definition at line 13 of file limits_messages.h.

Referenced by isc::limits::AddressLimitConfiguration::logClientClassLimit().

## ◆ LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_SUBNET

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_ADDRESS_LIMIT_BY_SUBNET"
| extern

Definition at line 14 of file limits_messages.h.

Referenced by isc::limits::AddressLimitConfiguration::logSubnetLimit().

## ◆ LIMITS_CONFIGURED_PREFIX_LIMIT_BY_CLIENT_CLASS

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_PREFIX_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_PREFIX_LIMIT_BY_CLIENT_CLASS"
| extern

Definition at line 15 of file limits_messages.h.

Referenced by isc::limits::PrefixLimitConfiguration::logClientClassLimit().

## ◆ LIMITS_CONFIGURED_PREFIX_LIMIT_BY_SUBNET

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_PREFIX_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_PREFIX_LIMIT_BY_SUBNET"
| extern

Definition at line 16 of file limits_messages.h.

Referenced by isc::limits::PrefixLimitConfiguration::logSubnetLimit().

## ◆ LIMITS_CONFIGURED_RATE_LIMIT_BY_CLIENT_CLASS

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_RATE_LIMIT_BY_CLIENT_CLASS = "LIMITS_CONFIGURED_RATE_LIMIT_BY_CLIENT_CLASS"
| extern

Definition at line 17 of file limits_messages.h.

Referenced by isc::limits::RateLimitConfiguration::logClientClassLimit().

## ◆ LIMITS_CONFIGURED_RATE_LIMIT_BY_SUBNET

const isc::log::MessageID isc::limits::LIMITS_CONFIGURED_RATE_LIMIT_BY_SUBNET = "LIMITS_CONFIGURED_RATE_LIMIT_BY_SUBNET"
| extern

Definition at line 18 of file limits_messages.h.

Referenced by isc::limits::RateLimitConfiguration::logSubnetLimit().

## ◆ LIMITS_LEASE_LIMIT_EXCEEDED

const isc::log::MessageID isc::limits::LIMITS_LEASE_LIMIT_EXCEEDED = "LIMITS_LEASE_LIMIT_EXCEEDED"
| extern

Definition at line 19 of file limits_messages.h.

Referenced by isc::limits::LimitManager::lease_callout().

## ◆ LIMITS_LEASE_WITHIN_LIMITS

const isc::log::MessageID isc::limits::LIMITS_LEASE_WITHIN_LIMITS = "LIMITS_LEASE_WITHIN_LIMITS"
| extern

Definition at line 20 of file limits_messages.h.

Referenced by isc::limits::LimitManager::lease_callout().

## ◆ limits_logger

isc::log::Logger isc::limits::limits_logger | ( | "limits-hooks" |  | ) |

Definition at line 18 of file limits_logger.h.

Referenced by isc::limits::LimitManager::dhcp_srv_configured(), isc::limits::LimitManager::lease_callout(), isc::limits::AddressLimitConfiguration::logClientClassLimit(), isc::limits::PrefixLimitConfiguration::logClientClassLimit(), isc::limits::RateLimitConfiguration::logClientClassLimit(), isc::limits::AddressLimitConfiguration::logSubnetLimit(), isc::limits::PrefixLimitConfiguration::logSubnetLimit(), isc::limits::RateLimitConfiguration::logSubnetLimit(), isc::limits::LimitManager::pkt_receive(), and isc::limits::LimitManager::subnet_select().

## ◆ LIMITS_PACKET_WIIH_SUBNET_ID_RATE_NO_SUBNET

const isc::log::MessageID isc::limits::LIMITS_PACKET_WIIH_SUBNET_ID_RATE_NO_SUBNET = "LIMITS_PACKET_WIIH_SUBNET_ID_RATE_NO_SUBNET"
| extern

Definition at line 21 of file limits_messages.h.

Referenced by isc::limits::LimitManager::subnet_select().

## ◆ LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_DROPPED

const isc::log::MessageID isc::limits::LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_DROPPED = "LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_DROPPED"
| extern

Definition at line 22 of file limits_messages.h.

Referenced by isc::limits::LimitManager::pkt_receive().

## ◆ LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_HONORED

const isc::log::MessageID isc::limits::LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_HONORED = "LIMITS_PACKET_WITH_CLIENT_CLASSES_RATE_LIMIT_HONORED"
| extern

Definition at line 23 of file limits_messages.h.

Referenced by isc::limits::LimitManager::pkt_receive().

## ◆ LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_DROPPED

const isc::log::MessageID isc::limits::LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_DROPPED = "LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_DROPPED"
| extern

Definition at line 24 of file limits_messages.h.

Referenced by isc::limits::LimitManager::subnet_select().

## ◆ LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_HONORED

const isc::log::MessageID isc::limits::LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_HONORED = "LIMITS_PACKET_WITH_SUBNET_ID_RATE_LIMIT_HONORED"
| extern

Definition at line 25 of file limits_messages.h.

Referenced by isc::limits::LimitManager::subnet_select().