Documentation ¶
Index ¶
- Variables
- func SetupDefaultPodNetwork(domain *api.Domain) error
- 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) ChangeMacAddr(iface string) (net.HardwareAddr, error)
- func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder
- func (_m *MockNetworkHandler) GetMacDetails(iface string) (net.HardwareAddr, 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) LinkSetUp(link netlink.Link) 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) StartDHCP(nic *VIF, serverAddr *netlink.Addr)
- 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) ChangeMacAddr(iface string) (net.HardwareAddr, error)
- func (h *NetworkUtilsHandler) GetMacDetails(iface string) (net.HardwareAddr, 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) LinkSetUp(link netlink.Link) 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) StartDHCP(nic *VIF, serverAddr *netlink.Addr)
- type VIF
Constants ¶
This section is empty.
Variables ¶
View Source
var DHCPServer = dhcp.SingleClientDHCPServer
View Source
var SetupPodNetwork = SetupDefaultPodNetwork
Allow mocking for tests
Functions ¶
func SetupDefaultPodNetwork ¶
SetupDefaultPodNetwork will prepare the pod management network to be used by a virtual machine which will own the pod network IP and MAC. Pods MAC address will be changed to a random address and IP will be deleted. This will also create a macvlan device with a fake IP. DHCP server will be started and bounded to the macvlan interface to server the original pod ip to the guest OS
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) ChangeMacAddr ¶
func (_m *MockNetworkHandler) ChangeMacAddr(iface string) (net.HardwareAddr, error)
func (*MockNetworkHandler) EXPECT ¶
func (_m *MockNetworkHandler) EXPECT() *_MockNetworkHandlerRecorder
func (*MockNetworkHandler) GetMacDetails ¶
func (_m *MockNetworkHandler) GetMacDetails(iface string) (net.HardwareAddr, 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) LinkSetUp ¶
func (_m *MockNetworkHandler) LinkSetUp(link netlink.Link) error
func (*MockNetworkHandler) ParseAddr ¶
func (_m *MockNetworkHandler) ParseAddr(s string) (*netlink.Addr, 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 LinkSetDown(link netlink.Link) error LinkSetUp(link netlink.Link) error LinkAdd(link netlink.Link) error ParseAddr(s string) (*netlink.Addr, error) ChangeMacAddr(iface string) (net.HardwareAddr, error) GetMacDetails(iface string) (net.HardwareAddr, error) StartDHCP(nic *VIF, serverAddr *netlink.Addr) }
var Handler NetworkHandler
type NetworkUtilsHandler ¶
type NetworkUtilsHandler struct{}
func (*NetworkUtilsHandler) ChangeMacAddr ¶
func (h *NetworkUtilsHandler) ChangeMacAddr(iface string) (net.HardwareAddr, error)
ChangeMacAddr changes the MAC address for a agiven interface
func (*NetworkUtilsHandler) GetMacDetails ¶
func (h *NetworkUtilsHandler) GetMacDetails(iface string) (net.HardwareAddr, error)
GetMacDetails from an interface
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) LinkSetUp ¶
func (h *NetworkUtilsHandler) LinkSetUp(link netlink.Link) error
func (*NetworkUtilsHandler) ParseAddr ¶
func (h *NetworkUtilsHandler) ParseAddr(s string) (*netlink.Addr, error)
Click to show internal directories.
Click to hide internal directories.