> Hmm, I still can't apply cleanly.
I think, the cause is the following.
- 4-50-ofp_meter_stats_reply.packet.json contained an unnecessary space.
- Mailer(I use Thunderbird) automatically deletes space of an end.
So, can you use the attached file as the patch?
It was applied in my environment.
thanks.
Signed-off-by: WATANABE Fumitaka <[email protected]>
---
ryu/ofproto/ofproto_v1_3_parser.py | 9 +++++----
.../ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py
b/ryu/ofproto/ofproto_v1_3_parser.py
index 50e6992..04b7b04 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -3446,7 +3446,7 @@ class OFPMultipartReply(MsgBase):
while offset < msg_len:
b = stats_type_cls.cls_stats_body_cls.parser(msg.buf, offset)
body.append(b)
- offset += b.length
+ offset += b.length if hasattr(b, 'length') else b.len
if stats_type_cls.cls_body_single_struct:
msg.body = body[0]
@@ -4325,9 +4325,10 @@ class OFPMeterBandStats(StringifyMixin):
class OFPMeterStats(StringifyMixin):
def __init__(self, meter_id=None, flow_count=None, packet_in_count=None,
byte_in_count=None, duration_sec=None, duration_nsec=None,
- band_stats=None, length=None):
+ band_stats=None, len_=None):
super(OFPMeterStats, self).__init__()
self.meter_id = meter_id
+ self.len = 0
self.flow_count = flow_count
self.packet_in_count = packet_in_count
self.byte_in_count = byte_in_count
@@ -4339,7 +4340,7 @@ class OFPMeterStats(StringifyMixin):
def parser(cls, buf, offset):
meter_stats = cls()
- (meter_stats.meter_id, meter_stats.length,
+ (meter_stats.meter_id, meter_stats.len,
meter_stats.flow_count, meter_stats.packet_in_count,
meter_stats.byte_in_count, meter_stats.duration_sec,
meter_stats.duration_nsec) = struct.unpack_from(
@@ -4348,7 +4349,7 @@ class OFPMeterStats(StringifyMixin):
meter_stats.band_stats = []
length = ofproto_v1_3.OFP_METER_STATS_SIZE
- while length < meter_stats.length:
+ while length < meter_stats.len:
band_stats = OFPMeterBandStats.parser(buf, offset)
meter_stats.band_stats.append(band_stats)
offset += ofproto_v1_3.OFP_METER_BAND_STATS_SIZE
diff --git
a/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
b/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
index 73b37f9..50d295c 100644
--- a/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
+++ b/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
@@ -15,7 +15,7 @@
"duration_nsec": 480000,
"duration_sec": 0,
"flow_count": 0,
- "length": 56,
+ "len": 56,
"meter_id": 100,
"packet_in_count": 0
}
--
1.7.10.4
On Tue, 29 Oct 2013 21:49:33 +0900 (JST)
FUJITA Tomonori <[email protected]> wrote:
On Tue, 29 Oct 2013 11:09:40 +0900
"watanabe.fumitaka" <[email protected]> wrote:
v1 -> v2
rebase: patch against the latest git
Signed-off-by: WATANABE Fumitaka <[email protected]>
---
ryu/ofproto/ofproto_v1_3_parser.py | 9 +++++----
.../ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
Hmm, I still can't apply cleanly.
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel
>From ed2642bb589f1c03a48995eacb58760f54e63842 Mon Sep 17 00:00:00 2001
From: WATANABE Fumitaka <[email protected]>
Date: Wed, 30 Oct 2013 10:47:04 +0900
Subject: [PATCH] meter
Signed-off-by: WATANABE Fumitaka <[email protected]>
---
ryu/ofproto/ofproto_v1_3_parser.py | 9 +++++----
.../ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py
index 50e6992..04b7b04 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -3446,7 +3446,7 @@ class OFPMultipartReply(MsgBase):
while offset < msg_len:
b = stats_type_cls.cls_stats_body_cls.parser(msg.buf, offset)
body.append(b)
- offset += b.length
+ offset += b.length if hasattr(b, 'length') else b.len
if stats_type_cls.cls_body_single_struct:
msg.body = body[0]
@@ -4325,9 +4325,10 @@ class OFPMeterBandStats(StringifyMixin):
class OFPMeterStats(StringifyMixin):
def __init__(self, meter_id=None, flow_count=None, packet_in_count=None,
byte_in_count=None, duration_sec=None, duration_nsec=None,
- band_stats=None, length=None):
+ band_stats=None, len_=None):
super(OFPMeterStats, self).__init__()
self.meter_id = meter_id
+ self.len = 0
self.flow_count = flow_count
self.packet_in_count = packet_in_count
self.byte_in_count = byte_in_count
@@ -4339,7 +4340,7 @@ class OFPMeterStats(StringifyMixin):
def parser(cls, buf, offset):
meter_stats = cls()
- (meter_stats.meter_id, meter_stats.length,
+ (meter_stats.meter_id, meter_stats.len,
meter_stats.flow_count, meter_stats.packet_in_count,
meter_stats.byte_in_count, meter_stats.duration_sec,
meter_stats.duration_nsec) = struct.unpack_from(
@@ -4348,7 +4349,7 @@ class OFPMeterStats(StringifyMixin):
meter_stats.band_stats = []
length = ofproto_v1_3.OFP_METER_STATS_SIZE
- while length < meter_stats.length:
+ while length < meter_stats.len:
band_stats = OFPMeterBandStats.parser(buf, offset)
meter_stats.band_stats.append(band_stats)
offset += ofproto_v1_3.OFP_METER_BAND_STATS_SIZE
diff --git a/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json b/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
index 73b37f9..50d295c 100644
--- a/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
+++ b/ryu/tests/unit/ofproto/json/of13/4-50-ofp_meter_stats_reply.packet.json
@@ -15,7 +15,7 @@
"duration_nsec": 480000,
"duration_sec": 0,
"flow_count": 0,
- "length": 56,
+ "len": 56,
"meter_id": 100,
"packet_in_count": 0
}
--
1.7.10.4
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel