class FlowEntry

Class for creating and interacting with OpenFlow flows

Attributes

barrier[R]

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.

buffer_id[R]

Buffered packet to apply to, or OFP_NO_BUFFER. Not meaningful for delete

flags[R]

integer: Bitmap of OpenFlow flags (OFPFF_* from OpenFlow spec)

hard_timeout[R]

integer: Max time before discarding (seconds)

id[R]

integer: Unique identifier of this FlowEntry in the Controller's data store

idle_timeout[R]

integer: Idle time before discarding (seconds)

install_hw[R]

internal Controller's inventory attribute

instructions[R]

list of Instruction: Instructions to be executed when a flow matches this entry flow match fields

match[R]

Match: Flow match fields

name[R]

string: FlowEntry name in the FlowTable (internal Controller's inventory attribute)

out_group[R]

integer: For delete commands, require matching entries to include this as an output group. A value of OFPG_ANY indicates no restriction

out_port[R]

integer: For delete commands, require matching entries to include this as an output port. A value of OFPP_ANY indicates no restriction.

priority[R]

integer: Priority level of flow entry

strict[R]

boolean: Modify/Delete entry strictly matching wildcards and priority

table_id[R]

string: ID of the table to put the flow in

Public Class Methods

new(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) click to toggle source

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_instruction(instruction) click to toggle source

Add an Instruction to the flow entry.

Parameters

# 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
add_match(match) click to toggle source

Add a match rule to the flow entry.

Parameters

# File lib/openflowdev/flow_entry.rb, line 149
def add_match(match)
  raise ArgumentError, "Match must be of type 'Match'" unless match.is_a?(Match)
  @match = match
end