blob: c3ed42042b71d5b4ce9b9921e40d011c9344816c [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Nick Gordonc6a85222017-01-03 16:54:34 -06003 * Copyright (c) 2014-2017, The University of Memphis,
Vince Lehmanc2e51f62015-01-20 15:03:11 -06004 * Regents of the University of California,
5 * Arizona Board of Regents.
akmhoque3d06e792014-05-27 16:23:20 -05006 *
7 * This file is part of NLSR (Named-data Link State Routing).
8 * See AUTHORS.md for complete list of NLSR authors and contributors.
9 *
10 * NLSR is free software: you can redistribute it and/or modify it under the terms
11 * of the GNU General Public License as published by the Free Software Foundation,
12 * either version 3 of the License, or (at your option) any later version.
13 *
14 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 * PURPOSE. See the GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
akmhoque3d06e792014-05-27 16:23:20 -050020 **/
Vince Lehmanc2e51f62015-01-20 15:03:11 -060021
dmcoomes9f936662017-03-02 10:33:09 -060022#ifndef NLSR_NLSR_HPP
23#define NLSR_NLSR_HPP
akmhoque298385a2014-02-13 14:13:09 -060024
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050025#include "adjacency-list.hpp"
Vince Lehman0a7da612014-10-29 14:39:29 -050026#include "common.hpp"
akmhoque53353462014-04-22 08:43:45 -050027#include "conf-parameter.hpp"
akmhoque31d1d4b2014-05-05 22:08:14 -050028#include "hello-protocol.hpp"
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050029#include "lsdb.hpp"
30#include "name-prefix-list.hpp"
Vince Lehman7b616582014-10-17 16:25:39 -050031#include "test-access-control.hpp"
Yingdi Yu20e3a6e2014-05-26 23:16:10 -070032#include "validator.hpp"
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050033#include "publisher/lsdb-dataset-interest-handler.hpp"
34#include "route/fib.hpp"
35#include "route/name-prefix-table.hpp"
36#include "route/routing-table.hpp"
37#include "security/certificate-store.hpp"
38#include "update/prefix-update-processor.hpp"
Nick Gordon4d2c6c02017-01-20 13:18:46 -060039#include "update/nfd-rib-command-processor.hpp"
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050040#include "utility/name-helper.hpp"
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -060041#include "stats-collector.hpp"
Yingdi Yu20e3a6e2014-05-26 23:16:10 -070042
Nick Gordond0a7df32017-05-30 16:44:34 -050043#include <boost/cstdint.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060044#include <stdexcept>
Nick Gordond0a7df32017-05-30 16:44:34 -050045#include <boost/throw_exception.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060046
47#include <ndn-cxx/face.hpp>
48#include <ndn-cxx/security/key-chain.hpp>
49#include <ndn-cxx/security/certificate-cache-ttl.hpp>
50#include <ndn-cxx/util/scheduler.hpp>
51#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
52#include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
53#include <ndn-cxx/mgmt/dispatcher.hpp>
54#include <ndn-cxx/mgmt/nfd/face-status.hpp>
55#include <ndn-cxx/data.hpp>
56#include <ndn-cxx/encoding/block.hpp>
57
akmhoque53353462014-04-22 08:43:45 -050058namespace nlsr {
59
Yingdi Yu20e3a6e2014-05-26 23:16:10 -070060static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast");
61
akmhoque53353462014-04-22 08:43:45 -050062class Nlsr
63{
Nick Gordond5c1a372016-10-31 13:56:23 -050064public:
65 using FetchDatasetCallback = std::function<void(const std::vector<ndn::nfd::FaceStatus>&)>;
66 using FetchDatasetTimeoutCallback = std::function<void(uint32_t, const std::string&)>;
Nick Gordon9461afb2017-04-25 15:54:50 -050067
akmhoquefdbddb12014-05-02 18:35:19 -050068 class Error : public std::runtime_error
69 {
70 public:
71 explicit
72 Error(const std::string& what)
73 : std::runtime_error(what)
74 {
75 }
76 };
77
Laqin Fana4cf4022017-01-03 18:57:35 +000078 Nlsr(boost::asio::io_service& ioService, ndn::Scheduler& scheduler, ndn::Face& face, ndn::KeyChain& keyChain);
akmhoque298385a2014-02-13 14:13:09 -060079
akmhoque53353462014-04-22 08:43:45 -050080 void
81 registrationFailed(const ndn::Name& name);
82
83 void
akmhoque157b0a42014-05-13 00:26:37 -050084 onRegistrationSuccess(const ndn::Name& name);
85
86 void
alvy297f4162015-03-03 17:15:33 -060087 onLocalhostRegistrationSuccess(const ndn::Name& name);
88
89 void
akmhoque31d1d4b2014-05-05 22:08:14 -050090 setInfoInterestFilter();
91
92 void
93 setLsaInterestFilter();
akmhoque53353462014-04-22 08:43:45 -050094
95 void
96 startEventLoop();
97
akmhoque53353462014-04-22 08:43:45 -050098 std::string
akmhoquefdbddb12014-05-02 18:35:19 -050099 getConfFileName() const
Yingdi Yu40cd1c32014-04-17 15:02:17 -0700100 {
akmhoque53353462014-04-22 08:43:45 -0500101 return m_configFileName;
Yingdi Yu40cd1c32014-04-17 15:02:17 -0700102 }
103
akmhoque53353462014-04-22 08:43:45 -0500104 void
akmhoquefdbddb12014-05-02 18:35:19 -0500105 setConfFileName(const std::string& fileName)
akmhoque5a44dd42014-03-12 18:11:32 -0500106 {
akmhoque53353462014-04-22 08:43:45 -0500107 m_configFileName = fileName;
108 }
akmhoque5a44dd42014-03-12 18:11:32 -0500109
akmhoque53353462014-04-22 08:43:45 -0500110 bool
111 getIsSetDaemonProcess()
112 {
113 return m_isDaemonProcess;
114 }
akmhoque5a44dd42014-03-12 18:11:32 -0500115
akmhoque53353462014-04-22 08:43:45 -0500116 void
117 setIsDaemonProcess(bool value)
118 {
119 m_isDaemonProcess = value;
120 }
akmhoque5a44dd42014-03-12 18:11:32 -0500121
akmhoque53353462014-04-22 08:43:45 -0500122 ConfParameter&
123 getConfParameter()
124 {
125 return m_confParam;
126 }
akmhoque5a44dd42014-03-12 18:11:32 -0500127
akmhoquec8a10f72014-04-25 18:42:55 -0500128 AdjacencyList&
129 getAdjacencyList()
akmhoque53353462014-04-22 08:43:45 -0500130 {
akmhoquec8a10f72014-04-25 18:42:55 -0500131 return m_adjacencyList;
akmhoque53353462014-04-22 08:43:45 -0500132 }
akmhoque298385a2014-02-13 14:13:09 -0600133
akmhoquec8a10f72014-04-25 18:42:55 -0500134 NamePrefixList&
135 getNamePrefixList()
akmhoque53353462014-04-22 08:43:45 -0500136 {
akmhoquec8a10f72014-04-25 18:42:55 -0500137 return m_namePrefixList;
akmhoque53353462014-04-22 08:43:45 -0500138 }
akmhoque298385a2014-02-13 14:13:09 -0600139
akmhoquefdbddb12014-05-02 18:35:19 -0500140 ndn::Face&
akmhoque53353462014-04-22 08:43:45 -0500141 getNlsrFace()
142 {
143 return m_nlsrFace;
144 }
akmhoque298385a2014-02-13 14:13:09 -0600145
akmhoque53353462014-04-22 08:43:45 -0500146 Lsdb&
147 getLsdb()
148 {
149 return m_nlsrLsdb;
150 }
akmhoque298385a2014-02-13 14:13:09 -0600151
akmhoque53353462014-04-22 08:43:45 -0500152 RoutingTable&
153 getRoutingTable()
154 {
155 return m_routingTable;
156 }
akmhoque298385a2014-02-13 14:13:09 -0600157
akmhoquec8a10f72014-04-25 18:42:55 -0500158 NamePrefixTable&
159 getNamePrefixTable()
akmhoque53353462014-04-22 08:43:45 -0500160 {
akmhoquec8a10f72014-04-25 18:42:55 -0500161 return m_namePrefixTable;
akmhoque53353462014-04-22 08:43:45 -0500162 }
akmhoque298385a2014-02-13 14:13:09 -0600163
akmhoque53353462014-04-22 08:43:45 -0500164 Fib&
165 getFib()
166 {
167 return m_fib;
168 }
akmhoque298385a2014-02-13 14:13:09 -0600169
akmhoque53353462014-04-22 08:43:45 -0500170 long int
171 getAdjBuildCount()
172 {
173 return m_adjBuildCount;
174 }
akmhoque298385a2014-02-13 14:13:09 -0600175
akmhoque53353462014-04-22 08:43:45 -0500176 void
177 incrementAdjBuildCount()
178 {
179 m_adjBuildCount++;
180 }
akmhoque298385a2014-02-13 14:13:09 -0600181
akmhoque53353462014-04-22 08:43:45 -0500182 void
akmhoquefdbddb12014-05-02 18:35:19 -0500183 setAdjBuildCount(int64_t abc)
akmhoque53353462014-04-22 08:43:45 -0500184 {
185 m_adjBuildCount = abc;
186 }
akmhoque298385a2014-02-13 14:13:09 -0600187
akmhoque157b0a42014-05-13 00:26:37 -0500188 bool
akmhoque53353462014-04-22 08:43:45 -0500189 getIsBuildAdjLsaSheduled()
190 {
191 return m_isBuildAdjLsaSheduled;
192 }
akmhoque298385a2014-02-13 14:13:09 -0600193
akmhoque53353462014-04-22 08:43:45 -0500194 void
195 setIsBuildAdjLsaSheduled(bool iabls)
196 {
197 m_isBuildAdjLsaSheduled = iabls;
198 }
akmhoque298385a2014-02-13 14:13:09 -0600199
akmhoque53353462014-04-22 08:43:45 -0500200 bool
201 getIsRoutingTableCalculating()
202 {
203 return m_isRoutingTableCalculating;
204 }
akmhoque85d88332014-02-17 21:11:21 -0600205
akmhoque53353462014-04-22 08:43:45 -0500206 void
207 setIsRoutingTableCalculating(bool irtc)
208 {
209 m_isRoutingTableCalculating = irtc;
210 }
akmhoque298385a2014-02-13 14:13:09 -0600211
akmhoque53353462014-04-22 08:43:45 -0500212 bool
213 getIsRouteCalculationScheduled()
214 {
215 return m_isRouteCalculationScheduled;
216 }
akmhoque298385a2014-02-13 14:13:09 -0600217
akmhoque53353462014-04-22 08:43:45 -0500218 void
219 setIsRouteCalculationScheduled(bool ircs)
220 {
221 m_isRouteCalculationScheduled = ircs;
222 }
akmhoque298385a2014-02-13 14:13:09 -0600223
Muktadir R Chowdhury3ac07282016-06-17 16:30:29 -0500224 LsdbDatasetInterestHandler&
225 getLsdbDatasetHandler()
226 {
227 return m_lsdbDatasetHandler;
228 }
229
akmhoque53353462014-04-22 08:43:45 -0500230 void
231 initialize();
akmhoque1fd8c1e2014-02-19 19:41:49 -0600232
Nick Gordond5c1a372016-10-31 13:56:23 -0500233 /*! \brief Initializes neighbors' Faces using information from NFD.
234 * \sa Nlsr::initialize()
235 * \sa Nlsr::processFaceDataset()
236 *
237 * This function serves as the entry-point for initializing the
238 * neighbors listed in nlsr.conf during Nlsr::initialize(). NLSR
239 * will attempt to fetch a dataset of Faces from NFD, and configure
240 * each of its neighbors using information from that dataset. The
241 * explicit callbacks allow for better testability.
242 */
243 void
244 initializeFaces(const FetchDatasetCallback& onFetchSuccess,
245 const FetchDatasetTimeoutCallback& onFetchFailure);
246
247 void
248 onFaceDatasetFetchTimeout(uint32_t code,
249 const std::string& reason,
250 uint32_t nRetriesSoFar);
251
252 /*! \brief Consumes a Face StatusDataset to configure NLSR neighbors.
253 * \sa Nlsr::initializeFaces
254 * \param faces A Face Dataset that should conform to FaceMgmt specifications.
255 *
256 * This function processes a Face StatusDataset that should conform
257 * to the FaceMgmt specifications listed
258 * [here](https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset).
259 * Any newly configured neighbors will have prefixes registered with NFD
260 * and be sent Hello Interests as well.
261 */
262 void
263 processFaceDataset(const std::vector<ndn::nfd::FaceStatus>& faces);
264
265 /*! \brief Registers NLSR-specific prefixes for a neighbor (Adjacent)
266 * \sa Nlsr::initializeFaces
267 * \param adj A reference to the neighbor to register prefixes for
268 * \param timeout The amount of time to give NFD to respond to *each* registration request.
269 *
270 * Registers the prefixes in NFD that NLSR needs to route with a
271 * neighbor. The timeout given is how long to set the timeout for
272 * *each* registration request that is made.
273 */
274 void
275 registerAdjacencyPrefixes(const Adjacent& adj,
276 const ndn::time::milliseconds& timeout);
277
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700278 void
akmhoque443ad812014-07-29 10:26:56 -0500279 initializeKey();
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700280
281 void
282 loadValidator(boost::property_tree::ptree section,
283 const std::string& filename)
284 {
285 m_validator.load(section, filename);
286 }
287
288 Validator&
289 getValidator()
290 {
291 return m_validator;
292 }
293
Nick Gordond0a7df32017-05-30 16:44:34 -0500294 /*! \brief Add a certificate NLSR claims to be authoritative for to the certificate store.
295 *
296 * \sa CertificateStore
297 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700298 void
dmcoomes9f936662017-03-02 10:33:09 -0600299 loadCertToPublish(std::shared_ptr<ndn::IdentityCertificate> certificate)
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700300 {
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500301 m_certStore.insert(certificate);
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700302 }
303
Nick Gordond0a7df32017-05-30 16:44:34 -0500304 /*! \brief Find a certificate
305 *
306 * Find a certificate that NLSR has. First it checks against the
307 * certificates this NLSR claims to be authoritative for, usually
308 * something like this specific router's certificate, and then
309 * checks the cache of certficates it has already fetched. If none
310 * can be found, it will return an empty pointer.
311 */
dmcoomes9f936662017-03-02 10:33:09 -0600312 std::shared_ptr<const ndn::IdentityCertificate>
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700313 getCertificate(const ndn::Name& certificateNameWithoutVersion)
314 {
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500315 shared_ptr<const ndn::IdentityCertificate> cert =
316 m_certStore.find(certificateNameWithoutVersion);
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700317
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500318 if (cert != nullptr) {
319 return cert;
320 }
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700321
322 return m_certificateCache->getCertificate(certificateNameWithoutVersion);
323 }
324
325 ndn::KeyChain&
326 getKeyChain()
327 {
328 return m_keyChain;
329 }
330
331 const ndn::Name&
332 getDefaultCertName()
333 {
334 return m_defaultCertName;
335 }
336
alvy297f4162015-03-03 17:15:33 -0600337 update::PrefixUpdateProcessor&
338 getPrefixUpdateProcessor()
339 {
340 return m_prefixUpdateProcessor;
341 }
342
Nick Gordon4d2c6c02017-01-20 13:18:46 -0600343 update::NfdRibCommandProcessor&
344 getNfdRibCommandProcessor()
345 {
346 return m_nfdRibCommandProcessor;
347 }
348
Nick Gordond1f4f332017-01-20 13:40:57 -0600349 ndn::mgmt::Dispatcher&
Laqin Fan54a43f02017-03-08 12:31:30 -0600350 getLocalhostDispatcher()
Nick Gordond1f4f332017-01-20 13:40:57 -0600351 {
laqinfand22da512017-05-25 17:29:53 -0500352 return m_localhostDispatcher;
353 }
354
355 ndn::mgmt::Dispatcher&
Laqin Fan54a43f02017-03-08 12:31:30 -0600356 getRouterNameDispatcher()
laqinfand22da512017-05-25 17:29:53 -0500357 {
358 return m_routerNameDispatcher;
Nick Gordond1f4f332017-01-20 13:40:57 -0600359 }
360
akmhoquee1765152014-06-30 11:32:01 -0500361 void
akmhoquec04e7272014-07-02 11:00:14 -0500362 setStrategies();
akmhoque157b0a42014-05-13 00:26:37 -0500363
akmhoque0494c252014-07-23 23:46:44 -0500364 void
365 daemonize();
366
Vince Lehman7b616582014-10-17 16:25:39 -0500367 uint32_t
368 getFirstHelloInterval() const
369 {
370 return m_firstHelloInterval;
371 }
372
Nick Gordond5c1a372016-10-31 13:56:23 -0500373 /*! \brief Canonize the URI for this and all proceeding neighbors in a list.
Nick Gordon9461afb2017-04-25 15:54:50 -0500374 *
375 * This function canonizes the URI of the Adjacent object pointed to
376 * by currentNeighbor. It then executes the then callback, providing
377 * the next iterator in the list to the callback. A standard
378 * invocation would be to pass the begin() iterator of NLSR's
379 * adjacency list, and to provide Nlsr::canonizeContinuation as the
380 * callback. Because every URI must be canonical before we begin
Nick Gordon922714a2017-06-13 14:12:02 -0500381 * operations, the canonize function provides a finally() function
382 * to resume whatever needs to occur.
Nick Gordon9461afb2017-04-25 15:54:50 -0500383 *
384 * \sa Nlsr::canonizeContinuation
385 * \sa Nlsr::initialize
386 * \sa NlsrRunner::run
387 */
388 void
389 canonizeNeighborUris(std::list<Adjacent>::iterator currentNeighbor,
Nick Gordon922714a2017-06-13 14:12:02 -0500390 std::function<void(std::list<Adjacent>::iterator)> then,
391 std::function<void(void)> finally);
Nick Gordon9461afb2017-04-25 15:54:50 -0500392
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600393 StatsCollector&
394 getStatsCollector()
395 {
396 return m_statsCollector;
397 }
Nick Gordon9461afb2017-04-25 15:54:50 -0500398
alvy297f4162015-03-03 17:15:33 -0600399PUBLIC_WITH_TESTS_ELSE_PRIVATE:
400 void
dmcoomes9f936662017-03-02 10:33:09 -0600401 addCertificateToCache(std::shared_ptr<ndn::IdentityCertificate> certificate)
alvy297f4162015-03-03 17:15:33 -0600402 {
403 if (certificate != nullptr) {
404 m_certificateCache->insertCertificate(certificate);
405 }
406 }
407
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500408 security::CertificateStore&
409 getCertificateStore()
410 {
411 return m_certStore;
412 }
413
akmhoque393d4ff2014-07-16 14:27:03 -0500414private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500415 /*! \brief Registers the prefix that NLSR will use for key/certificate interests.
416 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700417 void
418 registerKeyPrefix();
419
Nick Gordond0a7df32017-05-30 16:44:34 -0500420 /*! \brief Registers the prefix that NLSR will consider to be the machine-local, secure prefix.
421 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700422 void
alvy297f4162015-03-03 17:15:33 -0600423 registerLocalhostPrefix();
424
Nick Gordond0a7df32017-05-30 16:44:34 -0500425 /*! \brief Attempts to satisfy an Interest for a certificate, and send it back.
426 */
alvy297f4162015-03-03 17:15:33 -0600427 void
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700428 onKeyInterest(const ndn::Name& name, const ndn::Interest& interest);
429
Nick Gordond0a7df32017-05-30 16:44:34 -0500430 /*! \brief Do nothing.
431 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700432 void
433 onKeyPrefixRegSuccess(const ndn::Name& name);
434
Nick Gordond0a7df32017-05-30 16:44:34 -0500435 /*! \brief Do nothing.
436 */
akmhoquee1765152014-06-30 11:32:01 -0500437 void
akmhoquec04e7272014-07-02 11:00:14 -0500438 onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification);
akmhoquee1765152014-06-30 11:32:01 -0500439
Vince Lehman7b616582014-10-17 16:25:39 -0500440 void
441 setFirstHelloInterval(uint32_t interval)
442 {
443 m_firstHelloInterval = interval;
444 }
445
Nick Gordond5c1a372016-10-31 13:56:23 -0500446 /*! \brief Continues canonizing neighbor URIs.
Nick Gordon9461afb2017-04-25 15:54:50 -0500447 *
448 * For testability reasons, we want what each instance of
449 * canonization does after completion to be controllable. The best
450 * way to do this is to control that by simply passing a
451 * continuation function.
452 */
453 void
Nick Gordon922714a2017-06-13 14:12:02 -0500454 canonizeContinuation(std::list<Adjacent>::iterator iterator,
455 std::function<void(void)> finally);
Nick Gordon9461afb2017-04-25 15:54:50 -0500456
Nick Gordond5c1a372016-10-31 13:56:23 -0500457 void
458 scheduleDatasetFetch();
459
alvy297f4162015-03-03 17:15:33 -0600460public:
461 static const ndn::Name LOCALHOST_PREFIX;
462
akmhoque157b0a42014-05-13 00:26:37 -0500463private:
Vince Lehman904c2412014-09-23 19:36:11 -0500464 ndn::Face& m_nlsrFace;
Vince Lehman7c603292014-09-11 17:48:16 -0500465 ndn::Scheduler& m_scheduler;
Laqin Fana4cf4022017-01-03 18:57:35 +0000466 ndn::KeyChain& m_keyChain;
akmhoque53353462014-04-22 08:43:45 -0500467 ConfParameter m_confParam;
akmhoquec8a10f72014-04-25 18:42:55 -0500468 AdjacencyList m_adjacencyList;
469 NamePrefixList m_namePrefixList;
akmhoque53353462014-04-22 08:43:45 -0500470 bool m_isDaemonProcess;
akmhoquefdbddb12014-05-02 18:35:19 -0500471 std::string m_configFileName;
akmhoque53353462014-04-22 08:43:45 -0500472 Lsdb m_nlsrLsdb;
akmhoquefdbddb12014-05-02 18:35:19 -0500473 int64_t m_adjBuildCount;
akmhoque53353462014-04-22 08:43:45 -0500474 bool m_isBuildAdjLsaSheduled;
475 bool m_isRouteCalculationScheduled;
476 bool m_isRoutingTableCalculating;
akmhoque53353462014-04-22 08:43:45 -0500477 RoutingTable m_routingTable;
akmhoque53353462014-04-22 08:43:45 -0500478 Fib m_fib;
akmhoque31d1d4b2014-05-05 22:08:14 -0500479 NamePrefixTable m_namePrefixTable;
Laqin Fan54a43f02017-03-08 12:31:30 -0600480
laqinfand22da512017-05-25 17:29:53 -0500481 ndn::mgmt::Dispatcher m_localhostDispatcher;
482 ndn::mgmt::Dispatcher m_routerNameDispatcher;
483
Vince Lehmand6bb3fa2015-04-24 14:21:39 -0500484 LsdbDatasetInterestHandler m_lsdbDatasetHandler;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700485
Vince Lehmanf7eec4f2015-05-08 19:02:31 -0500486PUBLIC_WITH_TESTS_ELSE_PRIVATE:
487 HelloProtocol m_helloProtocol;
488
Vince Lehman7b616582014-10-17 16:25:39 -0500489private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500490 /*! \brief Where NLSR caches certificates it has fetched to validate
491 * Data signatures.
492 */
dmcoomes9f936662017-03-02 10:33:09 -0600493 std::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
Nick Gordond0a7df32017-05-30 16:44:34 -0500494 /*! \brief Where NLSR stores certificates it claims to be
495 * authoritative for. Usually the router certificate.
496 */
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500497 security::CertificateStore m_certStore;
Nick Gordond5c1a372016-10-31 13:56:23 -0500498
499PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700500 Validator m_validator;
Nick Gordond5c1a372016-10-31 13:56:23 -0500501
502private:
503 ndn::nfd::Controller m_controller;
504 ndn::nfd::Controller m_faceDatasetController;
Joao Pereira97473d42015-07-03 16:57:27 -0400505 ndn::security::SigningInfo m_signingInfo;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700506 ndn::Name m_defaultCertName;
alvy297f4162015-03-03 17:15:33 -0600507 update::PrefixUpdateProcessor m_prefixUpdateProcessor;
Nick Gordon4d2c6c02017-01-20 13:18:46 -0600508 update::NfdRibCommandProcessor m_nfdRibCommandProcessor;
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600509 StatsCollector m_statsCollector;
akmhoquee1765152014-06-30 11:32:01 -0500510
akmhoque060d3022014-08-12 13:35:06 -0500511 ndn::nfd::FaceMonitor m_faceMonitor;
Vince Lehman7b616582014-10-17 16:25:39 -0500512
513 uint32_t m_firstHelloInterval;
Nick Gordond5c1a372016-10-31 13:56:23 -0500514
515 friend class NlsrRunner;
akmhoque53353462014-04-22 08:43:45 -0500516};
akmhoque298385a2014-02-13 14:13:09 -0600517
Nick Gordonfad8e252016-08-11 14:21:38 -0500518} // namespace nlsr
akmhoqueb1710aa2014-02-19 17:13:36 -0600519
dmcoomes9f936662017-03-02 10:33:09 -0600520#endif // NLSR_NLSR_HPP