support parse OFPAction in NXFlowStats

Signed-off-by: Can Zhang <can@canx.me>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Can Zhang 2013-03-29 11:19:18 +08:00 committed by FUJITA Tomonori
parent 03c622453a
commit 128b125f06

View File

@ -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