From 60bae5eda50d912665a0f398f038132c19340a16 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 19 Jul 2013 15:32:10 +0900 Subject: of-wire json: adapt OF13 OFPMeterBand prefix OFPMeterBand.type and len with _ to avoid being picked by stringifymixin. they are redundant as json representation has python class name like OFPMeterBandDrop. Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_3_parser.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 4c00fd65..342f1c89 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -2625,8 +2625,8 @@ class OFPMeterStatsReply(OFPMultipartReply): class OFPMeterBand(StringifyMixin): def __init__(self, type_, len_): super(OFPMeterBand, self).__init__() - self.type = type_ - self.len = len_ + self._type = type_ + self._len = len_ class OFPMeterBandHeader(OFPMeterBand): @@ -2665,7 +2665,7 @@ class OFPMeterBandDrop(OFPMeterBandHeader): def serialize(self, buf, offset): msg_pack_into(ofproto_v1_3.OFP_METER_BAND_DROP_PACK_STR, buf, offset, - self.type, self.len, self.rate, self.burst_size) + self._type, self._len, self.rate, self.burst_size) @classmethod def parser(cls, buf, offset): @@ -2688,8 +2688,8 @@ class OFPMeterBandDscpRemark(OFPMeterBandHeader): def serialize(self, buf, offset): msg_pack_into(ofproto_v1_3.OFP_METER_BAND_DSCP_REMARK_PACK_STR, buf, - offset, self.type, self.len, self.rate, self.burst_size, - self.prec_level) + offset, self._type, self._len, self.rate, + self.burst_size, self.prec_level) @classmethod def parser(cls, buf, offset): @@ -2712,8 +2712,8 @@ class OFPMeterBandExperimenter(OFPMeterBandHeader): def serialize(self, buf, offset): msg_pack_into(ofproto_v1_3.OFP_METER_BAND_EXPERIMENTER_PACK_STR, buf, - offset, self.type, self.len, self.rate, self.burst_size, - self.experimenter) + offset, self._type, self._len, self.rate, + self.burst_size, self.experimenter) @classmethod def parser(cls, buf, offset): @@ -2746,8 +2746,8 @@ class OFPMeterConfigStats(StringifyMixin): while length < meter_config._length: band = OFPMeterBandHeader.parser(buf, offset) meter_config.bands.append(band) - offset += band.len - length += band.len + offset += band._len + length += band._len return meter_config -- cgit v1.2.3