X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fdcemulator%2Fson_emu_simple_switch_13.py;h=2adaf801b870169e37bfb1a223f1996b5a329ab9;hb=refs%2Fchanges%2F49%2F6149%2F3;hp=ce2f544885e124d8ebd0fa9304ce26d4612c4b59;hpb=c3a344f1e93a52da3da7f2e1ded2d9e22010508d;p=osm%2Fvim-emu.git diff --git a/src/emuvim/dcemulator/son_emu_simple_switch_13.py b/src/emuvim/dcemulator/son_emu_simple_switch_13.py index ce2f544..2adaf80 100755 --- a/src/emuvim/dcemulator/son_emu_simple_switch_13.py +++ b/src/emuvim/dcemulator/son_emu_simple_switch_13.py @@ -21,7 +21,8 @@ from ryu.ofproto import ofproto_v1_3 from ryu.lib.packet import packet from ryu.lib.packet import ethernet from ryu.lib.packet import ether_types -from ryu.topology.event import EventSwitchEnter, EventSwitchLeave, EventSwitchReconnected +from ryu.topology.event import EventSwitchEnter, EventSwitchReconnected + class SimpleSwitch13(app_manager.RyuApp): OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION] @@ -44,11 +45,13 @@ class SimpleSwitch13(app_manager.RyuApp): # truncated packet data. In that case, we cannot output packets # correctly. The bug has been fixed in OVS v2.1.0. match = parser.OFPMatch() - actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER, - ofproto.OFPCML_NO_BUFFER)] + # actions = [parser.OFPActionOutput(ofproto.OFPP_CONTROLLER, + # ofproto.OFPCML_NO_BUFFER)] + actions = [parser.OFPActionOutput(ofproto.OFPCML_NO_BUFFER)] self.add_flow(datapath, 0, match, actions) - def add_flow(self, datapath, priority, match, actions, buffer_id=None): + def add_flow(self, datapath, priority, match, + actions, buffer_id=None, table_id=0): ofproto = datapath.ofproto parser = datapath.ofproto_parser @@ -57,10 +60,10 @@ class SimpleSwitch13(app_manager.RyuApp): if buffer_id: mod = parser.OFPFlowMod(datapath=datapath, buffer_id=buffer_id, priority=priority, match=match, - instructions=inst) + instructions=inst, table_id=table_id) else: mod = parser.OFPFlowMod(datapath=datapath, priority=priority, - match=match, instructions=inst) + match=match, instructions=inst, table_id=table_id) datapath.send_msg(mod) # new switch detected @@ -74,8 +77,7 @@ class SimpleSwitch13(app_manager.RyuApp): # send NORMAL action for all undefined flows ofp_parser = datapath.ofproto_parser actions = [ofp_parser.OFPActionOutput(ofproto_v1_3.OFPP_NORMAL)] - self.add_flow(datapath, 0, None, actions) - + self.add_flow(datapath, 0, None, actions, table_id=0) @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER) def _packet_in_handler(self, ev):