X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=5c9ab9d31540779d617d6c8e7a55028dd325347f;hb=1c0333b6baf58cb382d78b53305bfb06149793e2;hp=8c10f19a14463002223beef9330f47850d208287;hpb=4653c5583a3ec9d7184782fee3d2f93602795686;p=sliver-openvswitch.git diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 8c10f19a1..5c9ab9d31 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2594,7 +2594,7 @@ ofproto_get_netflow_ids(const struct ofproto *ofproto, /* Checks the fault status of CFM for 'ofp_port' within 'ofproto'. Returns a * bitmask of 'cfm_fault_reason's to indicate a CFM fault (generally * indicating a connectivity problem). Returns zero if CFM is not faulted, - * and -1 if CFM is not enabled on 'port'. */ + * and -1 if CFM is not enabled on 'ofp_port'. */ int ofproto_port_get_cfm_fault(const struct ofproto *ofproto, uint16_t ofp_port) { @@ -2604,6 +2604,19 @@ ofproto_port_get_cfm_fault(const struct ofproto *ofproto, uint16_t ofp_port) : -1); } +/* Checks the operational status reported by the remote CFM endpoint of + * 'ofp_port' Returns 1 if operationally up, 0 if operationally down, and -1 + * if CFM is not enabled on 'ofp_port' or does not support operational status. + */ +int +ofproto_port_get_cfm_opup(const struct ofproto *ofproto, uint16_t ofp_port) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + return (ofport && ofproto->ofproto_class->get_cfm_opup + ? ofproto->ofproto_class->get_cfm_opup(ofport) + : -1); +} + /* Gets the MPIDs of the remote maintenance points broadcasting to 'ofp_port' * within 'ofproto'. Populates 'rmps' with an array of MPIDs owned by * 'ofproto', and 'n_rmps' with the number of MPIDs in 'rmps'. Returns a