blob: de733109171a566804e31c7c40f837cf79879b3d [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Nick Gordonfeae5572017-01-13 12:06:26 -06003 * Copyright (c) 2014-2017, The University of Memphis,
Nick Gordonf8b5bcd2016-08-11 15:06:50 -05004 * Regents of the University of California
akmhoque3d06e792014-05-27 16:23:20 -05005 *
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/>.
akmhoque3d06e792014-05-27 16:23:20 -050019 **/
Nick Gordonb7168472016-09-21 13:57:17 -050020
akmhoquefdbddb12014-05-02 18:35:19 -050021#include "fib.hpp"
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050022#include "adjacency-list.hpp"
23#include "conf-parameter.hpp"
akmhoque674b0b12014-05-20 14:33:28 -050024#include "logger.hpp"
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050025#include "nexthop-list.hpp"
26
27#include <map>
28#include <cmath>
laqinfancd7ca052017-06-02 04:57:18 -050029#include <algorithm>
30#include <iterator>
akmhoquec8a10f72014-04-25 18:42:55 -050031
akmhoque53353462014-04-22 08:43:45 -050032namespace nlsr {
33
akmhoque674b0b12014-05-20 14:33:28 -050034INIT_LOGGER("Fib");
35
akmhoque393d4ff2014-07-16 14:27:03 -050036const uint64_t Fib::GRACE_PERIOD = 10;
37
akmhoque53353462014-04-22 08:43:45 -050038using namespace std;
39using namespace ndn;
40
akmhoque53353462014-04-22 08:43:45 -050041void
akmhoque31d1d4b2014-05-05 22:08:14 -050042Fib::remove(const ndn::Name& name)
akmhoque53353462014-04-22 08:43:45 -050043{
akmhoque674b0b12014-05-20 14:33:28 -050044 _LOG_DEBUG("Fib::remove called");
Nick Gordonb7168472016-09-21 13:57:17 -050045 std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
akmhoque157b0a42014-05-13 00:26:37 -050046 if (it != m_table.end()) {
Vince Lehmanef21d8e2015-04-01 15:59:39 -050047 for (std::set<NextHop, NextHopComparator>::iterator nhit =
Nick Gordonb7168472016-09-21 13:57:17 -050048 (it->second).getNexthopList().getNextHops().begin();
49 nhit != (it->second).getNexthopList().getNextHops().end(); nhit++) {
akmhoque53353462014-04-22 08:43:45 -050050 //remove entry from NDN-FIB
Nick Gordond0a7df32017-05-30 16:44:34 -050051 // Only unregister the prefix if it ISN'T a neighbor.
Nick Gordonb7168472016-09-21 13:57:17 -050052 if (isPrefixUpdatable((it->second).getName())) {
53 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoquefdbddb12014-05-02 18:35:19 -050054 }
akmhoque53353462014-04-22 08:43:45 -050055 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050056 cancelEntryRefresh(it->second);
akmhoque53353462014-04-22 08:43:45 -050057 m_table.erase(it);
58 }
59}
60
Vince Lehman18841082014-08-19 17:15:24 -050061void
Vince Lehman942eb7b2014-10-02 10:09:27 -050062Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, NexthopList& hopsToAdd)
Vince Lehman18841082014-08-19 17:15:24 -050063{
64 const ndn::Name& name = entry.getName();
65
Vince Lehman942eb7b2014-10-02 10:09:27 -050066 for (NexthopList::iterator it = hopsToAdd.begin(); it != hopsToAdd.end(); ++it)
Vince Lehman18841082014-08-19 17:15:24 -050067 {
68 // Add nexthop to FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -050069 entry.getNexthopList().addNextHop(*it);
Vince Lehman18841082014-08-19 17:15:24 -050070
71 if (isPrefixUpdatable(name)) {
72 // Add nexthop to NDN-FIB
Ashlesh Gawande793e8702017-08-01 15:59:26 -050073 registerPrefix(name, ndn::util::FaceUri(it->getConnectingFaceUri()),
Vince Lehman942eb7b2014-10-02 10:09:27 -050074 it->getRouteCostAsAdjustedInteger(),
Vince Lehman18841082014-08-19 17:15:24 -050075 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
76 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
77 }
78 }
Vince Lehman942eb7b2014-10-02 10:09:27 -050079}
80
81void
Vince Lehman942eb7b2014-10-02 10:09:27 -050082Fib::update(const ndn::Name& name, NexthopList& allHops)
Vince Lehman18841082014-08-19 17:15:24 -050083{
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050084 FibEntry* entry = processUpdate(name, allHops);
85 if (entry != nullptr && !entry->getRefreshEventId()) {
86 scheduleEntryRefresh(*entry,
87 [this] (FibEntry& fibEntry) {
88 this->scheduleLoop(fibEntry);
89 });
90 }
91}
92
93FibEntry*
94Fib::processUpdate(const ndn::Name& name, NexthopList& allHops)
95{
Vince Lehman942eb7b2014-10-02 10:09:27 -050096 _LOG_DEBUG("Fib::update called");
Vince Lehman18841082014-08-19 17:15:24 -050097
Vince Lehman942eb7b2014-10-02 10:09:27 -050098 // Get the max possible faces which is the minumum of the configuration setting and
99 // the length of the list of all next hops.
100 unsigned int maxFaces = getNumberOfFacesForName(allHops);
Vince Lehman18841082014-08-19 17:15:24 -0500101
Vince Lehman942eb7b2014-10-02 10:09:27 -0500102 NexthopList hopsToAdd;
103 unsigned int nFaces = 0;
Vince Lehman18841082014-08-19 17:15:24 -0500104
Vince Lehman942eb7b2014-10-02 10:09:27 -0500105 // Create a list of next hops to be installed with length == maxFaces
106 for (NexthopList::iterator it = allHops.begin(); it != allHops.end() && nFaces < maxFaces;
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500107 ++it, ++nFaces) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500108 hopsToAdd.addNextHop(*it);
109 }
Vince Lehman18841082014-08-19 17:15:24 -0500110
Nick Gordonb7168472016-09-21 13:57:17 -0500111 std::map<ndn::Name, FibEntry>::iterator entryIt = m_table.find(name);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500112
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500113 // New FIB entry that has nextHops
114 if (entryIt == m_table.end() && hopsToAdd.getSize() != 0) {
Vince Lehman18841082014-08-19 17:15:24 -0500115 _LOG_DEBUG("New FIB Entry");
116
Vince Lehman18841082014-08-19 17:15:24 -0500117 FibEntry entry(name);
118
Vince Lehman942eb7b2014-10-02 10:09:27 -0500119 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500120
Nick Gordonb7168472016-09-21 13:57:17 -0500121 m_table.emplace(name, entry);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500122
123 return &m_table.find(name)->second;
akmhoque53353462014-04-22 08:43:45 -0500124 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500125 // Existing FIB entry that may or may not have nextHops
akmhoque157b0a42014-05-13 00:26:37 -0500126 else {
Vince Lehman18841082014-08-19 17:15:24 -0500127 // Existing FIB entry
128 _LOG_DEBUG("Existing FIB Entry");
Vince Lehman18841082014-08-19 17:15:24 -0500129
130 // Remove empty FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -0500131 if (hopsToAdd.getSize() == 0) {
akmhoque31d1d4b2014-05-05 22:08:14 -0500132 remove(name);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500133 return nullptr;
akmhoque53353462014-04-22 08:43:45 -0500134 }
Vince Lehman18841082014-08-19 17:15:24 -0500135
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500136 FibEntry& entry = (entryIt->second);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500137 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500138
laqinfancd7ca052017-06-02 04:57:18 -0500139 std::set<NextHop, NextHopComparator> hopsToRemove;
140 std::set_difference(entry.getNexthopList().begin(), entry.getNexthopList().end(),
141 hopsToAdd.begin(), hopsToAdd.end(),
142 std::inserter(hopsToRemove, hopsToRemove.end()), NextHopComparator());
143
144 bool isUpdatable = isPrefixUpdatable(entry.getName());
145 // Remove the uninstalled next hops from NFD and FIB entry
146 for (const auto& hop: hopsToRemove){
147 if (isUpdatable) {
148 unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
149 }
150 _LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
151 entry.getNexthopList().removeNextHop(hop);
152 }
Vince Lehman18841082014-08-19 17:15:24 -0500153
Vince Lehman18841082014-08-19 17:15:24 -0500154 // Increment sequence number
155 entry.setSeqNo(entry.getSeqNo() + 1);
156
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500157 return &(m_table.find(name)->second);
akmhoque53353462014-04-22 08:43:45 -0500158 }
159}
160
akmhoque53353462014-04-22 08:43:45 -0500161void
akmhoque31d1d4b2014-05-05 22:08:14 -0500162Fib::clean()
akmhoque53353462014-04-22 08:43:45 -0500163{
akmhoque674b0b12014-05-20 14:33:28 -0500164 _LOG_DEBUG("Fib::clean called");
Nick Gordonb7168472016-09-21 13:57:17 -0500165 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
166 it != m_table.end();
akmhoque157b0a42014-05-13 00:26:37 -0500167 ++it) {
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500168 _LOG_DEBUG("Cancelling Scheduled event. Name: " << it->second.getName());
169 cancelEntryRefresh(it->second);
Vince Lehmanef21d8e2015-04-01 15:59:39 -0500170 for (std::set<NextHop, NextHopComparator>::iterator nhit =
Nick Gordonb7168472016-09-21 13:57:17 -0500171 (it->second).getNexthopList().getNextHops().begin();
172 nhit != (it->second).getNexthopList().getNextHops().end(); nhit++) {
akmhoque53353462014-04-22 08:43:45 -0500173 //Remove entry from NDN-FIB
Nick Gordonb7168472016-09-21 13:57:17 -0500174 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoque53353462014-04-22 08:43:45 -0500175 }
176 }
akmhoque157b0a42014-05-13 00:26:37 -0500177 if (m_table.size() > 0) {
akmhoque53353462014-04-22 08:43:45 -0500178 m_table.clear();
179 }
180}
181
Vince Lehman942eb7b2014-10-02 10:09:27 -0500182unsigned int
183Fib::getNumberOfFacesForName(NexthopList& nextHopList)
akmhoque53353462014-04-22 08:43:45 -0500184{
Vince Lehman942eb7b2014-10-02 10:09:27 -0500185 uint32_t nNextHops = static_cast<uint32_t>(nextHopList.getNextHops().size());
186 uint32_t nMaxFaces = m_confParameter.getMaxFacesPerPrefix();
187
188 // Allow all faces
189 if (nMaxFaces == 0) {
190 return nNextHops;
akmhoque53353462014-04-22 08:43:45 -0500191 }
akmhoque157b0a42014-05-13 00:26:37 -0500192 else {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500193 return std::min(nNextHops, nMaxFaces);
akmhoque53353462014-04-22 08:43:45 -0500194 }
akmhoque53353462014-04-22 08:43:45 -0500195}
196
akmhoque393d4ff2014-07-16 14:27:03 -0500197bool
198Fib::isPrefixUpdatable(const ndn::Name& name) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500199 if (!m_adjacencyList.isNeighbor(name)) {
akmhoque393d4ff2014-07-16 14:27:03 -0500200 return true;
201 }
202
203 return false;
204}
205
akmhoque53353462014-04-22 08:43:45 -0500206void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500207Fib::registerPrefix(const ndn::Name& namePrefix, const ndn::util::FaceUri& faceUri,
208 uint64_t faceCost,
209 const ndn::time::milliseconds& timeout,
akmhoque060d3022014-08-12 13:35:06 -0500210 uint64_t flags, uint8_t times)
akmhoquec04e7272014-07-02 11:00:14 -0500211{
Nick Gordone9733ed2017-04-26 10:48:39 -0500212 uint64_t faceId = m_adjacencyList.getFaceId(ndn::util::FaceUri(faceUri));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500213
akmhoque102aea42014-08-04 10:22:12 -0500214 if (faceId != 0) {
akmhoque060d3022014-08-12 13:35:06 -0500215 ndn::nfd::ControlParameters faceParameters;
216 faceParameters
217 .setName(namePrefix)
218 .setFaceId(faceId)
219 .setFlags(flags)
220 .setCost(faceCost)
221 .setExpirationPeriod(timeout)
Davide Pesavento87911da2017-02-21 22:10:55 -0500222 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque060d3022014-08-12 13:35:06 -0500223
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500224 _LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
225 m_controller.start<ndn::nfd::RibRegisterCommand>(faceParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500226 std::bind(&Fib::onRegistrationSuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500227 "Successful in name registration",
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500228 faceUri),
dmcoomes9f936662017-03-02 10:33:09 -0600229 std::bind(&Fib::onRegistrationFailure,
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500230 this, _1,
akmhoque102aea42014-08-04 10:22:12 -0500231 "Failed in name registration",
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500232 faceParameters,
akmhoque060d3022014-08-12 13:35:06 -0500233 faceUri, times));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500234 }
235 else {
236 _LOG_WARN("Error: No Face Id for face uri: " << faceUri);
237 }
238}
239
240void
241Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
242 const std::string& message, const ndn::util::FaceUri& faceUri)
243{
244 _LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
245 " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
246
247 AdjacencyList::iterator adjacent = m_adjacencyList.findAdjacent(faceUri);
248 if (adjacent != m_adjacencyList.end()) {
249 adjacent->setFaceId(commandSuccessResult.getFaceId());
250 }
251
252 // Update the fast-access FaceMap with the new Face ID, too
253 m_faceMap.update(faceUri.toString(), commandSuccessResult.getFaceId());
254 m_faceMap.writeLog();
255}
256
257void
258Fib::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
259 const std::string& message,
260 const ndn::nfd::ControlParameters& parameters,
261 const ndn::util::FaceUri& faceUri,
262 uint8_t times)
263{
264 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
265 _LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
266 if (times < 3) {
267 _LOG_DEBUG("Trying to register again...");
268 registerPrefix(parameters.getName(), faceUri,
269 parameters.getCost(),
270 parameters.getExpirationPeriod(),
271 parameters.getFlags(), times+1);
272 }
273 else {
274 _LOG_DEBUG("Registration trial given up");
275 }
akmhoquefdbddb12014-05-02 18:35:19 -0500276}
akmhoque31d1d4b2014-05-05 22:08:14 -0500277
akmhoquefdbddb12014-05-02 18:35:19 -0500278void
akmhoque157b0a42014-05-13 00:26:37 -0500279Fib::unregisterPrefix(const ndn::Name& namePrefix, const std::string& faceUri)
akmhoquefdbddb12014-05-02 18:35:19 -0500280{
akmhoque157b0a42014-05-13 00:26:37 -0500281 uint32_t faceId = m_faceMap.getFaceId(faceUri);
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500282 _LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
akmhoque157b0a42014-05-13 00:26:37 -0500283 if (faceId > 0) {
284 ndn::nfd::ControlParameters controlParameters;
285 controlParameters
286 .setName(namePrefix)
287 .setFaceId(faceId)
Davide Pesavento87911da2017-02-21 22:10:55 -0500288 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque157b0a42014-05-13 00:26:37 -0500289 m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500290 std::bind(&Fib::onUnregistrationSuccess, this, _1,
291 "Successful in unregistering name"),
292 std::bind(&Fib::onUnregistrationFailure,
293 this, _1,
294 "Failed in unregistering name"));
akmhoque157b0a42014-05-13 00:26:37 -0500295 }
akmhoquefdbddb12014-05-02 18:35:19 -0500296}
297
298void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500299Fib::onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
300 const std::string& message)
301{
302 _LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
303 " Face Id: " << commandSuccessResult.getFaceId());
304}
305
306void
307Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
308 const std::string& message)
309{
310 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
311}
312
313void
akmhoque393d4ff2014-07-16 14:27:03 -0500314Fib::setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count)
akmhoque157b0a42014-05-13 00:26:37 -0500315{
316 ndn::nfd::ControlParameters parameters;
317 parameters
318 .setName(name)
319 .setStrategy(strategy);
320
321 m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
dmcoomes9f936662017-03-02 10:33:09 -0600322 std::bind(&Fib::onSetStrategySuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500323 "Successfully set strategy choice"),
dmcoomes9f936662017-03-02 10:33:09 -0600324 std::bind(&Fib::onSetStrategyFailure, this, _1,
akmhoque393d4ff2014-07-16 14:27:03 -0500325 parameters,
326 count,
akmhoque157b0a42014-05-13 00:26:37 -0500327 "Failed to set strategy choice"));
328}
329
330void
akmhoque393d4ff2014-07-16 14:27:03 -0500331Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
332 const std::string& message)
333{
334 _LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() << " "
335 << "for name: " << commandSuccessResult.getName());
336}
337
338void
Junxiao Shi63bd0342016-08-17 16:57:14 +0000339Fib::onSetStrategyFailure(const ndn::nfd::ControlResponse& response,
340 const ndn::nfd::ControlParameters& parameters,
341 uint32_t count,
342 const std::string& message)
akmhoque393d4ff2014-07-16 14:27:03 -0500343{
344 _LOG_DEBUG(message << ": " << parameters.getStrategy() << " "
345 << "for name: " << parameters.getName());
346 if (count < 3) {
347 setStrategy(parameters.getName(), parameters.getStrategy().toUri(),count+1);
348 }
349}
350
351void
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500352Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
353{
354 _LOG_DEBUG("Scheduling refresh for " << entry.getName()
355 << " Seq Num: " << entry.getSeqNo()
356 << " in " << m_refreshTime << " seconds");
357
358 entry.setRefreshEventId(m_scheduler.scheduleEvent(ndn::time::seconds(m_refreshTime),
359 std::bind(&Fib::refreshEntry, this,
360 entry.getName(), refreshCallback)));
361}
362
363void
364Fib::scheduleLoop(FibEntry& entry)
365{
366 scheduleEntryRefresh(entry,
367 std::bind(&Fib::scheduleLoop, this, _1));
368}
369
370void
371Fib::cancelEntryRefresh(const FibEntry& entry)
372{
373 _LOG_DEBUG("Cancelling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
374
375 m_scheduler.cancelEvent(entry.getRefreshEventId());
376 entry.getRefreshEventId().reset();
377}
378
379void
380Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
381{
382 std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
383
384 if (it == m_table.end()) {
385 return;
386 }
387
388 FibEntry& entry = it->second;
389 _LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
390
391 // Increment sequence number
392 entry.setSeqNo(entry.getSeqNo() + 1);
393
394 for (const NextHop& hop : entry) {
395 registerPrefix(entry.getName(),
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500396 ndn::util::FaceUri(hop.getConnectingFaceUri()),
397 hop.getRouteCostAsAdjustedInteger(),
398 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
399 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500400 }
401
402 refreshCb(entry);
403}
404
405void
akmhoque674b0b12014-05-20 14:33:28 -0500406Fib::writeLog()
407{
408 _LOG_DEBUG("-------------------FIB-----------------------------");
Nick Gordonb7168472016-09-21 13:57:17 -0500409 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
410 it != m_table.end();
akmhoque674b0b12014-05-20 14:33:28 -0500411 ++it) {
Nick Gordonb7168472016-09-21 13:57:17 -0500412 (it->second).writeLog();
akmhoque674b0b12014-05-20 14:33:28 -0500413 }
414}
akmhoquefdbddb12014-05-02 18:35:19 -0500415
Nick Gordonfad8e252016-08-11 14:21:38 -0500416} // namespace nlsr