summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCan Zhang <can@canx.me>2013-03-29 11:19:18 +0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-03-30 15:32:30 +0900
commit128b125f0632adde7b664b74ba0116b598af188c (patch)
tree7dfff510d193d66e02e8d7b99f21f90d66f9d684
parent03c622453ad2e45d76a54d9222863a7ae43056fe (diff)
support parse OFPAction in NXFlowStats
Signed-off-by: Can Zhang <can@canx.me> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_0_parser.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py
index 180e161d..a6d3977d 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -1044,6 +1044,7 @@ class NXFlowStats(object):
@classmethod
def parser(cls, buf, offset):
+ original_offset = offset
nxflow_stats = cls()
(nxflow_stats.length, nxflow_stats.table_id,
nxflow_stats.duration_sec, nxflow_stats.duration_nsec,
@@ -1065,6 +1066,16 @@ class NXFlowStats(object):
fields.append(field)
nxflow_stats.fields = fields
+ actions = []
+ total_len = original_offset + nxflow_stats.length
+ match_len = nxflow_stats.match_len
+ offset += (match_len + 7) / 8 * 8 - match_len
+ while offset < total_len:
+ action = OFPAction.parser(buf, offset)
+ actions.append(action)
+ offset += action.len
+ nxflow_stats.actions = actions
+
return nxflow_stats