class Trema::Controller::FlowModAdd13Option

Pio::FlowMod.new argument (OpenFlow 1.3)

Public Class Methods

new(user_options) click to toggle source
# File lib/trema/controller.rb, line 39
def initialize(user_options)
  @user_options = user_options
end

Public Instance Methods

to_hash() click to toggle source

rubocop:disable MethodLength rubocop:disable CyclomaticComplexity rubocop:disable PerceivedComplexity

# File lib/trema/controller.rb, line 46
def to_hash
  {
    command: :add,
    priority: @user_options[:priority] || 0,
    transaction_id: rand(0xffffffff),
    idle_timeout: @user_options[:idle_timeout] || 0,
    hard_timeout: @user_options[:hard_timeout] || 0,
    buffer_id: @user_options[:buffer_id] || 0xffffffff,
    match: @user_options.fetch(:match),
    table_id: @user_options[:table_id] || 0,
    flags: @user_options[:flags] || [],
    instructions: @user_options[:instructions] || []
  }
end