Method: Trema::Controller#send_flow_mod_add

Defined in:
lib/trema/controller.rb

#send_flow_mod_add(datapath_id, options) ⇒ Object



171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/trema/controller.rb', line 171

def send_flow_mod_add(datapath_id, options)
  flow_mod =
    case Pio::OpenFlow.version
    when 'OpenFlow10'
      FlowMod.new(FlowModAddOption.new(options).to_hash)
    when 'OpenFlow13'
      FlowMod.new(FlowModAdd13Option.new(options).to_hash)
    else
      raise "Unsupported OpenFlow version: #{Pio::OpenFlow.version}"
    end
  send_message datapath_id, flow_mod
end