Documentation ¶
Overview ¶
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
** Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type AppInterface
- type Controller
- type FgraphElem
- type Flood
- func (self *Flood) AddOutput(out *Output) error
- func (self *Flood) AddTunnelOutput(out *Output, tunnelId uint64) error
- func (self *Flood) Delete() error
- func (self *Flood) GetFlowInstr() openflow13.Instruction
- func (self *Flood) NumOutput() int
- func (self *Flood) RemoveOutput(out *Output) error
- func (self *Flood) Type() string
- type FloodOutput
- type Flow
- func (self *Flow) Delete() error
- func (self *Flow) GetFlowInstr() openflow13.Instruction
- func (self *Flow) Next(elem FgraphElem) error
- func (self *Flow) PopVlan() error
- func (self *Flow) SetDscp(dscp uint8) error
- func (self *Flow) SetIPField(ip net.IP, field string) error
- func (self *Flow) SetL4Field(port uint16, field string) error
- func (self *Flow) SetMacDa(macDa net.HardwareAddr) error
- func (self *Flow) SetMacSa(macSa net.HardwareAddr) error
- func (self *Flow) SetMetadata(metadata, metadataMask uint64) error
- func (self *Flow) SetTunnelId(tunnelId uint64) error
- func (self *Flow) SetVlan(vlanId uint16) error
- func (self *Flow) Type() string
- func (self *Flow) UnsetDscp() error
- type FlowAction
- type FlowMatch
- type OFSwitch
- func (self *OFSwitch) DPID() net.HardwareAddr
- func (self *OFSwitch) DefaultTable() *Table
- func (self *OFSwitch) DeleteTable(tableId uint8) error
- func (self *OFSwitch) Disconnect()
- func (self *OFSwitch) DropAction() *Output
- func (self *OFSwitch) GetTable(tableId uint8) *Table
- func (self *OFSwitch) NewFlood() (*Flood, error)
- func (self *OFSwitch) NewTable(tableId uint8) (*Table, error)
- func (self *OFSwitch) NormalLookup() *Output
- func (self *OFSwitch) OutputPort(portNo uint32) (*Output, error)
- func (self *OFSwitch) Send(req util.Message)
- func (self *OFSwitch) SendToController() *Output
- type Output
- type PacketIn
- type Table
Constants ¶
const IP_PROTO_TCP = 6
const IP_PROTO_UDP = 17
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppInterface ¶
type AppInterface 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 *PacketIn) // Controller received a multi-part reply from the switch MultipartReply(sw *OFSwitch, rep *openflow13.MultipartReply) }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
type FgraphElem ¶
type FgraphElem interface { // Returns the type of fw graph element Type() string // Returns the formatted instruction set. // This is used by the previous Fgraph element to install instruction set // in the flow entry GetFlowInstr() openflow13.Instruction }
type Flood ¶
type Flood struct { Switch *OFSwitch // Switch where this flood entry is present GroupId uint32 // Unique id for the openflow group FloodList []FloodOutput // List of output ports to flood to // contains filtered or unexported fields }
Flood Fgraph element
func (*Flood) AddTunnelOutput ¶
Add a new Output to group element
func (*Flood) GetFlowInstr ¶
func (self *Flood) GetFlowInstr() openflow13.Instruction
instruction set for output element
func (*Flood) RemoveOutput ¶
Remove a port from flood list
type FloodOutput ¶
type FloodOutput struct {
// contains filtered or unexported fields
}
type Flow ¶
type Flow struct { Table *Table // Table where this flow resides Match FlowMatch // Fields to be matched NextElem FgraphElem // Next fw graph element FlowID uint64 // Unique ID for the flow // contains filtered or unexported fields }
State of a flow entry
func (*Flow) GetFlowInstr ¶
func (self *Flow) GetFlowInstr() openflow13.Instruction
instruction set for flow element
func (*Flow) Next ¶
func (self *Flow) Next(elem FgraphElem) error
Set Next element in the Fgraph. This determines what actions will be part of the flow's instruction set
func (*Flow) SetIPField ¶
Special action on the flow to set an ip field
func (*Flow) SetL4Field ¶
Special action on the flow to set a L4 field
func (*Flow) SetMacDa ¶
func (self *Flow) SetMacDa(macDa net.HardwareAddr) error
Special actions on the flow to set mac dest addr
func (*Flow) SetMacSa ¶
func (self *Flow) SetMacSa(macSa net.HardwareAddr) error
Special action on the flow to set mac source addr
func (*Flow) SetMetadata ¶
Special actions on the flow to set metadata
func (*Flow) SetTunnelId ¶
Special actions on the flow to set vlan id
type FlowAction ¶
type FlowAction struct {
// contains filtered or unexported fields
}
additional actions in flow's instruction set
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 }
Small subset of openflow fields we currently support
type OFSwitch ¶
type OFSwitch struct {
// contains filtered or unexported fields
}
func NewSwitch ¶
func NewSwitch(stream *util.MessageStream, dpid net.HardwareAddr, app AppInterface) *OFSwitch
Builds and populates a Switch struct then starts listening for OpenFlow messages on conn.
func (*OFSwitch) DefaultTable ¶
Return table 0 which is the starting table for all packets
func (*OFSwitch) DeleteTable ¶
Delete a table. Return an error if there are fgraph nodes pointing at it
func (*OFSwitch) Disconnect ¶
func (self *OFSwitch) Disconnect()
func (*OFSwitch) DropAction ¶
Return the drop graph element
func (*OFSwitch) NormalLookup ¶
NormalLookup Return normal lookup graph element
func (*OFSwitch) OutputPort ¶
Return a output graph element for the port
func (*OFSwitch) SendToController ¶
SendToController Return send to controller graph element
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func (*Output) GetFlowInstr ¶
func (self *Output) GetFlowInstr() openflow13.Instruction
instruction set for output element
func (*Output) GetOutAction ¶
func (self *Output) GetOutAction() openflow13.Action
Return an output action (Used by group mods)
type PacketIn ¶
type PacketIn openflow13.PacketIn
type Table ¶
Fgraph table element
func (*Table) DeleteFlow ¶
Delete a flow from the table
func (*Table) GetFlowInstr ¶
func (self *Table) GetFlowInstr() openflow13.Instruction
instruction set for table element