akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame^] | 3 | * Copyright (c) 2014-2018, The University of Memphis, |
Nick Gordon | f8b5bcd | 2016-08-11 15:06:50 -0500 | [diff] [blame] | 4 | * Regents of the University of California |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 5 | * |
| 6 | * This file is part of NLSR (Named-data Link State Routing). |
| 7 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 8 | * |
| 9 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 10 | * of the GNU General Public License as published by the Free Software Foundation, |
| 11 | * either version 3 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 14 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along with |
| 18 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 19 | **/ |
Nick Gordon | d0a7df3 | 2017-05-30 16:44:34 -0500 | [diff] [blame] | 20 | #include "hello-protocol.hpp" |
Junxiao Shi | 63bd034 | 2016-08-17 16:57:14 +0000 | [diff] [blame] | 21 | |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 22 | #include "hello-protocol.hpp" |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 23 | #include "nlsr.hpp" |
| 24 | #include "lsdb.hpp" |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 25 | #include "utility/name-helper.hpp" |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 26 | #include "logger.hpp" |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 27 | |
| 28 | namespace nlsr { |
| 29 | |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame^] | 30 | INIT_LOGGER(HelloProtocol); |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 31 | |
akmhoque | 93f1a07 | 2014-06-19 16:24:28 -0500 | [diff] [blame] | 32 | const std::string HelloProtocol::INFO_COMPONENT = "INFO"; |
| 33 | const std::string HelloProtocol::NLSR_COMPONENT = "NLSR"; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 34 | |
Nick Gordon | e18296c | 2017-10-11 16:05:24 -0500 | [diff] [blame] | 35 | HelloProtocol::HelloProtocol(Nlsr& nlsr, ndn::Scheduler& scheduler) |
| 36 | : m_nlsr(nlsr) |
| 37 | , m_scheduler(scheduler) |
| 38 | { |
| 39 | } |
| 40 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 41 | void |
| 42 | HelloProtocol::expressInterest(const ndn::Name& interestName, uint32_t seconds) |
| 43 | { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 44 | NLSR_LOG_DEBUG("Expressing Interest :" << interestName); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 45 | ndn::Interest i(interestName); |
| 46 | i.setInterestLifetime(ndn::time::seconds(seconds)); |
| 47 | i.setMustBeFresh(true); |
| 48 | m_nlsr.getNlsrFace().expressInterest(i, |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 49 | std::bind(&HelloProtocol::onContent, |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 50 | this, |
| 51 | _1, _2), |
Alexander Afanasyev | 1de901f | 2017-03-09 12:43:57 -0800 | [diff] [blame] | 52 | std::bind(&HelloProtocol::processInterestTimedOut, // Nack |
| 53 | this, _1), |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 54 | std::bind(&HelloProtocol::processInterestTimedOut, |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 55 | this, _1)); |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 56 | |
| 57 | // increment SENT_HELLO_INTEREST |
| 58 | hpIncrementSignal(Statistics::PacketType::SENT_HELLO_INTEREST); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | void |
| 62 | HelloProtocol::sendScheduledInterest(uint32_t seconds) |
| 63 | { |
| 64 | std::list<Adjacent> adjList = m_nlsr.getAdjacencyList().getAdjList(); |
| 65 | for (std::list<Adjacent>::iterator it = adjList.begin(); it != adjList.end(); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 66 | ++it) { |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 67 | // If this adjacency has a Face, just proceed as usual. |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 68 | if((*it).getFaceId() != 0) { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 69 | // interest name: /<neighbor>/NLSR/INFO/<router> |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 70 | ndn::Name interestName = (*it).getName() ; |
| 71 | interestName.append(NLSR_COMPONENT); |
| 72 | interestName.append(INFO_COMPONENT); |
| 73 | interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode()); |
| 74 | expressInterest(interestName, |
| 75 | m_nlsr.getConfParameter().getInterestResendTime()); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 76 | NLSR_LOG_DEBUG("Sending scheduled interest: " << interestName); |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 77 | } |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 78 | } |
| 79 | scheduleInterest(m_nlsr.getConfParameter().getInfoInterestInterval()); |
| 80 | } |
| 81 | |
| 82 | void |
| 83 | HelloProtocol::scheduleInterest(uint32_t seconds) |
| 84 | { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 85 | NLSR_LOG_DEBUG("Scheduling HELLO Interests in " << ndn::time::seconds(seconds)); |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame] | 86 | |
Vince Lehman | 7c60329 | 2014-09-11 17:48:16 -0500 | [diff] [blame] | 87 | m_scheduler.scheduleEvent(ndn::time::seconds(seconds), |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 88 | std::bind(&HelloProtocol::sendScheduledInterest, this, seconds)); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | void |
| 92 | HelloProtocol::processInterest(const ndn::Name& name, |
| 93 | const ndn::Interest& interest) |
| 94 | { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 95 | // interest name: /<neighbor>/NLSR/INFO/<router> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 96 | const ndn::Name interestName = interest.getName(); |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 97 | |
| 98 | // increment RCV_HELLO_INTEREST |
| 99 | hpIncrementSignal(Statistics::PacketType::RCV_HELLO_INTEREST); |
| 100 | |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 101 | NLSR_LOG_DEBUG("Interest Received for Name: " << interestName); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 102 | if (interestName.get(-2).toUri() != INFO_COMPONENT) { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 103 | NLSR_LOG_DEBUG("INFO_COMPONENT not found or interestName: " << interestName |
dmcoomes | 9eaf3f4 | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 104 | << " does not match expression"); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 105 | return; |
| 106 | } |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 107 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 108 | ndn::Name neighbor; |
| 109 | neighbor.wireDecode(interestName.get(-1).blockFromValue()); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 110 | NLSR_LOG_DEBUG("Neighbor: " << neighbor); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 111 | if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 112 | std::shared_ptr<ndn::Data> data = std::make_shared<ndn::Data>(); |
akmhoque | 69c9aa9 | 2014-07-23 15:15:05 -0500 | [diff] [blame] | 113 | data->setName(ndn::Name(interest.getName()).appendVersion()); |
| 114 | data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec |
| 115 | data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()), |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 116 | INFO_COMPONENT.size()); |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 117 | |
| 118 | m_nlsr.getKeyChain().sign(*data, m_nlsr.getSigningInfo()); |
| 119 | |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 120 | NLSR_LOG_DEBUG("Sending out data for name: " << interest.getName()); |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 121 | |
akmhoque | 69c9aa9 | 2014-07-23 15:15:05 -0500 | [diff] [blame] | 122 | m_nlsr.getNlsrFace().put(*data); |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 123 | // increment SENT_HELLO_DATA |
| 124 | hpIncrementSignal(Statistics::PacketType::SENT_HELLO_DATA); |
Nick Gordon | c780a69 | 2017-04-27 18:03:02 -0500 | [diff] [blame] | 125 | |
| 126 | auto adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor); |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 127 | // If this neighbor was previously inactive, send our own hello interest, too |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 128 | if (adjacent->getStatus() == Adjacent::STATUS_INACTIVE) { |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 129 | // We can only do that if the neighbor currently has a face. |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 130 | if(adjacent->getFaceId() != 0){ |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 131 | // interest name: /<neighbor>/NLSR/INFO/<router> |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 132 | ndn::Name interestName(neighbor); |
| 133 | interestName.append(NLSR_COMPONENT); |
| 134 | interestName.append(INFO_COMPONENT); |
| 135 | interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode()); |
| 136 | expressInterest(interestName, |
| 137 | m_nlsr.getConfParameter().getInterestResendTime()); |
| 138 | } |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | void |
| 144 | HelloProtocol::processInterestTimedOut(const ndn::Interest& interest) |
| 145 | { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 146 | // interest name: /<neighbor>/NLSR/INFO/<router> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 147 | const ndn::Name interestName(interest.getName()); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 148 | NLSR_LOG_DEBUG("Interest timed out for Name: " << interestName); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 149 | if (interestName.get(-2).toUri() != INFO_COMPONENT) { |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 150 | return; |
| 151 | } |
akmhoque | 93f1a07 | 2014-06-19 16:24:28 -0500 | [diff] [blame] | 152 | ndn::Name neighbor = interestName.getPrefix(-3); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 153 | NLSR_LOG_DEBUG("Neighbor: " << neighbor); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 154 | m_nlsr.getAdjacencyList().incrementTimedOutInterestCount(neighbor); |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 155 | |
| 156 | Adjacent::Status status = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor); |
| 157 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 158 | uint32_t infoIntTimedOutCount = |
| 159 | m_nlsr.getAdjacencyList().getTimedOutInterestCount(neighbor); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 160 | NLSR_LOG_DEBUG("Status: " << status); |
| 161 | NLSR_LOG_DEBUG("Info Interest Timed out: " << infoIntTimedOutCount); |
Nick Gordon | d0a7df3 | 2017-05-30 16:44:34 -0500 | [diff] [blame] | 162 | if (infoIntTimedOutCount < m_nlsr.getConfParameter().getInterestRetryNumber()) { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 163 | // interest name: /<neighbor>/NLSR/INFO/<router> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 164 | ndn::Name interestName(neighbor); |
akmhoque | 93f1a07 | 2014-06-19 16:24:28 -0500 | [diff] [blame] | 165 | interestName.append(NLSR_COMPONENT); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 166 | interestName.append(INFO_COMPONENT); |
| 167 | interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode()); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 168 | NLSR_LOG_DEBUG("Resending interest: " << interestName); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 169 | expressInterest(interestName, |
| 170 | m_nlsr.getConfParameter().getInterestResendTime()); |
| 171 | } |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 172 | else if ((status == Adjacent::STATUS_ACTIVE) && |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 173 | (infoIntTimedOutCount == m_nlsr.getConfParameter().getInterestRetryNumber())) { |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 174 | m_nlsr.getAdjacencyList().setStatusOfNeighbor(neighbor, Adjacent::STATUS_INACTIVE); |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame] | 175 | |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 176 | NLSR_LOG_DEBUG("Neighbor: " << neighbor << " status changed to INACTIVE"); |
dmcoomes | 9eaf3f4 | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 177 | |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame] | 178 | m_nlsr.getLsdb().scheduleAdjLsaBuild(); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 179 | } |
| 180 | } |
| 181 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 182 | // This is the first function that incoming Hello data will |
| 183 | // see. This checks if the data appears to be signed, and passes it |
| 184 | // on to validate the content of the data. |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 185 | void |
| 186 | HelloProtocol::onContent(const ndn::Interest& interest, const ndn::Data& data) |
| 187 | { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 188 | NLSR_LOG_DEBUG("Received data for INFO(name): " << data.getName()); |
akmhoque | dfe615f | 2014-07-27 14:12:21 -0500 | [diff] [blame] | 189 | if (data.getSignature().hasKeyLocator()) { |
| 190 | if (data.getSignature().getKeyLocator().getType() == ndn::KeyLocator::KeyLocator_Name) { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 191 | NLSR_LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName()); |
akmhoque | dfe615f | 2014-07-27 14:12:21 -0500 | [diff] [blame] | 192 | } |
| 193 | } |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 194 | m_nlsr.getValidator().validate(data, |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 195 | std::bind(&HelloProtocol::onContentValidated, this, _1), |
| 196 | std::bind(&HelloProtocol::onContentValidationFailed, |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 197 | this, _1, _2)); |
| 198 | } |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 199 | |
| 200 | void |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 201 | HelloProtocol::onContentValidated(const ndn::Data& data) |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 202 | { |
dmcoomes | 9f93666 | 2017-03-02 10:33:09 -0600 | [diff] [blame] | 203 | // data name: /<neighbor>/NLSR/INFO/<router>/<version> |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 204 | ndn::Name dataName = data.getName(); |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 205 | NLSR_LOG_DEBUG("Data validation successful for INFO(name): " << dataName); |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 206 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 207 | if (dataName.get(-3).toUri() == INFO_COMPONENT) { |
akmhoque | 93f1a07 | 2014-06-19 16:24:28 -0500 | [diff] [blame] | 208 | ndn::Name neighbor = dataName.getPrefix(-4); |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 209 | |
| 210 | Adjacent::Status oldStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor); |
| 211 | m_nlsr.getAdjacencyList().setStatusOfNeighbor(neighbor, Adjacent::STATUS_ACTIVE); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 212 | m_nlsr.getAdjacencyList().setTimedOutInterestCount(neighbor, 0); |
Vince Lehman | cb76ade | 2014-08-28 21:24:41 -0500 | [diff] [blame] | 213 | Adjacent::Status newStatus = m_nlsr.getAdjacencyList().getStatusOfNeighbor(neighbor); |
| 214 | |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 215 | NLSR_LOG_DEBUG("Neighbor : " << neighbor); |
| 216 | NLSR_LOG_DEBUG("Old Status: " << oldStatus << " New Status: " << newStatus); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 217 | // change in Adjacency list |
| 218 | if ((oldStatus - newStatus) != 0) { |
Ashlesh Gawande | c5fa320 | 2016-12-05 13:21:51 -0600 | [diff] [blame] | 219 | if (m_nlsr.getConfParameter().getHyperbolicState() == HYPERBOLIC_STATE_ON) { |
| 220 | m_nlsr.getRoutingTable().scheduleRoutingTableCalculation(m_nlsr); |
| 221 | } |
| 222 | else { |
| 223 | m_nlsr.getLsdb().scheduleAdjLsaBuild(); |
| 224 | } |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 225 | } |
| 226 | } |
Alejandro Gil Torres | e0d2048 | 2016-03-06 23:56:19 -0600 | [diff] [blame] | 227 | // increment RCV_HELLO_DATA |
| 228 | hpIncrementSignal(Statistics::PacketType::RCV_HELLO_DATA); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 229 | } |
| 230 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 231 | void |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 232 | HelloProtocol::onContentValidationFailed(const ndn::Data& data, |
| 233 | const ndn::security::v2::ValidationError& ve) |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 234 | { |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 235 | NLSR_LOG_DEBUG("Validation Error: " << ve); |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 236 | } |
| 237 | |
Nick Gordon | fad8e25 | 2016-08-11 14:21:38 -0500 | [diff] [blame] | 238 | } // namespace nlsr |