blob: 0eb6d1688103fd30a277bbfc410ecd44f53716d4 [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 Gordonb7168472016-09-21 13:57:17 -050051 if (isPrefixUpdatable((it->second).getName())) {
52 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoquefdbddb12014-05-02 18:35:19 -050053 }
akmhoque53353462014-04-22 08:43:45 -050054 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050055 cancelEntryRefresh(it->second);
akmhoque53353462014-04-22 08:43:45 -050056 m_table.erase(it);
57 }
58}
59
Vince Lehman18841082014-08-19 17:15:24 -050060void
Vince Lehman942eb7b2014-10-02 10:09:27 -050061Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, NexthopList& hopsToAdd)
Vince Lehman18841082014-08-19 17:15:24 -050062{
63 const ndn::Name& name = entry.getName();
64
Vince Lehman942eb7b2014-10-02 10:09:27 -050065 for (NexthopList::iterator it = hopsToAdd.begin(); it != hopsToAdd.end(); ++it)
Vince Lehman18841082014-08-19 17:15:24 -050066 {
67 // Add nexthop to FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -050068 entry.getNexthopList().addNextHop(*it);
Vince Lehman18841082014-08-19 17:15:24 -050069
70 if (isPrefixUpdatable(name)) {
71 // Add nexthop to NDN-FIB
Ashlesh Gawande793e8702017-08-01 15:59:26 -050072 registerPrefix(name, ndn::util::FaceUri(it->getConnectingFaceUri()),
Vince Lehman942eb7b2014-10-02 10:09:27 -050073 it->getRouteCostAsAdjustedInteger(),
Vince Lehman18841082014-08-19 17:15:24 -050074 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
75 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
76 }
77 }
Vince Lehman942eb7b2014-10-02 10:09:27 -050078}
79
80void
Vince Lehman942eb7b2014-10-02 10:09:27 -050081Fib::update(const ndn::Name& name, NexthopList& allHops)
Vince Lehman18841082014-08-19 17:15:24 -050082{
Muktadir Chowdhury3be64662015-05-01 14:50:53 -050083 FibEntry* entry = processUpdate(name, allHops);
84 if (entry != nullptr && !entry->getRefreshEventId()) {
85 scheduleEntryRefresh(*entry,
86 [this] (FibEntry& fibEntry) {
87 this->scheduleLoop(fibEntry);
88 });
89 }
90}
91
92FibEntry*
93Fib::processUpdate(const ndn::Name& name, NexthopList& allHops)
94{
Vince Lehman942eb7b2014-10-02 10:09:27 -050095 _LOG_DEBUG("Fib::update called");
Vince Lehman18841082014-08-19 17:15:24 -050096
Vince Lehman942eb7b2014-10-02 10:09:27 -050097 // Get the max possible faces which is the minumum of the configuration setting and
98 // the length of the list of all next hops.
99 unsigned int maxFaces = getNumberOfFacesForName(allHops);
Vince Lehman18841082014-08-19 17:15:24 -0500100
Vince Lehman942eb7b2014-10-02 10:09:27 -0500101 NexthopList hopsToAdd;
102 unsigned int nFaces = 0;
Vince Lehman18841082014-08-19 17:15:24 -0500103
Vince Lehman942eb7b2014-10-02 10:09:27 -0500104 // Create a list of next hops to be installed with length == maxFaces
105 for (NexthopList::iterator it = allHops.begin(); it != allHops.end() && nFaces < maxFaces;
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500106 ++it, ++nFaces) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500107 hopsToAdd.addNextHop(*it);
108 }
Vince Lehman18841082014-08-19 17:15:24 -0500109
Nick Gordonb7168472016-09-21 13:57:17 -0500110 std::map<ndn::Name, FibEntry>::iterator entryIt = m_table.find(name);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500111
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500112 // New FIB entry that has nextHops
113 if (entryIt == m_table.end() && hopsToAdd.getSize() != 0) {
Vince Lehman18841082014-08-19 17:15:24 -0500114 _LOG_DEBUG("New FIB Entry");
115
Vince Lehman18841082014-08-19 17:15:24 -0500116 FibEntry entry(name);
117
Vince Lehman942eb7b2014-10-02 10:09:27 -0500118 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500119
Nick Gordonb7168472016-09-21 13:57:17 -0500120 m_table.emplace(name, entry);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500121
122 return &m_table.find(name)->second;
akmhoque53353462014-04-22 08:43:45 -0500123 }
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500124 // Existing FIB entry that may or may not have nextHops
akmhoque157b0a42014-05-13 00:26:37 -0500125 else {
Vince Lehman18841082014-08-19 17:15:24 -0500126 // Existing FIB entry
127 _LOG_DEBUG("Existing FIB Entry");
Vince Lehman18841082014-08-19 17:15:24 -0500128
129 // Remove empty FIB entry
Vince Lehman942eb7b2014-10-02 10:09:27 -0500130 if (hopsToAdd.getSize() == 0) {
akmhoque31d1d4b2014-05-05 22:08:14 -0500131 remove(name);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500132 return nullptr;
akmhoque53353462014-04-22 08:43:45 -0500133 }
Vince Lehman18841082014-08-19 17:15:24 -0500134
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500135 FibEntry& entry = (entryIt->second);
Vince Lehman942eb7b2014-10-02 10:09:27 -0500136 addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
Vince Lehman18841082014-08-19 17:15:24 -0500137
laqinfancd7ca052017-06-02 04:57:18 -0500138 std::set<NextHop, NextHopComparator> hopsToRemove;
139 std::set_difference(entry.getNexthopList().begin(), entry.getNexthopList().end(),
140 hopsToAdd.begin(), hopsToAdd.end(),
141 std::inserter(hopsToRemove, hopsToRemove.end()), NextHopComparator());
142
143 bool isUpdatable = isPrefixUpdatable(entry.getName());
144 // Remove the uninstalled next hops from NFD and FIB entry
145 for (const auto& hop: hopsToRemove){
146 if (isUpdatable) {
147 unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
148 }
149 _LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
150 entry.getNexthopList().removeNextHop(hop);
151 }
Vince Lehman18841082014-08-19 17:15:24 -0500152
Vince Lehman18841082014-08-19 17:15:24 -0500153 // Increment sequence number
154 entry.setSeqNo(entry.getSeqNo() + 1);
155
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500156 return &(m_table.find(name)->second);
akmhoque53353462014-04-22 08:43:45 -0500157 }
158}
159
akmhoque53353462014-04-22 08:43:45 -0500160void
akmhoque31d1d4b2014-05-05 22:08:14 -0500161Fib::clean()
akmhoque53353462014-04-22 08:43:45 -0500162{
akmhoque674b0b12014-05-20 14:33:28 -0500163 _LOG_DEBUG("Fib::clean called");
Nick Gordonb7168472016-09-21 13:57:17 -0500164 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
165 it != m_table.end();
akmhoque157b0a42014-05-13 00:26:37 -0500166 ++it) {
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500167 _LOG_DEBUG("Cancelling Scheduled event. Name: " << it->second.getName());
168 cancelEntryRefresh(it->second);
Vince Lehmanef21d8e2015-04-01 15:59:39 -0500169 for (std::set<NextHop, NextHopComparator>::iterator nhit =
Nick Gordonb7168472016-09-21 13:57:17 -0500170 (it->second).getNexthopList().getNextHops().begin();
171 nhit != (it->second).getNexthopList().getNextHops().end(); nhit++) {
akmhoque53353462014-04-22 08:43:45 -0500172 //Remove entry from NDN-FIB
Nick Gordonb7168472016-09-21 13:57:17 -0500173 unregisterPrefix((it->second).getName(), nhit->getConnectingFaceUri());
akmhoque53353462014-04-22 08:43:45 -0500174 }
175 }
akmhoque157b0a42014-05-13 00:26:37 -0500176 if (m_table.size() > 0) {
akmhoque53353462014-04-22 08:43:45 -0500177 m_table.clear();
178 }
179}
180
Vince Lehman942eb7b2014-10-02 10:09:27 -0500181unsigned int
182Fib::getNumberOfFacesForName(NexthopList& nextHopList)
akmhoque53353462014-04-22 08:43:45 -0500183{
Vince Lehman942eb7b2014-10-02 10:09:27 -0500184 uint32_t nNextHops = static_cast<uint32_t>(nextHopList.getNextHops().size());
185 uint32_t nMaxFaces = m_confParameter.getMaxFacesPerPrefix();
186
187 // Allow all faces
188 if (nMaxFaces == 0) {
189 return nNextHops;
akmhoque53353462014-04-22 08:43:45 -0500190 }
akmhoque157b0a42014-05-13 00:26:37 -0500191 else {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500192 return std::min(nNextHops, nMaxFaces);
akmhoque53353462014-04-22 08:43:45 -0500193 }
akmhoque53353462014-04-22 08:43:45 -0500194}
195
akmhoque393d4ff2014-07-16 14:27:03 -0500196bool
197Fib::isPrefixUpdatable(const ndn::Name& name) {
Vince Lehman942eb7b2014-10-02 10:09:27 -0500198 if (!m_adjacencyList.isNeighbor(name)) {
akmhoque393d4ff2014-07-16 14:27:03 -0500199 return true;
200 }
201
202 return false;
203}
204
akmhoque53353462014-04-22 08:43:45 -0500205void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500206Fib::registerPrefix(const ndn::Name& namePrefix, const ndn::util::FaceUri& faceUri,
207 uint64_t faceCost,
208 const ndn::time::milliseconds& timeout,
akmhoque060d3022014-08-12 13:35:06 -0500209 uint64_t flags, uint8_t times)
akmhoquec04e7272014-07-02 11:00:14 -0500210{
Nick Gordone9733ed2017-04-26 10:48:39 -0500211 uint64_t faceId = m_adjacencyList.getFaceId(ndn::util::FaceUri(faceUri));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500212
akmhoque102aea42014-08-04 10:22:12 -0500213 if (faceId != 0) {
akmhoque060d3022014-08-12 13:35:06 -0500214 ndn::nfd::ControlParameters faceParameters;
215 faceParameters
216 .setName(namePrefix)
217 .setFaceId(faceId)
218 .setFlags(flags)
219 .setCost(faceCost)
220 .setExpirationPeriod(timeout)
Davide Pesavento87911da2017-02-21 22:10:55 -0500221 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque060d3022014-08-12 13:35:06 -0500222
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500223 _LOG_DEBUG("Registering prefix: " << faceParameters.getName() << " faceUri: " << faceUri);
224 m_controller.start<ndn::nfd::RibRegisterCommand>(faceParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500225 std::bind(&Fib::onRegistrationSuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500226 "Successful in name registration",
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500227 faceUri),
dmcoomes9f936662017-03-02 10:33:09 -0600228 std::bind(&Fib::onRegistrationFailure,
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500229 this, _1,
akmhoque102aea42014-08-04 10:22:12 -0500230 "Failed in name registration",
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500231 faceParameters,
akmhoque060d3022014-08-12 13:35:06 -0500232 faceUri, times));
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500233 }
234 else {
235 _LOG_WARN("Error: No Face Id for face uri: " << faceUri);
236 }
237}
238
239void
240Fib::onRegistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
241 const std::string& message, const ndn::util::FaceUri& faceUri)
242{
243 _LOG_DEBUG(message << ": " << commandSuccessResult.getName() <<
244 " Face Uri: " << faceUri << " faceId: " << commandSuccessResult.getFaceId());
245
246 AdjacencyList::iterator adjacent = m_adjacencyList.findAdjacent(faceUri);
247 if (adjacent != m_adjacencyList.end()) {
248 adjacent->setFaceId(commandSuccessResult.getFaceId());
249 }
250
251 // Update the fast-access FaceMap with the new Face ID, too
252 m_faceMap.update(faceUri.toString(), commandSuccessResult.getFaceId());
253 m_faceMap.writeLog();
254}
255
256void
257Fib::onRegistrationFailure(const ndn::nfd::ControlResponse& response,
258 const std::string& message,
259 const ndn::nfd::ControlParameters& parameters,
260 const ndn::util::FaceUri& faceUri,
261 uint8_t times)
262{
263 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
264 _LOG_DEBUG("Prefix: " << parameters.getName() << " failed for: " << times);
265 if (times < 3) {
266 _LOG_DEBUG("Trying to register again...");
267 registerPrefix(parameters.getName(), faceUri,
268 parameters.getCost(),
269 parameters.getExpirationPeriod(),
270 parameters.getFlags(), times+1);
271 }
272 else {
273 _LOG_DEBUG("Registration trial given up");
274 }
akmhoquefdbddb12014-05-02 18:35:19 -0500275}
akmhoque31d1d4b2014-05-05 22:08:14 -0500276
akmhoquefdbddb12014-05-02 18:35:19 -0500277void
akmhoque157b0a42014-05-13 00:26:37 -0500278Fib::unregisterPrefix(const ndn::Name& namePrefix, const std::string& faceUri)
akmhoquefdbddb12014-05-02 18:35:19 -0500279{
akmhoque157b0a42014-05-13 00:26:37 -0500280 uint32_t faceId = m_faceMap.getFaceId(faceUri);
akmhoqueb5b3b4f2014-07-23 16:36:51 -0500281 _LOG_DEBUG("Unregister prefix: " << namePrefix << " Face Uri: " << faceUri);
akmhoque157b0a42014-05-13 00:26:37 -0500282 if (faceId > 0) {
283 ndn::nfd::ControlParameters controlParameters;
284 controlParameters
285 .setName(namePrefix)
286 .setFaceId(faceId)
Davide Pesavento87911da2017-02-21 22:10:55 -0500287 .setOrigin(ndn::nfd::ROUTE_ORIGIN_NLSR);
akmhoque157b0a42014-05-13 00:26:37 -0500288 m_controller.start<ndn::nfd::RibUnregisterCommand>(controlParameters,
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500289 std::bind(&Fib::onUnregistrationSuccess, this, _1,
290 "Successful in unregistering name"),
291 std::bind(&Fib::onUnregistrationFailure,
292 this, _1,
293 "Failed in unregistering name"));
akmhoque157b0a42014-05-13 00:26:37 -0500294 }
akmhoquefdbddb12014-05-02 18:35:19 -0500295}
296
297void
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500298Fib::onUnregistrationSuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
299 const std::string& message)
300{
301 _LOG_DEBUG("Unregister successful Prefix: " << commandSuccessResult.getName() <<
302 " Face Id: " << commandSuccessResult.getFaceId());
303}
304
305void
306Fib::onUnregistrationFailure(const ndn::nfd::ControlResponse& response,
307 const std::string& message)
308{
309 _LOG_DEBUG(message << ": " << response.getText() << " (code: " << response.getCode() << ")");
310}
311
312void
akmhoque393d4ff2014-07-16 14:27:03 -0500313Fib::setStrategy(const ndn::Name& name, const std::string& strategy, uint32_t count)
akmhoque157b0a42014-05-13 00:26:37 -0500314{
315 ndn::nfd::ControlParameters parameters;
316 parameters
317 .setName(name)
318 .setStrategy(strategy);
319
320 m_controller.start<ndn::nfd::StrategyChoiceSetCommand>(parameters,
dmcoomes9f936662017-03-02 10:33:09 -0600321 std::bind(&Fib::onSetStrategySuccess, this, _1,
akmhoque157b0a42014-05-13 00:26:37 -0500322 "Successfully set strategy choice"),
dmcoomes9f936662017-03-02 10:33:09 -0600323 std::bind(&Fib::onSetStrategyFailure, this, _1,
akmhoque393d4ff2014-07-16 14:27:03 -0500324 parameters,
325 count,
akmhoque157b0a42014-05-13 00:26:37 -0500326 "Failed to set strategy choice"));
327}
328
329void
akmhoque393d4ff2014-07-16 14:27:03 -0500330Fib::onSetStrategySuccess(const ndn::nfd::ControlParameters& commandSuccessResult,
331 const std::string& message)
332{
333 _LOG_DEBUG(message << ": " << commandSuccessResult.getStrategy() << " "
334 << "for name: " << commandSuccessResult.getName());
335}
336
337void
Junxiao Shi63bd0342016-08-17 16:57:14 +0000338Fib::onSetStrategyFailure(const ndn::nfd::ControlResponse& response,
339 const ndn::nfd::ControlParameters& parameters,
340 uint32_t count,
341 const std::string& message)
akmhoque393d4ff2014-07-16 14:27:03 -0500342{
343 _LOG_DEBUG(message << ": " << parameters.getStrategy() << " "
344 << "for name: " << parameters.getName());
345 if (count < 3) {
346 setStrategy(parameters.getName(), parameters.getStrategy().toUri(),count+1);
347 }
348}
349
350void
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500351Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
352{
353 _LOG_DEBUG("Scheduling refresh for " << entry.getName()
354 << " Seq Num: " << entry.getSeqNo()
355 << " in " << m_refreshTime << " seconds");
356
357 entry.setRefreshEventId(m_scheduler.scheduleEvent(ndn::time::seconds(m_refreshTime),
358 std::bind(&Fib::refreshEntry, this,
359 entry.getName(), refreshCallback)));
360}
361
362void
363Fib::scheduleLoop(FibEntry& entry)
364{
365 scheduleEntryRefresh(entry,
366 std::bind(&Fib::scheduleLoop, this, _1));
367}
368
369void
370Fib::cancelEntryRefresh(const FibEntry& entry)
371{
372 _LOG_DEBUG("Cancelling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
373
374 m_scheduler.cancelEvent(entry.getRefreshEventId());
375 entry.getRefreshEventId().reset();
376}
377
378void
379Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
380{
381 std::map<ndn::Name, FibEntry>::iterator it = m_table.find(name);
382
383 if (it == m_table.end()) {
384 return;
385 }
386
387 FibEntry& entry = it->second;
388 _LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
389
390 // Increment sequence number
391 entry.setSeqNo(entry.getSeqNo() + 1);
392
393 for (const NextHop& hop : entry) {
394 registerPrefix(entry.getName(),
Ashlesh Gawande793e8702017-08-01 15:59:26 -0500395 ndn::util::FaceUri(hop.getConnectingFaceUri()),
396 hop.getRouteCostAsAdjustedInteger(),
397 ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
398 ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
Muktadir Chowdhury3be64662015-05-01 14:50:53 -0500399 }
400
401 refreshCb(entry);
402}
403
404void
akmhoque674b0b12014-05-20 14:33:28 -0500405Fib::writeLog()
406{
407 _LOG_DEBUG("-------------------FIB-----------------------------");
Nick Gordonb7168472016-09-21 13:57:17 -0500408 for (std::map<ndn::Name, FibEntry>::iterator it = m_table.begin();
409 it != m_table.end();
akmhoque674b0b12014-05-20 14:33:28 -0500410 ++it) {
Nick Gordonb7168472016-09-21 13:57:17 -0500411 (it->second).writeLog();
akmhoque674b0b12014-05-20 14:33:28 -0500412 }
413}
akmhoquefdbddb12014-05-02 18:35:19 -0500414
Nick Gordonfad8e252016-08-11 14:21:38 -0500415} // namespace nlsr