of10

package
v0.0.0-...-42558ee Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Immutable messages
	OFPT_HELLO = iota
	OFPT_ERROR
	OFPT_ECHO_REQUEST
	OFPT_ECHO_REPLY
	OFPT_VENDOR

	// Switch configuration messages
	OFPT_FEATURES_REQUEST
	OFPT_FEATURES_REPLY
	OFPT_GET_CONFIG_REQUEST
	OFPT_GET_CONFIG_REPLY
	OFPT_SET_CONFIG

	// Asynchronous messages
	OFPT_PACKET_IN
	OFPT_FLOW_REMOVED
	OFPT_PORT_STATUS

	// Controller command messages
	OFPT_PACKET_OUT
	OFPT_FLOW_MOD
	OFPT_PORT_MOD

	// Statistics messages
	OFPT_STATS_REQUEST
	OFPT_STATS_REPLY

	// Barrier messages
	OFPT_BARRIER_REQUEST
	OFPT_BARRIER_REPLY

	// Queue configuration messages
	OFPT_QUEUE_GET_CONFIG_REQUEST
	OFPT_QUEUE_GET_CONFIG_REPLY
)
View Source
const EthernetAddressLength = 6
View Source
const HeaderLength = 8
View Source
const MaxPortNameLength = 16
View Source
const WireProtocolVersion = 0x01

Variables

