This may be used in port stats and port status messages

Signed-off-by: Simon Horman <[email protected]>
---
 ryu/ofproto/ofproto_v1_4_parser.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/ryu/ofproto/ofproto_v1_4_parser.py 
b/ryu/ofproto/ofproto_v1_4_parser.py
index 2209ff2..2fd7e18 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -869,6 +869,37 @@ class OFPPortDescPropEthernet(StringifyMixin):
         return ether
 
 
[email protected]_type(ofproto.OFPPDPT_OPTICAL)
+class OFPPortDescPropOptical(StringifyMixin):
+    def __init__(self, type_=None, length=None, supported=None,
+                 tx_min_req_lmda=None, tx_max_req_lmda=None,
+                 tx_grid_req_lmda=None, rx_min_req_lmda=None,
+                 rx_max_req_lmda=None, rx_grid_req_lmda=None,
+                 tx_pwr_min=None, tx_pwr_max=None):
+        self.type = type_
+        self.length = length
+        self.supported = supported
+        self.tx_min_req_lmda = tx_min_req_lmda
+        self.tx_max_req_lmda = tx_max_req_lmda
+        self.tx_grid_req_lmda = tx_grid_req_lmda
+        self.rx_min_req_lmda = rx_min_req_lmda
+        self.rx_max_req_lmda = rx_max_req_lmda
+        self.rx_grid_req_lmda = rx_grid_req_lmda
+        self.tx_pwr_min = tx_pwr_min
+        self.tx_pwr_max = tx_pwr_max
+
+    @classmethod
+    def parser(cls, buf):
+        optical = cls()
+        (optical.type, optical.length, optical.supported,
+         optical.tx_min_req_lmda, optical.tx_max_req_lmda,
+         optical.tx_grid_req_lmda, optical.rx_min_req_lmda,
+         optical.rx_max_req_lmda, optical.rx_grid_req_lmda,
+         optical.tx_pwr_min, optical.tx_pwr_max) = struct.unpack_from(
+            ofproto.OFP_PORT_DESC_PROP_OPTICAL_PACK_STR, buf, 0)
+        return optical
+
+
 class OFPTableModProp(OFPPropBase):
     _TYPES = {}
 
-- 
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