Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/ofproto/ofproto_v1_2_parser.py | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py
b/ryu/ofproto/ofproto_v1_2_parser.py
index 45f0614..99e6c63 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -1092,7 +1092,7 @@ class OFPStatsReply(MsgBase):
while offset < msg_len:
r = stats_type_cls.parser(msg.buf, offset)
body.append(r)
- offset += r._length
+ offset += r.length
if stats_type_cls.cls_body_single_struct:
msg.body = body[0]
@@ -1132,7 +1132,7 @@ class
OFPDescStats(ofproto_parser.namedtuple('OFPDescStats', (
desc = list(desc)
desc = map(lambda x: x.rstrip('\0'), desc)
stats = cls(*desc)
- stats._length = ofproto_v1_2.OFP_DESC_STATS_SIZE
+ stats.length = ofproto_v1_2.OFP_DESC_STATS_SIZE
return stats
@@ -1167,7 +1167,7 @@ class OFPFlowStatsRequest(OFPStatsRequest):
class OFPFlowStats(StringifyMixin):
def __init__(self, table_id, duration_sec, duration_nsec,
priority, idle_timeout, hard_timeout, cookie, packet_count,
- byte_count, match, instructions=None):
+ byte_count, match, instructions=None, length=None):
super(OFPFlowStats, self).__init__()
self.table_id = table_id
self.duration_sec = duration_sec
@@ -1207,7 +1207,7 @@ class OFPFlowStats(StringifyMixin):
o = cls(table_id, duration_sec, duration_nsec, priority,
idle_timeout, hard_timeout, cookie, packet_count,
byte_count, match, instructions)
- o._length = length
+ o.length = length
return o
@@ -1250,7 +1250,7 @@ class
OFPAggregateStatsReply(ofproto_parser.namedtuple('OFPAggregateStats', (
ofproto_v1_2.OFP_AGGREGATE_STATS_REPLY_PACK_STR,
buf, offset)
stats = cls(*desc)
- stats._length = ofproto_v1_2.OFP_AGGREGATE_STATS_REPLY_SIZE
+ stats.length = ofproto_v1_2.OFP_AGGREGATE_STATS_REPLY_SIZE
return stats
@@ -1281,7 +1281,7 @@ class OFPTableStats(
i = cls._fields.index('name')
table[i] = table[i].rstrip('\0')
stats = cls(*table)
- stats._length = ofproto_v1_2.OFP_TABLE_STATS_SIZE
+ stats.length = ofproto_v1_2.OFP_TABLE_STATS_SIZE
return stats
@@ -1313,7 +1313,7 @@ class OFPPortStats(
port = struct.unpack_from(ofproto_v1_2.OFP_PORT_STATS_PACK_STR,
buf, offset)
stats = cls(*port)
- stats._length = ofproto_v1_2.OFP_PORT_STATS_SIZE
+ stats.length = ofproto_v1_2.OFP_PORT_STATS_SIZE
return stats
@@ -1342,7 +1342,7 @@ class OFPQueueStats(
queue = struct.unpack_from(ofproto_v1_2.OFP_QUEUE_STATS_PACK_STR,
buf, offset)
stats = cls(*queue)
- stats._length = ofproto_v1_2.OFP_QUEUE_STATS_SIZE
+ stats.length = ofproto_v1_2.OFP_QUEUE_STATS_SIZE
return stats
@@ -1402,7 +1402,7 @@ class OFPGroupStats(StringifyMixin):
o = cls(group_id, ref_count, packet_count,
byte_count, bucket_counters)
- o._length = length
+ o.length = length
return o
@@ -1417,7 +1417,7 @@ class OFPGroupDescStatsRequest(OFPStatsRequest):
@OFPStatsReply.register_stats_reply_type(ofproto_v1_2.OFPST_GROUP_DESC)
class OFPGroupDescStats(StringifyMixin):
- def __init__(self, type_, group_id, buckets):
+ def __init__(self, type_, group_id, buckets, length=None):
self.type = type_
self.group_id = group_id
self.buckets = buckets
@@ -1438,7 +1438,7 @@ class OFPGroupDescStats(StringifyMixin):
bucket_len -= bucket.len
o = cls(type_, group_id, buckets)
- o._length = length
+ o.length = length
return o
@@ -1454,7 +1454,7 @@ class OFPGroupFeaturesStatsRequest(OFPStatsRequest):
@OFPStatsReply.register_stats_reply_type(ofproto_v1_2.OFPST_GROUP_FEATURES,
body_single_struct=True)
class OFPGroupFeaturesStats(StringifyMixin):
- def __init__(self, types, capabilities, max_groups, actions):
+ def __init__(self, types, capabilities, max_groups, actions, length=None):
self.types = types
self.capabilities = capabilities
self.max_groups = max_groups
@@ -1470,7 +1470,7 @@ class OFPGroupFeaturesStats(StringifyMixin):
actions = list(stats[6:10])
o = cls(types, capabilities, max_groups, actions)
- o._length = ofproto_v1_2.OFP_GROUP_FEATURES_STATS_SIZE
+ o.length = ofproto_v1_2.OFP_GROUP_FEATURES_STATS_SIZE
return o
--
1.8.3.1
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel