blob: 89410e93a65c33cc0588d0f8f6bebed940fe758f [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
381 * operations, the canonize function must call initialize itself.
382 *
383 * \sa Nlsr::canonizeContinuation
384 * \sa Nlsr::initialize
385 * \sa NlsrRunner::run
386 */
387 void
388 canonizeNeighborUris(std::list<Adjacent>::iterator currentNeighbor,
389 std::function<void(std::list<Adjacent>::iterator)> then);
390
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600391 StatsCollector&
392 getStatsCollector()
393 {
394 return m_statsCollector;
395 }
Nick Gordon9461afb2017-04-25 15:54:50 -0500396
alvy297f4162015-03-03 17:15:33 -0600397PUBLIC_WITH_TESTS_ELSE_PRIVATE:
398 void
dmcoomes9f936662017-03-02 10:33:09 -0600399 addCertificateToCache(std::shared_ptr<ndn::IdentityCertificate> certificate)
alvy297f4162015-03-03 17:15:33 -0600400 {
401 if (certificate != nullptr) {
402 m_certificateCache->insertCertificate(certificate);
403 }
404 }
405
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500406 security::CertificateStore&
407 getCertificateStore()
408 {
409 return m_certStore;
410 }
411
akmhoque393d4ff2014-07-16 14:27:03 -0500412private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500413 /*! \brief Registers the prefix that NLSR will use for key/certificate interests.
414 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700415 void
416 registerKeyPrefix();
417
Nick Gordond0a7df32017-05-30 16:44:34 -0500418 /*! \brief Registers the prefix that NLSR will consider to be the machine-local, secure prefix.
419 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700420 void
alvy297f4162015-03-03 17:15:33 -0600421 registerLocalhostPrefix();
422
Nick Gordond0a7df32017-05-30 16:44:34 -0500423 /*! \brief Attempts to satisfy an Interest for a certificate, and send it back.
424 */
alvy297f4162015-03-03 17:15:33 -0600425 void
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700426 onKeyInterest(const ndn::Name& name, const ndn::Interest& interest);
427
Nick Gordond0a7df32017-05-30 16:44:34 -0500428 /*! \brief Do nothing.
429 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700430 void
431 onKeyPrefixRegSuccess(const ndn::Name& name);
432
Nick Gordond0a7df32017-05-30 16:44:34 -0500433 /*! \brief Do nothing.
434 */
akmhoquee1765152014-06-30 11:32:01 -0500435 void
akmhoquec04e7272014-07-02 11:00:14 -0500436 onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification);
akmhoquee1765152014-06-30 11:32:01 -0500437
Vince Lehman7b616582014-10-17 16:25:39 -0500438 void
439 setFirstHelloInterval(uint32_t interval)
440 {
441 m_firstHelloInterval = interval;
442 }
443
Nick Gordond5c1a372016-10-31 13:56:23 -0500444 /*! \brief Continues canonizing neighbor URIs.
Nick Gordon9461afb2017-04-25 15:54:50 -0500445 *
446 * For testability reasons, we want what each instance of
447 * canonization does after completion to be controllable. The best
448 * way to do this is to control that by simply passing a
449 * continuation function.
450 */
451 void
452 canonizeContinuation(std::list<Adjacent>::iterator iterator);
453
Nick Gordond5c1a372016-10-31 13:56:23 -0500454 void
455 scheduleDatasetFetch();
456
alvy297f4162015-03-03 17:15:33 -0600457public:
458 static const ndn::Name LOCALHOST_PREFIX;
459
akmhoque157b0a42014-05-13 00:26:37 -0500460private:
Vince Lehman904c2412014-09-23 19:36:11 -0500461 ndn::Face& m_nlsrFace;
Vince Lehman7c603292014-09-11 17:48:16 -0500462 ndn::Scheduler& m_scheduler;
Laqin Fana4cf4022017-01-03 18:57:35 +0000463 ndn::KeyChain& m_keyChain;
akmhoque53353462014-04-22 08:43:45 -0500464 ConfParameter m_confParam;
akmhoquec8a10f72014-04-25 18:42:55 -0500465 AdjacencyList m_adjacencyList;
466 NamePrefixList m_namePrefixList;
akmhoque53353462014-04-22 08:43:45 -0500467 bool m_isDaemonProcess;
akmhoquefdbddb12014-05-02 18:35:19 -0500468 std::string m_configFileName;
akmhoque53353462014-04-22 08:43:45 -0500469 Lsdb m_nlsrLsdb;
akmhoquefdbddb12014-05-02 18:35:19 -0500470 int64_t m_adjBuildCount;
akmhoque53353462014-04-22 08:43:45 -0500471 bool m_isBuildAdjLsaSheduled;
472 bool m_isRouteCalculationScheduled;
473 bool m_isRoutingTableCalculating;
akmhoque53353462014-04-22 08:43:45 -0500474 RoutingTable m_routingTable;
akmhoque53353462014-04-22 08:43:45 -0500475 Fib m_fib;
akmhoque31d1d4b2014-05-05 22:08:14 -0500476 NamePrefixTable m_namePrefixTable;
Laqin Fan54a43f02017-03-08 12:31:30 -0600477
laqinfand22da512017-05-25 17:29:53 -0500478 ndn::mgmt::Dispatcher m_localhostDispatcher;
479 ndn::mgmt::Dispatcher m_routerNameDispatcher;
480
Vince Lehmand6bb3fa2015-04-24 14:21:39 -0500481 LsdbDatasetInterestHandler m_lsdbDatasetHandler;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700482
Vince Lehmanf7eec4f2015-05-08 19:02:31 -0500483PUBLIC_WITH_TESTS_ELSE_PRIVATE:
484 HelloProtocol m_helloProtocol;
485
Vince Lehman7b616582014-10-17 16:25:39 -0500486private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500487 /*! \brief Where NLSR caches certificates it has fetched to validate
488 * Data signatures.
489 */
dmcoomes9f936662017-03-02 10:33:09 -0600490 std::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache;
Nick Gordond0a7df32017-05-30 16:44:34 -0500491 /*! \brief Where NLSR stores certificates it claims to be
492 * authoritative for. Usually the router certificate.
493 */
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500494 security::CertificateStore m_certStore;
Nick Gordond5c1a372016-10-31 13:56:23 -0500495
496PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700497 Validator m_validator;
Nick Gordond5c1a372016-10-31 13:56:23 -0500498
499private:
500 ndn::nfd::Controller m_controller;
501 ndn::nfd::Controller m_faceDatasetController;
Joao Pereira97473d42015-07-03 16:57:27 -0400502 ndn::security::SigningInfo m_signingInfo;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700503 ndn::Name m_defaultCertName;
alvy297f4162015-03-03 17:15:33 -0600504 update::PrefixUpdateProcessor m_prefixUpdateProcessor;
Nick Gordon4d2c6c02017-01-20 13:18:46 -0600505 update::NfdRibCommandProcessor m_nfdRibCommandProcessor;
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600506 StatsCollector m_statsCollector;
akmhoquee1765152014-06-30 11:32:01 -0500507
akmhoque060d3022014-08-12 13:35:06 -0500508 ndn::nfd::FaceMonitor m_faceMonitor;
Vince Lehman7b616582014-10-17 16:25:39 -0500509
510 uint32_t m_firstHelloInterval;
Nick Gordond5c1a372016-10-31 13:56:23 -0500511
512 friend class NlsrRunner;
akmhoque53353462014-04-22 08:43:45 -0500513};
akmhoque298385a2014-02-13 14:13:09 -0600514
Nick Gordonfad8e252016-08-11 14:21:38 -0500515} // namespace nlsr
akmhoqueb1710aa2014-02-19 17:13:36 -0600516
dmcoomes9f936662017-03-02 10:33:09 -0600517#endif // NLSR_NLSR_HPP