openflow

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version13 versionType = "Openflow13"

	ProtocolIP   protocol = "ip"
	ProtocolARP  protocol = "arp"
	ProtocolTCP  protocol = "tcp"
	ProtocolUDP  protocol = "udp"
	ProtocolSCTP protocol = "sctp"
	ProtocolICMP protocol = "icmp"
)
View Source
const (
	NxmFieldSrcMAC  = "NXM_OF_ETH_SRC"
	NxmFieldDstMAC  = "NXM_OF_ETH_DST"
	NxmFieldARPSha  = "NXM_NX_ARP_SHA"
	NxmFieldARPTha  = "NXM_NX_ARP_THA"
	NxmFieldARPSpa  = "NXM_OF_ARP_SPA"
	NxmFieldARPTpa  = "NXM_OF_ARP_TPA"
	NxmFieldCtLabel = "NXM_NX_CT_LABEL"
	NxmFieldCtMark  = "NXM_NX_CT_MARK"
	NxmFieldARPOp   = "NXM_OF_ARP_OP"
	NxmFieldReg     = "NXM_NX_REG"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	LoadARPOperation(value uint16) FlowBuilder
	LoadRegRange(regID int, value uint32, to Range) FlowBuilder
	LoadRange(name string, addr uint32, to Range) FlowBuilder
	Move(from, to string) FlowBuilder
	MoveRange(fromName, toName string, from, to Range) FlowBuilder
	Resubmit(port string, table TableIDType) FlowBuilder
	CT(commit bool, tableID TableIDType, zone int) CTAction
	Drop() FlowBuilder
	Output(port int) FlowBuilder
	OutputFieldRange(from string, rng Range) FlowBuilder
	OutputRegRange(regID int, rng Range) FlowBuilder
	OutputInPort() FlowBuilder
	SetDstMAC(addr net.HardwareAddr) FlowBuilder
	SetSrcMAC(addr net.HardwareAddr) FlowBuilder
	SetARPSha(addr net.HardwareAddr) FlowBuilder
	SetARPTha(addr net.HardwareAddr) FlowBuilder
	SetARPSpa(addr net.IP) FlowBuilder
	SetARPTpa(addr net.IP) FlowBuilder
	SetSrcIP(addr net.IP) FlowBuilder
	SetDstIP(addr net.IP) FlowBuilder
	SetTunnelDst(addr net.IP) FlowBuilder
	DecTTL() FlowBuilder
	Normal() FlowBuilder
	Conjunction(conjID uint32, clauseID uint8, nClause uint8) FlowBuilder
}

type Bridge

type Bridge interface {
	CreateTable(id, next TableIDType, missAction MissActionType) Table
	GetName() string
	DeleteTable(id TableIDType) bool
	DumpTableStatus() []TableStatus
	// Connect initiates connection to the OFSwitch. It will block until the connection is established.
	// If Bridge is not connected in maxRetry times, it will return error.
	Connect(maxRetry int) error
	// Disconnect stops connection to the OFSwitch.
	Disconnect() error
}

Bridge defines operations on an openflow bridge.

func NewBridge

func NewBridge(name string) Bridge

type CTAction

type CTAction interface {
	LoadToMark(value uint32) CTAction
	LoadToLabelRange(value uint64, rng *Range) CTAction
	MoveToLabel(fromName string, fromRng, labelRng *Range) CTAction
	CTDone() FlowBuilder
}

type Flow

type Flow interface {
	Add() error
	Modify() error
	Delete() error
	String() string
	MatchString() string
	GetTable() Table
	// CopyToBuilder returns a new FlowBuilder that copies the matches of the Flow, but does not not copy the actions.
	CopyToBuilder() FlowBuilder
}

type FlowBuilder

type FlowBuilder interface {
	Priority(value uint32) FlowBuilder
	MatchProtocol(name protocol) FlowBuilder
	MatchReg(regID int, data uint32) FlowBuilder
	MatchRegRange(regID int, data uint32, rng Range) FlowBuilder
	MatchInPort(inPort uint32) FlowBuilder
	MatchDstIP(ip net.IP) FlowBuilder
	MatchDstIPNet(ipNet net.IPNet) FlowBuilder
	MatchSrcIP(ip net.IP) FlowBuilder
	MatchSrcIPNet(ipNet net.IPNet) FlowBuilder
	MatchDstMAC(mac net.HardwareAddr) FlowBuilder
	MatchSrcMAC(mac net.HardwareAddr) FlowBuilder
	MatchARPSha(mac net.HardwareAddr) FlowBuilder
	MatchARPTha(mac net.HardwareAddr) FlowBuilder
	MatchARPSpa(ip net.IP) FlowBuilder
	MatchARPTpa(ip net.IP) FlowBuilder
	MatchARPOp(op uint16) FlowBuilder
	MatchCTState(value string) FlowBuilder
	MatchCTMark(value string) FlowBuilder
	MatchConjID(value uint32) FlowBuilder
	MatchTCPDstPort(port uint16) FlowBuilder
	MatchUDPDstPort(port uint16) FlowBuilder
	MatchSCTPDstPort(port uint16) FlowBuilder
	Cookie(cookieID uint64) FlowBuilder
	Action() Action
	Done() Flow
}

type MissActionType

type MissActionType uint32
const (
	TableMissActionDrop MissActionType = iota
	TableMissActionNormal
	TableMissActionNext
)

type Range

type Range [2]uint32

type Table

type Table interface {
	GetID() TableIDType
	BuildFlow() FlowBuilder
	GetMissAction() MissActionType
	Status() TableStatus
	GetNext() TableIDType
}

type TableIDType

type TableIDType uint8
const LastTableID TableIDType = 0xff

type TableStatus

type TableStatus struct {
	ID         uint      `json:"id"`
	FlowCount  uint      `json:"flowCount"`
	UpdateTime time.Time `json:"updateTime"`
}

TableStatus represents the status of a specific flow table. The status is useful for debugging.

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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