ovsdb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Open = func() (Client, error) {
	odb, err := ovs.Connect("127.0.0.1", 6640)
	return client{odb}, err
}

Open creates a new Ovsdb connection. It's stored in a variable so we can mock it out for the unit tests.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Core ACLCore
	Log  bool
	// contains filtered or unexported fields
}

ACL is a firewall rule in OVN.

type ACLCore

type ACLCore struct {
	Priority  int
	Direction string
	Match     string
	Action    string
}

ACLCore is the actual ACL rule that will be matched, without various OVSDB metadata found in ACL.

type AddressSet

type AddressSet struct {
	Name      string
	Addresses []string
}

AddressSet is a named group of IPs in OVN.

type Client

type Client interface {
	CreateLogicalSwitch(lswitch string) error
	ListLogicalPorts() ([]LPort, error)
	CreateLogicalPort(lswitch, name, mac, ip string) error
	DeleteLogicalPort(lswitch string, lport LPort) error
	ListACLs() ([]ACL, error)
	CreateACL(lswitch, direction string, priority int, match, action string) error
	DeleteACL(lswitch string, ovsdbACL ACL) error
	ListAddressSets() ([]AddressSet, error)
	CreateAddressSet(name string, addresses []string) error
	DeleteAddressSet(name string) error
	OpenFlowPorts() (map[string]int, error)
	Disconnect()
}

Client is a connection to the ovsdb-server database.

type Interface

type Interface struct {
	Name        string
	Peer        string
	AttachedMAC string
	IfaceID     string
	Bridge      string
	Type        string
}

Interface is a linux device attached to OVS.

type LPort

type LPort struct {
	Name      string
	Addresses []string
	// contains filtered or unexported fields
}

LPort is a logical port in OVN.

type LPortSlice

type LPortSlice []LPort

LPortSlice is a wrapper around []LPort so it can be used in joins

func (LPortSlice) Get

func (lps LPortSlice) Get(i int) interface{}

Get gets the element at the ith index

func (LPortSlice) Len

func (lps LPortSlice) Len() int

Len returns the length of the slice

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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