diff options
author | Simon Horman <horms@verge.net.au> | 2014-02-27 17:56:15 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-02-27 22:29:57 +0900 |
commit | 55b89f0bd8f41f443b3f4d924ebf25a2482092ab (patch) | |
tree | 27577800fa201abebe58580c7ea3a9f0684d589a | |
parent | 77fd41944131ae5c3f1e5e079cdc2436cc2eee63 (diff) |
of14: Add port mod optical property
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 3feb09db..86ef8912 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -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): """ |