diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-02-02 00:49:43 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-02-02 00:49:43 +0900 |
commit | 0b8e9885aa2aacd0691f3b02c9fac64db24bdf39 (patch) | |
tree | 65da0e2b139fcb9c7ea0f57719fb210ef4cdd0da | |
parent | 9f30e7d23ad5f43468ed011f58fb727e39137d7d (diff) |
of12: set default attributes for OFPStatsRequest subclasses
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_2_parser.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py index 4e55dc0d..8f83bf7a 100644 --- a/ryu/ofproto/ofproto_v1_2_parser.py +++ b/ryu/ofproto/ofproto_v1_2_parser.py @@ -2169,8 +2169,10 @@ class OFPAggregateStatsRequest(OFPStatsRequest): match) datapath.send_msg(req) """ - def __init__(self, datapath, table_id, out_port, out_group, - cookie, cookie_mask, match, flags=0): + def __init__(self, datapath, table_id=ofproto_v1_2.OFPTT_ALL, + out_port=ofproto_v1_2.OFPP_ANY, + out_group=ofproto_v1_2.OFPP_ANY, + cookie=0, cookie_mask=0, match=None, flags=0): super(OFPAggregateStatsRequest, self).__init__( datapath, ofproto_v1_2.OFPST_AGGREGATE, @@ -2180,6 +2182,8 @@ class OFPAggregateStatsRequest(OFPStatsRequest): self.out_group = out_group self.cookie = cookie self.cookie_mask = cookie_mask + if match is None: + match = OFPMatch() self.match = match def _serialize_stats_body(self): @@ -2379,7 +2383,7 @@ class OFPPortStatsRequest(OFPStatsRequest): req = ofp_parser.OFPPortStatsRequest(datapath, ofp.OFPP_ANY) datapath.send_msg(req) """ - def __init__(self, datapath, port_no, flags=0): + def __init__(self, datapath, port_no=ofproto_v1_2.OFPP_ANY, flags=0): super(OFPPortStatsRequest, self).__init__(datapath, ofproto_v1_2.OFPST_PORT, flags) @@ -2488,7 +2492,8 @@ class OFPQueueStatsRequest(OFPStatsRequest): ofp.OFPQ_ALL) datapath.send_msg(req) """ - def __init__(self, datapath, port_no, queue_id, flags=0): + def __init__(self, datapath, port_no=ofproto_v1_2.OFPP_ANY, + queue_id=ofproto_v1_2.OFPQ_ALL, flags=0): super(OFPQueueStatsRequest, self).__init__(datapath, ofproto_v1_2.OFPST_QUEUE, flags) @@ -2589,7 +2594,7 @@ class OFPGroupStatsRequest(OFPStatsRequest): req = ofp_parser.OFPGroupStatsRequest(datapath, ofp.OFPG_ALL) datapath.send_msg(req) """ - def __init__(self, datapath, group_id, flags=0): + def __init__(self, datapath, group_id=ofproto_v1_2.OFPG_ALL, flags=0): super(OFPGroupStatsRequest, self).__init__(datapath, ofproto_v1_2.OFPST_GROUP, flags) |