diff options
author | Yusuke Iwase <iwase.yusuke0@gmail.com> | 2015-08-07 10:25:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-08 13:24:20 +0900 |
commit | 9497aad69fa5f66422e9b642ec2dc1d6dd2d6816 (patch) | |
tree | 1d7242d9f8aa2336dfe0509317baeffa925fb1fc | |
parent | 1fef327dc49ca5d32256f94cf73a8257f71d9255 (diff) |
ofproto_v1_5_parser: Support new OFPTableFeaturesStats structure
OpenFlow Spec 1.5 introduces a new ofp_table_features structures
in accordance with table feature request commands for simpler table
features updates.
This patch fixes OFPTableFeaturesStats class to support the new
structure of ofp_table_features.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_5_parser.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/ryu/ofproto/ofproto_v1_5_parser.py b/ryu/ofproto/ofproto_v1_5_parser.py index bd398a21..a28f418b 100644 --- a/ryu/ofproto/ofproto_v1_5_parser.py +++ b/ryu/ofproto/ofproto_v1_5_parser.py @@ -2439,39 +2439,40 @@ class OFPTableFeaturesStats(StringifyMixin): ] } - def __init__(self, table_id=None, name=None, metadata_match=None, - metadata_write=None, config=None, max_entries=None, - properties=None, length=None): + def __init__(self, table_id=None, command=None, features=None, name=None, + metadata_match=None, metadata_write=None, capabilities=None, + max_entries=None, properties=None, length=None): super(OFPTableFeaturesStats, self).__init__() - self.length = None + self.length = length self.table_id = table_id + self.command = command + self.features = features self.name = name self.metadata_match = metadata_match self.metadata_write = metadata_write - self.config = config + self.capabilities = capabilities self.max_entries = max_entries self.properties = properties @classmethod def parser(cls, buf, offset): - table_features = cls() - (table_features.length, table_features.table_id, - name, table_features.metadata_match, - table_features.metadata_write, table_features.config, - table_features.max_entries + tbl = cls() + (tbl.length, tbl.table_id, tbl.command, tbl.features, + name, tbl.metadata_match, tbl.metadata_write, + tbl.capabilities, tbl.max_entries ) = struct.unpack_from(ofproto.OFP_TABLE_FEATURES_PACK_STR, buf, offset) - table_features.name = name.rstrip(b'\0') + tbl.name = name.rstrip(b'\0') props = [] rest = buf[offset + ofproto.OFP_TABLE_FEATURES_SIZE: - offset + table_features.length] + offset + tbl.length] while rest: p, rest = OFPTableFeatureProp.parse(rest) props.append(p) - table_features.properties = props + tbl.properties = props - return table_features + return tbl def serialize(self): # fixup @@ -2482,9 +2483,9 @@ class OFPTableFeaturesStats(StringifyMixin): buf = bytearray() msg_pack_into(ofproto.OFP_TABLE_FEATURES_PACK_STR, buf, 0, - self.length, self.table_id, self.name, - self.metadata_match, self.metadata_write, - self.config, self.max_entries) + self.length, self.table_id, self.command, self.features, + self.name, self.metadata_match, self.metadata_write, + self.capabilities, self.max_entries) return buf + bin_props |