From 7e313b90fd32248a131ee4e32a9a454aeced7af3 Mon Sep 17 00:00:00 2001 From: Yusuke Iwase Date: Wed, 22 Jul 2015 13:54:31 +0900 Subject: [PATCH] ofproto_v1_5_parser: Enable setting mask in OFPActionSetField 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 Signed-off-by: FUJITA Tomonori --- 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 6775cbff..4f173770 100644 --- a/ryu/ofproto/ofproto_v1_5_parser.py +++ b/ryu/ofproto/ofproto_v1_5_parser.py @@ -5490,11 +5490,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__() @@ -5502,7 +5505,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