of14: Add port stats optical property
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
808a1bfdf7
commit
4e60ce00cb
@ -3871,6 +3871,39 @@ class OFPPortStatsPropEthernet(StringifyMixin):
|
||||
return ether
|
||||
|
||||
|
||||
@OFPPortStatsProp.register_type(ofproto.OFPPSPT_OPTICAL)
|
||||
class OFPPortStatsPropOptical(StringifyMixin):
|
||||
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,
|
||||
tx_pwr=None, rx_pwr=None, bias_current=None,
|
||||
temperature=None):
|
||||
self.type = type_
|
||||
self.length = length
|
||||
self.flags = flags
|
||||
self.tx_freq_lmda = tx_freq_lmda
|
||||
self.tx_offset = tx_offset
|
||||
self.tx_grid_span = tx_grid_span
|
||||
self.rx_freq_lmda = rx_freq_lmda
|
||||
self.rx_offset = rx_offset
|
||||
self.rx_grid_span = rx_grid_span
|
||||
self.tx_pwr = tx_pwr
|
||||
self.rx_pwr = rx_pwr
|
||||
self.bias_current = bias_current
|
||||
self.temperature = temperature
|
||||
|
||||
@classmethod
|
||||
def parser(cls, buf):
|
||||
optical = cls()
|
||||
(optical.type, optical.length, optical.flags,
|
||||
optical.tx_freq_lmda, optical.tx_offset, optical.tx_grid_span,
|
||||
optical.rx_freq_lmda, optical.rx_offset, optical.rx_grid_span,
|
||||
optical.tx_pwr, optical.rx_pwr, optical.bias_current,
|
||||
optical.temperature) = struct.unpack_from(
|
||||
ofproto.OFP_PORT_STATS_PROP_OPTICAL_PACK_STR, buf, 0)
|
||||
return optical
|
||||
|
||||
|
||||
class OFPPortStats(StringifyMixin):
|
||||
def __init__(self, length=None, port_no=None, duration_sec=None,
|
||||
duration_nsec=None, rx_packets=None, tx_packets=None,
|
||||
|
Loading…
Reference in New Issue
Block a user