Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- type BarrierReply
- type BarrierRequest
- type BaseAction
- func (r *BaseAction) DstMAC() (ok bool, mac net.HardwareAddr)
- func (r *BaseAction) Error() error
- func (r *BaseAction) OutPort() OutPort
- func (r *BaseAction) Queue() (ok bool, queue uint32)
- func (r *BaseAction) SetDstMAC(mac net.HardwareAddr)
- func (r *BaseAction) SetOutPort(port OutPort)
- func (r *BaseAction) SetQueue(queue uint32)
- func (r *BaseAction) SetSrcMAC(mac net.HardwareAddr)
- func (r *BaseAction) SetVLANID(vid uint16)
- func (r *BaseAction) SrcMAC() (ok bool, mac net.HardwareAddr)
- func (r *BaseAction) VLANID() (ok bool, vid uint16)
- type BaseEcho
- type BaseError
- type BaseHello
- type Config
- type ConfigFlag
- type DescReply
- type DescRequest
- type Echo
- type EchoReply
- type EchoRequest
- type Error
- type Factory
- type FeaturesReply
- type FeaturesRequest
- type FlowMod
- type FlowModCmd
- type FlowRemoved
- type FlowStatsRequest
- type GetConfigReply
- type GetConfigRequest
- type Header
- type Hello
- type InPort
- type Instruction
- type Match
- type Message
- func (r *Message) MarshalBinary() ([]byte, error)
- func (r *Message) Payload() []byte
- func (r *Message) SetPayload(payload []byte)
- func (r *Message) SetTransactionID(xid uint32)
- func (r *Message) TransactionID() uint32
- func (r *Message) Type() uint8
- func (r *Message) UnmarshalBinary(data []byte) error
- func (r *Message) Version() uint8
- type OutPort
- func (r *OutPort) IsAll() bool
- func (r *OutPort) IsController() bool
- func (r *OutPort) IsFlood() bool
- func (r *OutPort) IsInPort() bool
- func (r *OutPort) IsNone() bool
- func (r *OutPort) IsTable() bool
- func (r *OutPort) SetAll()
- func (r *OutPort) SetController()
- func (r *OutPort) SetFlood()
- func (r *OutPort) SetInPort()
- func (r *OutPort) SetNone()
- func (r *OutPort) SetTable()
- func (r *OutPort) SetValue(port uint32)
- func (r OutPort) String() string
- func (r *OutPort) Value() uint32
- type PacketIn
- type PacketOut
- type Port
- type PortDescReply
- type PortDescRequest
- type PortReason
- type PortStatus
- type PropertyType
- type Queue
- type QueueGetConfigReply
- type QueueGetConfigRequest
- type QueueProperty
- type SetConfig
- type TableFeaturesRequest
Constants ¶
View Source
const ( OF10_VERSION = 0x01 OF13_VERSION = 0x04 )
Variables ¶
View Source
var ( ErrInvalidPacketLength = errors.New("invalid packet length") ErrUnsupportedVersion = errors.New("unsupported protocol version") ErrUnsupportedMessage = errors.New("unsupported message type") ErrInvalidMACAddress = errors.New("invalid MAC address") ErrInvalidIPAddress = errors.New("invalid IP address") ErrUnsupportedIPProtocol = errors.New("unsupported IP protocol") ErrUnsupportedEtherType = errors.New("unsupported Ethernet type") ErrMissingIPProtocol = errors.New("missing IP protocol") ErrMissingEtherType = errors.New("missing Ethernet type") ErrUnsupportedMatchType = errors.New("unsupported flow match type") ErrInvalidPropertyMethod = errors.New("invalid property method") )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { DstMAC() (ok bool, mac net.HardwareAddr) encoding.BinaryMarshaler encoding.BinaryUnmarshaler Queue() (ok bool, queue uint32) // Error() returns last error message Error() error OutPort() OutPort SetDstMAC(mac net.HardwareAddr) SetQueue(queue uint32) SetOutPort(port OutPort) SetSrcMAC(mac net.HardwareAddr) SetVLANID(vid uint16) SrcMAC() (ok bool, mac net.HardwareAddr) VLANID() (ok bool, vid uint16) }
type BarrierReply ¶
type BarrierReply interface { Header encoding.BinaryUnmarshaler }
type BarrierRequest ¶
type BarrierRequest interface { Header encoding.BinaryMarshaler }
type BaseAction ¶
type BaseAction struct {
// contains filtered or unexported fields
}
func NewBaseAction ¶
func NewBaseAction() *BaseAction
func (*BaseAction) DstMAC ¶
func (r *BaseAction) DstMAC() (ok bool, mac net.HardwareAddr)
func (*BaseAction) Error ¶
func (r *BaseAction) Error() error
func (*BaseAction) OutPort ¶
func (r *BaseAction) OutPort() OutPort
func (*BaseAction) Queue ¶
func (r *BaseAction) Queue() (ok bool, queue uint32)
func (*BaseAction) SetDstMAC ¶
func (r *BaseAction) SetDstMAC(mac net.HardwareAddr)
func (*BaseAction) SetOutPort ¶
func (r *BaseAction) SetOutPort(port OutPort)
func (*BaseAction) SetQueue ¶
func (r *BaseAction) SetQueue(queue uint32)
func (*BaseAction) SetSrcMAC ¶
func (r *BaseAction) SetSrcMAC(mac net.HardwareAddr)
func (*BaseAction) SetVLANID ¶
func (r *BaseAction) SetVLANID(vid uint16)
func (*BaseAction) SrcMAC ¶
func (r *BaseAction) SrcMAC() (ok bool, mac net.HardwareAddr)
func (*BaseAction) VLANID ¶
func (r *BaseAction) VLANID() (ok bool, vid uint16)
type BaseEcho ¶
type BaseEcho struct { Message // contains filtered or unexported fields }
func (*BaseEcho) MarshalBinary ¶
func (*BaseEcho) UnmarshalBinary ¶
type BaseError ¶
type BaseError struct { Message // contains filtered or unexported fields }
func (*BaseError) UnmarshalBinary ¶
type BaseHello ¶
type BaseHello struct {
Message
}
func (*BaseHello) MarshalBinary ¶
func (*BaseHello) UnmarshalBinary ¶
type Config ¶
type Config interface { // Error() returns last error message Error() error Flags() ConfigFlag MissSendLength() uint16 SetFlags(flags ConfigFlag) SetMissSendLength(length uint16) }
type ConfigFlag ¶
type ConfigFlag uint16
const ( FragNormal ConfigFlag = iota FragDrop FragReasm FragMask )
type DescReply ¶
type DescReply interface { Header Manufacturer() string Hardware() string Software() string Serial() string Description() string encoding.BinaryUnmarshaler }
Description reply
type DescRequest ¶
type DescRequest interface { Header encoding.BinaryMarshaler }
Description reqeust
type Echo ¶
type Echo interface { Data() []byte encoding.BinaryMarshaler encoding.BinaryUnmarshaler // Error() returns last error message Error() error Header SetData(data []byte) }
type EchoRequest ¶
type EchoRequest interface { Echo }
type Factory ¶
type Factory interface { ProtocolVersion() uint8 NewAction() (Action, error) NewBarrierRequest() (BarrierRequest, error) NewBarrierReply() (BarrierReply, error) NewDescRequest() (DescRequest, error) NewDescReply() (DescReply, error) NewEchoRequest() (EchoRequest, error) NewEchoReply() (EchoReply, error) NewError() (Error, error) NewFeaturesRequest() (FeaturesRequest, error) NewFeaturesReply() (FeaturesReply, error) NewFlowMod(cmd FlowModCmd) (FlowMod, error) NewFlowRemoved() (FlowRemoved, error) NewFlowStatsRequest() (FlowStatsRequest, error) // TODO: NewFlowStatsReply() (FlowStatsReply, error) NewGetConfigRequest() (GetConfigRequest, error) NewGetConfigReply() (GetConfigReply, error) NewHello() (Hello, error) NewInstruction() (Instruction, error) NewMatch() (Match, error) NewPacketIn() (PacketIn, error) NewPacketOut() (PacketOut, error) NewPortDescRequest() (PortDescRequest, error) NewPortDescReply() (PortDescReply, error) NewPortStatus() (PortStatus, error) NewQueueGetConfigRequest() (QueueGetConfigRequest, error) NewSetConfig() (SetConfig, error) NewTableFeaturesRequest() (TableFeaturesRequest, error) }
Abstract factory
type FeaturesReply ¶
type FeaturesRequest ¶
type FeaturesRequest interface { Header encoding.BinaryMarshaler }
type FlowMod ¶
type FlowMod interface { Cookie() uint64 CookieMask() uint64 encoding.BinaryMarshaler Error() error FlowInstruction() Instruction FlowMatch() Match HardTimeout() uint16 Header IdleTimeout() uint16 OutPort() OutPort Priority() uint16 SetCookie(cookie uint64) SetCookieMask(mask uint64) SetFlowInstruction(action Instruction) SetFlowMatch(match Match) SetHardTimeout(timeout uint16) SetIdleTimeout(timeout uint16) SetOutPort(port OutPort) SetPriority(priority uint16) SetTableID(id uint8) TableID() uint8 }
type FlowRemoved ¶
type FlowStatsRequest ¶
type GetConfigReply ¶
type GetConfigReply interface { Header Config encoding.BinaryUnmarshaler }
type GetConfigRequest ¶
type GetConfigRequest interface { Header encoding.BinaryMarshaler }
type Hello ¶
type Hello interface { Header encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
type InPort ¶
type InPort struct {
// contains filtered or unexported fields
}
func (*InPort) IsController ¶
func (*InPort) SetController ¶
func (r *InPort) SetController()
type Instruction ¶
type Match ¶
type Match interface { DstIP() *net.IPNet DstMAC() (wildcard bool, mac net.HardwareAddr) // DstPort returns protocol (TCP or UDP) destination port number DstPort() (wildcard bool, port uint16) encoding.BinaryMarshaler encoding.BinaryUnmarshaler Error() error EtherType() (wildcard bool, etherType uint16) // InPort returns switch port number InPort() (wildcard bool, inport InPort) IPProtocol() (wildcard bool, protocol uint8) SetDstIP(ip *net.IPNet) SetDstMAC(mac net.HardwareAddr) // SetDstPort sets protocol (TCP or UDP) destination port number SetDstPort(p uint16) SetEtherType(t uint16) // SetInPort sets switch port number SetInPort(port InPort) SetIPProtocol(p uint8) SetSrcIP(ip *net.IPNet) SetSrcMAC(mac net.HardwareAddr) // SetSrcPort sets protocol (TCP or UDP) source port number SetSrcPort(p uint16) SetVLANID(id uint16) SetVLANPriority(p uint8) SetWildcardEtherType() SetWildcardDstMAC() // SetWildcardDstPort sets protocol (TCP or UDP) destination port number as a wildcard SetWildcardDstPort() SetWildcardSrcMAC() // SetWildcardSrcPort sets protocol (TCP or UDP) source port number as a wildcard SetWildcardSrcPort() // SetWildcardInPort sets switch port number as a wildcard SetWildcardInPort() SetWildcardIPProtocol() SetWildcardVLANID() SetWildcardVLANPriority() SrcIP() *net.IPNet SrcMAC() (wildcard bool, mac net.HardwareAddr) // SrcPort returns protocol (TCP or UDP) source port number SrcPort() (wildcard bool, port uint16) VLANID() (wildcard bool, vlanID uint16) VLANPriority() (wildcard bool, priority uint8) }
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) MarshalBinary ¶
func (*Message) SetPayload ¶
func (*Message) SetTransactionID ¶
func (*Message) TransactionID ¶
func (*Message) UnmarshalBinary ¶
type OutPort ¶
type OutPort struct {
// contains filtered or unexported fields
}
func NewOutPort ¶
func NewOutPort() OutPort
NewOutPort returns output port whose default value is FLOOD
func (*OutPort) IsController ¶
func (*OutPort) SetController ¶
func (r *OutPort) SetController()
type Port ¶
type Port interface { Number() uint32 MAC() net.HardwareAddr Name() string IsPortDown() bool // Is the port Administratively down? IsLinkDown() bool // Is a physical link on the port down? IsCopper() bool IsFiber() bool IsAutoNego() bool // Speed returns current link speed in MB Speed() uint64 encoding.BinaryUnmarshaler }
type PortDescReply ¶
type PortDescReply interface { Header Ports() []Port encoding.BinaryUnmarshaler }
type PortDescRequest ¶
type PortDescRequest interface { Header encoding.BinaryMarshaler }
type PortReason ¶
type PortReason uint8
const ( PortAdded PortReason = iota PortDeleted PortModified )
type PortStatus ¶
type PortStatus interface { Header Reason() PortReason Port() Port encoding.BinaryUnmarshaler }
type PropertyType ¶
type PropertyType uint16
const ( OFPQT_NONE PropertyType = iota OFPQT_MIN_RATE OFPQT_MAX_RATE OFPQT_EXPERIMENTER = 0xffff )
type Queue ¶
type Queue interface { ID() uint32 Port() uint32 Length() uint16 Property() []QueueProperty encoding.BinaryUnmarshaler }
type QueueGetConfigReply ¶
type QueueGetConfigReply interface { Header Port() uint32 Queue() []Queue encoding.BinaryUnmarshaler }
type QueueGetConfigRequest ¶
type QueueGetConfigRequest interface { Header Port() OutPort SetPort(OutPort) encoding.BinaryMarshaler }
type QueueProperty ¶
type QueueProperty interface { Type() PropertyType Length() uint16 Rate() (uint16, error) Experimenter() (uint32, error) Data() []byte encoding.BinaryUnmarshaler }
type TableFeaturesRequest ¶
type TableFeaturesRequest interface { Header encoding.BinaryMarshaler }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.