netlinkshim

package
v1.11.0-cni-plu...-ddfc3b1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExist

func IsExist(err error) bool

func IsNotExist

func IsNotExist(err error) bool

func IsNotSupported

func IsNotSupported(err error) bool

Types

type Interface

type Interface interface {
	SetSocketTimeout(to time.Duration) error
	SetStrictCheck(b bool) error
	LinkList() ([]netlink.Link, error)
	LinkByName(name string) (netlink.Link, error)
	LinkAdd(link netlink.Link) error
	LinkDel(link netlink.Link) error
	LinkSetMTU(link netlink.Link, mtu int) error
	LinkSetUp(link netlink.Link) error
	RouteListFiltered(family int, filter *netlink.Route, filterMask uint64) ([]netlink.Route, error)
	RouteListFilteredIter(family int, filter *netlink.Route, filterMask uint64, f func(netlink.Route) (cont bool)) error
	RouteAdd(route *netlink.Route) error
	RouteReplace(route *netlink.Route) error
	RouteDel(route *netlink.Route) error
	AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
	AddrAdd(link netlink.Link, addr *netlink.Addr) error
	AddrDel(link netlink.Link, addr *netlink.Addr) error
	RuleList(family int) ([]netlink.Rule, error)
	RuleAdd(rule *netlink.Rule) error
	RuleDel(rule *netlink.Rule) error
	Delete()
	NeighAdd(neigh *netlink.Neigh) error
	NeighList(linkIndex, family int) ([]netlink.Neigh, error)
	NeighSet(a *netlink.Neigh) error
	NeighDel(a *netlink.Neigh) error
}
func NewRealNetlink() (Interface, error)
type RealNetlink struct {
	// contains filtered or unexported fields
}

func (*RealNetlink) AddrAdd

func (r *RealNetlink) AddrAdd(link netlink.Link, addr *netlink.Addr) error

func (*RealNetlink) AddrDel

func (r *RealNetlink) AddrDel(link netlink.Link, addr *netlink.Addr) error

func (*RealNetlink) AddrList

func (r *RealNetlink) AddrList(link netlink.Link, family int) ([]netlink.Addr, error)

func (*RealNetlink) Delete

func (r *RealNetlink) Delete()

func (*RealNetlink) LinkAdd

func (r *RealNetlink) LinkAdd(link netlink.Link) error

func (*RealNetlink) LinkByName

func (r *RealNetlink) LinkByName(name string) (netlink.Link, error)

func (*RealNetlink) LinkDel

func (r *RealNetlink) LinkDel(link netlink.Link) error
func (r *RealNetlink) LinkList() ([]netlink.Link, error)

func (*RealNetlink) LinkSetMTU

func (r *RealNetlink) LinkSetMTU(link netlink.Link, mtu int) error

func (*RealNetlink) LinkSetUp

func (r *RealNetlink) LinkSetUp(link netlink.Link) error

func (*RealNetlink) NeighAdd

func (r *RealNetlink) NeighAdd(neigh *netlink.Neigh) error

func (*RealNetlink) NeighDel

func (r *RealNetlink) NeighDel(a *netlink.Neigh) error

func (*RealNetlink) NeighList

func (r *RealNetlink) NeighList(linkIndex, family int) ([]netlink.Neigh, error)

func (*RealNetlink) NeighSet

func (r *RealNetlink) NeighSet(a *netlink.Neigh) error

func (*RealNetlink) RouteAdd

func (r *RealNetlink) RouteAdd(route *netlink.Route) error

func (*RealNetlink) RouteDel

func (r *RealNetlink) RouteDel(route *netlink.Route) error

func (*RealNetlink) RouteListFiltered

func (r *RealNetlink) RouteListFiltered(family int, filter *netlink.Route, filterMask uint64) ([]netlink.Route, error)

func (*RealNetlink) RouteListFilteredIter

func (r *RealNetlink) RouteListFilteredIter(family int, filter *netlink.Route, filterMask uint64, f func(netlink.Route) (cont bool)) error

func (*RealNetlink) RouteReplace

func (r *RealNetlink) RouteReplace(route *netlink.Route) error

func (*RealNetlink) RuleAdd

func (r *RealNetlink) RuleAdd(rule *netlink.Rule) error

func (*RealNetlink) RuleDel

func (r *RealNetlink) RuleDel(rule *netlink.Rule) error

func (*RealNetlink) RuleList

func (r *RealNetlink) RuleList(family int) ([]netlink.Rule, error)

func (*RealNetlink) SetSocketTimeout

func (r *RealNetlink) SetSocketTimeout(to time.Duration) error

func (*RealNetlink) SetStrictCheck

func (r *RealNetlink) SetStrictCheck(b bool) error

type Wireguard

type Wireguard interface {
	Close() error
	DeviceByName(name string) (*wgtypes.Device, error)
	Devices() ([]*wgtypes.Device, error)
	ConfigureDevice(name string, cfg wgtypes.Config) error
}

Wireguard is a shim interface for mocking linkClient calls to manage the wireguard key and peer configuration.

func NewRealWireguard

func NewRealWireguard() (Wireguard, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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