View Source
var BadActionCodes = struct {
	BadType         ErrorCode
	BadLength       ErrorCode
	BadVendorId     ErrorCode
	BadVendorType   ErrorCode
	BadOutPort      ErrorCode
	BadArgument     ErrorCode
	PermissionError ErrorCode
	TooManyActions  ErrorCode
	BadQeueu        ErrorCode
}{
	OFPBAC_BAD_TYPE,
	OFPBAC_BAD_LEN,
	OFPBAC_BAD_VENDOR,
	OFPBAC_BAD_VENDOR_TYPE,
	OFPBAC_BAD_OUT_PORT,
	OFPBAC_BAD_ARGUMENT,
	OFPBAC_EPERM,
	OFPBAC_TOO_MANY,
	OFPBAC_BAD_QUEUE,
}
View Source
var BadRequestCodes = struct {
	BadVersion       ErrorCode
	BadType          ErrorCode
	BadStatRequest   ErrorCode
	BadVendorType    ErrorCode
	BadVendorSubType ErrorCode
	PermissionError  ErrorCode
	BadLength        ErrorCode
	BufferEmpty      ErrorCode
	BufferUnknown    ErrorCode
}{
	OFPBRC_BAD_VERSION,
	OFPBRC_BAD_TYPE,
	OFPBRC_BAD_STAT,
	OFPBRC_BAD_VENDOR,
	OFPBRC_BAD_SUBTYPE,
	OFPBRC_EPERM,
	OFPBRC_BAD_LEN,
	OFPBRC_BUFFER_EMPTY,
	OFPBRC_BUFFER_UNKNOWN,
}
View Source
var Capabilities = struct {
	FlowStats    Capability
	TableStats   Capability
	PortStats    Capability
	Stp          Capability
	Reserved     Capability
	IpReassemble Capability
	QueueStats   Capability
	ArpMatchIp   Capability
}{
	OFPC_FLOW_STATS,
	OFPC_TABLE_STATS,
	OFPC_PORT_STATS,
	OFPC_STP,
	OFPC_RESERVED,
	OFPC_IP_REASM,
	OFPC_QUEUE_STATS,
	OFPC_ARP_MATCH_IP,
}
View Source
var ConfigFlags = struct {
	FragmentNormal     ConfigFlag
	FragmentDrop       ConfigFlag
	FragmentReassemble ConfigFlag
	FragmentMask       ConfigFlag
}{
	OFPC_FRAG_NORMAL,
	OFPC_FRAG_DROP,
	OFPC_FRAG_REASM,
	OFPC_FRAG_MASK,
}
View Source
var FlowModFailedCodes = struct {
	AllTablesFull       ErrorCode
	Overlap             ErrorCode
	PermissionError     ErrorCode
	BadEmergencyTimeout ErrorCode
	BadCommand          ErrorCode
	Unsupported         ErrorCode
}{
	OFPFMFC_ALL_TABLES_FULL,
	OFPFMFC_OVERLAP,
	OFPFMFC_EPERM,
	OFPFMFC_BAD_EMERG_TIMEOUT,
	OFPFMFC_BAD_COMMAND,
	OFPFMFC_UNSUPPORTED,
}
View Source
var FlowModFlags = struct {
	SendFlowRemoved FlowModFlag
	CheckOverlap    FlowModFlag
	Emergency       FlowModFlag
}{
	OFPFF_SEND_FLOW_REM,
	OFPFF_CHECK_OVERLAP,
	OFPFF_EMERG,
}
View Source
var FlowRemovedReasons = struct {
	IdleTimeout FlowRemovedReason
	HardTimeout FlowRemovedReason
	Delete      FlowRemovedReason
}{
	OFPRR_IDLE_TIMEOUT,
	OFPRR_HARD_TIMEOUT,
	OFPRR_DELETE,
}
View Source
var HelloFailedCodes = struct {
	Incompatible    ErrorCode
	PermissionError ErrorCode
}{
	OFPHFC_INCOMPATIBLE,
	OFPHFC_EPERM,
}
View Source
var PacketInReasons = struct {
	NoMatch PacketInReason
	Action  PacketInReason
}{
	OFPR_NO_MATCH,
	OFPR_ACTION,
}
View Source
var PortConfigs = struct {
	PortDown     PortConfig
	NoStp        PortConfig
	NoReceive    PortConfig
	NoReceiveStp PortConfig
	NoFlood      PortConfig
	NoForward    PortConfig
	NoPacketIn   PortConfig
}{
	OFPPC_PORT_DOWN,
	OFPPC_NO_STP,
	OFPPC_NO_RECV,
	OFPPC_NO_RECV_STP,
	OFPPC_NO_FLOOD,
	OFPPC_NO_FWD,
	OFPPC_NO_PACKET_IN,
}
View Source
var PortFeatures = struct {
	HalfDuplex10M   PortFeature
	FullDuplex10M   PortFeature
	HalfDuplex100M  PortFeature
	FullDuplex100M  PortFeature
	HalfDuplex1G    PortFeature
	FullDuplex1G    PortFeature
	FullDuplex10G   PortFeature
	Copper          PortFeature
	Fiber           PortFeature
	AutoNegotiation PortFeature
	Pause           PortFeature
	AsymmetricPause PortFeature
}{
	OFPPF_10MB_HD,
	OFPPF_10MB_FD,
	OFPPF_100MB_HD,
	OFPPF_100MB_FD,
	OFPPF_1GB_HD,
	OFPPF_1GB_FD,
	OFPPF_10GB_FD,
	OFPPF_COPPER,
	OFPPF_FIBER,
	OFPPF_AUTONEG,
	OFPPF_PAUSE,
	OFPPF_PAUSE_ASYM,
}
View Source
var PortModFailedCode = struct {
	BadPort            ErrorCode
	BadHardwareAddress ErrorCode
}{
	OFPPMFC_BAD_PORT,
	OFPPMFC_BAD_HW_ADDR,
}
View Source
var PortStates = struct {
	LinkDown   PortState
	StpListen  PortState
	StpLearn   PortState
	StpForward PortState
	StpBlock   PortState
	StpMask    PortState
}{
	OFPPS_LINK_DOWN,
	OFPPS_STP_LISTEN,
	OFPPS_STP_LEARN,
	OFPPS_STP_FORWARD,
	OFPPS_STP_BLOCK,
	OFPPS_STP_MASK,
}
View Source
var PortStatusReasons = struct {
	Add    PortStatusReason
	Delete PortStatusReason
	Modify PortStatusReason
}{
	OFPPR_ADD,
	OFPPR_DELETE,
	OFPPR_MODIFY,
}
View Source
var QueueOperationFailedCodes = struct {
	BadPort         ErrorCode
	BadQueue        ErrorCode
	PermissionError ErrorCode
}{
	OFPQOFC_BAD_Port,
	OFPQOFC_BAD_QUEUE,
	OFPQOFC_EPERM,
}
View Source
var QueuePropertyTypes = struct {
	None    QueuePropertyType
	MinRate QueuePropertyType
}{
	OFPQT_NONE,
	OFPQT_MIN_RATE,
}
View Source
var StatsTypes = struct {
	Description StatsType
	Flow        StatsType
	Aggregate   StatsType
	Table       StatsType
	Port        StatsType
	Queue       StatsType
	Vendor      StatsType
}{
	OFPST_DESC,
	OFPST_FLOW,
	OFPST_AGGREGATE,
	OFPST_TABLE,
	OFPST_PORT,
	OFPST_QUEUE,
	OFPST_VENDOR,
}

