src/main/ruby/org/o3project/odenos/component/driver/of_driver/openflow_controller.rb
#
# Delete FlowEntrys from switches.
# FlowEntry is ignored if in :teardown state.
# FlowEntry is removed from `flowentries` if in :none state.
# @param [OFPFlow] flow
# @param [Array<FlowEntry>] flowentries
#
Delete FlowEntrys from switches.
FlowEntry is ignored if in :teardown state.
FlowEntry is removed from `flowentries` if in :none state.
Delete FlowEntrys from switches . FlowEntry is ignored if in : teardown state . FlowEntry is removed from ` flowentries ` if in : none state .
def teardown_flowentries(flow, flowentries)
            idle_timeout = 0
            hard_timeout = 0
            priority     = flow.priority
            priority     = priority.to_i if priority.is_a?(String)
            if priority == OFP_LOW_PRIORITY
              priority += 1
            end
            flowentries.delete_if { |entry| entry.status == Flow::NONE }
            flowentries.each do|flowentry|
              if flowentry.status == Flow::TEARDOWN 
                next
              end
              flowentry.status = Flow::TEARDOWN
              inst = Instructions::ApplyAction.new(actions: flowentry.actions)
              info ">> send_flow_mod. #{flowentry.inspect}"
              send_flow_mod(flowentry.dpid,
                            match: flowentry.match,
                            idle_timeout: idle_timeout,
                            hard_timeout: hard_timeout,
                            out_port: OFPP_ANY,
                            out_group: OFPG_ANY,
                            priority: priority,
                            buffer_id: OFP_NO_BUFFER,
                            flags: OFPFF_SEND_FLOW_REM,
                            command: OFPFC_DELETE_STRICT,
                            strict: true,
                            instructions: nil)
            end
          end
def teardown_flowentries ( flow , flowentries ) idle_timeout = 0 hard_timeout = 0 priority = flow . priority priority = priority . to_i if priority . is_a? ( String ) if priority == OFP_LOW_PRIORITY priority += 1 end flowentries . delete_if { | entry | entry . status == Flow :: NONE } flowentries . each do | flowentry | if flowentry . status == Flow :: TEARDOWN next end flowentry . status = Flow :: TEARDOWN inst = Instructions :: ApplyAction . new ( actions : flowentry . actions ) info ">> send_flow_mod. #{flowentry.inspect}" send_flow_mod ( flowentry . dpid , match : flowentry . match , idle_timeout : idle_timeout , hard_timeout : hard_timeout , out_port : OFPP_ANY , out_group : OFPG_ANY , priority : priority , buffer_id : OFP_NO_BUFFER , flags : OFPFF_SEND_FLOW_REM , command : OFPFC_DELETE_STRICT , strict : true , instructions : nil ) end end
Delete FlowEntrys from switches.
Delete FlowEntrys from switches .
# idle_timeout = flow.idle_timeout # hard_timeout = flow.hard_timeout # flow_mod already sent # Change flow "entry" state to "teardown"
flow
<not_specific>
flowentries
<not_specific>
<not_specific>
None