Documentation
¶
Index ¶
- Variables
- type BindMechanism
- type BridgeBindMechanism
- type CriticalNetworkError
- type MacvtapBindMechanism
- type MasqueradeBindMechanism
- type MockNetworkHandler
- func (_m *MockNetworkHandler) AddrAdd(link netlink.Link, addr *netlink.Addr) error
- func (_m *MockNetworkHandler) AddrDel(link netlink.Link, addr *netlink.Addr) error
- func (_m *MockNetworkHandler) AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
- func (_m *MockNetworkHandler) AddrReplace(link netlink.Link, addr *netlink.Addr) error
- func (_m *MockNetworkHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error
- func (_m *MockNetworkHandler) ConfigureIpForwarding(proto iptables.Protocol) error
- func (_m *MockNetworkHandler) ConfigureIpv4ArpIgnore() error
- func (_m *MockNetworkHandler) CreateTapDevice(tapName string, queueNumber uint32, launcherPID int, mtu int, tapOwner string) error
- func (_m *MockNetworkHandler) DisableTXOffloadChecksum(ifaceName string) error
- func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder
- func (_m *MockNetworkHandler) GetHostAndGwAddressesFromCIDR(s string) (string, string, error)
- func (_m *MockNetworkHandler) GetMacDetails(iface string) (net.HardwareAddr, error)
- func (_m *MockNetworkHandler) GetNFTIPString(proto iptables.Protocol) string
- func (_m *MockNetworkHandler) HasNatIptables(proto iptables.Protocol) bool
- func (_m *MockNetworkHandler) IptablesAppendRule(proto iptables.Protocol, table string, chain string, rulespec ...string) error
- func (_m *MockNetworkHandler) IptablesNewChain(proto iptables.Protocol, table string, chain string) error
- func (_m *MockNetworkHandler) IsIpv4Primary() (bool, error)
- func (_m *MockNetworkHandler) IsIpv6Enabled(interfaceName string) (bool, error)
- func (_m *MockNetworkHandler) LinkAdd(link netlink.Link) error
- func (_m *MockNetworkHandler) LinkByName(name string) (netlink.Link, error)
- func (_m *MockNetworkHandler) LinkSetDown(link netlink.Link) error
- func (_m *MockNetworkHandler) LinkSetLearningOff(link netlink.Link) error
- func (_m *MockNetworkHandler) LinkSetMaster(link netlink.Link, master *netlink.Bridge) error
- func (_m *MockNetworkHandler) LinkSetName(link netlink.Link, name string) error
- func (_m *MockNetworkHandler) LinkSetUp(link netlink.Link) error
- func (_m *MockNetworkHandler) NftablesAppendRule(proto iptables.Protocol, table string, chain string, rulespec ...string) error
- func (_m *MockNetworkHandler) NftablesLoad(proto iptables.Protocol) error
- func (_m *MockNetworkHandler) NftablesNewChain(proto iptables.Protocol, table string, chain string) error
- func (_m *MockNetworkHandler) ParseAddr(s string) (*netlink.Addr, error)
- func (_m *MockNetworkHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)
- func (_m *MockNetworkHandler) SetRandomMac(iface string) (net.HardwareAddr, error)
- func (_m *MockNetworkHandler) StartDHCP(nic *VIF, serverAddr net.IP, bridgeInterfaceName string, ...) error
- type NetworkHandler
- type NetworkUtilsHandler
- func (h *NetworkUtilsHandler) AddrAdd(link netlink.Link, addr *netlink.Addr) error
- func (h *NetworkUtilsHandler) AddrDel(link netlink.Link, addr *netlink.Addr) error
- func (h *NetworkUtilsHandler) AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
- func (h *NetworkUtilsHandler) AddrReplace(link netlink.Link, addr *netlink.Addr) error
- func (h *NetworkUtilsHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error
- func (h *NetworkUtilsHandler) ConfigureIpForwarding(proto iptables.Protocol) error
- func (h *NetworkUtilsHandler) ConfigureIpv4ArpIgnore() error
- func (h *NetworkUtilsHandler) CreateTapDevice(tapName string, queueNumber uint32, launcherPID int, mtu int, tapOwner string) error
- func (h *NetworkUtilsHandler) DisableTXOffloadChecksum(ifaceName string) error
- func (h *NetworkUtilsHandler) GetHostAndGwAddressesFromCIDR(s string) (string, string, error)
- func (h *NetworkUtilsHandler) GetMacDetails(iface string) (net.HardwareAddr, error)
- func (h *NetworkUtilsHandler) GetNFTIPString(proto iptables.Protocol) string
- func (h *NetworkUtilsHandler) HasNatIptables(proto iptables.Protocol) bool
- func (h *NetworkUtilsHandler) IptablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error
- func (h *NetworkUtilsHandler) IptablesNewChain(proto iptables.Protocol, table, chain string) error
- func (h *NetworkUtilsHandler) IsIpv4Primary() (bool, error)
- func (h *NetworkUtilsHandler) IsIpv6Enabled(interfaceName string) (bool, error)
- func (h *NetworkUtilsHandler) LinkAdd(link netlink.Link) error
- func (h *NetworkUtilsHandler) LinkByName(name string) (netlink.Link, error)
- func (h *NetworkUtilsHandler) LinkSetDown(link netlink.Link) error
- func (h *NetworkUtilsHandler) LinkSetLearningOff(link netlink.Link) error
- func (h *NetworkUtilsHandler) LinkSetMaster(link netlink.Link, master *netlink.Bridge) error
- func (h *NetworkUtilsHandler) LinkSetName(link netlink.Link, name string) error
- func (h *NetworkUtilsHandler) LinkSetUp(link netlink.Link) error
- func (h *NetworkUtilsHandler) NftablesAppendRule(proto iptables.Protocol, table, chain string, rulespec ...string) error
- func (h *NetworkUtilsHandler) NftablesLoad(proto iptables.Protocol) error
- func (h *NetworkUtilsHandler) NftablesNewChain(proto iptables.Protocol, table, chain string) error
- func (h *NetworkUtilsHandler) ParseAddr(s string) (*netlink.Addr, error)
- func (h *NetworkUtilsHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)
- func (h *NetworkUtilsHandler) SetRandomMac(iface string) (net.HardwareAddr, error)
- func (h *NetworkUtilsHandler) StartDHCP(nic *VIF, serverAddr net.IP, bridgeInterfaceName string, ...) error
- type SlirpBindMechanism
- type VIF
- type VMNetworkConfigurator
Constants ¶
This section is empty.
Variables ¶
View Source
var DHCPServer = dhcp.SingleClientDHCPServer
Allow mocking for tests
View Source
var DHCPv6Server = dhcpv6.SingleClientDHCPv6Server
Functions ¶
This section is empty.
Types ¶
type BindMechanism ¶ added in v0.6.0
type BindMechanism interface {
// contains filtered or unexported methods
}
type BridgeBindMechanism ¶ added in v0.38.0
type BridgeBindMechanism struct {
// contains filtered or unexported fields
}
type CriticalNetworkError ¶ added in v0.31.0
type CriticalNetworkError struct {
Msg string
}
func (*CriticalNetworkError) Error ¶ added in v0.31.0
func (e *CriticalNetworkError) Error() string
type MacvtapBindMechanism ¶ added in v0.38.0
type MacvtapBindMechanism struct {
// contains filtered or unexported fields
}
type MasqueradeBindMechanism ¶ added in v0.38.0
type MasqueradeBindMechanism struct {
// contains filtered or unexported fields
}
type MockNetworkHandler ¶
type MockNetworkHandler struct {
// contains filtered or unexported fields
}
Mock of NetworkHandler interface
func NewMockNetworkHandler ¶
func NewMockNetworkHandler(ctrl *gomock.Controller) *MockNetworkHandler
func (*MockNetworkHandler) AddrReplace ¶ added in v0.39.0
func (*MockNetworkHandler) BindTapDeviceToBridge ¶ added in v0.33.0
func (_m *MockNetworkHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error
func (*MockNetworkHandler) ConfigureIpForwarding ¶ added in v0.39.0
func (_m *MockNetworkHandler) ConfigureIpForwarding(proto iptables.Protocol) error
func (*MockNetworkHandler) ConfigureIpv4ArpIgnore ¶ added in v0.39.0
func (_m *MockNetworkHandler) ConfigureIpv4ArpIgnore() error
func (*MockNetworkHandler) CreateTapDevice ¶ added in v0.33.0
func (*MockNetworkHandler) DisableTXOffloadChecksum ¶ added in v0.36.0
func (_m *MockNetworkHandler) DisableTXOffloadChecksum(ifaceName string) error
func (*MockNetworkHandler) EXPECT ¶
func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder
func (*MockNetworkHandler) GetHostAndGwAddressesFromCIDR ¶ added in v0.11.1
func (_m *MockNetworkHandler) GetHostAndGwAddressesFromCIDR(s string) (string, string, error)
func (*MockNetworkHandler) GetMacDetails ¶
func (_m *MockNetworkHandler) GetMacDetails(iface string) (net.HardwareAddr, error)
func (*MockNetworkHandler) GetNFTIPString ¶ added in v0.29.0
func (_m *MockNetworkHandler) GetNFTIPString(proto iptables.Protocol) string
func (*MockNetworkHandler) HasNatIptables ¶ added in v0.29.0
func (_m *MockNetworkHandler) HasNatIptables(proto iptables.Protocol) bool
func (*MockNetworkHandler) IptablesAppendRule ¶ added in v0.11.1
func (*MockNetworkHandler) IptablesNewChain ¶ added in v0.11.1
func (*MockNetworkHandler) IsIpv4Primary ¶ added in v0.33.0
func (_m *MockNetworkHandler) IsIpv4Primary() (bool, error)
func (*MockNetworkHandler) IsIpv6Enabled ¶ added in v0.29.0
func (_m *MockNetworkHandler) IsIpv6Enabled(interfaceName string) (bool, 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) LinkSetLearningOff ¶ added in v0.9.2
func (_m *MockNetworkHandler) LinkSetLearningOff(link netlink.Link) error
func (*MockNetworkHandler) LinkSetMaster ¶ added in v0.11.1
func (*MockNetworkHandler) LinkSetName ¶ added in v0.39.0
func (_m *MockNetworkHandler) LinkSetName(link netlink.Link, name string) error
func (*MockNetworkHandler) LinkSetUp ¶
func (_m *MockNetworkHandler) LinkSetUp(link netlink.Link) error
func (*MockNetworkHandler) NftablesAppendRule ¶ added in v0.20.0
func (*MockNetworkHandler) NftablesLoad ¶ added in v0.20.0
func (_m *MockNetworkHandler) NftablesLoad(proto iptables.Protocol) error
func (*MockNetworkHandler) NftablesNewChain ¶ added in v0.20.0
func (*MockNetworkHandler) ParseAddr ¶
func (_m *MockNetworkHandler) ParseAddr(s string) (*netlink.Addr, error)
func (*MockNetworkHandler) SetRandomMac ¶ added in v0.6.0
func (_m *MockNetworkHandler) SetRandomMac(iface string) (net.HardwareAddr, error)
type NetworkHandler ¶
type NetworkHandler interface { LinkByName(name string) (netlink.Link, error) AddrList(link netlink.Link, family int) ([]netlink.Addr, 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) GetHostAndGwAddressesFromCIDR(s string) (string, string, error) SetRandomMac(iface string) (net.HardwareAddr, error) GetMacDetails(iface string) (net.HardwareAddr, error) LinkSetMaster(link netlink.Link, master *netlink.Bridge) error StartDHCP(nic *VIF, serverAddr net.IP, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions, filterByMAC bool) error HasNatIptables(proto iptables.Protocol) bool IsIpv6Enabled(interfaceName string) (bool, error) IsIpv4Primary() (bool, error) ConfigureIpForwarding(proto iptables.Protocol) error ConfigureIpv4ArpIgnore() 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) AddrReplace ¶ added in v0.39.0
func (*NetworkUtilsHandler) BindTapDeviceToBridge ¶ added in v0.33.0
func (h *NetworkUtilsHandler) BindTapDeviceToBridge(tapName string, bridgeName string) error
func (*NetworkUtilsHandler) ConfigureIpForwarding ¶ added in v0.39.0
func (h *NetworkUtilsHandler) ConfigureIpForwarding(proto iptables.Protocol) error
func (*NetworkUtilsHandler) ConfigureIpv4ArpIgnore ¶ added in v0.39.0
func (h *NetworkUtilsHandler) ConfigureIpv4ArpIgnore() error
func (*NetworkUtilsHandler) CreateTapDevice ¶ added in v0.33.0
func (*NetworkUtilsHandler) DisableTXOffloadChecksum ¶ added in v0.36.0
func (h *NetworkUtilsHandler) DisableTXOffloadChecksum(ifaceName string) error
func (*NetworkUtilsHandler) GetHostAndGwAddressesFromCIDR ¶ added in v0.11.1
func (h *NetworkUtilsHandler) GetHostAndGwAddressesFromCIDR(s string) (string, string, error)
func (*NetworkUtilsHandler) GetMacDetails ¶
func (h *NetworkUtilsHandler) GetMacDetails(iface string) (net.HardwareAddr, error)
GetMacDetails from an interface
func (*NetworkUtilsHandler) GetNFTIPString ¶ added in v0.29.0
func (h *NetworkUtilsHandler) GetNFTIPString(proto iptables.Protocol) string
func (*NetworkUtilsHandler) HasNatIptables ¶ added in v0.29.0
func (h *NetworkUtilsHandler) HasNatIptables(proto iptables.Protocol) bool
func (*NetworkUtilsHandler) IptablesAppendRule ¶ added in v0.11.1
func (*NetworkUtilsHandler) IptablesNewChain ¶ added in v0.11.1
func (h *NetworkUtilsHandler) IptablesNewChain(proto iptables.Protocol, table, chain string) error
func (*NetworkUtilsHandler) IsIpv4Primary ¶ added in v0.33.0
func (h *NetworkUtilsHandler) IsIpv4Primary() (bool, error)
func (*NetworkUtilsHandler) IsIpv6Enabled ¶ added in v0.29.0
func (h *NetworkUtilsHandler) IsIpv6Enabled(interfaceName string) (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) LinkSetLearningOff ¶ added in v0.9.2
func (h *NetworkUtilsHandler) LinkSetLearningOff(link netlink.Link) error
func (*NetworkUtilsHandler) LinkSetMaster ¶ added in v0.11.1
func (*NetworkUtilsHandler) LinkSetName ¶ added in v0.39.0
func (h *NetworkUtilsHandler) LinkSetName(link netlink.Link, name string) error
func (*NetworkUtilsHandler) LinkSetUp ¶
func (h *NetworkUtilsHandler) LinkSetUp(link netlink.Link) error
func (*NetworkUtilsHandler) NftablesAppendRule ¶ added in v0.20.0
func (*NetworkUtilsHandler) NftablesLoad ¶ added in v0.20.0
func (h *NetworkUtilsHandler) NftablesLoad(proto iptables.Protocol) error
func (*NetworkUtilsHandler) NftablesNewChain ¶ added in v0.20.0
func (h *NetworkUtilsHandler) NftablesNewChain(proto iptables.Protocol, table, chain string) error
func (*NetworkUtilsHandler) ParseAddr ¶
func (h *NetworkUtilsHandler) ParseAddr(s string) (*netlink.Addr, error)
func (*NetworkUtilsHandler) SetRandomMac ¶ added in v0.6.0
func (h *NetworkUtilsHandler) SetRandomMac(iface string) (net.HardwareAddr, error)
SetRandomMac changes the MAC address for a given interface to a randomly generated, preserving the vendor prefix
type SlirpBindMechanism ¶ added in v0.38.0
type SlirpBindMechanism struct {
// contains filtered or unexported fields
}
type VIF ¶
type VMNetworkConfigurator ¶ added in v0.41.0
type VMNetworkConfigurator struct {
// contains filtered or unexported fields
}
func NewVMNetworkConfigurator ¶ added in v0.41.0
func NewVMNetworkConfigurator(vmi *v1.VirtualMachineInstance, cacheFactory cache.InterfaceCacheFactory) *VMNetworkConfigurator
func (*VMNetworkConfigurator) SetupPodNetworkPhase1 ¶ added in v0.41.0
func (n *VMNetworkConfigurator) SetupPodNetworkPhase1(pid int) error
func (*VMNetworkConfigurator) SetupPodNetworkPhase2 ¶ added in v0.41.0
func (n *VMNetworkConfigurator) SetupPodNetworkPhase2(domain *api.Domain) error
Directories
¶
Path | Synopsis |
---|---|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
Click to show internal directories.
Click to hide internal directories.