dhcpd

package
v2.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHCPHandler

type DHCPHandler struct {
	sabakan.Model
	MyURL *url.URL
}

DHCPHandler is an implementation of Handler using sabakan.Model.

func (DHCPHandler) ServeDHCP

func (h DHCPHandler) ServeDHCP(ctx context.Context, pkt *dhcp4.Packet, intf Interface) (*dhcp4.Packet, error)

ServeDHCP implements Handler interface

type Handler

type Handler interface {
	ServeDHCP(ctx context.Context, pkt *dhcp4.Packet, intf Interface) (*dhcp4.Packet, error)
}

Handler defines an interface for Server.

type Interface

type Interface interface {
	Addrs() ([]net.Addr, error)
	Name() string
}

Interface is an abstract network interface.

type Server

type Server struct {
	Handler Handler
	Conn    *dhcp4.Conn
}

Server is DHCP4 server.

func (Server) Serve

func (s Server) Serve(ctx context.Context) error

Serve runs until context is canceled.

Once ctx is canceled, s.Conn will be closed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL