book

package
v0.0.0-...-a7fb08b Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddressIsNotAssigned = errors.New("specified address is not assigned to the interface")
)

Functions

This section is empty.

Types

type Book

type Book struct {
	DNS        DNS
	V4Networks map[string]*V4Network
	Machines   map[string]*Machine
}

Immutable!!

func FromConfig

func FromConfig(conf *conf.Config) (*Book, error)

func (*Book) LookupIPForFQDN

func (b *Book) LookupIPForFQDN(fqdn string) net.IP

func (*Book) LookupIPForHardwareAddr

func (b *Book) LookupIPForHardwareAddr(hwaddr net.HardwareAddr) net.IP

func (*Book) Validate

func (b *Book) Validate() error

type DNS

type DNS struct {
	Listen    string
	Networks  []string
	LocalTTL  int
	GlobalTTL int
}

type Interface

type Interface struct {
	HardwareAddr net.HardwareAddr
	IPv4Addr     net.IP
	Fqdn         string
}

type Machine

type Machine struct {
	Name       string
	Interfaces []Interface
}

type V4Network

type V4Network struct {
	Name              string
	Interface         *net.Interface
	MyAddress         net.IP
	Network           *net.IPNet
	DHCP4Listen       string
	NameServerAddrs   []net.IP
	GatewayAddr       net.IP
	LeaseDurationDays float64
}

Jump to

Keyboard shortcuts

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