class FlowEntry
Class for creating and interacting with OpenFlow flows
Attributes
boolean: Boolean flag used to enforce OpenFlow switch to do ordered message processing. Barrier request/reply messages are used by the controller to ensure message dependencies have been met or to receive notifications for completed operations. When the controller wants to ensure message dependencies have been met or wants to receive notifications for completed operations, it may use an OFPT_BARRIER_REQUEST message. This message has no body. Upon receipt, the switch must finish processing all previously-received messages, including sending corresponding reply or error messages, before executing any messages beyond the Barrier Request.
Buffered packet to apply to, or OFP_NO_BUFFER. Not meaningful for delete
integer: Bitmap of OpenFlow flags (OFPFF_* from OpenFlow spec)
integer: Max time before discarding (seconds)
integer: Unique identifier of this FlowEntry in the Controller's data store
integer: Idle time before discarding (seconds)
internal Controller's inventory attribute
list of Instruction: Instructions to be executed when a flow matches this entry flow match fields
Match: Flow match fields
string: FlowEntry name in the FlowTable (internal Controller's inventory attribute)
integer: For delete commands, require matching entries to include this as an output group. A value of OFPG_ANY indicates no restriction
integer: For delete commands, require matching entries to include this as an output port. A value of OFPP_ANY indicates no restriction.
integer: Priority level of flow entry
boolean: Modify/Delete entry strictly matching wildcards and priority
string: ID of the table to put the flow in
Public Class Methods
Parameters
flow_table_id
-
string: ID of the table to put the flow in
flow_id
-
integer: Unique identifier of this FlowEntry in the Controller's data store
flow_priority
-
integer: Priority level of flow entry
name
-
string: FlowEntry name in the FlowTable (internal Controller's inventory attribute)
idle_timeout
-
integer: Idle time before discarding (seconds)
hard_timeout
-
integer: Max time before discarding (seconds)
strict
-
boolean: Modify/Delete entry strictly matching wildcards and priority
install_hw
-
internal Controller's inventory attribute
barrier
-
boolean: Boolean flag used to enforce OpenFlow switch to do ordered message processing.
Barrier request/reply messages are used by the controller to ensure message dependencies have been met or to receive notifications for completed operations. When the controller wants to ensure message dependencies have been met or wants to receive notifications for completed operations, it may use an OFPT_BARRIER_REQUEST message. This message has no body. Upon receipt, the switch must finish processing all previously-received messages, including sending corresponding reply or error messages, before executing any messages beyond the Barrier Request.
cookie
-
integer: Opaque Controller-issued identifier
cookie_mask
-
integer: Mask used to restrict the cookie bits that must match when the command is
OFPFC_MODIFY* or OFPFC_DELETE*. A value of 0 indicates no restriction
out_port
-
integer: For delete commands, require matching entries to include this as an
output port. A value of OFPP_ANY indicates no restriction.
out_group
-
integer: For delete commands, require matching entries to include this as an
output group. A value of OFPG_ANY indicates no restriction
flags
-
integer: Bitmap of OpenFlow flags (OFPFF_* from OpenFlow spec)
buffer_id
-
Buffered packet to apply to, or OFP_NO_BUFFER. Not meaningful for delete
# File lib/openflowdev/flow_entry.rb, line 109 def initialize(flow_table_id: 0, flow_id: nil, flow_priority: nil, name: nil, idle_timeout: 0, hard_timeout: 0, strict: false, install_hw: false, barrier: false, cookie: nil, cookie_mask: nil, out_port: nil, out_group: nil, flags: nil, buffer_id: nil) raise ArgumentError, "Flow ID (flow_id) required" unless flow_id raise ArgumentError, "Flow Priority (flow_priority) required" unless flow_priority @table_id = flow_table_id @id = flow_id @name = name @priority = flow_priority @idle_timeout = idle_timeout @hard_timeout = hard_timeout @strict = strict @install_hw = install_hw @barrier = barrier @cookie = cookie @cookie_mask = cookie_mask @instructions = [] @out_port = out_port @out_group = out_group @flags = flags @buffer_id = buffer_id end
Public Instance Methods
Add an Instruction to the flow entry.
Parameters
instruction
-
Instruction : Instruction to add to the flow entry.
# File lib/openflowdev/flow_entry.rb, line 139 def add_instruction(instruction) raise ArgumentError, "Instruction must be of type 'Instruction'" unless instruction.is_a?(Instruction) @instructions << instruction end