dhcpkit.ipv6.server.extensions.rate_limit.config module

Config processing for a handler to rate limit clients

class dhcpkit.ipv6.server.extensions.rate_limit.config.RateLimitHandlerFactory(section: ZConfig.matcher.SectionValue)[source]

Bases: dhcpkit.ipv6.server.handlers.HandlerFactory

Config processing for a handler to rate limit clients

create() → dhcpkit.ipv6.server.extensions.rate_limit.RateLimitHandler[source]

Create a handler of this class based on the configuration in the config section.

Returns:A handler object
dhcpkit.ipv6.server.extensions.rate_limit.config.duration(config_duration: str) → int[source]

Convert the config duration to an integer.

Parameters:config_duration – The duration as a string
Returns:The duration as an integer
dhcpkit.ipv6.server.extensions.rate_limit.config.key_function(key_name: str) → function[source]

Map from name to key extraction function.

Parameters:key_name – The name of the function
Returns:The specified function
dhcpkit.ipv6.server.extensions.rate_limit.config.rate(configured_rate: str) → int[source]

Convert the config rate to an integer.

Parameters:configured_rate – The number of messages as a string
Returns:The number of messages as an integer