dhcpkit.ipv6.server.handlers package

Handlers to apply to transaction bundles

exception dhcpkit.ipv6.server.handlers.CannotRespondError[source]

Bases: dhcpkit.ipv6.server.handlers.HandlerException

This exception signals that we cannot reply to this client.

class dhcpkit.ipv6.server.handlers.Handler[source]

Bases: object

Base class for handlers

analyse_post(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Analyse the response that is going out after all handlers have been applied.

Parameters:bundle – The transaction bundle
analyse_pre(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Analyse the request that came in before handlers can change it.

Parameters:bundle – The transaction bundle
handle(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Handle the data in the bundle. Subclasses should do their main work here.

Parameters:bundle – The transaction bundle
post(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Post-process the data in the bundle. Subclasses can e.g. clean up state. Subclasses assigning addresses should check whether the bundle.response is an AdvertiseMessage or a ReplyMessage. The class can change between handle() and post() when the server is using rapid-commit.

Parameters:bundle – The transaction bundle
pre(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Pre-process the data in the bundle. Subclasses can update bundle state here or abort processing of the request by raising a CannotRespondError.

Parameters:bundle – The transaction bundle
worker_init()[source]

The __init__ method will be called in the master process. After initialisation the master process will create worker processes using the multiprocessing module. Things that can’t be pickled and transmitted to the worker processes (think database connections etc) have to be initialised separately. Each worker process will call worker_init() to do so. Filters that don’t need per-worker initialisation can do everything in __init__().

exception dhcpkit.ipv6.server.handlers.HandlerException[source]

Bases: Exception

Base class for handler exceptions

class dhcpkit.ipv6.server.handlers.HandlerFactory(section: ZConfig.matcher.SectionValue)[source]

Bases: dhcpkit.common.server.config_elements.ConfigElementFactory

Base class for handler factories

class dhcpkit.ipv6.server.handlers.RelayHandler[source]

Bases: dhcpkit.ipv6.server.handlers.Handler

A base class for handlers that work on option in the relay messages chain.

handle(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Handle the data in the bundle by checking the relay chain and calling handle_relay() for each relay message.

Parameters:bundle – The transaction bundle
handle_relay(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle, relay_message_in: dhcpkit.ipv6.messages.RelayForwardMessage, relay_message_out: dhcpkit.ipv6.messages.RelayReplyMessage)[source]

Handle the options for each relay message pair.

Parameters:
  • bundle – The transaction bundle
  • relay_message_in – The incoming relay message
  • relay_message_out – Thr outgoing relay message
exception dhcpkit.ipv6.server.handlers.ReplyWithLeasequeryError(status_code: int = 0, status_message: str = '')[source]

Bases: dhcpkit.ipv6.server.handlers.ReplyWithStatusError

This exception signals a leasequery error to the client.

error_description = 'Leasequery error'
exception dhcpkit.ipv6.server.handlers.ReplyWithStatusError(status_code: int = 0, status_message: str = '')[source]

Bases: dhcpkit.ipv6.server.handlers.HandlerException

This exception signals an error to the client.

error_description = 'Error'
exception dhcpkit.ipv6.server.handlers.UseMulticastError[source]

Bases: dhcpkit.ipv6.server.handlers.HandlerException

This exception signals that a STATUS_USE_MULTICAST should be returned to the client.