OpenFlow Sepc 1.5 allows wildcard to be used in set-field
action (EXT-314).
This patch enables setting mask in set-field action.

Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/ofproto/ofproto_v1_5_parser.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_5_parser.py 
b/ryu/ofproto/ofproto_v1_5_parser.py
index 308e573..91da3a8 100644
--- a/ryu/ofproto/ofproto_v1_5_parser.py
+++ b/ryu/ofproto/ofproto_v1_5_parser.py
@@ -5445,11 +5445,14 @@ class OFPActionSetField(OFPAction):
 
     This action modifies a header field in the packet.
 
-    The set of keywords available for this is same as OFPMatch.
+    The set of keywords available for this is same as OFPMatch
+    which including with/without mask.
 
     Example::
 
-        set_field = OFPActionSetField(eth_src="00:00:00:00:00")
+        set_field = OFPActionSetField(eth_src="00:00:00:00:00:00")
+        set_field = OFPActionSetField(ipv4_src=("192.168.100.0",
+                                                "255.255.255.0"))
     """
     def __init__(self, field=None, **kwargs):
         super(OFPActionSetField, self).__init__()
@@ -5457,7 +5460,6 @@ class OFPActionSetField(OFPAction):
         key = list(kwargs.keys())[0]
         value = kwargs[key]
         assert isinstance(key, (str, six.text_type))
-        assert not isinstance(value, tuple)  # no mask
         self.key = key
         self.value = value
 
-- 
1.9.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to