Documentation ¶
Index ¶
- Constants
- Variables
- type Acl
- type AclCore
- type Client
- func (ovsdb Client) Close()
- func (ovsdb Client) CreateACL(lswitch string, direction string, priority int, match string, action string) error
- func (ovsdb Client) CreateInterface(bridge, name string) error
- func (ovsdb Client) CreateLogicalPort(lswitch, name, mac, ip string) error
- func (ovsdb Client) CreateLogicalSwitch(lswitch string) error
- func (ovsdb Client) DeleteACL(lswitch string, ovsdbACL Acl) error
- func (ovsdb Client) DeleteInterface(iface Interface) error
- func (ovsdb Client) DeleteLogicalPort(lswitch string, lport LPort) error
- func (ovsdb Client) ListACLs(lswitch string) ([]Acl, error)
- func (ovsdb Client) ListInterfaces() ([]Interface, error)
- func (ovsdb Client) ListLogicalPorts(lswitch string) ([]LPort, error)
- func (ovsdb Client) ModifyInterface(iface Interface) error
- func (ovsdb Client) SetBridgeMac(bridge, mac string) error
- type Interface
- type InterfaceSlice
- type LPort
- type LPortSlice
Constants ¶
const ( // InterfaceTypePatch is the logical interface type `patch` InterfaceTypePatch = "patch" // InterfaceTypeInternal is the logical interface type `internal` InterfaceTypeInternal = "internal" // InterfaceTypeGeneve is the logical interface type `geneve` InterfaceTypeGeneve = "geneve" )
Variables ¶
var Open = func() (Client, error) { client, err := ovs.Connect("127.0.0.1", 6640) return Client{ovsdbClient{client}}, 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 AclCore ¶
AclCore is the actual ACL rule that will be matched, without various OVSDB metadata found in Acl.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a connection to the ovsdb-server database.
func NewFakeOvsdbClient ¶
func NewFakeOvsdbClient() Client
NewFakeOvsdbClient returns an ovsdb client with mocked ovsdb.
func (Client) Close ¶
func (ovsdb Client) Close()
Close destroys an Ovsdb connection created by Open.
func (Client) CreateACL ¶
func (ovsdb Client) CreateACL(lswitch string, direction string, priority int, match string, action string) error
CreateACL creates an access control rule in OVN.
direction, unless wildcarded, must be either "from-lport" or "to-lport"
priority, unless wildcarded, must be in [1,32767]
match, unless wildcarded or empty, must be a valid OpenFlow expression
action must be one of {"allow", "allow-related", "drop", "reject"}
direction and match may be wildcarded by passing the value "*". priority may also be wildcarded by passing a value less than 0.
func (Client) CreateInterface ¶
CreateInterface creates an openflow port on specified bridge.
A port cannot be created without an interface, that is why the "default" interface (one with the same name as the port) is created along with it.
func (Client) CreateLogicalPort ¶
CreateLogicalPort creates a new logical port in OVN.
func (Client) CreateLogicalSwitch ¶
CreateLogicalSwitch creates a new logical switch in OVN.
func (Client) DeleteInterface ¶
DeleteInterface deletes an openflow interface.
func (Client) DeleteLogicalPort ¶
DeleteLogicalPort removes a logical port from OVN.
func (Client) ListInterfaces ¶
ListInterfaces gets all openflow interfaces.
func (Client) ListLogicalPorts ¶
ListLogicalPorts lists the logical ports in OVN.
func (Client) ModifyInterface ¶
ModifyInterface modifies the openflow interface.
func (Client) SetBridgeMac ¶
SetBridgeMac sets the MAC address of the bridge.
type Interface ¶
type Interface struct { Name string Peer string AttachedMAC string IfaceID string Bridge string Type string OFPort *int // contains filtered or unexported fields }
Interface is a logical interface in OVN.
type InterfaceSlice ¶
type InterfaceSlice []Interface
InterfaceSlice is used for HashJoin.
func (InterfaceSlice) Get ¶
func (ovsps InterfaceSlice) Get(i int) interface{}
Get is required for HashJoin.
type LPort ¶
type LPort struct { Bridge string 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