ovsctl

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(bridge string) *ovsCtlClient

Types

type BadRequestError

type BadRequestError string

func (BadRequestError) Error

func (e BadRequestError) Error() string

type ExecError

type ExecError struct {
	// contains filtered or unexported fields
}

ExecError is for errors happened in command execution.

func (*ExecError) CommandExecuted

func (e *ExecError) CommandExecuted() bool

CommandExecuted returns whether the OVS command has been executed.

func (*ExecError) GetErrorOutput

func (e *ExecError) GetErrorOutput() string

GetErrorOutput returns the command's output to stderr if it has ben executed and exited with an error.

type OVSCtlClient

type OVSCtlClient interface {
	// DumpFlows returns flows of the bridge.
	DumpFlows(args ...string) ([]string, error)
	// DumpMatchedFlows returns the flow which exactly matches the matchStr.
	DumpMatchedFlow(matchStr string) (string, error)
	// DumpTableFlows returns all flows in the table.
	DumpTableFlows(table uint8) ([]string, error)
	// DumpGroups returns OpenFlow groups of the bridge.
	DumpGroups(args ...string) ([][]string, error)
	// RunOfctlCmd executes "ovs-ofctl" command and returns the outputs.
	RunOfctlCmd(cmd string, args ...string) ([]byte, error)
	// Trace executes "ovs-appctl ofproto/trace" to perform OVS packet tracing.
	Trace(req *TracingRequest) (string, error)
}

OVSCtlClient is an interface for executing OVS "ovs-ofctl" and "ovs-appctl" commands.

type TracingRequest

type TracingRequest struct {
	InPort string // Input port.
	SrcIP  net.IP
	DstIP  net.IP
	SrcMAC net.HardwareAddr
	DstMAC net.HardwareAddr
	Flow   string
	// Whether in_port field in Flow can override InPort.
	AllowOverrideInPort bool
}

TracingRequest defines tracing request parameters.

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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