Functions

func NewXidGenerator

func NewXidGenerator() func() uint32

Types

type Action

type Action interface {
	GetType() ActionType
	encoding.BinaryUnmarshaler
}

type ActionHeader

type ActionHeader struct {
	Type   ActionType
	Length uint16
}

func (*ActionHeader) GetType

func (header *ActionHeader) GetType() ActionType

type ActionType

type ActionType uint16
const (
	OFPAT_OUTPUT ActionType = iota
	OFPAT_SET_VLAN_VID
	OFPAT_SET_VLAN_PCP
	OFPAT_SET_STRIP_VLAN
	OFPAT_SET_DL_SRC
	OFPAT_SET_DL_DST
	OFPAT_SET_NW_SRC
	OFPAT_SET_NW_DST
	OFPAT_SET_NW_TOS
	OFPAT_SET_TP_SRC
	OFPAT_SET_TP_DST
	OFPAT_ENQUEUE
	OFPAT_VENDOR ActionType = 0xffff
)

type AggregateStatsReply

type AggregateStatsReply struct {
	PacketCount uint64
	ByteCount   uint64
	FlowCount   uint64
	// contains filtered or unexported fields
}

type AggregateStatsRequest

type AggregateStatsRequest struct {
	Match   Match
	TableId uint8

	OutPort PortNumber
	// contains filtered or unexported fields
}

type BarrierReply

type BarrierReply struct {
	Header
}

func (*BarrierReply) UnmarshalBinary

func (m *BarrierReply) UnmarshalBinary(data []byte) error

type BarrierRequest

type BarrierRequest struct {
	Header
}

func (*BarrierRequest) UnmarshalBinary

func (m *BarrierRequest) UnmarshalBinary(data []byte) error

type BufferId

type BufferId uint32

type Capability

type Capability uint32
const (
	OFPC_FLOW_STATS Capability = 1 << iota
	OFPC_TABLE_STATS
	OFPC_PORT_STATS
	OFPC_STP
	OFPC_RESERVED
	OFPC_IP_REASM
	OFPC_QUEUE_STATS
	OFPC_ARP_MATCH_IP
)

type ConfigFlag

type ConfigFlag uint16
const (
	OFPC_FRAG_NORMAL ConfigFlag = iota
	OFPC_FRAG_DROP
	OFPC_FRAG_REASM
	OFPC_FRAG_MASK
)
type Cookie uint64

type DatapathId

type DatapathId uint64

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(rd io.Reader) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode() (Message, error)

type DescriptionStats

type DescriptionStats struct {
	Manufacturer []uint8
	Hardware     []uint8
	Software     []uint8
	SerialNumber []uint8
	Datapath     []uint8
}

type Dscp

type Dscp uint8

type EchoReply

type EchoReply struct {
	Header
	Body []uint8
}

func (*EchoReply) UnmarshalBinary

func (m *EchoReply) UnmarshalBinary(data []byte) error

type EchoRequest

type EchoRequest struct {
	Header
	Body []uint8
}

func (*EchoRequest) UnmarshalBinary

func (m *EchoRequest) UnmarshalBinary(data []byte) error

type Enqueue

