dhcpkit.ipv6.server.extensions.rate_limit.key_functions module

Functions to extract a key from a transaction bundle

dhcpkit.ipv6.server.extensions.rate_limit.key_functions.duid_key(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → str[source]

Get the DUID from the request in the transaction bundle

Parameters:bundle – The transaction bundle
Returns:The DUID in hex notation
dhcpkit.ipv6.server.extensions.rate_limit.key_functions.interface_id_key(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → str[source]

Get the Interface-ID from the request in the transaction bundle, with a fallback to the DUID if no Interface-ID is found.

Parameters:bundle – The transaction bundle
Returns:The Interface-ID (or DUID) in hex notation
dhcpkit.ipv6.server.extensions.rate_limit.key_functions.linklayer_id_key(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → str[source]

Get the LinkLayer-ID from the request in the transaction bundle, with a fallback to the DUID if no LinkLayer-ID is found.

Parameters:bundle – The transaction bundle
Returns:The LinkLayer-ID (or DUID) in hex notation
dhcpkit.ipv6.server.extensions.rate_limit.key_functions.remote_id_key(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → str[source]

Get the Remote-ID from the request in the transaction bundle, with a fallback to the DUID if no Remote-ID is found.

Parameters:bundle – The transaction bundle
Returns:The Remote-ID (or DUID) in hex notation
dhcpkit.ipv6.server.extensions.rate_limit.key_functions.subscriber_id_key(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → str[source]

Get the Subscriber-ID from the request in the transaction bundle, with a fallback to the DUID if no Subscriber-ID is found.

Parameters:bundle – The transaction bundle
Returns:The Subscriber-ID (or DUID) in hex notation