ovs

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

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

func NewTransaction

func NewTransaction(bridge string) *Transaction

NewTransaction begins a new OVS transaction for a given bridge. 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.

func (*Transaction) AddBridge

func (tx *Transaction) AddBridge(properties ...string)

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

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) AddPort

func (tx *Transaction) AddPort(port string, ofport uint, properties ...string)

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

func (*Transaction) DeleteBridge

func (tx *Transaction) DeleteBridge()

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

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) DeletePort

func (tx *Transaction) DeletePort(port string)

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

func (*Transaction) DumpFlows

func (tx *Transaction) DumpFlows() ([]string, error)

DumpFlows dumps the flow table for the bridge and returns it as an array of strings, one per flow. Since this function has a return value, it also returns an error immediately if an error occurs.

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