type Enqueue struct {
	ActionHeader
	Port PortNumber

	QueueId uint32
	// contains filtered or unexported fields
}

func (*Enqueue) UnmarshalBinary

func (m *Enqueue) UnmarshalBinary(data []byte) error

type ErrorCode

type ErrorCode uint16
const (
	OFPBRC_BAD_VERSION ErrorCode = iota
	OFPBRC_BAD_TYPE
	OFPBRC_BAD_STAT
	OFPBRC_BAD_VENDOR
	OFPBRC_BAD_SUBTYPE
	OFPBRC_EPERM
	OFPBRC_BAD_LEN
	OFPBRC_BUFFER_EMPTY
	OFPBRC_BUFFER_UNKNOWN
)

ErrorCode for Bad Request

const (
	OFPBAC_BAD_TYPE ErrorCode = iota
	OFPBAC_BAD_LEN
	OFPBAC_BAD_VENDOR
	OFPBAC_BAD_VENDOR_TYPE
	OFPBAC_BAD_OUT_PORT
	OFPBAC_BAD_ARGUMENT
	OFPBAC_EPERM
	OFPBAC_TOO_MANY
	OFPBAC_BAD_QUEUE
)

ErrorCode for Bad Action

const (
	OFPFMFC_ALL_TABLES_FULL ErrorCode = iota
	OFPFMFC_OVERLAP
	OFPFMFC_EPERM
	OFPFMFC_BAD_EMERG_TIMEOUT
	OFPFMFC_BAD_COMMAND
	OFPFMFC_UNSUPPORTED
)

ErrorCode for Flow Mod Failed

const (
	OFPPMFC_BAD_PORT ErrorCode = iota
	OFPPMFC_BAD_HW_ADDR
)

ErrorCode for Port Mod Failed

const (
	OFPQOFC_BAD_Port ErrorCode = iota
	OFPQOFC_BAD_QUEUE
	OFPQOFC_EPERM
)

ErrorCode for Queue Op Failed

const (
	OFPHFC_INCOMPATIBLE ErrorCode = iota
	OFPHFC_EPERM
)

ErrorCode for Hello Failed

type ErrorMessage

type ErrorMessage struct {
	Header
	Type ErrorType
	Code ErrorCode
	Data []uint8
}

func (*ErrorMessage) UnmarshalBinary

func (m *ErrorMessage) UnmarshalBinary(data []byte) error

type ErrorType

type ErrorType uint16
const (
	OFPET_HELLO_FAILED ErrorType = iota
	OFPET_BAD_REQUEST
	OFPET_BAD_ACTION
	OFPET_FLOW_MOD_FAILED
	OFPET_PORT_MOD_FAILED
	OFPET_QUEUE_OP_FAILED
)

type EtherType

type EtherType uint16

type FeaturesReply

type FeaturesReply struct {
	Header
	DatapathId DatapathId
	Buffers    uint32
	Tables     uint8

	Capabilities Capability
	Actions      ActionType
	Ports        []PhysicalPort
	// contains filtered or unexported fields
}

func (*FeaturesReply) UnmarshalBinary

func (m *FeaturesReply) UnmarshalBinary(data []byte) error

type FeaturesRequest

type FeaturesRequest struct {
	Header
}

func (*FeaturesRequest) UnmarshalBinary

func (m *FeaturesRequest) UnmarshalBinary(data []byte) error

type FlowMod

type FlowMod struct {
	Header
	Match       Match
	Cookie      Cookie
	Command     FlowModCommand
	IdleTimeout uint16
	HardTimeout uint16
	Priority    uint16
	BufferId    BufferId
	OutPort     PortNumber
	Flags       FlowModFlag
	Actions     []Action
}

func (*FlowMod) UnmarshalBinary

func (m *FlowMod) UnmarshalBinary(data []byte) error

type FlowModCommand

type FlowModCommand uint16
const (
	OFPFC_ADD FlowModCommand = iota
	OFPFC_MODIFY
	OFPFC_MODIFY_STRICT
	OFPFC_DELETE
	OFPFC_DELETE_STRICT
)

