dhcp

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHCPAllocator

type DHCPAllocator struct {
	// contains filtered or unexported fields
}

func New

func New() *DHCPAllocator

func NewDHCPAllocator

func NewDHCPAllocator() *DHCPAllocator

func (*DHCPAllocator) AddLease

func (a *DHCPAllocator) AddLease(
	hwAddr string,
	poolName string,
	clientIP string,
	ref string,
) (err error)

func (*DHCPAllocator) AddPool added in v0.4.0

func (a *DHCPAllocator) AddPool(
	name string,
	serverIP string,
	subnetMask string,
	routerIP string,
	DNSServers []string,
	domainName string,
	domainSearch []string,
	NTPServers []string,
	leaseTime int,
) (err error)

func (*DHCPAllocator) CheckLease

func (a *DHCPAllocator) CheckLease(hwAddr string) bool

func (*DHCPAllocator) CheckPool added in v0.4.0

func (a *DHCPAllocator) CheckPool(name string) bool

func (*DHCPAllocator) DeleteLease

func (a *DHCPAllocator) DeleteLease(hwAddr string) (err error)

func (*DHCPAllocator) DeletePool added in v0.4.0

func (a *DHCPAllocator) DeletePool(name string) (err error)

func (*DHCPAllocator) GetLease

func (a *DHCPAllocator) GetLease(hwAddr string) (lease DHCPLease)

func (*DHCPAllocator) GetPool added in v0.4.0

func (a *DHCPAllocator) GetPool(name string) (pool DHCPPool)

func (*DHCPAllocator) Run

func (a *DHCPAllocator) Run(nic string, serverip string) (err error)

func (*DHCPAllocator) Stop

func (a *DHCPAllocator) Stop(nic string) (err error)

func (*DHCPAllocator) Usage

func (a *DHCPAllocator) Usage()

type DHCPLease

type DHCPLease struct {
	PoolName  string
	ClientIP  net.IP
	Reference string
}

type DHCPPool added in v0.4.0

type DHCPPool struct {
	ServerIP     net.IP
	SubnetMask   net.IPMask
	Router       net.IP
	DNS          []net.IP
	DomainName   string
	DomainSearch []string
	NTP          []net.IP
	LeaseTime    int
}

Jump to

Keyboard shortcuts

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