blob: 592b2bd4f42e3ef409976dc9dc2fd235cb1a3c4b [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 -050038void
akmhoque31d1d4b2014-05-05 22:08:14 -050039Fib::remove(const ndn::Name& name)
akmhoque53353462014-04-22 08:43:45 -050040{
akmhoque674b0b12014-05-20 14:33:28 -050041 _LOG_DEBUG("Fib::remove called");
Nick Gordonb7168472016-09-21 13:57:17 -050042 std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
akmhoque157b0a42014-05-13 00:26:37 -050043 if (it != m_table.end()) {
Vince Lehmanef21d8e2015-04-01 15:59:39 -050044 for (std::set<NextHop, NextHopComparator>::iterator nhit =
Nick Gordonb7168472016-09-21 13:57:17 -050045 (it->second).getNexthopList().getNextHops().begin();
46 nhit != (it->second).getNexthopList().getNextHops().end(); nhit++) {
akmhoque53353462014-04-22 08:43:45 -050047 //remove entry from NDN-FIB
Nick Gordond0a7df32017-05-30 16:44:34 -050048 // Only unregister the prefix if it ISN'T a neighbor.
Nick Gordonb7168472016-09-21 13:57:17 -050049 if (isPrefixUpdatable((it->second).getName())) {
50 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoquefdbddb12014-05-02 18:35:19 -050051 }
akmhoque53353462014-04-22 08:43:45 -050052 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050053 cancelEntryRefresh(it->second);
akmhoque53353462014-04-22 08:43:45 -050054 m_table.erase(it);
55 }
56}
57
Vince Lehman18841082014-08-19 17:15:24 -050058void
Vince Lehman942eb7b2014-10-02 10:09:27 -050059Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, NexthopList& hopsToAdd)
Vince Lehman18841082014-08-19 17:15:24 -050060{
61 const ndn::Name& name = entry.getName();
62
Vince Lehman942eb7b2014-10-02 10:09:27 -050063 for (NexthopList::iterator it = hopsToAdd.begin(); it != hopsToAdd.end(); ++it)
Vince Lehman18841082014-08-19 17:15:24 -050064 {
65 // Add nexthop to FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -050066 entry.getNexthopList().addNextHop(*it);
Vince Lehman18841082014-08-19 17:15:24 -050067
68 if (isPrefixUpdatable(name)) {
69 // Add nexthop to NDN-FIB
Ashlesh Gawande793e8702017-08-01 15:59:26 -050070 registerPrefix(name, ndn::util::FaceUri(it->getConnectingFaceUri()),
Vince Lehman942eb7b2014-10-02 10:09:27 -050071 it->getRouteCostAsAdjustedInteger(),
Vince Lehman18841082014-08-19 17:15:24 -050072 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
73 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
74 }
75 }
Vince Lehman942eb7b2014-10-02 10:09:27 -050076}
77
78void
Vince Lehman942eb7b2014-10-02 10:09:27 -050079Fib::update(const ndn::Name& name, NexthopList& allHops)
Vince Lehman18841082014-08-19 17:15:24 -050080{
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050081 FibEntry* entry = processUpdate(name, allHops);
82 if (entry != nullptr && !entry->getRefreshEventId()) {
83 scheduleEntryRefresh(*entry,
84 [this] (FibEntry& fibEntry) {
85 this->scheduleLoop(fibEntry);
86 });
87 }
88}
89
90FibEntry*
91Fib::processUpdate(const ndn::Name& name, NexthopList& allHops)
92{
Vince Lehman942eb7b2014-10-02 10:09:27 -050093 _LOG_DEBUG("Fib::update called");
Vince Lehman18841082014-08-19 17:15:24 -050094
Vince Lehman942eb7b2014-10-02 10:09:27 -050095 // Get the max possible faces which is the minumum of the configuration setting and
96 // the length of the list of all next hops.
97 unsigned int maxFaces = getNumberOfFacesForName(allHops);
Vince Lehman18841082014-08-19 17:15:24 -050098
Vince Lehman942eb7b2014-10-02 10:09:27 -050099 NexthopList hopsToAdd;
100 unsigned int nFaces = 0;
Vince Lehman18841082014-08-19 17:15:24 -0500101
Vince Lehman942eb7b2014-10-02 10:09:27 -0500102 // Create a list of next hops to be installed with length == maxFaces
103 for (NexthopList::iterator it = allHops.begin(); it != allHops.end() && nFaces < maxFaces;
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500104 ++it, ++nFaces) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500105 hopsToAdd.addNextHop(*it);
106 }
Vince Lehman18841082014-08-19 17:15:24 -0500107
Nick Gordonb7168472016-09-21 13:57:17 -0500108 std::map<ndn::Name, FibEntry>::iterator entryIt = m_table.find(name);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500109
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500110 // New FIB entry that has nextHops
111 if (entryIt == m_table.end() && hopsToAdd.getSize() != 0) {
Vince Lehman18841082014-08-19 17:15:24 -0500112 _LOG_DEBUG("New FIB Entry");
113
Vince Lehman18841082014-08-19 17:15:24 -0500114 FibEntry entry(name);
115
Vince Lehman942eb7b2014-10-02 10:09:27 -0500116 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500117
Nick Gordonb7168472016-09-21 13:57:17 -0500118 m_table.emplace(name, entry);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500119
120 return &m_table.find(name)->second;
akmhoque53353462014-04-22 08:43:45 -0500121 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500122 // Existing FIB entry that may or may not have nextHops
akmhoque157b0a42014-05-13 00:26:37 -0500123 else {
Vince Lehman18841082014-08-19 17:15:24 -0500124 // Existing FIB entry
125 _LOG_DEBUG("Existing FIB Entry");
Vince Lehman18841082014-08-19 17:15:24 -0500126
127 // Remove empty FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -0500128 if (hopsToAdd.getSize() == 0) {
akmhoque31d1d4b2014-05-05 22:08:14 -0500129 remove(name);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500130 return nullptr;
akmhoque53353462014-04-22 08:43:45 -0500131 }
Vince Lehman18841082014-08-19 17:15:24 -0500132
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500133 FibEntry& entry = (entryIt->second);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500134 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500135
laqinfancd7ca052017-06-02 04:57:18 -0500136 std::set<NextHop, NextHopComparator> hopsToRemove;
137 std::set_difference(entry.getNexthopList().begin(), entry.getNexthopList().end(),
138 hopsToAdd.begin(), hopsToAdd.end(),
139 std::inserter(hopsToRemove, hopsToRemove.end()), NextHopComparator());
140
141 bool isUpdatable = isPrefixUpdatable(entry.getName());
142 // Remove the uninstalled next hops from NFD and FIB entry
143 for (const auto& hop: hopsToRemove){
144 if (isUpdatable) {
145 unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
146 }
147 _LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
148 entry.getNexthopList().removeNextHop(hop);
149 }
Vince Lehman18841082014-08-19 17:15:24 -0500150
Vince Lehman18841082014-08-19 17:15:24 -0500151 // Increment sequence number
152 entry.setSeqNo(entry.getSeqNo() + 1);
153
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500154 return &(m_table.find(name)->second);
akmhoque53353462014-04-22 08:43:45 -0500155 }
156}
157
akmhoque53353462014-04-22 08:43:45 -0500158void
akmhoque31d1d4b2014-05-05 22:08:14 -0500159Fib::clean()
akmhoque53353462014-04-22 08:43:45 -0500160{
akmhoque674b0b12014-05-20 14:33:28 -0500161 _LOG_DEBUG("Fib::clean called");
Nick Gordonb7168472016-09-21 13:57:17 -0500162 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
163 it != m_table.end();
akmhoque157b0a42014-05-13 00:26:37 -0500164 ++it) {
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500165 _LOG_DEBUG("Cancelling Scheduled event. Name: " << it->second.getName());
166 cancelEntryRefresh(it->second);
Vince Lehmanef21d8e2015-04-01 15:59:39 -0500167 for (std::set<NextHop, NextHopComparator>::iterator nhit =
Nick Gordonb7168472016-09-21 13:57:17 -0500168 (it->second).getNexthopList().getNextHops().begin();
169 nhit != (it->second).getNexthopList().getNextHops().end(); nhit++) {
akmhoque53353462014-04-22 08:43:45 -0500170 //Remove entry from NDN-FIB
Nick Gordonb7168472016-09-21 13:57:17 -0500171 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoque53353462014-04-22 08:43:45 -0500172 }
173 }
akmhoque157b0a42014-05-13 00:26:37 -0500174 if (m_table.size() > 0) {
akmhoque53353462014-04-22 08:43:45 -0500175 m_table.clear();
176 }
177}
178
Vince Lehman942eb7b2014-10-02 10:09:27 -0500179unsigned int
180Fib::getNumberOfFacesForName(NexthopList& nextHopList)
akmhoque53353462014-04-22 08:43:45 -0500181{
Vince Lehman942eb7b2014-10-02 10:09:27 -0500182 uint32_t nNextHops = static_cast<uint32_t>(nextHopList.getNextHops().size());
183 uint32_t nMaxFaces = m_confParameter.getMaxFacesPerPrefix();
184
185 // Allow all faces
186 if (nMaxFaces == 0) {
187 return nNextHops;
akmhoque53353462014-04-22 08:43:45 -0500188 }
akmhoque157b0a42014-05-13 00:26:37 -0500189 else {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500190 return std::min(nNextHops, nMaxFaces);
akmhoque53353462014-04-22 08:43:45 -0500191 }
akmhoque53353462014-04-22 08:43:45 -0500192}
193
akmhoque393d4ff2014-07-16 14:27:03 -0500194bool
195Fib::isPrefixUpdatable(const ndn::Name& name) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500196 if (!m_adjacencyList.isNeighbor(name)) {
akmhoque393d4ff2014-07-16 14:27:03 -0500197 return true;
198 }
199
200 return false;
201}
202
akmhoque53353462014-04-22 08:43:45 -0500203void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500204Fib::registerPrefix(const ndn::Name& namePrefix, const ndn::util::FaceUri& faceUri,
205 uint64_t faceCost,
206 const ndn::time::milliseconds& timeout,
akmhoque060d3022014-08-12 13:35:06 -0500207 uint64_t flags, uint8_t times)
akmhoquec04e7272014-07-02 11:00:14 -0500208{
Nick Gordone9733ed2017-04-26 10:48:39 -0500209 uint64_t faceId = m_adjacencyList.getFaceId(ndn::util::FaceUri(faceUri));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500210
akmhoque102aea42014-08-04 10:22:12 -0500211 if (faceId != 0) {
akmhoque060d3022014-08-12 13:35:06 -0500212 ndn::nfd::ControlParameters faceParameters;
213 faceParameters
214 .setName(namePrefix)
215 .setFaceId(faceId)
216 .setFlags(flags)
217 .setCost(faceCost)
218 .setExpirationPeriod(timeout)
Davide Pesavento87911da2017-02-21 22:10:55 -0500219 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque060d3022014-08-12 13:35:06 -0500220
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500221 _LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
222 m_controller.start<ndn::nfd::RibRegisterCommand>(faceParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500223 std::bind(&Fib::onRegistrationSuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500224 "Successful in name registration",
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500225 faceUri),
dmcoomes9f936662017-03-02 10:33:09 -0600226 std::bind(&Fib::onRegistrationFailure,
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500227 this, _1,
akmhoque102aea42014-08-04 10:22:12 -0500228 "Failed in name registration",
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500229 faceParameters,
akmhoque060d3022014-08-12 13:35:06 -0500230 faceUri, times));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500231 }
232 else {
233 _LOG_WARN("Error: No Face Id for face uri: " << faceUri);
234 }
235}
236
237void
238Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
239 const std::string& message, const ndn::util::FaceUri& faceUri)
240{
241 _LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
242 " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
243
244 AdjacencyList::iterator adjacent = m_adjacencyList.findAdjacent(faceUri);
245 if (adjacent != m_adjacencyList.end()) {
246 adjacent->setFaceId(commandSuccessResult.getFaceId());
247 }
248
249 // Update the fast-access FaceMap with the new Face ID, too
250 m_faceMap.update(faceUri.toString(), commandSuccessResult.getFaceId());
251 m_faceMap.writeLog();
252}
253
254void
255Fib::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
256 const std::string& message,
257 const ndn::nfd::ControlParameters& parameters,
258 const ndn::util::FaceUri& faceUri,
259 uint8_t times)
260{
261 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
262 _LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
263 if (times < 3) {
264 _LOG_DEBUG("Trying to register again...");
265 registerPrefix(parameters.getName(), faceUri,
266 parameters.getCost(),
267 parameters.getExpirationPeriod(),
268 parameters.getFlags(), times+1);
269 }
270 else {
271 _LOG_DEBUG("Registration trial given up");
272 }
akmhoquefdbddb12014-05-02 18:35:19 -0500273}
akmhoque31d1d4b2014-05-05 22:08:14 -0500274
akmhoquefdbddb12014-05-02 18:35:19 -0500275void
akmhoque157b0a42014-05-13 00:26:37 -0500276Fib::unregisterPrefix(const ndn::Name& namePrefix, const std::string& faceUri)
akmhoquefdbddb12014-05-02 18:35:19 -0500277{
akmhoque157b0a42014-05-13 00:26:37 -0500278 uint32_t faceId = m_faceMap.getFaceId(faceUri);
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500279 _LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
akmhoque157b0a42014-05-13 00:26:37 -0500280 if (faceId > 0) {
281 ndn::nfd::ControlParameters controlParameters;
282 controlParameters
283 .setName(namePrefix)
284 .setFaceId(faceId)
Davide Pesavento87911da2017-02-21 22:10:55 -0500285 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque157b0a42014-05-13 00:26:37 -0500286 m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500287 std::bind(&Fib::onUnregistrationSuccess, this, _1,
288 "Successful in unregistering name"),
289 std::bind(&Fib::onUnregistrationFailure,
290 this, _1,
291 "Failed in unregistering name"));
akmhoque157b0a42014-05-13 00:26:37 -0500292 }
akmhoquefdbddb12014-05-02 18:35:19 -0500293}
294
295void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500296Fib::onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
297 const std::string& message)
298{
299 _LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
300 " Face Id: " << commandSuccessResult.getFaceId());
301}
302
303void
304Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
305 const std::string& message)
306{
307 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
308}
309
310void
akmhoque393d4ff2014-07-16 14:27:03 -0500311Fib::setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count)
akmhoque157b0a42014-05-13 00:26:37 -0500312{
313 ndn::nfd::ControlParameters parameters;
314 parameters
315 .setName(name)
316 .setStrategy(strategy);
317
318 m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
dmcoomes9f936662017-03-02 10:33:09 -0600319 std::bind(&Fib::onSetStrategySuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500320 "Successfully set strategy choice"),
dmcoomes9f936662017-03-02 10:33:09 -0600321 std::bind(&Fib::onSetStrategyFailure, this, _1,
akmhoque393d4ff2014-07-16 14:27:03 -0500322 parameters,
323 count,
akmhoque157b0a42014-05-13 00:26:37 -0500324 "Failed to set strategy choice"));
325}
326
327void
akmhoque393d4ff2014-07-16 14:27:03 -0500328Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
329 const std::string& message)
330{
331 _LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() << " "
332 << "for name: " << commandSuccessResult.getName());
333}
334
335void
Junxiao Shi63bd0342016-08-17 16:57:14 +0000336Fib::onSetStrategyFailure(const ndn::nfd::ControlResponse& response,
337 const ndn::nfd::ControlParameters& parameters,
338 uint32_t count,
339 const std::string& message)
akmhoque393d4ff2014-07-16 14:27:03 -0500340{
341 _LOG_DEBUG(message << ": " << parameters.getStrategy() << " "
342 << "for name: " << parameters.getName());
343 if (count < 3) {
344 setStrategy(parameters.getName(), parameters.getStrategy().toUri(),count+1);
345 }
346}
347
348void
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500349Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
350{
351 _LOG_DEBUG("Scheduling refresh for " << entry.getName()
352 << " Seq Num: " << entry.getSeqNo()
353 << " in " << m_refreshTime << " seconds");
354
355 entry.setRefreshEventId(m_scheduler.scheduleEvent(ndn::time::seconds(m_refreshTime),
356 std::bind(&Fib::refreshEntry, this,
357 entry.getName(), refreshCallback)));
358}
359
360void
361Fib::scheduleLoop(FibEntry& entry)
362{
363 scheduleEntryRefresh(entry,
364 std::bind(&Fib::scheduleLoop, this, _1));
365}
366
367void
368Fib::cancelEntryRefresh(const FibEntry& entry)
369{
370 _LOG_DEBUG("Cancelling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
371
372 m_scheduler.cancelEvent(entry.getRefreshEventId());
373 entry.getRefreshEventId().reset();
374}
375
376void
377Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
378{
379 std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
380
381 if (it == m_table.end()) {
382 return;
383 }
384
385 FibEntry& entry = it->second;
386 _LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
387
388 // Increment sequence number
389 entry.setSeqNo(entry.getSeqNo() + 1);
390
391 for (const NextHop& hop : entry) {
392 registerPrefix(entry.getName(),
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500393 ndn::util::FaceUri(hop.getConnectingFaceUri()),
394 hop.getRouteCostAsAdjustedInteger(),
395 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
396 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500397 }
398
399 refreshCb(entry);
400}
401
402void
akmhoque674b0b12014-05-20 14:33:28 -0500403Fib::writeLog()
404{
405 _LOG_DEBUG("-------------------FIB-----------------------------");
Nick Gordonb7168472016-09-21 13:57:17 -0500406 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
407 it != m_table.end();
akmhoque674b0b12014-05-20 14:33:28 -0500408 ++it) {
Nick Gordonb7168472016-09-21 13:57:17 -0500409 (it->second).writeLog();
akmhoque674b0b12014-05-20 14:33:28 -0500410 }
411}
akmhoquefdbddb12014-05-02 18:35:19 -0500412
Nick Gordonfad8e252016-08-11 14:21:38 -0500413} // namespace nlsr