type FlowModFlag

type FlowModFlag uint16
const (
	OFPFF_SEND_FLOW_REM FlowModFlag = 1 << iota
	OFPFF_CHECK_OVERLAP
	OFPFF_EMERG
)

type FlowRemoved

type FlowRemoved struct {
	Header
	Match    Match
	Cookie   Cookie
	Priority uint16
	Reason   FlowRemovedReason

	DurationSec     uint32
	DurationNanoSec uint32
	IdleTimeout     uint16

	PacketCount uint64
	ByteCount   uint64
	// contains filtered or unexported fields
}

func (*FlowRemoved) UnmarshalBinary

func (m *FlowRemoved) UnmarshalBinary(data []byte) error

type FlowRemovedReason

type FlowRemovedReason uint8
const (
	OFPRR_IDLE_TIMEOUT FlowRemovedReason = iota
	OFPRR_HARD_TIMEOUT
	OFPRR_DELETE
)

type FlowStatsReply

type FlowStatsReply struct {
	Length  uint16
	TableId uint8

	Match           Match
	DurationSec     uint32
	DurationNanoSec uint32
	Priority        uint16
	IdleTimeout     uint16
	HardTimeout     uint16

	Cookie      Cookie
	PacketCount uint64
	ByteCount   uint64
	Actions     []ActionHeader
	// contains filtered or unexported fields
}

type FlowStatsRequest

type FlowStatsRequest struct {
	Match   Match
	TalbeId uint8

	OutPort PortNumber
	// contains filtered or unexported fields
}

type GenericMessage

type GenericMessage struct {
	Header
	Payload []byte
}

type GetConfigReply

type GetConfigReply struct {
	Header
	Flags          ConfigFlag
	MissSendLength uint16
}

func (*GetConfigReply) UnmarshalBinary

func (m *GetConfigReply) UnmarshalBinary(data []byte) error

type GetConfigRequest

type GetConfigRequest struct {
	Header
}

func (*GetConfigRequest) UnmarshalBinary

func (m *GetConfigRequest) UnmarshalBinary(data []byte) error
type Header struct {
	Version uint8
	Type    MessageType
	Length  uint16
	Xid     uint32
}

func (*Header) GetHeader

func (h *Header) GetHeader() *Header

type Hello

type Hello struct {
	Header
}

func (*Hello) UnmarshalBinary

func (m *Hello) UnmarshalBinary(data []byte) error

type Match

type Match struct {
	Wildcards    Wildcard
	InPort       PortNumber
	EthSrc       [EthernetAddressLength]uint8
	EthDst       [EthernetAddressLength]uint8
	VlanId       VlanId
	VlanPriority VlanPriority

	EtherType  EtherType
	IpTos      Dscp
	IpProtocol ProtocolNumber

	IpSrc        [4]uint8
	IpDst        [4]uint8
	TransportSrc TransportPort
	TransportDst TransportPort
	// contains filtered or unexported fields
}

type Message

type Message interface {
	encoding.BinaryUnmarshaler
	GetHeader() *Header
}

type MessageType

type MessageType uint8

type PacketIn

type PacketIn struct {
	Header
	BufferId    uint32
	TotalLength uint16
	InPort      PortNumber
	Reason      PacketInReason

	Data []uint8
	// contains filtered or unexported fields
}

func (*PacketIn) UnmarshalBinary

func (m *PacketIn) UnmarshalBinary(data []byte) error

type PacketInReason

type PacketInReason uint8
const (
	OFPR_NO_MATCH PacketInReason = iota
	OFPR_ACTION
)

type PacketOut

type PacketOut struct {
	Header
	BufferId      uint32
	InPort        PortNumber
	ActionsLength uint16
	Actions       []Action
	Data          []uint8
}

func (*PacketOut) UnmarshalBinary

func (m *PacketOut) UnmarshalBinary(data []byte) error

type PacketQueue

type PacketQueue struct {
	QueueId uint32
	Length  uint16

	Properties []QueueProperty
	// contains filtered or unexported fields
}

