ovs

package
v0.0.0-...-5929fdb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FLOWS       = "resources/test/dump-flows.txt"
	PORTS       = "resources/test/dump-ports.txt"
	GROUPS      = "resources/test/dump-groups.txt"
	GROUP_STATS = "resources/test/dump-group-stats.txt"
)
View Source
const OvsDefaultPort int = 6633

the passive TCP port where OVS entries are listening for OpenFlow commands

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	//    BucketId  string    `json:"bucketid"` // for now I see no real usage of BucketID
	Actions string `json:"actions"`
	Bytes   int    `json:"bytes"`
	Packets int    `json:"packets"`
}

type Flow

type Flow struct {
	Cookie   string  `json:"cookie"`
	Duration float64 `json:"duration"`
	Table    string  `json:"table"`
	Packets  int     `json:"packets"`
	Bytes    int     `json:"bytes"`
	IdleAge  int     `json:"idle_age"`
	HardAge  int     `json:"hard_age"`
	Priority string  `json:"priority"`
	Match    string  `json:"match"`
	Action   string  `json:"action"`
}

type Group

type Group struct {
	GroupId   string   `json:"groupid"`
	GroupType string   `json:"grouptype"`
	Buckets   []Bucket `json:"buckets"`
	Duration  int      `json:"duration"`
	Bytes     int      `json:"bytes"`
	Packets   int      `json:"packets"`
}

type OvsDumpReader

type OvsDumpReader struct {
	// contains filtered or unexported fields
}
var (
	CliDumpReader OvsDumpReader = OvsDumpReader{OvsDumpSourceCLI{}}
)

func (OvsDumpReader) Flows

func (o OvsDumpReader) Flows(ip string, port int) ([]Flow, error)

func (OvsDumpReader) Ports

func (o OvsDumpReader) Ports(ip string, port int) ([]Port, error)

type OvsDumpSource

type OvsDumpSource interface {
	DumpFlows(ip string, port int) ([]string, error)
	DumpPorts(ip string, port int) ([]string, error)
}

type OvsDumpSourceCLI

type OvsDumpSourceCLI struct{}

func (OvsDumpSourceCLI) DumpFlows

func (o OvsDumpSourceCLI) DumpFlows(ip string, port int) ([]string, error)

func (OvsDumpSourceCLI) DumpGroupStats

func (o OvsDumpSourceCLI) DumpGroupStats(ip string, port int) ([]string, error)

func (OvsDumpSourceCLI) DumpGroups

func (o OvsDumpSourceCLI) DumpGroups(ip string, port int) ([]string, error)

func (OvsDumpSourceCLI) DumpPorts

func (o OvsDumpSourceCLI) DumpPorts(ip string, port int) ([]string, error)

type OvsDumpSourceTest

type OvsDumpSourceTest struct{}

func (OvsDumpSourceTest) DumpFlows

func (o OvsDumpSourceTest) DumpFlows(iface string, port int) ([]string, error)

func (OvsDumpSourceTest) DumpGroupStats

func (o OvsDumpSourceTest) DumpGroupStats(iface string, port int) ([]string, error)

func (OvsDumpSourceTest) DumpGroups

func (o OvsDumpSourceTest) DumpGroups(iface string, port int) ([]string, error)

func (OvsDumpSourceTest) DumpPorts

func (o OvsDumpSourceTest) DumpPorts(iface string, port int) ([]string, error)

type OvsStatReader

type OvsStatReader interface {
	Flows(ip string, port int) ([]Flow, error)
	Ports(ip string, port int) ([]Port, error)
}
var (
	OvsDefaultReader OvsStatReader = OvsDumpReader{}
)

type Port

type Port struct {
	PortNumber   string `json:"portnumber"`
	RxPackets    int    `json:"rxpackets"`
	TxPackets    int    `json:"txpackets"`
	RxBytes      int    `json:"rxbytes"`
	TxBytes      int    `json:"txbytes"`
	RxDrops      int    `json:"rxdrops"`
	TxDrops      int    `json:"txdrops"`
	RxErrors     string `json:"rxerrors"`
	TxErrors     string `json:"txerrors"`
	RxFrameErr   string `json:"rxframeerr"`
	RxOverruns   string `json:"rxovverruns"`
	RxCrcErrors  string `json:"rxcrcerrors"`
	TxCollisions string `json:"txcollisions"`
}

Jump to

Keyboard shortcuts

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