dhcpkit.ipv6.server.extensions.static_assignments.sqlite module

An option handler that assigns addresses based on DUID from a SQLite database

class dhcpkit.ipv6.server.extensions.static_assignments.sqlite.SqliteStaticAssignmentHandler(filename: str, address_preferred_lifetime: int, address_valid_lifetime: int, prefix_preferred_lifetime: int, prefix_valid_lifetime: int)[source]

Bases: dhcpkit.ipv6.server.extensions.static_assignments.StaticAssignmentHandler

Assign addresses and/or prefixes based on the contents of a Shelf file

get_assignment(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle) → dhcpkit.ipv6.server.extensions.static_assignments.Assignment[source]

Look up the assignment based on DUID, Interface-ID of the relay closest to the client and Remote-ID of the relay closest to the client, in that order.

Parameters:bundle – The transaction bundle
Returns:The assignment, if any
worker_init()[source]

Open the SQLite database in each worker

dhcpkit.ipv6.server.extensions.static_assignments.sqlite.build_sqlite() → int[source]

Function to be called from the command line to convert a CSV based assignments file to a sqlite database. :return: exit code