X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=cbd8928158a96392b3292f57d7a5335525a6740b;hb=1de11730e612b09e28892880c2845185497a3741;hp=15bcd13502492ca9dce35cf6f9b1f3d7c4957318;hpb=348f01e3e36b67f86ac2f9f90c7574d9e1b85d73;p=sliver-openvswitch.git diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 15bcd1350..cbd892815 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2003,6 +2003,25 @@ ofproto_port_get_cfm_fault(const struct ofproto *ofproto, uint16_t ofp_port) : -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 + * number less than 0 if CFM is not enabled on 'ofp_port'. */ +int +ofproto_port_get_cfm_remote_mpids(const struct ofproto *ofproto, + uint16_t ofp_port, const uint64_t **rmps, + size_t *n_rmps) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + + *rmps = NULL; + *n_rmps = 0; + return (ofport && ofproto->ofproto_class->get_cfm_remote_mpids + ? ofproto->ofproto_class->get_cfm_remote_mpids(ofport, rmps, + n_rmps) + : -1); +} + static int handle_aggregate_stats_request(struct ofconn *ofconn, const struct ofp_stats_msg *osm)