ovs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseOvsInstance

func CloseOvsInstance(prjID string) error

Types

type OvsNode

type OvsNode struct {
	PrjID       string
	Name        string
	ShortName   string
	Running     bool
	OvsInstance *OvsProjectInstance
	Interfaces  map[string]link.IfState
	Logger      *logrus.Entry
}

func NewOvsNode

func NewOvsNode(prjID, name, shortName string) (*OvsNode, error)

func (*OvsNode) AddInterface

func (o *OvsNode) AddInterface(ifName string, ifIndex int, ns netns.NsHandle) error

func (*OvsNode) CanRunConsole

func (o *OvsNode) CanRunConsole() error

func (*OvsNode) Capture

func (o *OvsNode) Capture(ifIndex int, out io.Writer) error

func (*OvsNode) Close

func (o *OvsNode) Close() error

func (*OvsNode) Console

func (o *OvsNode) Console(shell bool, in io.ReadCloser, out io.Writer, resizeCh chan term.Winsize) error

func (*OvsNode) CopyFrom

func (o *OvsNode) CopyFrom(srcPath, destPath string) error

func (*OvsNode) CopyTo

func (o *OvsNode) CopyTo(srcPath, destPath string) error

func (*OvsNode) GetBridgeName added in v0.1.1

func (o *OvsNode) GetBridgeName() string

func (*OvsNode) GetInterfaceName

func (o *OvsNode) GetInterfaceName(ifIndex int) string

func (*OvsNode) GetInterfacesState added in v0.1.1

func (o *OvsNode) GetInterfacesState() map[string]link.IfState

func (*OvsNode) GetName

func (s *OvsNode) GetName() string

func (*OvsNode) GetNetns

func (o *OvsNode) GetNetns() (netns.NsHandle, error)

func (*OvsNode) GetShortName added in v0.1.1

func (s *OvsNode) GetShortName() string

func (*OvsNode) GetType

func (s *OvsNode) GetType() string

func (*OvsNode) IsRunning

func (o *OvsNode) IsRunning() bool

func (*OvsNode) LoadConfig

func (o *OvsNode) LoadConfig(confPath string) ([]string, error)

func (*OvsNode) ReadConfigFiles added in v0.2.0

func (o *OvsNode) ReadConfigFiles(confDir string) (map[string][]byte, error)

func (*OvsNode) Save

func (o *OvsNode) Save(dstPath string) error

func (*OvsNode) SetInterfaceState

func (n *OvsNode) SetInterfaceState(ifIndex int, state link.IfState) error

func (*OvsNode) Start

func (o *OvsNode) Start() error

func (*OvsNode) Stop

func (o *OvsNode) Stop() error

type OvsProjectInstance

type OvsProjectInstance struct {
	Logger *logrus.Entry
	// contains filtered or unexported fields
}

func GetOvsInstance

func GetOvsInstance(prjID string) *OvsProjectInstance

func NewOvsInstance

func NewOvsInstance(prjID string) (*OvsProjectInstance, error)

func (*OvsProjectInstance) AddBr

func (o *OvsProjectInstance) AddBr(brName string) error

func (*OvsProjectInstance) AddPort

func (o *OvsProjectInstance) AddPort(brName, ifName string) error

func (*OvsProjectInstance) Capture

func (o *OvsProjectInstance) Capture(ifName string, out io.Writer) error

func (*OvsProjectInstance) Close

func (o *OvsProjectInstance) Close() error

func (*OvsProjectInstance) DelBr

func (o *OvsProjectInstance) DelBr(brName string) error

func (*OvsProjectInstance) DelPort

func (o *OvsProjectInstance) DelPort(brName, ifName string) error

func (*OvsProjectInstance) Exec

func (o *OvsProjectInstance) Exec(cmd []string) error

func (*OvsProjectInstance) GetNetns

func (o *OvsProjectInstance) GetNetns() (netns.NsHandle, error)

func (*OvsProjectInstance) LoadConfig

func (o *OvsProjectInstance) LoadConfig(name, brName, confPath string) ([]string, error)

func (*OvsProjectInstance) SaveConfig

func (o *OvsProjectInstance) SaveConfig(name, brName, dstPath string) error

func (*OvsProjectInstance) Start

func (o *OvsProjectInstance) Start() error

type State

type State int

Jump to

Keyboard shortcuts

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