Documentation ¶
Index ¶
- Constants
- Variables
- 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) ConfigurePingGroupRange() error
- func (_m *MockNetworkHandler) ConfigureRouteLocalNet(_param0 string) error
- func (_m *MockNetworkHandler) ConfigureUnprivilegedPortStart(_param0 string) 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) GetNFTIPString(proto iptables.Protocol) string
- func (_m *MockNetworkHandler) HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)
- func (_m *MockNetworkHandler) HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)
- 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) 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) LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) 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) ReadIPAddressesFromLink(interfaceName string) (string, string, error)
- func (_m *MockNetworkHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)
- func (_m *MockNetworkHandler) StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) 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) ConfigurePingGroupRange() error
- func (h *NetworkUtilsHandler) ConfigureRouteLocalNet(iface string) error
- func (h *NetworkUtilsHandler) ConfigureUnprivilegedPortStart(port string) 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) GetNFTIPString(proto iptables.Protocol) string
- func (h *NetworkUtilsHandler) HasIPv4GlobalUnicastAddress(interfaceName string) (bool, error)
- func (h *NetworkUtilsHandler) HasIPv6GlobalUnicastAddress(interfaceName string) (bool, error)
- 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) 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) LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) 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) ReadIPAddressesFromLink(interfaceName string) (string, string, error)
- func (h *NetworkUtilsHandler) RouteList(link netlink.Link, family int) ([]netlink.Route, error)
- func (h *NetworkUtilsHandler) StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error
Constants ¶
View Source
const (
LibvirtUserAndGroupId = "0"
)
Variables ¶
View Source
var DHCPServer = dhcpserver.SingleClientDHCPServer
Allow mocking for tests
View Source
var DHCPv6Server = dhcpserverv6.SingleClientDHCPv6Server
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) AddrReplace ¶
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) ConfigureUnprivilegedPortStart ¶ added in v0.58.1
func (_m *MockNetworkHandler) ConfigureUnprivilegedPortStart(_param0 string) error
func (*MockNetworkHandler) CreateTapDevice ¶
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 (*MockNetworkHandler) IptablesNewChain ¶
func (*MockNetworkHandler) IsIpv4Primary ¶
func (_m *MockNetworkHandler) IsIpv4Primary() (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) 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 (*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 (*MockNetworkHandler) NftablesLoad ¶
func (_m *MockNetworkHandler) NftablesLoad(proto iptables.Protocol) error
func (*MockNetworkHandler) NftablesNewChain ¶
func (*MockNetworkHandler) ParseAddr ¶
func (_m *MockNetworkHandler) ParseAddr(s string) (*netlink.Addr, error)
func (*MockNetworkHandler) ReadIPAddressesFromLink ¶
func (_m *MockNetworkHandler) ReadIPAddressesFromLink(interfaceName string) (string, string, 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 ConfigureUnprivilegedPortStart(string) 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 ¶
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) ConfigureUnprivilegedPortStart ¶ added in v0.58.1
func (h *NetworkUtilsHandler) ConfigureUnprivilegedPortStart(port string) error
func (*NetworkUtilsHandler) CreateTapDevice ¶
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 (*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 (*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 (*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 (*NetworkUtilsHandler) ReadIPAddressesFromLink ¶
func (h *NetworkUtilsHandler) ReadIPAddressesFromLink(interfaceName string) (string, string, error)
func (*NetworkUtilsHandler) StartDHCP ¶
func (h *NetworkUtilsHandler) StartDHCP(nic *cache.DHCPConfig, bridgeInterfaceName string, dhcpOptions *v1.DHCPOptions) error
Click to show internal directories.
Click to hide internal directories.