ovs

package
v0.0.0-...-f99d0f1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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 = 16633

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"`
	IdleTimeout string  `json:"idletimeout"`
	IdleAge     int     `json:"idleage"`
	Priority    string  `json:"proirity"`
	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{OvsDumpSourceTest{}}
)

func (OvsDumpReader) Flows

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

func (OvsDumpReader) Groups

func (o OvsDumpReader) Groups(ip string, port int) ([]Group, 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)
	DumpGroups(ip string, port int) ([]string, error)
	DumpGroupStats(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(ip string, port int) ([]string, error)

func (OvsDumpSourceTest) DumpGroupStats

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

func (OvsDumpSourceTest) DumpGroups

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

func (OvsDumpSourceTest) DumpPorts

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

type OvsStatReader

type OvsStatReader interface {
	Flows(ip string, port int) ([]Flow, error)
	Ports(ip string, port int) ([]Port, error)
	Groups(ip string, port int) ([]Group, 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