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.


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

def initialize(user_options)
  @user_options = user_options
end

Instance Method Details

#to_hashObject


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

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