driver

package
v1.2.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LibvirtUserAndGroupId = "0"
)

Variables

Allow mocking for tests

Functions

This section is empty.

Types

type IPVersion added in v0.59.0

type IPVersion int
const (
	IPv4 IPVersion = 4
	IPv6 IPVersion = 6
)

type MockNetworkHandler

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

Mock of NetworkHandler interface

func NewMockNetworkHandler

func NewMockNetworkHandler(ctrl *gomock.Controller) *MockNetworkHandler

func (*MockNetworkHandler) AddrList

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

func (*MockNetworkHandler) EXPECT

func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder

func (*MockNetworkHandler) HasIPv4GlobalUnicastAddress added in v0.52.0

func (_m *MockNetworkHandler) HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)

func (*MockNetworkHandler) HasIPv6GlobalUnicastAddress added in v0.52.0

func (_m *MockNetworkHandler) HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)

func (*MockNetworkHandler) IsIpv4Primary

func (_m *MockNetworkHandler) IsIpv4Primary() (bool, error)

func (*MockNetworkHandler) LinkByName

func (_m *MockNetworkHandler) LinkByName(name string) (netlink.Link, error)

func (*MockNetworkHandler) LinkDel added in v1.0.0

func (_m *MockNetworkHandler) LinkDel(link netlink.Link) error

func (*MockNetworkHandler) ParseAddr

func (_m *MockNetworkHandler) ParseAddr(s string) (*netlink.Addr, error)
func (_m *MockNetworkHandler) ReadIPAddressesFromLink(interfaceName string) (string, string, error)

func (*MockNetworkHandler) RouteList

func (_m *MockNetworkHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)

func (*MockNetworkHandler) StartDHCP

func (_m *MockNetworkHandler) StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error

type NetworkHandler

type NetworkHandler interface {
	LinkByName(name string) (netlink.Link, error)
	AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
	ReadIPAddressesFromLink(interfaceName string) (string, string, error)
	RouteList(link netlink.Link, family int) ([]netlink.Route, error)
	LinkDel(link netlink.Link) error
	ParseAddr(s string) (*netlink.Addr, error)
	StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error
	HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)
	HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)
	IsIpv4Primary() (bool, error)
}

type NetworkUtilsHandler

type NetworkUtilsHandler struct{}

func (*NetworkUtilsHandler) AddrList

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

func (*NetworkUtilsHandler) HasIPv4GlobalUnicastAddress added in v0.52.0

func (h *NetworkUtilsHandler) HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)

func (*NetworkUtilsHandler) HasIPv6GlobalUnicastAddress added in v0.52.0

func (h *NetworkUtilsHandler) HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)

func (*NetworkUtilsHandler) IsIpv4Primary

func (h *NetworkUtilsHandler) IsIpv4Primary() (bool, error)

func (*NetworkUtilsHandler) LinkByName

func (h *NetworkUtilsHandler) LinkByName(name string) (netlink.Link, error)

func (*NetworkUtilsHandler) LinkDel added in v1.0.0

func (h *NetworkUtilsHandler) LinkDel(link netlink.Link) error

func (*NetworkUtilsHandler) ParseAddr

func (h *NetworkUtilsHandler) ParseAddr(s string) (*netlink.Addr, error)
func (h *NetworkUtilsHandler) ReadIPAddressesFromLink(interfaceName string) (string, string, error)

func (*NetworkUtilsHandler) RouteList

func (h *NetworkUtilsHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)

func (*NetworkUtilsHandler) StartDHCP

func (h *NetworkUtilsHandler) StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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