of14: Add port mod optical property

Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Simon Horman 2014-02-27 17:56:15 +09:00 committed by FUJITA Tomonori
parent 77fd419441
commit 55b89f0bd8

View File

@ -5121,6 +5121,30 @@ class OFPPortModPropEthernet(StringifyMixin):
return buf
class OFPPortModPropOptical(StringifyMixin):
def __init__(self, type_=None, length=None, configure=None,
freq_lmda=None, fl_offset=None, grid_span=None,
tx_pwr=None):
self.type = type_
self.length = length
self.configure = configure
self.freq_lmda = freq_lmda
self.fl_offset = fl_offset
self.grid_span = grid_span
self.tx_pwr = tx_pwr
def serialize(self):
# fixup
self.length = struct.calcsize(
ofproto.OFP_PORT_MOD_PROP_OPTICAL_PACK_STR)
buf = bytearray()
msg_pack_into(ofproto.OFP_PORT_MOD_PROP_OPTICAL_PACK_STR, buf, 0,
self.type, self.length, self.configure, self.freq_lmda,
self.fl_offset, self.grid_span, self.tx_pwr)
return buf
@_set_msg_type(ofproto.OFPT_PORT_MOD)
class OFPPortMod(MsgBase):
"""