X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.c;h=f37d8406d6147279985c81664e6fa79fb745f4d4;hb=9a9e3786b3a8065723887ab009aedb7f6d2667aa;hp=ff7f6534b746a1d3c23291b50413770dd58bd376;hpb=0f3f3c3db0a997ddb512bf9f0a9a1df7d5252f84;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index ff7f6534b..f37d8406d 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1778,43 +1778,22 @@ set_cfm(struct ofport *ofport_, const struct cfm_settings *s) return error; } -static int -get_cfm_fault(const struct ofport *ofport_) -{ - struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); - - return ofport->cfm ? cfm_get_fault(ofport->cfm) : -1; -} - -static int -get_cfm_opup(const struct ofport *ofport_) -{ - struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); - - return ofport->cfm ? cfm_get_opup(ofport->cfm) : -1; -} - -static int -get_cfm_remote_mpids(const struct ofport *ofport_, const uint64_t **rmps, - size_t *n_rmps) +static bool +get_cfm_status(const struct ofport *ofport_, + struct ofproto_cfm_status *status) { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); if (ofport->cfm) { - cfm_get_remote_mpids(ofport->cfm, rmps, n_rmps); - return 0; + status->faults = cfm_get_fault(ofport->cfm); + status->remote_opstate = cfm_get_opup(ofport->cfm); + status->health = cfm_get_health(ofport->cfm); + cfm_get_remote_mpids(ofport->cfm, &status->rmps, &status->n_rmps); + return true; } else { - return -1; + return false; } } - -static int -get_cfm_health(const struct ofport *ofport_) -{ - struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); - - return ofport->cfm ? cfm_get_health(ofport->cfm) : -1; -} /* Spanning Tree. */ @@ -8414,10 +8393,7 @@ const struct ofproto_class ofproto_dpif_class = { get_netflow_ids, set_sflow, set_cfm, - get_cfm_fault, - get_cfm_opup, - get_cfm_remote_mpids, - get_cfm_health, + get_cfm_status, set_stp, get_stp_status, set_stp_port,