dhcpkit.ipv6.server.extensions.map.config module

Configuration elements for the MAP server option handlers

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

Bases: dhcpkit.ipv6.server.handlers.HandlerFactory

Create a handler for putting an S46MapEContainerOption in responses

create() → dhcpkit.ipv6.server.extensions.map.MapEOptionHandler[source]

Create a handler for putting an S46MapEContainerOption in responses

Returns:A handler object
class dhcpkit.ipv6.server.extensions.map.config.MapRule(section: ZConfig.matcher.SectionValue)[source]

Bases: dhcpkit.common.server.config_elements.ConfigElementFactory

Representation of a single MAP rule

a_bits

a bits: offset of the PSID bits

Returns:Number of bits
create() → dhcpkit.ipv6.extensions.map.S46RuleOption[source]

Create a MAP rule option based on the configuration.

Returns:The mapping rule
ea_len

Calculate the number of Embedded Address bits.

Returns:Number of bits
k_bits

k bits: length in bits of the PSID (2^k == sharing_ratio)

Returns:Number of bits
m_bits

m bits: number of bits after the PSID (2^m == contiguous ports)

Returns:Number of bits
validate_config_section()[source]

Check whether the combination of parameters make sense.

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

Bases: dhcpkit.ipv6.server.handlers.HandlerFactory

Create a handler for putting an S46MapTContainerOption in responses

create() → dhcpkit.ipv6.server.extensions.map.MapTOptionHandler[source]

Create a handler for putting an S46MapTContainerOption in responses

Returns:A handler object
dhcpkit.ipv6.server.extensions.map.config.power_of_two(value: str) → int[source]

Validate whether this is an integer that is a power of two.

Parameters:value – The config string
Returns:The integer value