From 128b125f0632adde7b664b74ba0116b598af188c Mon Sep 17 00:00:00 2001 From: Can Zhang Date: Fri, 29 Mar 2013 11:19:18 +0800 Subject: [PATCH] support parse OFPAction in NXFlowStats Signed-off-by: Can Zhang Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_0_parser.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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