Signed-off-by: Simon Horman <[email protected]>

---
v3
* First post
---
 ryu/ofproto/ofproto_v1_4_parser.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_4_parser.py 
b/ryu/ofproto/ofproto_v1_4_parser.py
index a1ff463..17ea978 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -3872,6 +3872,39 @@ class OFPPortStatsPropEthernet(StringifyMixin):
         return ether
 
 
[email protected]_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,
-- 
1.8.5.2


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to