v1.15.2 Latest Latest

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0




This section is empty.


View Source
var (
	IPAndNWProtos = []string{"ip", "icmp", "tcp", "udp", "sctp", "ipv6", "icmp6", "tcp6", "udp6", "sctp6"}


func NewClient

func NewClient(bridge string) *ovsCtlClient


type BadRequestError

type BadRequestError string

func (BadRequestError) Error

func (e BadRequestError) Error() string

type DPFeature added in v1.3.0

type DPFeature string
const (
	CTStateFeature    DPFeature = "CT state"
	CTZoneFeature     DPFeature = "CT zone"
	CTMarkFeature     DPFeature = "CT mark"
	CTLabelFeature    DPFeature = "CT label"
	CTStateNATFeature DPFeature = "CT state NAT"

type ExecError

type ExecError struct {
	// contains filtered or unexported fields

ExecError is for errors happened in command execution.

func NewExecError added in v1.13.3

func NewExecError(err error, errorOutput string) *ExecError

func (*ExecError) CommandExecuted

func (e *ExecError) CommandExecuted() bool

CommandExecuted returns whether the OVS command has been executed.

func (*ExecError) Error added in v1.3.0

func (e *ExecError) Error() string

func (*ExecError) GetErrorOutput

func (e *ExecError) GetErrorOutput() string

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

type OVSAppctlRunner added in v1.11.0

type OVSAppctlRunner interface {
	RunAppctlCmd(cmd string, needsBridge bool, args ...string) ([]byte, error)

type OVSCtlClient

type OVSCtlClient interface {
	// DumpFlows returns flows of the bridge.
	DumpFlows(args ...string) ([]string, error)
	// DumpFlowsWithoutTableNames returns flows of the bridge, and the table is shown as uint8 value in the result.
	// This function is only used in test.
	DumpFlowsWithoutTableNames(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)
	// DumpGroup returns the OpenFlow group if it exists on the bridge.
	DumpGroup(groupID uint32) (string, error)
	// DumpGroups returns OpenFlow groups of the bridge.
	DumpGroups() ([]string, error)
	// DumpPortsDesc returns OpenFlow ports descriptions of the bridge.
	DumpPortsDesc() ([][]string, error)
	// SetPortNoFlood sets the given port with config "no-flood". This configuration must work with OpenFlow10.
	SetPortNoFlood(ofport int) error
	// Trace executes "ovs-appctl ofproto/trace" to perform OVS packet tracing.
	Trace(req *TracingRequest) (string, error)
	// GetDPFeatures executes "ovs-appctl dpif/show-dp-features" to check supported DP features.
	GetDPFeatures() (map[DPFeature]bool, error)
	// DeleteDPInterface executes "ovs-appctl dpctl/del-if ovs-system $name" to delete OVS datapath interface.
	DeleteDPInterface(name string) error

type OVSOfctlRunner added in v1.11.0

type OVSOfctlRunner interface {
	RunOfctlCmd(cmd string, args ...string) ([]byte, error)

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.


Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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