TODO: Properties should be generalized

type Packetizable

type Packetizable interface {
	io.ReadWriter
	Len() uint
}

type PhysicalPort

type PhysicalPort struct {
	PortNumber         PortNumber
	HardwareAddress    [EthernetAddressLength]uint8
	Name               [MaxPortNameLength]uint8
	Config             PortConfig
	State              PortState
	CurrentFeatures    PortFeature
	AdvertisedFeatures PortFeature
	SupportedFeatures  PortFeature
	PeerFeatures       PortFeature
}

type PortConfig

type PortConfig uint16
const (
	OFPPC_PORT_DOWN PortConfig = 1 << iota
	OFPPC_NO_STP
	OFPPC_NO_RECV
	OFPPC_NO_RECV_STP
	OFPPC_NO_FLOOD
	OFPPC_NO_FWD
	OFPPC_NO_PACKET_IN
)

type PortFeature

type PortFeature uint16
const (
	OFPPF_10MB_HD PortFeature = 1 << iota
	OFPPF_10MB_FD
	OFPPF_100MB_HD
	OFPPF_100MB_FD
	OFPPF_1GB_HD
	OFPPF_1GB_FD
	OFPPF_10GB_FD
	OFPPF_COPPER
	OFPPF_FIBER
	OFPPF_AUTONEG
	OFPPF_PAUSE
	OFPPF_PAUSE_ASYM
)

type PortMod

type PortMod struct {
	Header
	PortNumber      PortNumber
	HardwareAddress [EthernetAddressLength]uint8
	Config          PortConfig
	Mask            PortConfig
	Advertise       PortFeature
	// contains filtered or unexported fields
}

func (*PortMod) UnmarshalBinary

func (m *PortMod) UnmarshalBinary(data []byte) error

type PortNumber

type PortNumber uint16
const (
	OFPP_MAX        PortNumber = 0xff00
	OFPP_IN_PORT    PortNumber = 0xfff8
	OFPP_TABLE      PortNumber = 0xfff9
	OFPP_NORMAL     PortNumber = 0xfffa
	OFPP_FLOOD      PortNumber = 0xfffb
	OFPP_ALL        PortNumber = 0xfffc
	OFPP_CONTROLLER PortNumber = 0xfffd
	OFPP_LOCAL      PortNumber = 0xfffe
	OFPP_NONE       PortNumber = 0xffff
)

type PortState

type PortState uint16
const (
	OFPPS_LINK_DOWN   PortState = 1 << 0
	OFPPS_STP_LISTEN  PortState = 0 << 8
	OFPPS_STP_LEARN   PortState = 1 << 8
	OFPPS_STP_FORWARD PortState = 2 << 8
	OFPPS_STP_BLOCK   PortState = 3 << 8
	OFPPS_STP_MASK    PortState = 3 << 8
)

type PortStatsReply

type PortStatsReply struct {
	PortNumber PortNumber

	RxPackets       uint64
	TxPackets       uint64
	RxBytes         uint64
	TxBytes         uint64
	RxDropped       uint64
	TxDropped       uint64
	RxErrors        uint64
	TxErrors        uint64
	RxFrameErrors   uint64
	RxOverrunErrors uint64
	RxCrcErrors     uint64
	Collisions      uint64
	// contains filtered or unexported fields
}

type PortStatsRequest

type PortStatsRequest struct {
	PortNumber PortNumber
	// contains filtered or unexported fields
}

type PortStatus

type PortStatus struct {
	Header
	Reason PortStatusReason

	Description PhysicalPort
	// contains filtered or unexported fields
}

func (*PortStatus) UnmarshalBinary

func (m *PortStatus) UnmarshalBinary(data []byte) error

type PortStatusReason

type PortStatusReason uint8
const (
	OFPPR_ADD PortStatusReason = iota
	OFPPR_DELETE
	OFPPR_MODIFY
)

type ProtocolNumber

type ProtocolNumber uint8

type QueueGetConfigReply

