interfacestore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceConfig

type InterfaceConfig struct {
	ID           string
	Type         InterfaceType
	IP           net.IP
	MAC          net.HardwareAddr
	PodName      string
	PodNamespace string
	NetNS        string
	*OVSPortConfig
}

func NewContainerInterface

func NewContainerInterface(containerID string, podName string, podNamespace string, containerNetNS string, mac net.HardwareAddr, ip net.IP) *InterfaceConfig

NewContainerInterface creates container interface configuration

func NewGatewayInterface

func NewGatewayInterface(gatewayName string) *InterfaceConfig

NewGatewayInterface creates host gateway interface configuration

func NewTunnelInterface

func NewTunnelInterface(tunnelName string) *InterfaceConfig

NewTunnelInterface creates tunnel port interface configuration

type InterfaceStore

type InterfaceStore interface {
	Initialize(interfaces []*InterfaceConfig)
	AddInterface(ifaceID string, interfaceConfig *InterfaceConfig)
	DeleteInterface(ifaceID string)
	GetInterface(ifaceID string) (*InterfaceConfig, bool)
	GetContainerInterface(podName string, podNamespace string) (*InterfaceConfig, bool)
	GetContainerInterfaceNum() int
	Len() int
	GetInterfaceIDs() []string
}

InterfaceStore is a service interface to create local interfaces for container, host gateway, and tunnel port. Support add/delete/get operations

func NewInterfaceStore

func NewInterfaceStore() InterfaceStore

type InterfaceType

type InterfaceType uint8
const (
	// ContainerInterface is used to mark current interface is for container
	ContainerInterface InterfaceType = iota
	// GatewayInterface is used to mark current interface is for host gateway
	GatewayInterface
	// TunnelInterface is used to mark current interface is for tunnel port
	TunnelInterface
)

type OVSPortConfig

type OVSPortConfig struct {
	IfaceName string
	PortUUID  string
	OFPort    int32
}

Jump to

Keyboard shortcuts

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