module Havox::OpenFlow10::RouteFlow::Matches

Constants

FIELDS

Public Class Methods

treat(hash) click to toggle source
# File lib/havox/modules/openflow10/routeflow/matches.rb, line 30
def self.treat(hash)
  hash[:ethertype] = hash[:ethertype].to_i unless hash[:ethertype].nil?
  hash[:ipv4_src]  = parsed_ipv4(hash[:ipv4_src]) unless hash[:ipv4_src].nil?
  hash[:ipv4]      = parsed_ipv4(hash[:ipv4]) unless hash[:ipv4].nil?
  hash[:nw_proto]  = hash[:nw_proto].to_i unless hash[:nw_proto].nil?
  hash[:in_port]   = hash[:in_port].to_i unless hash[:in_port].nil?
  hash[:tp_src]    = hash[:tp_src].to_i unless hash[:tp_src].nil?
  hash[:tp_dst]    = hash[:tp_dst].to_i unless hash[:tp_dst].nil?
  hash[:vlan_id]   = hash[:vlan_id].to_i unless hash[:vlan_id].nil?
  hash
end