driver

package
v0.57.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LibvirtUserAndGroupId = "0"
)

Variables

Allow mocking for tests

Functions

This section is empty.

Types

type MockNetworkHandler

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

Mock of NetworkHandler interface

func NewMockNetworkHandler

func NewMockNetworkHandler(ctrl *gomock.Controller) *MockNetworkHandler

func (*MockNetworkHandler) AddrAdd

func (_m *MockNetworkHandler) AddrAdd(link netlink.Link, addr *netlink.Addr) error

func (*MockNetworkHandler) AddrDel

func (_m *MockNetworkHandler) AddrDel(link netlink.Link, addr *netlink.Addr) error

func (*MockNetworkHandler) AddrList

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

func (*MockNetworkHandler) AddrReplace

func (_m *MockNetworkHandler) AddrReplace(link netlink.Link, addr *netlink.Addr) error

func (*MockNetworkHandler) BindTapDeviceToBridge

func (_m *MockNetworkHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error

func (*MockNetworkHandler) ConfigureIpForwarding

func (_m *MockNetworkHandler) ConfigureIpForwarding(proto iptables.Protocol) error

func (*MockNetworkHandler) ConfigureIpv4ArpIgnore

func (_m *MockNetworkHandler) ConfigureIpv4ArpIgnore() error

func (*MockNetworkHandler) ConfigurePingGroupRange added in v0.56.0

func (_m *MockNetworkHandler) ConfigurePingGroupRange() error

func (*MockNetworkHandler) ConfigureRouteLocalNet added in v0.57.0

func (_m *MockNetworkHandler) ConfigureRouteLocalNet(_param0 string) error

func (*MockNetworkHandler) CreateTapDevice

func (_m *MockNetworkHandler) CreateTapDevice(tapName string, queueNumber uint32, launcherPID int, mtu int, tapOwner string) error

func (*MockNetworkHandler) DisableTXOffloadChecksum

func (_m *MockNetworkHandler) DisableTXOffloadChecksum(ifaceName string) error

func (*MockNetworkHandler) EXPECT

func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder

func (*MockNetworkHandler) GetNFTIPString

func (_m *MockNetworkHandler) GetNFTIPString(proto iptables.Protocol) string

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) HasNatIptables

func (_m *MockNetworkHandler) HasNatIptables(proto iptables.Protocol) bool

func (*MockNetworkHandler) IptablesAppendRule

func (_m *MockNetworkHandler) IptablesAppendRule(proto iptables.Protocol, table string, chain string, rulespec ...string) error

func (*MockNetworkHandler) IptablesNewChain

func (_m *MockNetworkHandler) IptablesNewChain(proto iptables.Protocol, table string, chain string) error

func (*MockNetworkHandler) IsIpv4Primary

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

func (*MockNetworkHandler) LinkAdd

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

func (*MockNetworkHandler) LinkByName

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

func (*MockNetworkHandler) LinkSetDown

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

func (*MockNetworkHandler) LinkSetHardwareAddr added in v0.53.0

func (_m *MockNetworkHandler) LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) error

func (*MockNetworkHandler) LinkSetLearningOff

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

func (*MockNetworkHandler) LinkSetMaster

func (_m *MockNetworkHandler) LinkSetMaster(link netlink.Link, master *netlink.Bridge) error

func (*MockNetworkHandler) LinkSetName

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

func (*MockNetworkHandler) LinkSetUp

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

func (*MockNetworkHandler) NftablesAppendRule

func (_m *MockNetworkHandler) NftablesAppendRule(proto iptables.Protocol, table string, chain string, rulespec ...string) error

func (*MockNetworkHandler) NftablesLoad

func (_m *MockNetworkHandler) NftablesLoad(proto iptables.Protocol) error

func (*MockNetworkHandler) NftablesNewChain

