dhcpkit.ipv6.server.listeners package

Code to keep the receiving and sending sockets together. When receiving traffic on a link-local multicast address the reply should be sent from a link-local address on the receiving interface. This class makes it easy to keep those together.

exception dhcpkit.ipv6.server.listeners.ClosedListener[source]

Bases: dhcpkit.ipv6.server.listeners.ListeningSocketError

Signal that the socket isn’t done receiving yet

exception dhcpkit.ipv6.server.listeners.IgnoreMessage[source]

Bases: dhcpkit.ipv6.server.listeners.ListeningSocketError

Signal that this message should be ignored

class dhcpkit.ipv6.server.listeners.IncomingPacketBundle(*, message_id: str = '??????', data: bytes = b'', source_address: ipaddress.IPv6Address = None, link_address: ipaddress.IPv6Address = None, interface_index: int = -1, received_over_multicast: bool = False, received_over_tcp: bool = False, marks: Iterable = None, relay_options: Iterable = None)[source]

Bases: object

A class that is very efficient to pickle because this is what will be sent to worker processes.

Using a class instead of a namedtuple makes it easier to extend it in the future. To make this possible all properties should have a default value, and the constructor must be called with keyword arguments only.

exception dhcpkit.ipv6.server.listeners.IncompleteMessage[source]

Bases: dhcpkit.ipv6.server.listeners.IgnoreMessage

Signal that the socket isn’t done receiving yet

class dhcpkit.ipv6.server.listeners.Listener[source]

Bases: object

A class to represent something listening for incoming requests.

fileno() → int[source]

The fileno of the listening socket, so this object can be used by select()

Returns:The file descriptor
recv_request() → Tuple[source]

Receive incoming messages

Returns:The incoming packet data and a replier object
class dhcpkit.ipv6.server.listeners.ListenerCreator[source]

Bases: object

A class to represent something that creates something to listen for incoming requests.

create_listener() → Union[source]

Receive incoming messages

Returns:The incoming packet data and a replier object
fileno() → int[source]

The fileno of the listening socket, so this object can be used by select()

Returns:The file descriptor
exception dhcpkit.ipv6.server.listeners.ListenerError[source]

Bases: Exception

Base class for listener errors

exception dhcpkit.ipv6.server.listeners.ListeningSocketError[source]

Bases: dhcpkit.ipv6.server.listeners.ListenerError

Signal that the listening socket could not be created.

class dhcpkit.ipv6.server.listeners.Replier[source]

Bases: object

A class to send replies to the client

can_send_multiple = False
send_reply(outgoing_message: dhcpkit.ipv6.messages.RelayReplyMessage) → bool[source]

Send a reply to the client

Parameters:outgoing_message – The message to send, including a wrapping RelayReplyMessage
Returns:Whether sending was successful
dhcpkit.ipv6.server.listeners.increase_message_counter()[source]

Increase the message counter and return the new value

Returns:The new value of the message counter