dhcp

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup added in v0.2.0

func Cleanup(ctx context.Context, a *DHCPAllocator, nic string) <-chan error

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,
	serverIP string,
	clientIP string,
	cidr string,
	routerIP string,
	dnsServers []string,
	domainName *string,
	domainSearch []string,
	ntpServers []string,
	leaseTime *int,
) (err error)

func (*DHCPAllocator) DeleteLease

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

func (*DHCPAllocator) DryRun

func (a *DHCPAllocator) DryRun(ctx context.Context, nic string) (err error)

func (*DHCPAllocator) GetLease

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

func (*DHCPAllocator) ListAll

func (a *DHCPAllocator) ListAll(name string) (map[string]string, error)

func (*DHCPAllocator) Run

func (a *DHCPAllocator) Run(ctx context.Context, nic string) (err error)

func (*DHCPAllocator) Usage

func (a *DHCPAllocator) Usage()

type DHCPLease

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

func (*DHCPLease) String

func (l *DHCPLease) String() string

Jump to

Keyboard shortcuts

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