Documentation ¶
Overview ¶
Package dhcp provides utilities for controlling DHCP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server controls a DHCP server on AP router.
func StartServer ¶
func StartServer(ctx context.Context, host *ssh.Conn, name, iface, workDir string, ipStart, ipEnd net.IP) (*Server, error)
StartServer creates and runs a DHCP server on iface of the given host with settings specified in conf. workDir is the dir on host for the server to put temporary files. name is the identifier used for log filenames in OutDir. ipStart, ipEnd specifies the leasable range for this dhcp server to offer. After getting a Server instance, d, the caller should call d.Close() at the end, and use the shortened ctx (provided by d.ReserveForClose()) before d.Close() to reserve time for it to run.
func (*Server) ReserveForClose ¶
ReserveForClose returns a shortened ctx with cancel function. The shortened ctx is used for running things before d.Close() to reserve time for it to run.