blob: 10999d20ad9276321e761dc3587034d81d4d21f2 [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
laqinfan35731852017-08-08 06:17:39 -05003 * Copyright (c) 2014-2018, 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"
laqinfan35731852017-08-08 06:17:39 -050032#include "publisher/dataset-interest-handler.hpp"
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050033#include "route/fib.hpp"
34#include "route/name-prefix-table.hpp"
35#include "route/routing-table.hpp"
36#include "security/certificate-store.hpp"
37#include "update/prefix-update-processor.hpp"
Nick Gordon4d2c6c02017-01-20 13:18:46 -060038#include "update/nfd-rib-command-processor.hpp"
Vince Lehmanc2acdcb2015-04-29 11:14:35 -050039#include "utility/name-helper.hpp"
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -060040#include "stats-collector.hpp"
Yingdi Yu20e3a6e2014-05-26 23:16:10 -070041
Nick Gordond0a7df32017-05-30 16:44:34 -050042#include <boost/cstdint.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060043#include <stdexcept>
Nick Gordond0a7df32017-05-30 16:44:34 -050044#include <boost/throw_exception.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060045
46#include <ndn-cxx/face.hpp>
47#include <ndn-cxx/security/key-chain.hpp>
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050048#include <ndn-cxx/security/validator-config.hpp>
49#include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp>
50#include <ndn-cxx/security/signing-helpers.hpp>
51#include <ndn-cxx/security/signing-info.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060052#include <ndn-cxx/util/scheduler.hpp>
53#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
54#include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
55#include <ndn-cxx/mgmt/dispatcher.hpp>
56#include <ndn-cxx/mgmt/nfd/face-status.hpp>
57#include <ndn-cxx/data.hpp>
58#include <ndn-cxx/encoding/block.hpp>
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050059#include <ndn-cxx/encoding/nfd-constants.hpp>
60#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
61#include <ndn-cxx/mgmt/nfd/control-response.hpp>
Laqin Fan54a43f02017-03-08 12:31:30 -060062
akmhoque53353462014-04-22 08:43:45 -050063namespace nlsr {
64
Yingdi Yu20e3a6e2014-05-26 23:16:10 -070065static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast");
66
akmhoque53353462014-04-22 08:43:45 -050067class Nlsr
68{
Nick Gordond5c1a372016-10-31 13:56:23 -050069public:
70 using FetchDatasetCallback = std::function<void(const std::vector<ndn::nfd::FaceStatus>&)>;
71 using FetchDatasetTimeoutCallback = std::function<void(uint32_t, const std::string&)>;
Nick Gordon9461afb2017-04-25 15:54:50 -050072
akmhoquefdbddb12014-05-02 18:35:19 -050073 class Error : public std::runtime_error
74 {
75 public:
76 explicit
77 Error(const std::string& what)
78 : std::runtime_error(what)
79 {
80 }
81 };
82
Laqin Fana4cf4022017-01-03 18:57:35 +000083 Nlsr(boost::asio::io_service& ioService, ndn::Scheduler& scheduler, ndn::Face& face, ndn::KeyChain& keyChain);
akmhoque298385a2014-02-13 14:13:09 -060084
akmhoque53353462014-04-22 08:43:45 -050085 void
86 registrationFailed(const ndn::Name& name);
87
88 void
akmhoque157b0a42014-05-13 00:26:37 -050089 onRegistrationSuccess(const ndn::Name& name);
90
91 void
akmhoque31d1d4b2014-05-05 22:08:14 -050092 setInfoInterestFilter();
93
94 void
95 setLsaInterestFilter();
akmhoque53353462014-04-22 08:43:45 -050096
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050097 /*! \brief Add top level prefixes for Dispatcher
98 *
99 * All dispatcher-related sub-prefixes *must* be registered before sub-prefixes
100 * must be added before adding top
101 */
102 void
103 addDispatcherTopPrefix(const ndn::Name& topPrefix);
104
akmhoque53353462014-04-22 08:43:45 -0500105 void
106 startEventLoop();
107
akmhoque53353462014-04-22 08:43:45 -0500108 std::string
akmhoquefdbddb12014-05-02 18:35:19 -0500109 getConfFileName() const
Yingdi Yu40cd1c32014-04-17 15:02:17 -0700110 {
akmhoque53353462014-04-22 08:43:45 -0500111 return m_configFileName;
Yingdi Yu40cd1c32014-04-17 15:02:17 -0700112 }
113
akmhoque53353462014-04-22 08:43:45 -0500114 void
akmhoquefdbddb12014-05-02 18:35:19 -0500115 setConfFileName(const std::string& fileName)
akmhoque5a44dd42014-03-12 18:11:32 -0500116 {
akmhoque53353462014-04-22 08:43:45 -0500117 m_configFileName = fileName;
118 }
akmhoque5a44dd42014-03-12 18:11:32 -0500119
akmhoque53353462014-04-22 08:43:45 -0500120 bool
121 getIsSetDaemonProcess()
122 {
123 return m_isDaemonProcess;
124 }
akmhoque5a44dd42014-03-12 18:11:32 -0500125
akmhoque53353462014-04-22 08:43:45 -0500126 void
127 setIsDaemonProcess(bool value)
128 {
129 m_isDaemonProcess = value;
130 }
akmhoque5a44dd42014-03-12 18:11:32 -0500131
akmhoque53353462014-04-22 08:43:45 -0500132 ConfParameter&
133 getConfParameter()
134 {
135 return m_confParam;
136 }
akmhoque5a44dd42014-03-12 18:11:32 -0500137
akmhoquec8a10f72014-04-25 18:42:55 -0500138 AdjacencyList&
139 getAdjacencyList()
akmhoque53353462014-04-22 08:43:45 -0500140 {
akmhoquec8a10f72014-04-25 18:42:55 -0500141 return m_adjacencyList;
akmhoque53353462014-04-22 08:43:45 -0500142 }
akmhoque298385a2014-02-13 14:13:09 -0600143
akmhoquec8a10f72014-04-25 18:42:55 -0500144 NamePrefixList&
145 getNamePrefixList()
akmhoque53353462014-04-22 08:43:45 -0500146 {
akmhoquec8a10f72014-04-25 18:42:55 -0500147 return m_namePrefixList;
akmhoque53353462014-04-22 08:43:45 -0500148 }
akmhoque298385a2014-02-13 14:13:09 -0600149
akmhoquefdbddb12014-05-02 18:35:19 -0500150 ndn::Face&
akmhoque53353462014-04-22 08:43:45 -0500151 getNlsrFace()
152 {
153 return m_nlsrFace;
154 }
akmhoque298385a2014-02-13 14:13:09 -0600155
akmhoque53353462014-04-22 08:43:45 -0500156 Lsdb&
157 getLsdb()
158 {
159 return m_nlsrLsdb;
160 }
akmhoque298385a2014-02-13 14:13:09 -0600161
akmhoque53353462014-04-22 08:43:45 -0500162 RoutingTable&
163 getRoutingTable()
164 {
165 return m_routingTable;
166 }
akmhoque298385a2014-02-13 14:13:09 -0600167
akmhoquec8a10f72014-04-25 18:42:55 -0500168 NamePrefixTable&
169 getNamePrefixTable()
akmhoque53353462014-04-22 08:43:45 -0500170 {
akmhoquec8a10f72014-04-25 18:42:55 -0500171 return m_namePrefixTable;
akmhoque53353462014-04-22 08:43:45 -0500172 }
akmhoque298385a2014-02-13 14:13:09 -0600173
akmhoque53353462014-04-22 08:43:45 -0500174 Fib&
175 getFib()
176 {
177 return m_fib;
178 }
akmhoque298385a2014-02-13 14:13:09 -0600179
akmhoque53353462014-04-22 08:43:45 -0500180 long int
181 getAdjBuildCount()
182 {
183 return m_adjBuildCount;
184 }
akmhoque298385a2014-02-13 14:13:09 -0600185
akmhoque53353462014-04-22 08:43:45 -0500186 void
187 incrementAdjBuildCount()
188 {
189 m_adjBuildCount++;
190 }
akmhoque298385a2014-02-13 14:13:09 -0600191
akmhoque53353462014-04-22 08:43:45 -0500192 void
akmhoquefdbddb12014-05-02 18:35:19 -0500193 setAdjBuildCount(int64_t abc)
akmhoque53353462014-04-22 08:43:45 -0500194 {
195 m_adjBuildCount = abc;
196 }
akmhoque298385a2014-02-13 14:13:09 -0600197
akmhoque157b0a42014-05-13 00:26:37 -0500198 bool
akmhoque53353462014-04-22 08:43:45 -0500199 getIsBuildAdjLsaSheduled()
200 {
201 return m_isBuildAdjLsaSheduled;
202 }
akmhoque298385a2014-02-13 14:13:09 -0600203
akmhoque53353462014-04-22 08:43:45 -0500204 void
205 setIsBuildAdjLsaSheduled(bool iabls)
206 {
207 m_isBuildAdjLsaSheduled = iabls;
208 }
akmhoque298385a2014-02-13 14:13:09 -0600209
akmhoque53353462014-04-22 08:43:45 -0500210 bool
211 getIsRoutingTableCalculating()
212 {
213 return m_isRoutingTableCalculating;
214 }
akmhoque85d88332014-02-17 21:11:21 -0600215
akmhoque53353462014-04-22 08:43:45 -0500216 void
217 setIsRoutingTableCalculating(bool irtc)
218 {
219 m_isRoutingTableCalculating = irtc;
220 }
akmhoque298385a2014-02-13 14:13:09 -0600221
akmhoque53353462014-04-22 08:43:45 -0500222 bool
223 getIsRouteCalculationScheduled()
224 {
225 return m_isRouteCalculationScheduled;
226 }
akmhoque298385a2014-02-13 14:13:09 -0600227
akmhoque53353462014-04-22 08:43:45 -0500228 void
229 setIsRouteCalculationScheduled(bool ircs)
230 {
231 m_isRouteCalculationScheduled = ircs;
232 }
akmhoque298385a2014-02-13 14:13:09 -0600233
laqinfan35731852017-08-08 06:17:39 -0500234 DatasetInterestHandler&
235 getDatasetHandler()
Muktadir R Chowdhury3ac07282016-06-17 16:30:29 -0500236 {
laqinfan35731852017-08-08 06:17:39 -0500237 return m_datasetHandler;
Muktadir R Chowdhury3ac07282016-06-17 16:30:29 -0500238 }
239
akmhoque53353462014-04-22 08:43:45 -0500240 void
241 initialize();
akmhoque1fd8c1e2014-02-19 19:41:49 -0600242
Nick Gordond5c1a372016-10-31 13:56:23 -0500243 /*! \brief Initializes neighbors' Faces using information from NFD.
244 * \sa Nlsr::initialize()
245 * \sa Nlsr::processFaceDataset()
246 *
247 * This function serves as the entry-point for initializing the
248 * neighbors listed in nlsr.conf during Nlsr::initialize(). NLSR
249 * will attempt to fetch a dataset of Faces from NFD, and configure
250 * each of its neighbors using information from that dataset. The
251 * explicit callbacks allow for better testability.
252 */
253 void
254 initializeFaces(const FetchDatasetCallback& onFetchSuccess,
255 const FetchDatasetTimeoutCallback& onFetchFailure);
256
257 void
258 onFaceDatasetFetchTimeout(uint32_t code,
259 const std::string& reason,
260 uint32_t nRetriesSoFar);
261
262 /*! \brief Consumes a Face StatusDataset to configure NLSR neighbors.
263 * \sa Nlsr::initializeFaces
264 * \param faces A Face Dataset that should conform to FaceMgmt specifications.
265 *
266 * This function processes a Face StatusDataset that should conform
267 * to the FaceMgmt specifications listed
268 * [here](https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Face-Dataset).
269 * Any newly configured neighbors will have prefixes registered with NFD
270 * and be sent Hello Interests as well.
271 */
272 void
273 processFaceDataset(const std::vector<ndn::nfd::FaceStatus>& faces);
274
275 /*! \brief Registers NLSR-specific prefixes for a neighbor (Adjacent)
276 * \sa Nlsr::initializeFaces
277 * \param adj A reference to the neighbor to register prefixes for
278 * \param timeout The amount of time to give NFD to respond to *each* registration request.
279 *
280 * Registers the prefixes in NFD that NLSR needs to route with a
281 * neighbor. The timeout given is how long to set the timeout for
282 * *each* registration request that is made.
283 */
284 void
285 registerAdjacencyPrefixes(const Adjacent& adj,
286 const ndn::time::milliseconds& timeout);
287
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500288 /*! \brief Add a certificate NLSR claims to be authoritative for to the certificate store.
289 *
290 * \sa CertificateStore
291 */
292 void
293 loadCertToPublish(const ndn::security::v2::Certificate& certificate);
294
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700295 void
akmhoque443ad812014-07-29 10:26:56 -0500296 initializeKey();
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700297
298 void
299 loadValidator(boost::property_tree::ptree section,
300 const std::string& filename)
301 {
302 m_validator.load(section, filename);
303 }
304
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500305 ndn::security::ValidatorConfig&
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700306 getValidator()
307 {
308 return m_validator;
309 }
310
Nick Gordond0a7df32017-05-30 16:44:34 -0500311 /*! \brief Find a certificate
312 *
313 * Find a certificate that NLSR has. First it checks against the
314 * certificates this NLSR claims to be authoritative for, usually
315 * something like this specific router's certificate, and then
316 * checks the cache of certficates it has already fetched. If none
317 * can be found, it will return an empty pointer.
318 */
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500319 const ndn::security::v2::Certificate*
320 getCertificate(const ndn::Name& certificateKeyName)
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700321 {
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500322 const ndn::security::v2::Certificate* cert =
323 m_certStore.find(certificateKeyName);
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700324
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500325 return cert;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700326 }
327
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500328 ndn::security::v2::KeyChain&
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700329 getKeyChain()
330 {
331 return m_keyChain;
332 }
333
334 const ndn::Name&
335 getDefaultCertName()
336 {
337 return m_defaultCertName;
338 }
339
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500340 const ndn::security::SigningInfo&
341 getSigningInfo()
342 {
343 return m_signingInfo;
344 }
345
alvy297f4162015-03-03 17:15:33 -0600346 update::PrefixUpdateProcessor&
347 getPrefixUpdateProcessor()
348 {
349 return m_prefixUpdateProcessor;
350 }
351
Nick Gordon4d2c6c02017-01-20 13:18:46 -0600352 update::NfdRibCommandProcessor&
353 getNfdRibCommandProcessor()
354 {
355 return m_nfdRibCommandProcessor;
356 }
357
Nick Gordond1f4f332017-01-20 13:40:57 -0600358 ndn::mgmt::Dispatcher&
laqinfan35731852017-08-08 06:17:39 -0500359 getDispatcher()
Nick Gordond1f4f332017-01-20 13:40:57 -0600360 {
laqinfan35731852017-08-08 06:17:39 -0500361 return m_dispatcher;
Nick Gordond1f4f332017-01-20 13:40:57 -0600362 }
363
akmhoquee1765152014-06-30 11:32:01 -0500364 void
akmhoquec04e7272014-07-02 11:00:14 -0500365 setStrategies();
akmhoque157b0a42014-05-13 00:26:37 -0500366
akmhoque0494c252014-07-23 23:46:44 -0500367 void
368 daemonize();
369
Vince Lehman7b616582014-10-17 16:25:39 -0500370 uint32_t
371 getFirstHelloInterval() const
372 {
373 return m_firstHelloInterval;
374 }
375
Nick Gordond5c1a372016-10-31 13:56:23 -0500376 /*! \brief Canonize the URI for this and all proceeding neighbors in a list.
Nick Gordon9461afb2017-04-25 15:54:50 -0500377 *
378 * This function canonizes the URI of the Adjacent object pointed to
379 * by currentNeighbor. It then executes the then callback, providing
380 * the next iterator in the list to the callback. A standard
381 * invocation would be to pass the begin() iterator of NLSR's
382 * adjacency list, and to provide Nlsr::canonizeContinuation as the
383 * callback. Because every URI must be canonical before we begin
Nick Gordon922714a2017-06-13 14:12:02 -0500384 * operations, the canonize function provides a finally() function
385 * to resume whatever needs to occur.
Nick Gordon9461afb2017-04-25 15:54:50 -0500386 *
387 * \sa Nlsr::canonizeContinuation
388 * \sa Nlsr::initialize
389 * \sa NlsrRunner::run
390 */
391 void
392 canonizeNeighborUris(std::list<Adjacent>::iterator currentNeighbor,
Nick Gordon922714a2017-06-13 14:12:02 -0500393 std::function<void(std::list<Adjacent>::iterator)> then,
394 std::function<void(void)> finally);
Nick Gordon9461afb2017-04-25 15:54:50 -0500395
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600396 StatsCollector&
397 getStatsCollector()
398 {
399 return m_statsCollector;
400 }
Nick Gordon9461afb2017-04-25 15:54:50 -0500401
alvy297f4162015-03-03 17:15:33 -0600402PUBLIC_WITH_TESTS_ELSE_PRIVATE:
alvy297f4162015-03-03 17:15:33 -0600403
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500404 security::CertificateStore&
405 getCertificateStore()
406 {
407 return m_certStore;
408 }
409
akmhoque393d4ff2014-07-16 14:27:03 -0500410private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500411 /*! \brief Registers the prefix that NLSR will use for key/certificate interests.
412 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700413 void
414 registerKeyPrefix();
415
Nick Gordond0a7df32017-05-30 16:44:34 -0500416 /*! \brief Registers the prefix that NLSR will consider to be the machine-local, secure prefix.
417 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700418 void
alvy297f4162015-03-03 17:15:33 -0600419 registerLocalhostPrefix();
420
Nick Gordond0a7df32017-05-30 16:44:34 -0500421 /*! \brief Attempts to satisfy an Interest for a certificate, and send it back.
422 */
alvy297f4162015-03-03 17:15:33 -0600423 void
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700424 onKeyInterest(const ndn::Name& name, const ndn::Interest& interest);
425
Nick Gordond0a7df32017-05-30 16:44:34 -0500426 /*! \brief Do nothing.
427 */
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700428 void
429 onKeyPrefixRegSuccess(const ndn::Name& name);
430
Nick Gordond0a7df32017-05-30 16:44:34 -0500431 /*! \brief Do nothing.
432 */
akmhoquee1765152014-06-30 11:32:01 -0500433 void
akmhoquec04e7272014-07-02 11:00:14 -0500434 onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification);
akmhoquee1765152014-06-30 11:32:01 -0500435
Vince Lehman7b616582014-10-17 16:25:39 -0500436 void
437 setFirstHelloInterval(uint32_t interval)
438 {
439 m_firstHelloInterval = interval;
440 }
441
Nick Gordond5c1a372016-10-31 13:56:23 -0500442 /*! \brief Continues canonizing neighbor URIs.
Nick Gordon9461afb2017-04-25 15:54:50 -0500443 *
444 * For testability reasons, we want what each instance of
445 * canonization does after completion to be controllable. The best
446 * way to do this is to control that by simply passing a
447 * continuation function.
448 */
449 void
Nick Gordon922714a2017-06-13 14:12:02 -0500450 canonizeContinuation(std::list<Adjacent>::iterator iterator,
451 std::function<void(void)> finally);
Nick Gordon9461afb2017-04-25 15:54:50 -0500452
Nick Gordond5c1a372016-10-31 13:56:23 -0500453 void
454 scheduleDatasetFetch();
455
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500456 /*! \brief Enables NextHopFaceId indication in NFD for incoming data packet.
457 *
458 * After enabling, when NFD gets a data packet, it will put the incoming face id
459 * of the data in NextHopFaceId field of the packet. The NextHopFaceId will be used
460 * by DirectFetcher to fetch the certificates needed to validate the data packet.
461 * \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2#Consumer-Controlled-Forwarding
462 */
463 void
464 enableIncomingFaceIdIndication();
465
466 void
467 onFaceIdIndicationSuccess(const ndn::nfd::ControlParameters& cp);
468
469 void
470 onFaceIdIndicationFailure(const ndn::nfd::ControlResponse& cr);
471
alvy297f4162015-03-03 17:15:33 -0600472public:
473 static const ndn::Name LOCALHOST_PREFIX;
474
akmhoque157b0a42014-05-13 00:26:37 -0500475private:
Vince Lehman904c2412014-09-23 19:36:11 -0500476 ndn::Face& m_nlsrFace;
Vince Lehman7c603292014-09-11 17:48:16 -0500477 ndn::Scheduler& m_scheduler;
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500478 ndn::security::v2::KeyChain& m_keyChain;
akmhoque53353462014-04-22 08:43:45 -0500479 ConfParameter m_confParam;
akmhoquec8a10f72014-04-25 18:42:55 -0500480 AdjacencyList m_adjacencyList;
481 NamePrefixList m_namePrefixList;
akmhoque53353462014-04-22 08:43:45 -0500482 bool m_isDaemonProcess;
akmhoquefdbddb12014-05-02 18:35:19 -0500483 std::string m_configFileName;
akmhoque53353462014-04-22 08:43:45 -0500484 Lsdb m_nlsrLsdb;
akmhoquefdbddb12014-05-02 18:35:19 -0500485 int64_t m_adjBuildCount;
akmhoque53353462014-04-22 08:43:45 -0500486 bool m_isBuildAdjLsaSheduled;
487 bool m_isRouteCalculationScheduled;
488 bool m_isRoutingTableCalculating;
akmhoque53353462014-04-22 08:43:45 -0500489 RoutingTable m_routingTable;
akmhoque53353462014-04-22 08:43:45 -0500490 Fib m_fib;
akmhoque31d1d4b2014-05-05 22:08:14 -0500491 NamePrefixTable m_namePrefixTable;
Laqin Fan54a43f02017-03-08 12:31:30 -0600492
laqinfan35731852017-08-08 06:17:39 -0500493 ndn::mgmt::Dispatcher m_dispatcher;
laqinfand22da512017-05-25 17:29:53 -0500494
laqinfan35731852017-08-08 06:17:39 -0500495 DatasetInterestHandler m_datasetHandler;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700496
Vince Lehmanf7eec4f2015-05-08 19:02:31 -0500497PUBLIC_WITH_TESTS_ELSE_PRIVATE:
498 HelloProtocol m_helloProtocol;
499
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -0500500 ndn::security::ValidatorConfig m_validator;
501
Vince Lehman7b616582014-10-17 16:25:39 -0500502private:
Nick Gordond0a7df32017-05-30 16:44:34 -0500503 /*! \brief Where NLSR stores certificates it claims to be
504 * authoritative for. Usually the router certificate.
505 */
Vince Lehmanc2acdcb2015-04-29 11:14:35 -0500506 security::CertificateStore m_certStore;
Nick Gordond5c1a372016-10-31 13:56:23 -0500507
Nick Gordond5c1a372016-10-31 13:56:23 -0500508 ndn::nfd::Controller m_controller;
509 ndn::nfd::Controller m_faceDatasetController;
Joao Pereira97473d42015-07-03 16:57:27 -0400510 ndn::security::SigningInfo m_signingInfo;
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700511 ndn::Name m_defaultCertName;
alvy297f4162015-03-03 17:15:33 -0600512 update::PrefixUpdateProcessor m_prefixUpdateProcessor;
Nick Gordon4d2c6c02017-01-20 13:18:46 -0600513 update::NfdRibCommandProcessor m_nfdRibCommandProcessor;
Alejandro Gil Torrese0d20482016-03-06 23:56:19 -0600514 StatsCollector m_statsCollector;
akmhoquee1765152014-06-30 11:32:01 -0500515
akmhoque060d3022014-08-12 13:35:06 -0500516 ndn::nfd::FaceMonitor m_faceMonitor;
Vince Lehman7b616582014-10-17 16:25:39 -0500517
518 uint32_t m_firstHelloInterval;
Nick Gordond5c1a372016-10-31 13:56:23 -0500519
520 friend class NlsrRunner;
akmhoque53353462014-04-22 08:43:45 -0500521};
akmhoque298385a2014-02-13 14:13:09 -0600522
Nick Gordonfad8e252016-08-11 14:21:38 -0500523} // namespace nlsr
akmhoqueb1710aa2014-02-19 17:13:36 -0600524
dmcoomes9f936662017-03-02 10:33:09 -0600525#endif // NLSR_NLSR_HPP