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>
This commit is contained in:
Simon Horman 2014-02-27 17:56:14 +09:00 committed by FUJITA Tomonori
parent ec5f96daf0
commit 77fd419441

View File

@ -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