summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2015-12-22 11:49:13 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-12-22 13:50:27 +0900
commit6e4b2b67a3c4f7fc466a1aa156bd8f8b06936750 (patch)
treef87e437ae500ce9cc7ced8a763c67314479b2ba4
parent1ed92b25b5997f804dd70a4f072fd20f6af618e0 (diff)
ofproto_v1_[2345]_parser: Set default length field
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_2_parser.py4
-rw-r--r--ryu/ofproto/ofproto_v1_3_parser.py2
-rw-r--r--ryu/ofproto/ofproto_v1_4_parser.py2
-rw-r--r--ryu/ofproto/ofproto_v1_5_parser.py4
4 files changed, 7 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py
index 781b0674..7f38e36e 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -2151,6 +2151,7 @@ class OFPFlowStats(StringifyMixin):
self.byte_count = byte_count
self.match = match
self.instructions = instructions
+ self.length = length
@classmethod
def parser(cls, buf, offset):
@@ -2697,13 +2698,14 @@ class OFPGroupStats(StringifyMixin):
"""
def __init__(self, group_id, ref_count, packet_count,
- byte_count, bucket_counters):
+ byte_count, bucket_counters, length=None):
super(OFPGroupStats, self).__init__()
self.group_id = group_id
self.ref_count = ref_count
self.packet_count = packet_count
self.byte_count = byte_count
self.bucket_counters = bucket_counters
+ self.length = length
@classmethod
def parser(cls, buf, offset):
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py
index 47773f6c..f8982125 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -3867,7 +3867,6 @@ class OFPFlowStats(StringifyMixin):
byte_count=None, match=None, instructions=None,
length=None):
super(OFPFlowStats, self).__init__()
- self.length = 0
self.table_id = table_id
self.duration_sec = duration_sec
self.duration_nsec = duration_nsec
@@ -3880,6 +3879,7 @@ class OFPFlowStats(StringifyMixin):
self.byte_count = byte_count
self.match = match
self.instructions = instructions
+ self.length = length
@classmethod
def parser(cls, buf, offset):
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index 943fcc95..86d45683 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -3360,7 +3360,6 @@ class OFPFlowStats(StringifyMixin):
byte_count=None, match=None, instructions=None,
length=None):
super(OFPFlowStats, self).__init__()
- self.length = 0
self.table_id = table_id
self.duration_sec = duration_sec
self.duration_nsec = duration_nsec
@@ -3374,6 +3373,7 @@ class OFPFlowStats(StringifyMixin):
self.byte_count = byte_count
self.match = match
self.instructions = instructions
+ self.length = length
@classmethod
def parser(cls, buf, offset):
diff --git a/ryu/ofproto/ofproto_v1_5_parser.py b/ryu/ofproto/ofproto_v1_5_parser.py
index d7e49145..2d671b72 100644
--- a/ryu/ofproto/ofproto_v1_5_parser.py
+++ b/ryu/ofproto/ofproto_v1_5_parser.py
@@ -3905,14 +3905,14 @@ class OFPFlowDesc(StringifyMixin):
class OFPFlowStats(StringifyMixin):
def __init__(self, table_id=None, reason=None, priority=None,
- match=None, stats=None, length=0):
+ match=None, stats=None, length=None):
super(OFPFlowStats, self).__init__()
- self.length = length
self.table_id = table_id
self.reason = reason
self.priority = priority
self.match = match
self.stats = stats
+ self.length = length
@classmethod
def parser(cls, buf, offset):