type QueueGetConfigReply struct {
	Header
	Port PortNumber

	Queues []PacketQueue
	// contains filtered or unexported fields
}

func (*QueueGetConfigReply) UnmarshalBinary

func (m *QueueGetConfigReply) UnmarshalBinary(data []byte) error

type QueueGetConfigRequest

type QueueGetConfigRequest struct {
	Header
	Port PortNumber
	// contains filtered or unexported fields
}

func (*QueueGetConfigRequest) UnmarshalBinary

func (m *QueueGetConfigRequest) UnmarshalBinary(data []byte) error

type QueueProperty

type QueueProperty interface {
	Header() *QueuePropertyHeader
	FillBody(buf *bytes.Buffer) error
}

type QueuePropertyHeader

type QueuePropertyHeader struct {
	Property QueuePropertyType
	Length   uint16
	// contains filtered or unexported fields
}

func (*QueuePropertyHeader) FillBody

func (p *QueuePropertyHeader) FillBody(buf *bytes.Buffer) error

func (*QueuePropertyHeader) Header

type QueuePropertyMinRate

type QueuePropertyMinRate struct {
	QueuePropertyHeader
	Rate uint16
	// contains filtered or unexported fields
}

func (*QueuePropertyMinRate) FillBody

func (p *QueuePropertyMinRate) FillBody(buf *bytes.Buffer) error

type QueuePropertyType

type QueuePropertyType uint16
const (
	OFPQT_NONE QueuePropertyType = iota
	OFPQT_MIN_RATE
)

type QueueStatsReply

type QueueStatsReply struct {
	PortNumber PortNumber

	QueueId   uint32
	TxBytes   uint64
	TxPackets uint64
	TxErrors  uint64
	// contains filtered or unexported fields
}

type QueueStatsRequest

type QueueStatsRequest struct {
	PortNumber PortNumber

	QueueId uint32
	// contains filtered or unexported fields
}

type SendOutPort

type SendOutPort struct {
	ActionHeader
	Port      PortNumber
	MaxLength uint16
}

func (*SendOutPort) UnmarshalBinary

func (m *SendOutPort) UnmarshalBinary(data []byte) error

type SetConfig

type SetConfig struct {
	Header
	Flags          ConfigFlag
	MissSendLength uint16
}

func (*SetConfig) UnmarshalBinary

func (m *SetConfig) UnmarshalBinary(data []byte) error

type SetEtherDst

type SetEtherDst struct {
	ActionHeader
	Address [EthernetAddressLength]uint8
	// contains filtered or unexported fields
}

func (*SetEtherDst) UnmarshalBinary

func (a *SetEtherDst) UnmarshalBinary(data []byte) error

type SetEtherSrc

type SetEtherSrc struct {
	ActionHeader
	Address [EthernetAddressLength]uint8
	// contains filtered or unexported fields
}

func (*SetEtherSrc) UnmarshalBinary

func (a *SetEtherSrc) UnmarshalBinary(data []byte) error

type SetIpDst

type SetIpDst struct {
	ActionHeader
	Address [4]uint8
}

func (*SetIpDst) UnmarshalBinary

func (a *SetIpDst) UnmarshalBinary(data []byte) error

type SetIpSrc

type SetIpSrc struct {
	ActionHeader
	Address [4]uint8
}

func (*SetIpSrc) UnmarshalBinary

func (a *SetIpSrc) UnmarshalBinary(data []byte) error

type SetIpTos

type SetIpTos struct {
	ActionHeader
	Tos Dscp
	// contains filtered or unexported fields
}

func (*SetIpTos) UnmarshalBinary

func (a *SetIpTos) UnmarshalBinary(data []byte) error

type SetTransportDst

type SetTransportDst struct {
	ActionHeader
	Port TransportPort
	// contains filtered or unexported fields
}

func (*SetTransportDst) UnmarshalBinary

func (a *SetTransportDst) UnmarshalBinary(data []byte) error

type SetTransportSrc

type SetTransportSrc struct {
	ActionHeader
	Port TransportPort
	// contains filtered or unexported fields
}

func (*SetTransportSrc) UnmarshalBinary

func (a *SetTransportSrc) UnmarshalBinary(data []byte) error

type SetVlanPcp

type SetVlanPcp struct {
	ActionHeader
	Priority VlanPriority
	// contains filtered or unexported fields
}

func (*SetVlanPcp) UnmarshalBinary

func (m *SetVlanPcp) UnmarshalBinary(data []byte) error

type SetVlanVid

type SetVlanVid struct {
	ActionHeader
	Id VlanId
	// contains filtered or unexported fields
}

func (*SetVlanVid) UnmarshalBinary

func (m *SetVlanVid) UnmarshalBinary(data []byte) error

type StatsReply

type StatsReply struct {
	Header
	Type  StatsType
	Flags uint16
	Body  []uint8
}

func (*StatsReply) UnmarshalBinary

func (m *StatsReply) UnmarshalBinary(data []byte) error

type StatsRequest

type StatsRequest struct {
	Header
	Type  StatsType
	Flags uint16
	Body  []uint8
}

func (*StatsRequest) UnmarshalBinary

func (m *StatsRequest) UnmarshalBinary(data []byte) error

type StatsType

type StatsType uint16
const (
	OFPST_DESC StatsType = iota
	OFPST_FLOW
	OFPST_AGGREGATE
	OFPST_TABLE
	OFPST_PORT
	OFPST_QUEUE
	OFPST_VENDOR StatsType = 0xffff
)

type StripVlan

type StripVlan struct {
	ActionHeader
}

func (*StripVlan) UnmarshalBinary

func (m *StripVlan) UnmarshalBinary(data []byte) error

type SwitchConfig

type SwitchConfig struct {
	Header
	Flags          ConfigFlag
	MissSendLength uint16
}

type TableStatsReply

type TableStatsReply struct {
	TableId uint8

	Name         []uint8
	Wildcards    Wildcard
	MaxEntries   uint32
	ActiveCount  uint32
	LookupCount  uint32
	MatchedCount uint32
	// contains filtered or unexported fields
}

type TransportPort

type TransportPort uint16

type VendorActionHeader

type VendorActionHeader struct {
	ActionHeader
	Vendor VendorId
}

func (*VendorActionHeader) UnmarshalBinary

func (a *VendorActionHeader) UnmarshalBinary(data []byte) error

type VendorId

type VendorId uint32

type VendorMessage

type VendorMessage struct {
	Header
	Vendor VendorId
	Body   []uint8
}

func (*VendorMessage) UnmarshalBinary

func (m *VendorMessage) UnmarshalBinary(data []byte) error

type VlanId

type VlanId uint16

type VlanPriority

type VlanPriority uint8

type Wildcard

type Wildcard uint32
const (
	OFPFW_IN_PORT Wildcard = 1 << iota
	OFPFW_DL_VLAN
	OFPFW_DL_SRC
	OFPFW_DL_DST
	OFPFW_DL_TYPE
	OFPFW_NW_PROTO
	OFPFW_TP_SRC
	OFPFW_TP_DST

	OFPFW_NW_SRC_SHIFT Wildcard = 8
	OFPFW_NW_SRC_BITS  Wildcard = 6
	OFPFW_NW_SRC_MASK  Wildcard = ((1 << OFPFW_NW_SRC_BITS) - 1) << OFPFW_NW_SRC_SHIFT

	OFPFW_NW_DST_SHIFT Wildcard = 16
	OFPFW_NW_DST_BITS  Wildcard = 6
	OFPFW_NW_DST_MASK  Wildcard = ((1 << OFPFW_NW_DST_BITS) - 1) << OFPFW_NW_DST_SHIFT
	OFPFW_NW_DST_ALL   Wildcard = 32 << OFPFW_NW_DST_SHIFT

	OFPFW_DL_VLAN_PCP Wildcard = 1 << 20
	OFPFW_NW_TOS      Wildcard = 1 << 21

	OFPFW_ALL Wildcard = ((1 << 22) - 1)
)

Jump to

Keyboard shortcuts

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