func (_m *MockNetworkHandler) NftablesNewChain(proto iptables.Protocol, table string, chain string) 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)
	AddrDel(link netlink.Link, addr *netlink.Addr) error
	AddrAdd(link netlink.Link, addr *netlink.Addr) error
	AddrReplace(link netlink.Link, addr *netlink.Addr) error
	LinkSetDown(link netlink.Link) error
	LinkSetUp(link netlink.Link) error
	LinkSetName(link netlink.Link, name string) error
	LinkAdd(link netlink.Link) error
	LinkSetLearningOff(link netlink.Link) error
	ParseAddr(s string) (*netlink.Addr, error)
	LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) error
	LinkSetMaster(link netlink.Link, master *netlink.Bridge) error
	StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error
	HasNatIptables(proto iptables.Protocol) bool
	HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)
	HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)
	IsIpv4Primary() (bool, error)
	ConfigureIpForwarding(proto iptables.Protocol) error
	ConfigureRouteLocalNet(string) error
	ConfigureIpv4ArpIgnore() error
	ConfigurePingGroupRange() error
	IptablesNewChain(proto iptables.Protocol, table, chain string) error
	IptablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error
	NftablesNewChain(proto iptables.Protocol, table, chain string) error
	NftablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error
	NftablesLoad(proto iptables.Protocol) error
	GetNFTIPString(proto iptables.Protocol) string
	CreateTapDevice(tapName string, queueNumber uint32, launcherPID int, mtu int, tapOwner string) error
	BindTapDeviceToBridge(tapName string, bridgeName string) error
	DisableTXOffloadChecksum(ifaceName string) error
}

type NetworkUtilsHandler

type NetworkUtilsHandler struct{}

func (*NetworkUtilsHandler) AddrAdd

func (h *NetworkUtilsHandler) AddrAdd(link netlink.Link, addr *netlink.Addr) error

func (*NetworkUtilsHandler) AddrDel

func (h *NetworkUtilsHandler) AddrDel(link netlink.Link, addr *netlink.Addr) error

func (*NetworkUtilsHandler) AddrList

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

func (*NetworkUtilsHandler) AddrReplace

func (h *NetworkUtilsHandler) AddrReplace(link netlink.Link, addr *netlink.Addr) error

func (*NetworkUtilsHandler) BindTapDeviceToBridge

func (h *NetworkUtilsHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error

func (*NetworkUtilsHandler) ConfigureIpForwarding

func (h *NetworkUtilsHandler) ConfigureIpForwarding(proto iptables.Protocol) error

func (*NetworkUtilsHandler) ConfigureIpv4ArpIgnore

func (h *NetworkUtilsHandler) ConfigureIpv4ArpIgnore() error

func (*NetworkUtilsHandler) ConfigurePingGroupRange added in v0.56.0

func (h *NetworkUtilsHandler) ConfigurePingGroupRange() error

func (*NetworkUtilsHandler) ConfigureRouteLocalNet added in v0.57.0

func (h *NetworkUtilsHandler) ConfigureRouteLocalNet(iface string) error

func (*NetworkUtilsHandler) CreateTapDevice

func (h *NetworkUtilsHandler) CreateTapDevice(tapName string, queueNumber uint32, launcherPID int, mtu int, tapOwner string) error

func (*NetworkUtilsHandler) DisableTXOffloadChecksum

func (h *NetworkUtilsHandler) DisableTXOffloadChecksum(ifaceName string) error

func (*NetworkUtilsHandler) GetNFTIPString

func (h *NetworkUtilsHandler) GetNFTIPString(proto iptables.Protocol) string

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) HasNatIptables

func (h *NetworkUtilsHandler) HasNatIptables(proto iptables.Protocol) bool

func (*NetworkUtilsHandler) IptablesAppendRule

func (h *NetworkUtilsHandler) IptablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error

func (*NetworkUtilsHandler) IptablesNewChain

func (h *NetworkUtilsHandler) IptablesNewChain(proto iptables.Protocol, table, chain string) error

func (*NetworkUtilsHandler) IsIpv4Primary

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

func (*NetworkUtilsHandler) LinkAdd

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

func (*NetworkUtilsHandler) LinkByName

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

func (*NetworkUtilsHandler) LinkSetDown

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

func (*NetworkUtilsHandler) LinkSetHardwareAddr added in v0.53.0

func (h *NetworkUtilsHandler) LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) error

func (*NetworkUtilsHandler) LinkSetLearningOff

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

func (*NetworkUtilsHandler) LinkSetMaster

func (h *NetworkUtilsHandler) LinkSetMaster(link netlink.Link, master *netlink.Bridge) error

func (*NetworkUtilsHandler) LinkSetName

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

func (*NetworkUtilsHandler) LinkSetUp

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

func (*NetworkUtilsHandler) NftablesAppendRule

func (h *NetworkUtilsHandler) NftablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error

func (*NetworkUtilsHandler) NftablesLoad

func (h *NetworkUtilsHandler) NftablesLoad(proto iptables.Protocol) error

func (*NetworkUtilsHandler) NftablesNewChain

func (h *NetworkUtilsHandler) NftablesNewChain(proto iptables.Protocol, table, chain string) 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

Jump to

Keyboard shortcuts

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