MCPcopy Create free account
hub / github.com/SNAS/openbmp / isAddPathEnabled

Method isAddPathEnabled

Server/src/bgp/AddPathDataContainer.cpp:76–92  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

74 * \return is enabled
75 */
76bool 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}

Callers 3

parseNlriData_v4Method · 0.80

Calls 1

getAFiSafiKeyStringMethod · 0.95

Tested by

no test coverage detected