dhcpcanon Python API Reference

dhcpcanon.dhcpcapfsm
dhcpcanon.dhcpcap
dhcpcanon.dhcpcaplease
dhcpcanon.clientscript
dhcpcanon.timers Timers for the DHCP client implementation of the Anonymity Profile ([RFC 7844]).
dhcpcanon.dhcpcaputils
dhcpcanon.constants Constants for the DHCP client implementation of the Anonymity Profile ([RFC 7844]).
dhcpcanon.conflog Logging configuration.

dhcpcapfsm module

dhcpcap module

dhcpcaplease module

clientscript module

timers module

Timers for the DHCP client implementation of the Anonymity Profile ([RFC 7844]).

dhcpcanon.timers.future_dt_str(dt, td)[source]

.

dhcpcanon.timers.gen_delay_selecting()[source]

Generate the delay in seconds in which the DISCOVER will be sent.

[RFC 2131#section-4.4.1]:

The client SHOULD wait a random time between one and ten seconds to
desynchronize the use of DHCP at startup.
dhcpcanon.timers.gen_rebinding_time(lease_time, elapsed=0)[source]

.

dhcpcanon.timers.gen_renewing_time(lease_time, elapsed=0)[source]

Generate RENEWING time.

[RFC 2131#section-4.4.5]:

T1
defaults to (0.5 * duration_of_lease).  T2 defaults to (0.875 *
duration_of_lease).  Times T1 and T2 SHOULD be chosen with some
random "fuzz" around a fixed value, to avoid synchronization of
client reacquisition.
dhcpcanon.timers.gen_timeout_request_rebind(lease)[source]

.

dhcpcanon.timers.gen_timeout_request_renew(lease)[source]

Generate time in seconds to retransmit DHCPREQUEST.

[RFC 2131#section-4..4.5]:

In both RENEWING and REBINDING states,
if the client receives no response to its DHCPREQUEST
message, the client SHOULD wait one-half of the remaining
time until T2 (in RENEWING state) and one-half of the
remaining lease time (in REBINDING state), down to a
minimum of 60 seconds, before retransmitting the
DHCPREQUEST message.
dhcpcanon.timers.gen_timeout_resend(attempts)[source]

Generate the time in seconds in which DHCPDISCOVER wil be retransmited.

[RFC 2131#section-3.1]:

might retransmit the
DHCPREQUEST message four times, for a total delay of 60 seconds

[RFC 2131#section-4.1]:

For example, in a 10Mb/sec Ethernet
internetwork, the delay before the first retransmission SHOULD be 4
seconds randomized by the value of a uniform random number chosen
from the range -1 to +1.  Clients with clocks that provide resolution
granularity of less than one second may choose a non-integer
randomization value.  The delay before the next retransmission SHOULD
be 8 seconds randomized by the value of a uniform number chosen from
the range -1 to +1.  The retransmission delay SHOULD be doubled with
subsequent retransmissions up to a maximum of 64 seconds.
dhcpcanon.timers.nowutc()[source]

.

dhcpcaputils module

constants module

Constants for the DHCP client implementation of the Anonymity Profile ([RFC 7844]).

dhcpcanon.constants.PRL = b'\x01\x03\x06\x0f\x1f!+,./y\xf9\xfc'

SD_DHCP_OPTION_SUBNET_MASK = 1 SD_DHCP_OPTION_ROUTER = 3 SD_DHCP_OPTION_DOMAIN_NAME_SERVER = 6 SD_DHCP_OPTION_DOMAIN_NAME = 15 SD_DHCP_OPTION_ROUTER_DISCOVER = 31 SD_DHCP_OPTION_STATIC_ROUTE = 33 SD_DHCP_OPTION_VENDOR_SPECIFIC = 43 SD_DHCP_OPTION_NETBIOS_NAMESERVER = 44 SD_DHCP_OPTION_NETBIOS_NODETYPE = 46 SD_DHCP_OPTION_NETBIOS_SCOPE = 47 SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE = 121 SD_DHCP_OPTION_PRIVATE_CLASSLESS_STATIC_ROUTE = 249 SD_DHCP_OPTION_PRIVATE_PROXY_AUTODISCOVERY = 252

conflog module

Logging configuration.