* Add Add Path data to persistent storage * * \param [in] afi Afi code from RFC * \param [in] safi Safi code form RFC * \param [in] send_receive Send Recieve code from RFC * \param [in] sent_open Is obtained from sent open message. False if from recieved */
| 27 | * \param [in] sent_open Is obtained from sent open message. False if from recieved |
| 28 | */ |
| 29 | void AddPathDataContainer::addAddPath(int afi, int safi, int send_receive, bool sent_open) { |
| 30 | AddPathMap::iterator iterator = this->addPathMap.find(this->getAFiSafiKeyString(afi, safi)); |
| 31 | if(iterator == this->addPathMap.end()) { |
| 32 | sendReceiveCodesForSentAndReceivedOpenMessageStructure newStructure; |
| 33 | |
| 34 | if (sent_open) { |
| 35 | newStructure.sendReceiveCodeForSentOpenMessage = send_receive; |
| 36 | } else { |
| 37 | newStructure.sendReceiveCodeForReceivedOpenMessage = send_receive; |
| 38 | } |
| 39 | |
| 40 | this->addPathMap.insert(std::pair<std::string, sendReceiveCodesForSentAndReceivedOpenMessageStructure>( |
| 41 | this->getAFiSafiKeyString(afi, safi), |
| 42 | newStructure |
| 43 | )); |
| 44 | } else { |
| 45 | if (sent_open) { |
| 46 | iterator->second.sendReceiveCodeForSentOpenMessage = send_receive; |
| 47 | } else { |
| 48 | iterator->second.sendReceiveCodeForReceivedOpenMessage = send_receive; |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Generates unique string from AFI and SAFI combination |
no test coverage detected