* Is add path capability enabled for such AFI and SAFI * * \param [in] afi Afi code from RFC * \param [in] safi Safi code form RFC * * \return is enabled */
| 74 | * \return is enabled |
| 75 | */ |
| 76 | bool AddPathDataContainer::isAddPathEnabled(int afi, int safi) { |
| 77 | AddPathMap::iterator iterator = this->addPathMap.find(this->getAFiSafiKeyString(afi, safi)); |
| 78 | |
| 79 | if(iterator == this->addPathMap.end()) { |
| 80 | return false; |
| 81 | } else { |
| 82 | // Following the rule: |
| 83 | // add_path_<afi/safi> = true IF (SENT_OPEN has ADD-PATH sent or both) AND (RECV_OPEN has ADD-PATH recv or both) |
| 84 | return ( |
| 85 | iterator->second.sendReceiveCodeForSentOpenMessage == bgp_msg::OpenMsg::BGP_CAP_ADD_PATH_RECEIVE or |
| 86 | iterator->second.sendReceiveCodeForSentOpenMessage == bgp_msg::OpenMsg::BGP_CAP_ADD_PATH_SEND_RECEIVE |
| 87 | ) and ( |
| 88 | iterator->second.sendReceiveCodeForReceivedOpenMessage == bgp_msg::OpenMsg::BGP_CAP_ADD_PATH_SEND or |
| 89 | iterator->second.sendReceiveCodeForReceivedOpenMessage == bgp_msg::OpenMsg::BGP_CAP_ADD_PATH_SEND_RECEIVE |
| 90 | ); |
| 91 | } |
| 92 | } |
no test coverage detected