Hi,
Thank you for submitting your patch!
> diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
> index f407e5a..44f611a 100644
> --- a/ryu/lib/ofctl_v1_3.py
> +++ b/ryu/lib/ofctl_v1_3.py
> @@ -1152,5 +1152,11 @@ def mod_port_behavior(dp, port_config):
> ofctl_utils.send_msg(dp, port_mod, LOG)
>
>
> +def set_role(dp, role):
> + r = UTIL.ofp_role_from_user(role.get('role',
> dp.ofproto.OFPCR_ROLE_MASTER))
> + role_request = dp.ofproto_parser.OFPRoleRequest(dp, r, 0)
> + ofctl_utils.send_msg(dp, role_request, LOG)
> +
> +
> # NOTE(jkoelker) Alias common funcitons
> send_experimenter = ofctl_utils.send_experimenter
The implementation for UTIL.ofp_role_from_user() seems not be included in your
patch.
And, the default role in OpenFlow is "OFPCR_ROLE_EQUAL",
so specifying "OFPCR_ROLE_EQUAL" is more safe in this case, I guess.
FYI, the following is an example for UTIL.ofp_role_from_user().
Could you test and merge this into your patch?
diff --git a/ryu/lib/ofctl_utils.py b/ryu/lib/ofctl_utils.py
index a09517a..fd8dfc0 100644
--- a/ryu/lib/ofctl_utils.py
+++ b/ryu/lib/ofctl_utils.py
@@ -424,3 +424,9 @@ class OFCtlUtil(object):
def ofp_queue_to_user(self, queue):
return self._reserved_num_to_user(queue, 'OFPQ_')
+
+ def ofp_role_from_user(self, role):
+ return self._reserved_num_from_user(role, 'OFPCR_ROLE_')
+
+ def ofp_role_to_user(self, role):
+ return self._reserved_num_to_user(role, 'OFPCR_ROLE_')
Thanks,
Iwase
On 2016年08月25日 17:03, 林東岳 wrote:
> Hi,
> Attachment is my patch.
> tungyueh
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel