ovs

package
v3.5.1-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ovs provides a wrapper around ovs-vsctl and ovs-ofctl

Index

Constants

View Source
const (
	OVS_OFCTL = "ovs-ofctl"
	OVS_VSCTL = "ovs-vsctl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface added in v1.4.0

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

func New added in v1.4.0

func New(execer exec.Interface, bridge string, minVersion string) (*Interface, error)

New returns a new ovs.Interface

func (*Interface) AddBridge added in v1.4.0

func (ovsif *Interface) AddBridge(properties ...string) error

AddBridge creates the bridge associated with the interface, optionally setting properties on it (as with "ovs-vsctl set Bridge ..."). If the bridge already existed, it will be destroyed and recreated.

func (*Interface) AddPort added in v1.4.0

func (ovsif *Interface) AddPort(port string, ofportRequest int, properties ...string) (int, error)

AddPort adds an interface to the bridge, requesting the indicated port number, and optionally setting properties on it (as with "ovs-vsctl set Interface ..."). Returns the allocated port number (or an error).

func (*Interface) DeleteBridge added in v1.4.0

func (ovsif *Interface) DeleteBridge() error

DeleteBridge deletes the bridge associated with the interface. (It is an error if the bridge does not exist.)

func (*Interface) DeletePort added in v1.4.0

func (ovsif *Interface) DeletePort(port string) error

DeletePort removes an interface from the bridge. (It is not an error if the interface is not currently a bridge port.)

func (*Interface) DumpFlows added in v1.4.0

func (ovsif *Interface) DumpFlows() ([]string, error)

DumpFlows dumps the flow table for the bridge and returns it as an array of strings, one per flow.

func (*Interface) GetOFPort added in v1.5.0

func (ovsif *Interface) GetOFPort(port string) (int, error)

GetOFPort returns the OpenFlow port number of a given network interface attached to a bridge.

func (*Interface) NewTransaction added in v1.4.0

func (ovsif *Interface) NewTransaction() *Transaction

NewTransaction begins a new OVS transaction. If an error occurs at any step in the transaction, it will be recorded until EndTransaction(), and any further calls on the transaction will be ignored.

type Transaction

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

func (*Transaction) AddFlow

func (tx *Transaction) AddFlow(flow string, args ...interface{})

AddFlow adds a flow to the bridge. The arguments are passed to fmt.Sprintf().

func (*Transaction) DeleteFlows

func (tx *Transaction) DeleteFlows(flow string, args ...interface{})

DeleteFlows deletes all matching flows from the bridge. The arguments are passed to fmt.Sprintf().

func (*Transaction) EndTransaction

func (tx *Transaction) EndTransaction() error

EndTransaction ends an OVS transaction and returns any error that occurred during the transaction. You should not use the transaction again after calling this function.

Jump to

Keyboard shortcuts

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