Documentation ¶
Index ¶
- Constants
- type ConsumerInterface
- type Controller
- type Flow
- func (self *Flow) FlowKey() string
- func (self *Flow) GetFlowInstructions() openflow13.Instruction
- func (self *Flow) GetMatchFields() openflow13.Match
- func (self *Flow) GetWriteMetaDataFlowInstruction() (*openflow13.InstrWriteMetadata, error)
- func (self *Flow) PopVlan()
- func (self *Flow) SetDropAction()
- func (self *Flow) SetDscp(dscp uint8)
- func (self *Flow) SetFloodAction()
- func (self *Flow) SetGotoControllerAction()
- func (self *Flow) SetGotoTableAction(tblID uint8)
- func (self *Flow) SetIPField(ip net.IP, field string)
- func (self *Flow) SetL4Field(port uint16, field string)
- func (self *Flow) SetMacDa(macDa net.HardwareAddr)
- func (self *Flow) SetMacSa(macSa net.HardwareAddr)
- func (self *Flow) SetMetadata(metadata, metadataMask uint64)
- func (self *Flow) SetNormalAction()
- func (self *Flow) SetOutputPortAction(portNo uint32)
- func (self *Flow) SetTunnelId(tunnelId uint64)
- func (self *Flow) SetVlan(vlanId uint16)
- func (self *Flow) UnsetDscp()
- type FlowAction
- type FlowMatch
- type FlowOutput
- type OFSwitch
Constants ¶
View Source
const IP_PROTO_TCP = 6
View Source
const IP_PROTO_UDP = 17
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerInterface ¶
type ConsumerInterface interface { // A Switch connected to the controller SwitchConnected(sw *OFSwitch) // Switch disconnected from the controller SwitchDisconnected(sw *OFSwitch) // Controller received a packet from the switch PacketRcvd(sw *OFSwitch, pkt *openflow13.PacketIn) // Controller received a multi-part reply from the switch MultipartReply(sw *OFSwitch, rep *openflow13.MultipartReply) // Port stats change UP/down PortStatusChange(sw *OFSwitch, portStatus *openflow13.PortStatus) // Flow removed, this could be helpful at the case many controllers manage the bridge FlowRemoved(sw *OFSwitch, flowRemoved *openflow13.FlowRemoved) }
type Controller ¶
type Controller struct { Bridge *OFSwitch // contains filtered or unexported fields }
func NewController ¶
func NewController(consumer ConsumerInterface) *Controller
Create a new controller
type Flow ¶
type Flow struct { TableId uint8 // FLow Table Match FlowMatch // Fields to be matched FlowID uint64 // Unique ID for the flow FlowActions []*FlowAction // List of flow actions FlowOutput []*FlowOutput IdleTimeout uint16 /* Idle time before discarding (seconds). */ HardTimeout uint16 /* Max time before discarding (seconds). */ // contains filtered or unexported fields }
func (*Flow) GetFlowInstructions ¶
func (self *Flow) GetFlowInstructions() openflow13.Instruction
func (*Flow) GetMatchFields ¶
func (self *Flow) GetMatchFields() openflow13.Match
Get all defined match openflow match fields
func (*Flow) GetWriteMetaDataFlowInstruction ¶
func (self *Flow) GetWriteMetaDataFlowInstruction() (*openflow13.InstrWriteMetadata, error)
func (*Flow) SetDropAction ¶
func (self *Flow) SetDropAction()
func (*Flow) SetFloodAction ¶
func (self *Flow) SetFloodAction()
func (*Flow) SetGotoControllerAction ¶
func (self *Flow) SetGotoControllerAction()
func (*Flow) SetGotoTableAction ¶
func (*Flow) SetL4Field ¶
field should has one of the following values TCPSrc, TCPDst, UDPSrc or UDPDst
func (*Flow) SetMacDa ¶
func (self *Flow) SetMacDa(macDa net.HardwareAddr)
func (*Flow) SetMacSa ¶
func (self *Flow) SetMacSa(macSa net.HardwareAddr)
func (*Flow) SetMetadata ¶
func (*Flow) SetNormalAction ¶
func (self *Flow) SetNormalAction()
func (*Flow) SetOutputPortAction ¶
func (*Flow) SetTunnelId ¶
type FlowAction ¶
type FlowAction struct {
// contains filtered or unexported fields
}
type FlowMatch ¶
type FlowMatch struct { Priority uint16 // Priority of the flow InputPort uint32 // Input port number MacDa *net.HardwareAddr // Mac dest MacDaMask *net.HardwareAddr // Mac dest mask MacSa *net.HardwareAddr // Mac source MacSaMask *net.HardwareAddr // Mac source mask Ethertype uint16 // Ethertype VlanId uint16 // vlan id ArpOper uint16 // ARP Oper type IpSa *net.IP // IPv4 source addr IpSaMask *net.IP // IPv4 source mask IpDa *net.IP // IPv4 dest addr IpDaMask *net.IP // IPv4 dest mask Ipv6Sa *net.IP // IPv6 source addr Ipv6SaMask *net.IP // IPv6 source mask Ipv6Da *net.IP // IPv6 dest addr Ipv6DaMask *net.IP // IPv6 dest mask IpProto uint8 // IP protocol IpDscp uint8 // DSCP/TOS field TcpSrcPort uint16 // TCP source port TcpDstPort uint16 // TCP dest port UdpSrcPort uint16 // UDP source port UdpDstPort uint16 // UDP dest port Metadata *uint64 // OVS metadata MetadataMask *uint64 // Metadata mask TunnelId uint64 // Vxlan Tunnel id i.e. VNI TcpFlags *uint16 // TCP flags TcpFlagsMask *uint16 // Mask for TCP flags }
type FlowOutput ¶
type OFSwitch ¶
type OFSwitch struct {
// contains filtered or unexported fields
}
func NewSwitch ¶
func NewSwitch(stream *util.MessageStream, dpid net.HardwareAddr, consumer ConsumerInterface) *OFSwitch
Builds and populates a Switch struct then starts listening for OpenFlow messages on conn.
func (*OFSwitch) DeleteFlow ¶
func (*OFSwitch) Disconnect ¶
func (self *OFSwitch) Disconnect()
func (*OFSwitch) InstallFlow ¶
Click to show internal directories.
Click to hide internal directories.