Versions in this module Expand all Collapse all v1 v1.1.0 Nov 1, 2016 Changes in this version + const BOOLEAN + const COMMENT + const DEFAULT_LEASE_TIME + const END + const EOF + const FREE_LEASE_AFTER + const GLOBAL + const ILLEGAL + const IP_ADDRESS + const MAX_LEASE_TIME + const NETWORK + const NUMBER + const OPTION + const POOL + const RANGE + const REGISTERED + const SERVER_IDENTIFIER + const STRING + const SUBNET + const UNREGISTERED v1.0.0 Sep 29, 2016 Changes in this version + func IsRegisteredByIP(s LeaseStore, ip net.IP) (bool, error) + type Config struct + func ParseFile(path string) (*Config, error) + type Device interface + GetID func() int + GetMAC func() net.HardwareAddr + GetUsername func() string + IsBlacklisted func() bool + IsExpired func() bool + IsRegistered func() bool + Save func() error + SetLastSeen func(time.Time) + type DeviceStore interface + GetDeviceByMAC func(net.HardwareAddr) (Device, error) + type Environment string + const EnvDev + const EnvProd + const EnvTesting + type Handler struct + func NewDHCPServer(conf *Config, s *ServerConfig) *Handler + func (h *Handler) GetPoolStats() []*PoolStat + func (h *Handler) ListenAndServe() error + func (h *Handler) LoadLeases() error + func (h *Handler) Readonly() + func (h *Handler) Respond() + func (h *Handler) ServeDHCP(p dhcp4.Packet, msgType dhcp4.MessageType, options dhcp4.Options) dhcp4.Packet + type Lease struct + End time.Time + Hostname string + ID int + IP net.IP + IsAbandoned bool + MAC net.HardwareAddr + Network string + Offered bool + Registered bool + Start time.Time + func GetAllLeases(s LeaseStore) ([]*Lease, error) + func GetAllLeasesByMAC(s LeaseStore, mac net.HardwareAddr) ([]*Lease, error) + func GetLeaseByIP(s LeaseStore, ip net.IP) (*Lease, error) + func GetLeaseByMAC(s LeaseStore, mac net.HardwareAddr) (*Lease, error) + func NewLease(s LeaseStore) *Lease + func SearchLeases(s LeaseStore, where string, vals ...interface{}) ([]*Lease, error) + func (l *Lease) Delete() error + func (l *Lease) IsExpired() bool + func (l *Lease) IsFree() bool + func (l *Lease) Save() error + type LeaseStore interface + CreateLease func(*Lease) error + DeleteLease func(*Lease) error + GetAllLeases func() ([]*Lease, error) + GetAllLeasesByMAC func(net.HardwareAddr) ([]*Lease, error) + GetLeaseByIP func(net.IP) (*Lease, error) + GetRecentLeaseByMAC func(net.HardwareAddr) (*Lease, error) + SearchLeases func(string, ...interface{}) ([]*Lease, error) + UpdateLease func(*Lease) error + type PoolStat struct + Abandoned int + Active int + Claimed int + End string + Free int + NetworkName string + Registered bool + Start string + Subnet string + Total int + type ServerConfig struct + DeviceStore DeviceStore + Env Environment + LeaseStore LeaseStore + Log *verbose.Logger + LogPath string + func (s *ServerConfig) IsDev() bool + func (s *ServerConfig) IsProd() bool + func (s *ServerConfig) IsTesting() bool Incompatible versions in this module v2.0.0+incompatible Aug 13, 2018