This patch sorts out the inheritance relation of properties field class.
Signed-off-by: IWASE Yusuke <[email protected]>
---
ryu/ofproto/ofproto_v1_4_parser.py | 28 ++++++++++++++++------------
ryu/ofproto/ofproto_v1_5_parser.py | 28 ++++++++++++++++------------
2 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py
b/ryu/ofproto/ofproto_v1_4_parser.py
index 3faf040..7861990 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -890,7 +890,7 @@ class OFPPortDescProp(OFPPropBase):
@OFPPortDescProp.register_type(ofproto.OFPPDPT_ETHERNET)
-class OFPPortDescPropEthernet(StringifyMixin):
+class OFPPortDescPropEthernet(OFPPortDescProp):
def __init__(self, type_=None, length=None, curr=None, advertised=None,
supported=None, peer=None, curr_speed=None, max_speed=None):
self.type = type_
@@ -913,7 +913,7 @@ class OFPPortDescPropEthernet(StringifyMixin):
@OFPPortDescProp.register_type(ofproto.OFPPDPT_OPTICAL)
-class OFPPortDescPropOptical(StringifyMixin):
+class OFPPortDescPropOptical(OFPPortDescProp):
def __init__(self, type_=None, length=None, supported=None,
tx_min_freq_lmda=None, tx_max_freq_lmda=None,
tx_grid_freq_lmda=None, rx_min_freq_lmda=None,
@@ -953,7 +953,7 @@ class OFPTableModProp(OFPPropBase):
@OFPTableModProp.register_type(ofproto.OFPTMPT_EVICTION)
-class OFPTableModPropEviction(StringifyMixin):
+class OFPTableModPropEviction(OFPTableModProp):
def __init__(self, type_=None, length=None, flags=None):
self.type = type_
self.length = length
@@ -977,7 +977,7 @@ class OFPTableModPropEviction(StringifyMixin):
@OFPTableModProp.register_type(ofproto.OFPTMPT_VACANCY)
-class OFPTableModPropVacancy(StringifyMixin):
+class OFPTableModPropVacancy(OFPTableModProp):
def __init__(self, type_=None, length=None, vacancy_down=None,
vacancy_up=None, vacancy=None):
self.type = type_
@@ -1015,7 +1015,7 @@ class OFPQueueDescProp(OFPPropBase):
@OFPQueueDescProp.register_type(ofproto.OFPQDPT_MIN_RATE)
-class OFPQueueDescPropMinRate(StringifyMixin):
+class OFPQueueDescPropMinRate(OFPQueueDescProp):
def __init__(self, type_=None, length=None, rate=None):
self.type = type_
self.length = length
@@ -1030,7 +1030,7 @@ class OFPQueueDescPropMinRate(StringifyMixin):
@OFPQueueDescProp.register_type(ofproto.OFPQDPT_MAX_RATE)
-class OFPQueueDescPropMaxRate(StringifyMixin):
+class OFPQueueDescPropMaxRate(OFPQueueDescProp):
def __init__(self, type_=None, length=None, rate=None):
self.type = type_
self.length = length
@@ -4188,7 +4188,7 @@ class OFPPortStatsProp(OFPPropBase):
@OFPPortStatsProp.register_type(ofproto.OFPPSPT_ETHERNET)
-class OFPPortStatsPropEthernet(StringifyMixin):
+class OFPPortStatsPropEthernet(OFPPortStatsProp):
def __init__(self, type_=None, length=None, rx_frame_err=None,
rx_over_err=None, rx_crc_err=None, collisions=None):
self.type = type_
@@ -4208,7 +4208,7 @@ class OFPPortStatsPropEthernet(StringifyMixin):
@OFPPortStatsProp.register_type(ofproto.OFPPSPT_OPTICAL)
-class OFPPortStatsPropOptical(StringifyMixin):
+class OFPPortStatsPropOptical(OFPPortStatsProp):
def __init__(self, type_=None, length=None, flags=None,
tx_freq_lmda=None, tx_offset=None, tx_grid_span=None,
rx_freq_lmda=None, rx_offset=None, rx_grid_span=None,
@@ -5554,7 +5554,11 @@ class OFPGroupMod(MsgBase):
offset += b.len
-class OFPPortModPropEthernet(StringifyMixin):
+class OFPPortModProp(OFPPropBase):
+ _TYPES = {}
+
+
+class OFPPortModPropEthernet(OFPPortModProp):
def __init__(self, type_=None, length=None, advertise=None):
self.type = type_
self.advertise = advertise
@@ -5570,7 +5574,7 @@ class OFPPortModPropEthernet(StringifyMixin):
return buf
-class OFPPortModPropOptical(StringifyMixin):
+class OFPPortModPropOptical(OFPPortModProp):
def __init__(self, type_=None, length=None, configure=None,
freq_lmda=None, fl_offset=None, grid_span=None,
tx_pwr=None):
@@ -5618,7 +5622,7 @@ class OFPPortMod(MsgBase):
| OFPPC_NO_FWD
| OFPPC_NO_PACKET_IN
mask Bitmap of configuration flags above to be changed
- properties List of ``OFPPortProp`` subclass instance
+ properties List of ``OFPPortModProp`` subclass instance
================ ======================================================
Example::
@@ -5825,7 +5829,7 @@ class OFPAsyncConfigProp(OFPPropBase):
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_TABLE_STATUS_MASTER)
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_REQUESTFORWARD_SLAVE)
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_REQUESTFORWARD_MASTER)
-class OFPAsyncConfigPropReasons(StringifyMixin):
+class OFPAsyncConfigPropReasons(OFPAsyncConfigProp):
def __init__(self, type_=None, length=None, mask=None):
self.type = type_
self.length = length
diff --git a/ryu/ofproto/ofproto_v1_5_parser.py
b/ryu/ofproto/ofproto_v1_5_parser.py
index f70236b..d5f409e 100644
--- a/ryu/ofproto/ofproto_v1_5_parser.py
+++ b/ryu/ofproto/ofproto_v1_5_parser.py
@@ -890,7 +890,7 @@ class OFPPortDescProp(OFPPropBase):
@OFPPortDescProp.register_type(ofproto.OFPPDPT_ETHERNET)
-class OFPPortDescPropEthernet(StringifyMixin):
+class OFPPortDescPropEthernet(OFPPortDescProp):
def __init__(self, type_=None, length=None, curr=None, advertised=None,
supported=None, peer=None, curr_speed=None, max_speed=None):
self.type = type_
@@ -913,7 +913,7 @@ class OFPPortDescPropEthernet(StringifyMixin):
@OFPPortDescProp.register_type(ofproto.OFPPDPT_OPTICAL)
-class OFPPortDescPropOptical(StringifyMixin):
+class OFPPortDescPropOptical(OFPPortDescProp):
def __init__(self, type_=None, length=None, supported=None,
tx_min_freq_lmda=None, tx_max_freq_lmda=None,
tx_grid_freq_lmda=None, rx_min_freq_lmda=None,
@@ -953,7 +953,7 @@ class OFPTableModProp(OFPPropBase):
@OFPTableModProp.register_type(ofproto.OFPTMPT_EVICTION)
-class OFPTableModPropEviction(StringifyMixin):
+class OFPTableModPropEviction(OFPTableModProp):
def __init__(self, type_=None, length=None, flags=None):
self.type = type_
self.length = length
@@ -977,7 +977,7 @@ class OFPTableModPropEviction(StringifyMixin):
@OFPTableModProp.register_type(ofproto.OFPTMPT_VACANCY)
-class OFPTableModPropVacancy(StringifyMixin):
+class OFPTableModPropVacancy(OFPTableModProp):
def __init__(self, type_=None, length=None, vacancy_down=None,
vacancy_up=None, vacancy=None):
self.type = type_
@@ -1015,7 +1015,7 @@ class OFPQueueDescProp(OFPPropBase):
@OFPQueueDescProp.register_type(ofproto.OFPQDPT_MIN_RATE)
-class OFPQueueDescPropMinRate(StringifyMixin):
+class OFPQueueDescPropMinRate(OFPQueueDescProp):
def __init__(self, type_=None, length=None, rate=None):
self.type = type_
self.length = length
@@ -1030,7 +1030,7 @@ class OFPQueueDescPropMinRate(StringifyMixin):
@OFPQueueDescProp.register_type(ofproto.OFPQDPT_MAX_RATE)
-class OFPQueueDescPropMaxRate(StringifyMixin):
+class OFPQueueDescPropMaxRate(OFPQueueDescProp):
def __init__(self, type_=None, length=None, rate=None):
self.type = type_
self.length = length
@@ -4188,7 +4188,7 @@ class OFPPortStatsProp(OFPPropBase):
@OFPPortStatsProp.register_type(ofproto.OFPPSPT_ETHERNET)
-class OFPPortStatsPropEthernet(StringifyMixin):
+class OFPPortStatsPropEthernet(OFPPortStatsProp):
def __init__(self, type_=None, length=None, rx_frame_err=None,
rx_over_err=None, rx_crc_err=None, collisions=None):
self.type = type_
@@ -4208,7 +4208,7 @@ class OFPPortStatsPropEthernet(StringifyMixin):
@OFPPortStatsProp.register_type(ofproto.OFPPSPT_OPTICAL)
-class OFPPortStatsPropOptical(StringifyMixin):
+class OFPPortStatsPropOptical(OFPPortStatsProp):
def __init__(self, type_=None, length=None, flags=None,
tx_freq_lmda=None, tx_offset=None, tx_grid_span=None,
rx_freq_lmda=None, rx_offset=None, rx_grid_span=None,
@@ -5553,7 +5553,11 @@ class OFPGroupMod(MsgBase):
offset += b.len
-class OFPPortModPropEthernet(StringifyMixin):
+class OFPPortModProp(OFPPropBase):
+ _TYPES = {}
+
+
+class OFPPortModPropEthernet(OFPPortModProp):
def __init__(self, type_=None, length=None, advertise=None):
self.type = type_
self.advertise = advertise
@@ -5569,7 +5573,7 @@ class OFPPortModPropEthernet(StringifyMixin):
return buf
-class OFPPortModPropOptical(StringifyMixin):
+class OFPPortModPropOptical(OFPPortModProp):
def __init__(self, type_=None, length=None, configure=None,
freq_lmda=None, fl_offset=None, grid_span=None,
tx_pwr=None):
@@ -5617,7 +5621,7 @@ class OFPPortMod(MsgBase):
| OFPPC_NO_FWD
| OFPPC_NO_PACKET_IN
mask Bitmap of configuration flags above to be changed
- properties List of ``OFPPortProp`` subclass instance
+ properties List of ``OFPPortModProp`` subclass instance
================ ======================================================
Example::
@@ -5824,7 +5828,7 @@ class OFPAsyncConfigProp(OFPPropBase):
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_TABLE_STATUS_MASTER)
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_REQUESTFORWARD_SLAVE)
@OFPAsyncConfigProp.register_type(ofproto.OFPACPT_REQUESTFORWARD_MASTER)
-class OFPAsyncConfigPropReasons(StringifyMixin):
+class OFPAsyncConfigPropReasons(OFPAsyncConfigProp):
def __init__(self, type_=None, length=None, mask=None):
self.type = type_
self.length = length
--
1.9.1
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel