diff options
author | Simon Horman <horms@verge.net.au> | 2014-01-28 08:58:47 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-01-28 08:27:56 +0900 |
commit | 8639905bb7398d5c478a387189a283b5ace4d8ec (patch) | |
tree | b1fc70c878e14dc149350bcfd40ca89c2e903663 | |
parent | d5c2c1f2e38476d043ff4f8e65f00f9de0c913af (diff) |
Make type and len class attributes of OFPInstructionMeter
Make type and len class attributes of OFPInstructionMeter
and update JSON accordingly.
This is in keeping with the implementation of other OFPInstruction classes.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_3_parser.py | 3 | ||||
-rw-r--r-- | ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 8b4a6bc7..ec8bcc49 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -2558,9 +2558,8 @@ class OFPInstructionMeter(StringifyMixin): meter_id Meter instance ================ ====================================================== """ - _base_attributes = ['type', 'len'] - def __init__(self, meter_id): + def __init__(self, meter_id, type_=None, len_=None): super(OFPInstructionMeter, self).__init__() self.type = ofproto_v1_3.OFPIT_METER self.len = ofproto_v1_3.OFP_INSTRUCTION_METER_SIZE diff --git a/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json b/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json index 97ddd628..736f7cdd 100644 --- a/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json +++ b/ryu/tests/unit/ofproto/json/of13/4-46-ofp_flow_mod.packet.json @@ -10,6 +10,8 @@ "instructions": [ { "OFPInstructionMeter": { + "len": 8, + "type": 6, "meter_id": 1 } }, |