Documentation ¶
Index ¶
- Constants
- func AddToBridgeBulk(elements map[string][]OVSInterface) error
- func ExecLink(args ...string) error
- func GetOFPort(containerName, ifName string) (string, bool)
- type IPRoute
- type OVSBulk
- type OVSDockerClient
- func (c *OVSDockerClient) AddPort(brName, ifName string, settings PortSettings, hostIf *OVSInterface, ...) error
- func (c *OVSDockerClient) DeletePort(ifName string)
- func (c *OVSDockerClient) ExecNS(args ...string) error
- func (c *OVSDockerClient) FindPort(ifName string) (string, bool)
- func (c *OVSDockerClient) IfNames() (string, string)
- func (c *OVSDockerClient) PortExists(ifName string) bool
- func (c *OVSDockerClient) PortnameContainer() string
- func (c *OVSDockerClient) PortnameHost() string
- func (c *OVSDockerClient) SysctlSet(key, val string) error
- type OVSInterface
- type PortSettings
Constants ¶
const MPLSMAXLabels = 65535
Variables ¶
This section is empty.
Functions ¶
func AddToBridgeBulk ¶
func AddToBridgeBulk(elements map[string][]OVSInterface) error
Types ¶
type OVSBulk ¶
type OVSBulk map[string][]OVSInterface
type OVSDockerClient ¶
type OVSDockerClient struct { PID int Portname string ContainerName string // contains filtered or unexported fields }
func New ¶
func New(containerName string) *OVSDockerClient
New returns an OVSDockerClient based on the container name. It fetches the matching PID and generates an UUID for future use
func (*OVSDockerClient) AddPort ¶
func (c *OVSDockerClient) AddPort(brName, ifName string, settings PortSettings, hostIf *OVSInterface, bridge bool) error
AddPort adds a port to the container, and links it with an OVS bridge. If hostIf in not nil, it fills the struct fields. If bridge is set to false, the host part is not added to the OVS bridge
func (*OVSDockerClient) DeletePort ¶
func (c *OVSDockerClient) DeletePort(ifName string)
DeletePort deletes a port from a container
func (*OVSDockerClient) ExecNS ¶
func (c *OVSDockerClient) ExecNS(args ...string) error
ExecNS is a wrapper around the "ip netns exec <PID>" command (with PID auto-filled)
func (*OVSDockerClient) FindPort ¶
func (c *OVSDockerClient) FindPort(ifName string) (string, bool)
FindPort checks if an interface ifName exists within the container, and returns the corresponding interface on the host side
func (*OVSDockerClient) IfNames ¶
func (c *OVSDockerClient) IfNames() (string, string)
IfNames returns both portnames (host and container)
func (*OVSDockerClient) PortExists ¶
func (c *OVSDockerClient) PortExists(ifName string) bool
PortExists checks if an interface with name ifName already exists in the container (from OVS)
func (*OVSDockerClient) PortnameContainer ¶
func (c *OVSDockerClient) PortnameContainer() string
PortnameContainer returns the portname suffixed by "_c"
func (*OVSDockerClient) PortnameHost ¶
func (c *OVSDockerClient) PortnameHost() string
PortnameHost returns the portname suffixed by "_l"
func (*OVSDockerClient) SysctlSet ¶
func (c *OVSDockerClient) SysctlSet(key, val string) error
SysctlSet executes a syswtl write inside the container network namespace
type OVSInterface ¶
type OVSInterface struct { HostIface string `json:"h_if"` Bridge string `json:"br"` ContainerIface string `json:"c_if"` Settings PortSettings }
type PortSettings ¶
func DefaultParams ¶
func DefaultParams() PortSettings