summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2013-07-19 15:32:10 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-07-19 18:14:57 +0900
commit60bae5eda50d912665a0f398f038132c19340a16 (patch)
treeb785259ff0b2ccee0fbd9e5679e2e9c2cdbfb914
parent3fc9c426911abbf56d2a2001017def155ec1cb2e (diff)
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 <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/ofproto/ofproto_v1_3_parser.py18
1 files 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