Commit 7a53f3de authored by Philipp Tennigkeit's avatar Philipp Tennigkeit

adapted commentary

parent 6035cb88
Pipeline #2547 passed with stage
in 28 seconds
......@@ -23,6 +23,8 @@ class SPBSwitchApp(app_manager.RyuApp):
self.net = Topology()
self.verbose = False
# Flow Handler
@set_ev_cls(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)
def switch_features_handler(self, ev):
datapath = ev.msg.datapath
......@@ -45,7 +47,7 @@ class SPBSwitchApp(app_manager.RyuApp):
mod = parser.OFPFlowMod(datapath=dp, priority=priority, match=match, instructions=inst)
dp.send_msg(mod)
# Handle Packages
# Packet Handler
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
......@@ -105,6 +107,8 @@ class SPBSwitchApp(app_manager.RyuApp):
out = parser.OFPPacketOut(datapath=datapath, buffer_id=buffer_id, in_port=in_port, actions=actions, data=data)
datapath.send_msg(out)
# Packet Filter
def _filter(self, ev):
reason = ""
apply_filter = False
......@@ -132,6 +136,8 @@ class SPBSwitchApp(app_manager.RyuApp):
self._print_event("FILTER", reason, ev)
return apply_filter
# Misc
def _print_event(self, actor, reason, event):
out = "[{0}] {1}".format(actor, reason)
self.logger.info(out)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment