Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start launches a DHCPv4 client for the given interface. If preferredClient is empty, uses the native client. If preferredClient is "dhclient", "dhcpcd", or "udhcpc", uses that external client. In daemon mode, native client stays running to renew leases; otherwise it's oneshot.
Types ¶
type Lease ¶
type Lease struct {
Interface string `json:"interface"`
IP string `json:"ip"`
SubnetMask string `json:"subnet_mask"`
Router string `json:"router"`
DNS []string `json:"dns"`
Domain string `json:"domain,omitempty"`
ServerIP string `json:"server_ip"`
LeaseTime uint32 `json:"lease_time"`
RenewTime uint32 `json:"renew_time"`
RebindTime uint32 `json:"rebind_time"`
AcquiredAt time.Time `json:"acquired_at"`
}
Lease holds DHCPv4 lease information.
func (*Lease) ExpiryDeadline ¶
ExpiryDeadline returns when the lease expires.
func (*Lease) RebindDeadline ¶
RebindDeadline returns when the lease enters rebinding state.
func (*Lease) RenewalDeadline ¶
RenewalDeadline returns when the lease should be renewed.
type LeaseV6 ¶
type LeaseV6 struct {
Interface string `json:"interface"`
Addresses []V6Addr `json:"addresses"`
DNS []string `json:"dns"`
ServerDUID []byte `json:"server_duid"`
ClientDUID []byte `json:"client_duid"`
IAID uint32 `json:"iaid"`
RenewTime uint32 `json:"renew_time"`
RebindTime uint32 `json:"rebind_time"`
AcquiredAt time.Time `json:"acquired_at"`
}
LeaseV6 holds DHCPv6 lease information.
func (*LeaseV6) ExpiryDeadline ¶
ExpiryDeadline returns when the first DHCPv6 address becomes invalid.
func (*LeaseV6) RebindDeadline ¶
RebindDeadline returns when the earliest DHCPv6 IA_NA must be rebound.
func (*LeaseV6) RenewalDeadline ¶
RenewalDeadline returns when the earliest DHCPv6 IA_NA should be renewed.