dhcpkit.ipv6.server.listeners.udp module

UDP implementations of listeners and repliers

class dhcpkit.ipv6.server.listeners.udp.UDPListener(interface_name: str, listen_socket: socket.socket, reply_socket: socket.socket = None, global_address: ipaddress.IPv6Address = None, marks: Iterable = None)[source]

Bases: dhcpkit.ipv6.server.listeners.Listener

A wrapper for a normal socket that bundles a socket to listen on with a (potentially different) socket to send replies from.

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.udp.UDPReplier(reply_socket: socket.socket)[source]

Bases: dhcpkit.ipv6.server.listeners.Replier

A class to send replies to the client

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