From 61fe3a7b3b8b628ac70511e6af25bb9f8cb8bc2b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 7 Dec 2010 14:36:18 -0800 Subject: [PATCH] ofp-print: Print OFPUTIL_NXT_ROLE_REQUEST and OFPUTIL_NXT_ROLE_REPLY. --- lib/ofp-print.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 4f634bdf..2a6528af 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -1462,6 +1462,24 @@ ofp_print_nxt_tun_id_from_cookie(struct ds *string, ds_put_format(string, " set=%"PRIu8, ntic->set); } +static void +ofp_print_nxt_role_message(struct ds *string, + const struct nx_role_request *nrr) +{ + unsigned int role = ntohl(nrr->role); + + ds_put_cstr(string, " role="); + if (role == NX_ROLE_OTHER) { + ds_put_cstr(string, "other"); + } else if (role == NX_ROLE_MASTER) { + ds_put_cstr(string, "master"); + } else if (role == NX_ROLE_SLAVE) { + ds_put_cstr(string, "slave"); + } else { + ds_put_format(string, "%u", role); + } +} + static void ofp_print_nxt_set_flow_format(struct ds *string, const struct nxt_set_flow_format *nsff) @@ -1621,7 +1639,7 @@ ofp_to_string__(const struct ofp_header *oh, case OFPUTIL_NXT_ROLE_REQUEST: case OFPUTIL_NXT_ROLE_REPLY: - /* XXX */ + ofp_print_nxt_role_message(string, msg); break; case OFPUTIL_NXT_SET_FLOW_FORMAT: -- 2.30.2