summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-02-27 17:56:14 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-27 22:29:57 +0900
commit77fd41944131ae5c3f1e5e079cdc2436cc2eee63 (patch)
tree14809d0c365319da39632999ce2c8c0887b2536a
parentec5f96daf03e5cfc6f2431579552c1be8e4a437d (diff)
of14: Remove _PACK_STR from port mod ethernet property
Use OFP_PORT_MOD_PROP_ETHERNET_PACK_STR in and remove _PACK_STR from OFPPortModPropEthernet. Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--ryu/ofproto/ofproto_v1_4_parser.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index f5234c07..3feb09db 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -5106,19 +5106,18 @@ class OFPGroupMod(MsgBase):
class OFPPortModPropEthernet(StringifyMixin):
- _PACK_STR = '!HHI' # type, len, advertise
-
def __init__(self, type_=None, length=None, advertise=None):
self.type = type_
self.advertise = advertise
def serialize(self):
# fixup
- self.length = struct.calcsize(self._PACK_STR)
+ self.length = struct.calcsize(
+ ofproto.OFP_PORT_MOD_PROP_ETHERNET_PACK_STR)
buf = bytearray()
- msg_pack_into(self._PACK_STR, buf, 0, self.type, self.length,
- self.advertise)
+ msg_pack_into(ofproto.OFP_PORT_MOD_PROP_ETHERNET_PACK_STR,
+ buf, 0, self.type, self.length, self.advertise)
return buf