Skip to content

Commit

Permalink
of1.0: add nx_match to NXFlowStatsRequest
Browse files Browse the repository at this point in the history
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
  • Loading branch information
ohmk authored and fujita committed Apr 18, 2013
1 parent fd7723e commit fc161ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ryu/ofproto/ofproto_v1_0_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2194,15 +2194,21 @@ def _serialize_vendor_stats(self):


class NXFlowStatsRequest(NXStatsRequest):
def __init__(self, datapath, flags, out_port, match_len,
table_id):
def __init__(self, datapath, flags, out_port, table_id, rule=None):
super(NXFlowStatsRequest, self).__init__(datapath, flags,
ofproto_v1_0.NXST_FLOW)
self.out_port = out_port
self.match_len = match_len
self.table_id = table_id
self.rule = rule
self.match_len = 0

def _serialize_vendor_stats_body(self):
if self.rule is not None:
offset = ofproto_v1_0.NX_STATS_MSG_SIZE + \
ofproto_v1_0.NX_FLOW_STATS_REQUEST_SIZE
self.match_len = nx_match.serialize_nxm_match(
self.rule, self.buf, offset)

msg_pack_into(
ofproto_v1_0.NX_FLOW_STATS_REQUEST_PACK_STR,
self.buf, ofproto_v1_0.NX_STATS_MSG_SIZE, self.out_port,
Expand Down

0 comments on commit fc161ff

Please sign in to comment.