Hello,
I find that when I use ryu app ofctl_rest to check flows, there will be an
error in method actions_to_str of ofctl_v1_0, the code as follows:
def actions_to_str(acts):
actions = []
for a in acts:
action_type = a.cls_action_type
if action_type == ofproto_v1_0.OFPAT_OUTPUT:
buf = 'OUTPUT:' + str(a.port)
......
when I receive a action msg (e.g NXActionResubmitTable,NXActionSetTunnel,
other nx_action_subtype),and these msgs do not have a member like
cls_action_type.
so it encounters an error.
I don't know if there are proper ways to fix it ,and my solution is as
follows:
---------------------------------------
diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
index ad47470..ca9d207 100644
--- a/ryu/lib/ofctl_v1_0.py
+++ b/ryu/lib/ofctl_v1_0.py
@@ -71,6 +71,12 @@ def actions_to_str(acts):
buf = 'SET_DL_SRC:' + haddr_to_str(a.dl_addr)
elif action_type == ofproto_v1_0.OFPAT_SET_DL_DST:
buf = 'SET_DL_DST:' + haddr_to_str(a.dl_addr)
+ elif action_type == ofproto_v1_0.OFPAT_VENDOR:
+ action_subtype = a.cls_subtype
+ if action_subtype == ofproto_v1_0.NXAST_RESUBMIT:
+ pass #TODO
+ else:
+ pass
else:
buf = 'UNKNOWN'
actions.append(buf)
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
b/ryu/ofproto/ofproto_v1_0_parse
index 7945888..ede1b13 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -400,6 +400,7 @@ class NXActionHeader(object):
@staticmethod
def register_nx_action_subtype(subtype):
def _register_nx_action_subtype(cls):
+ cls.cls_action_type = ofproto_v1_0.OFPAT_VENDOR
cls.cls_subtype = subtype
NXActionHeader._NX_ACTION_SUBTYPES[cls.cls_subtype] = cls
return cls
Best regards,
Joe
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel