host

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPAdresses

type IPAdresses struct {
	dict.HDict[IPAdressesMapKey, *IpAddr]
}

IPAdresses ip addresses

func (IPAdresses) Clone

func (a IPAdresses) Clone() IPAdresses

Clone makes a copy

func (IPAdresses) Eq

func (a IPAdresses) Eq(b IPAdresses) bool

Eq -

func (*IPAdresses) Upd

func (a *IPAdresses) Upd(lnk LinkID, addr net.IPNet, how UpdStrategy)

Upd upfdate with IP

type IPAdressesMapKey

type IPAdressesMapKey [md5.Size]byte

IPAdressesMapKey md5 from IpAddr.IPNet

type IpAddr

type IpAddr struct {
	net.IPNet
	Links LinkRefs
}

IpAddr ip address

func (IpAddr) Clone

func (a IpAddr) Clone() IpAddr

Clone makes a copy

func (IpAddr) Eq

func (a IpAddr) Eq(b IpAddr) bool

Eq -

func (IpAddr) Key

func (a IpAddr) Key() IPAdressesMapKey

Key make map key

type IpDev

type IpDev struct {
	Name string
	ID   LinkID
}

IpDev ip device

type IpDevs

type IpDevs struct {
	dict.HDict[LinkID, IpDev] //nolint:revive
}

IpDevs ip devices

func (IpDevs) Clone

func (devs IpDevs) Clone() IpDevs

Clone makes a copy

func (IpDevs) Eq

func (devs IpDevs) Eq(other IpDevs) bool

Eq -

func (*IpDevs) Upd

func (devs *IpDevs) Upd(d IpDev, how UpdStrategy)

Upd update devs

type LinkID

type LinkID = int

LinkID link ID dev

type LinkRefs

type LinkRefs struct {
	dict.HSet[LinkID]
}

LinkRefs link refs

func (LinkRefs) Clone

func (r LinkRefs) Clone() LinkRefs

Clone makes a copy

func (LinkRefs) Eq

func (r LinkRefs) Eq(other LinkRefs) bool

Eq -

func (*LinkRefs) Upd

func (r *LinkRefs) Upd(ref LinkID, howUpd UpdStrategy)

Upd modifies references

type NetConf

type NetConf struct {
	IpDevs
	IPAdresses
}

NetConf network conf

func (NetConf) Clone

func (conf NetConf) Clone() NetConf

Clone -

func (NetConf) Eq

func (conf NetConf) Eq(other NetConf) bool

Eq -

func (NetConf) LocalIPs

func (conf NetConf) LocalIPs() (IPv4 []net.IP, IPv6 []net.IP)

LocalIPs get effective local unique IP lists

func (*NetConf) UpdFromWatcher

func (conf *NetConf) UpdFromWatcher(msgs ...nl.WatcherMsg)

UpdFromWatcher updates conf with messages came from netlink-watcher

type UpdStrategy

type UpdStrategy uint

UpdStrategy update strategy

const (
	//Update use insert/update
	Update UpdStrategy = iota

	//Delete use delete
	Delete
)

Jump to

Keyboard shortcuts

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