Class: Trema::Controller::FlowModDeleteOption

Inherits:
Object
  • Object
show all
Defined in:
lib/trema/controller.rb

Overview

Pio::FlowMod.new argument

Instance Method Summary collapse

Constructor Details

#initialize(user_options) ⇒ FlowModDeleteOption

Returns a new instance of FlowModDeleteOption.



68
69
70
# File 'lib/trema/controller.rb', line 68

def initialize(user_options)
  @user_options = user_options
end

Instance Method Details

#to_hashObject



72
73
74
75
76
77
78
79
80
# File 'lib/trema/controller.rb', line 72

def to_hash
  {
    command: :delete,
    transaction_id: rand(0xffffffff),
    buffer_id: @user_options[:buffer_id] || 0xffffffff,
    match: @user_options.fetch(:match),
    out_port: @user_options[:out_port] || 0xffffffff
  }
end