package
0.0.0-20210515183826-906eb8da3f05
Repository: https://github.com/aau-network-security/openvswitch.git
Documentation: pkg.go.dev

# README

ovsnl

Package ovsnl enables interaction with the Linux Open vSwitch generic netlink interface.

// Dial a generic netlink connection and create a *ovsnl.Client.
c, err := ovsnl.New()
if err != nil {
    // If OVS generic netlink families aren't available, do nothing.
    if os.IsNotExist(err) {
        log.Printf("generic netlink OVS families not found: %v", err)
        return
    }

	log.Fatalf("failed to create client %v", err)
}
// Be sure to close the generic netlink connection!
defer c.Close()

// List available OVS datapaths.
dps, err := c.Datapath.List()
if err != nil {
	log.Fatalf("failed to list datapaths: %v", err)
}

for _, d := range dps {
	log.Printf("datapath: %q, flows: %d", d.Name, d.Stats.Flows)
}

# Functions

New creates a new Linux Open vSwitch generic netlink client.

# Constants

Possible DatapathFeatures flag values.
Possible DatapathFeatures flag values.

# Structs

A Client is a Linux Open vSwitch generic netlink client.
A Datapath is an Open vSwitch in-kernel datapath.
DatapathMegaflowStats contains statistics about mega flow mask usage for a Datapath.
A DatapathService provides access to methods which interact with the "ovs_datapath" generic netlink family.
DatapathStats contains statistics about packets that have passed through a Datapath.

# Type aliases

DatapathFeatures is a set of bit flags that specify features for a datapath.