blob: 2b182bde6d30635c739f51e448f7148622fdbb69 [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 **/
Ashlesh Gawande5bf83172014-09-19 12:38:17 -050021
akmhoque53353462014-04-22 08:43:45 -050022#ifndef NLSR_LSDB_HPP
23#define NLSR_LSDB_HPP
24
Vince Lehman50df6b72015-03-03 12:06:40 -060025#include "conf-parameter.hpp"
akmhoque53353462014-04-22 08:43:45 -050026#include "lsa.hpp"
Ashlesh Gawande3e105a02017-05-16 17:36:56 -050027#include "sequencing-manager.hpp"
Ashlesh Gawande5bf83172014-09-19 12:38:17 -050028#include "test-access-control.hpp"
Ashlesh Gawande3e105a02017-05-16 17:36:56 -050029#include "communication/sync-logic-handler.hpp"
akmhoque53353462014-04-22 08:43:45 -050030
Ashlesh Gawande90173ad2017-08-09 15:19:50 -050031#include <utility>
32#include <boost/cstdint.hpp>
33
34#include <ndn-cxx/security/key-chain.hpp>
35#include <ndn-cxx/util/time.hpp>
36
akmhoque53353462014-04-22 08:43:45 -050037namespace nlsr {
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -070038
39using namespace ndn::time;
40
akmhoque53353462014-04-22 08:43:45 -050041class Nlsr;
42
43class Lsdb
44{
45public:
Ashlesh Gawande3e105a02017-05-16 17:36:56 -050046 Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler);
47
48 SyncLogicHandler&
49 getSyncLogicHandler()
50 {
51 return m_sync;
52 }
akmhoque53353462014-04-22 08:43:45 -050053
akmhoque53353462014-04-22 08:43:45 -050054 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050055 doesLsaExist(const ndn::Name& key, const std::string& lsType);
akmhoque53353462014-04-22 08:43:45 -050056
Nick G97e34942016-07-11 14:46:27 -050057
58 /*! \brief Builds a name LSA for this router and then installs it
59 into the LSDB.
60 */
akmhoque53353462014-04-22 08:43:45 -050061 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050062 buildAndInstallOwnNameLsa();
akmhoque53353462014-04-22 08:43:45 -050063
Nick G97e34942016-07-11 14:46:27 -050064 /*! \brief Returns the name LSA with the given key.
65 \param key The name of the router that the desired LSA comes from.
66 */
akmhoqueb6450b12014-04-24 00:01:03 -050067 NameLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -050068 findNameLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -050069
Nick G97e34942016-07-11 14:46:27 -050070 /*! \brief Installs a name LSA into the LSDB
71 \param nlsa The name LSA to install into the LSDB.
72 */
akmhoque53353462014-04-22 08:43:45 -050073 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050074 installNameLsa(NameLsa& nlsa);
akmhoque53353462014-04-22 08:43:45 -050075
Nick G97e34942016-07-11 14:46:27 -050076 /*! \brief Remove a name LSA from the LSDB.
77 \param key The name of the router that published the LSA to remove.
78
79 This function will remove a name LSA from the LSDB by finding an
80 LSA whose name matches key. This removal also causes the NPT to
81 remove those name prefixes if no more LSAs advertise them.
82 */
akmhoque53353462014-04-22 08:43:45 -050083 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050084 removeNameLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -050085
Nick G97e34942016-07-11 14:46:27 -050086 /*! Returns whether a seq. no. from a certain router signals a new LSA.
87 \param key The name of the originating router.
88 \param seqNo The sequence number to check.
89 */
akmhoque53353462014-04-22 08:43:45 -050090 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050091 isNameLsaNew(const ndn::Name& key, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -050092
93 void
akmhoque2f423352014-06-03 11:49:35 -050094 writeNameLsdbLog();
akmhoque53353462014-04-22 08:43:45 -050095
Jiewen Tana0497d82015-02-02 21:59:18 -080096 const std::list<NameLsa>&
97 getNameLsdb();
98
Nick G97e34942016-07-11 14:46:27 -050099 /*! \brief Builds a cor. LSA for this router and installs it into the LSDB. */
akmhoque53353462014-04-22 08:43:45 -0500100 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500101 buildAndInstallOwnCoordinateLsa();
akmhoque53353462014-04-22 08:43:45 -0500102
Nick G97e34942016-07-11 14:46:27 -0500103 /*! \brief Finds a cor. LSA in the LSDB.
104 \param key The name of the originating router that published the LSA.
105 */
akmhoqueb6450b12014-04-24 00:01:03 -0500106 CoordinateLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -0500107 findCoordinateLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500108
Nick G97e34942016-07-11 14:46:27 -0500109 /*! \brief Installs a cor. LSA into the LSDB.
110 \param clsa The cor. LSA to install.
111 */
akmhoque53353462014-04-22 08:43:45 -0500112 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500113 installCoordinateLsa(CoordinateLsa& clsa);
akmhoque53353462014-04-22 08:43:45 -0500114
Nick G97e34942016-07-11 14:46:27 -0500115 /*! \brief Removes a cor. LSA from the LSDB.
116 \param key The name of the router that published the LSA to remove.
117
118 Removes the coordinate LSA whose origin router name matches that
119 given by key. Additionally, ask the NPT to remove the prefix,
120 which will occur if no other LSAs point there.
121 */
akmhoque53353462014-04-22 08:43:45 -0500122 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500123 removeCoordinateLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500124
Nick G97e34942016-07-11 14:46:27 -0500125 /*! \brief Returns whether a cor. LSA from a router is new or not.
126 \param key The name prefix of the originating router.
127 \param seqNo The sequence number of the candidate LSA.
128 */
akmhoque53353462014-04-22 08:43:45 -0500129 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500130 isCoordinateLsaNew(const ndn::Name& key, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500131
132 void
akmhoque2f423352014-06-03 11:49:35 -0500133 writeCorLsdbLog();
akmhoque53353462014-04-22 08:43:45 -0500134
Jiewen Tana0497d82015-02-02 21:59:18 -0800135 const std::list<CoordinateLsa>&
136 getCoordinateLsdb();
137
Nick G97e34942016-07-11 14:46:27 -0500138 //function related to Adj LSDB
139
140 /*! \brief Schedules a build of this router's LSA. */
akmhoque53353462014-04-22 08:43:45 -0500141 void
Vince Lehman50df6b72015-03-03 12:06:40 -0600142 scheduleAdjLsaBuild();
akmhoque53353462014-04-22 08:43:45 -0500143
Nick G97e34942016-07-11 14:46:27 -0500144 /*! \brief Wrapper event to build and install an adj. LSA for this router. */
akmhoque53353462014-04-22 08:43:45 -0500145 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500146 buildAndInstallOwnAdjLsa();
akmhoque53353462014-04-22 08:43:45 -0500147
Nick G97e34942016-07-11 14:46:27 -0500148 /*! \brief Removes an adj. LSA from the LSDB.
149 \param key The name of the publishing router whose LSA to remove.
150 */
akmhoque53353462014-04-22 08:43:45 -0500151 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500152 removeAdjLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500153
Nick G97e34942016-07-11 14:46:27 -0500154 /*! \brief Returns whether an LSA is new.
155 \param key The name of the publishing router.
156 \param seqNo The seq. no. of the candidate LSA.
157
158 This function determines whether the LSA with the name key and
159 seq. no. seqNo would be new to this LSDB.
160 */
akmhoque53353462014-04-22 08:43:45 -0500161 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500162 isAdjLsaNew(const ndn::Name& key, uint64_t seqNo);
Jiewen Tana0497d82015-02-02 21:59:18 -0800163
Nick G97e34942016-07-11 14:46:27 -0500164 /*! \brief Installs an adj. LSA into the LSDB.
165 \param alsa The adj. LSA to add to the LSDB.
166 */
akmhoque53353462014-04-22 08:43:45 -0500167 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500168 installAdjLsa(AdjLsa& alsa);
akmhoque53353462014-04-22 08:43:45 -0500169
Nick G97e34942016-07-11 14:46:27 -0500170 /*! \brief Finds an adj. LSA in the LSDB.
171 \param key The name of the publishing router whose LSA to find.
172 */
akmhoqueb6450b12014-04-24 00:01:03 -0500173 AdjLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -0500174 findAdjLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500175
Jiewen Tana0497d82015-02-02 21:59:18 -0800176 const std::list<AdjLsa>&
akmhoque53353462014-04-22 08:43:45 -0500177 getAdjLsdb();
178
179 void
Vince Lehman50df6b72015-03-03 12:06:40 -0600180 setAdjLsaBuildInterval(uint32_t interval)
181 {
182 m_adjLsaBuildInterval = ndn::time::seconds(interval);
183 }
184
185 const ndn::time::seconds&
186 getAdjLsaBuildInterval() const
187 {
188 return m_adjLsaBuildInterval;
189 }
190
Ashlesh Gawande3e105a02017-05-16 17:36:56 -0500191 SequencingManager&
192 getSequencingManager()
193 {
194 return m_sequencingManager;
195 }
196
Vince Lehman50df6b72015-03-03 12:06:40 -0600197 void
akmhoque2f423352014-06-03 11:49:35 -0500198 writeAdjLsdbLog();
akmhoque53353462014-04-22 08:43:45 -0500199
akmhoque53353462014-04-22 08:43:45 -0500200 void
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700201 setLsaRefreshTime(const seconds& lsaRefreshTime);
akmhoque53353462014-04-22 08:43:45 -0500202
203 void
204 setThisRouterPrefix(std::string trp);
205
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500206 void
207 expressInterest(const ndn::Name& interestName, uint32_t timeoutCount,
208 steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE);
209
210 void
211 processInterest(const ndn::Name& name, const ndn::Interest& interest);
212
akmhoque53353462014-04-22 08:43:45 -0500213private:
Nick G97e34942016-07-11 14:46:27 -0500214 /* \brief Add a name LSA to the LSDB if it isn't already there.
215 \param nlsa The candidade name LSA.
216 */
akmhoque53353462014-04-22 08:43:45 -0500217 bool
218 addNameLsa(NameLsa& nlsa);
219
Nick G97e34942016-07-11 14:46:27 -0500220 /*! \brief Returns whether the LSDB contains some LSA.
221 \param key The name of the publishing router whose LSA to check for.
222 */
akmhoque53353462014-04-22 08:43:45 -0500223 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500224 doesNameLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500225
Nick G97e34942016-07-11 14:46:27 -0500226 /*! \brief Adds a cor. LSA to the LSDB if it isn't already there.
227 \param clsa The candidate cor. LSA.
228 */
akmhoque53353462014-04-22 08:43:45 -0500229 bool
akmhoqueb6450b12014-04-24 00:01:03 -0500230 addCoordinateLsa(CoordinateLsa& clsa);
akmhoque53353462014-04-22 08:43:45 -0500231
Nick G97e34942016-07-11 14:46:27 -0500232 /*! \brief Returns whether a cor. LSA is in the LSDB.
233 \param key The name of the router that published the queried LSA.
234 */
akmhoque53353462014-04-22 08:43:45 -0500235 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500236 doesCoordinateLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500237
Nick G97e34942016-07-11 14:46:27 -0500238 /*! \brief Attempts to construct an adj. LSA.
239
240 This function will attempt to construct an adjacency LSA. An LSA
241 can only be built when the status of all of the router's neighbors
242 is known. That is, when we are not currently trying to contact any
243 neighbor.
244 */
Vince Lehman50df6b72015-03-03 12:06:40 -0600245 void
246 buildAdjLsa();
247
Nick G97e34942016-07-11 14:46:27 -0500248 /*! \brief Adds an adj. LSA to the LSDB if it isn't already there.
249 \param alsa The candidate adj. LSA to add to the LSDB.
250 */
akmhoque53353462014-04-22 08:43:45 -0500251 bool
252 addAdjLsa(AdjLsa& alsa);
253
Nick G97e34942016-07-11 14:46:27 -0500254 /*! \brief Returns whether the LSDB contains an LSA.
255 \param key The name of a router whose LSA to check for in the LSDB.
256 */
akmhoque53353462014-04-22 08:43:45 -0500257 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500258 doesAdjLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500259
Nick G97e34942016-07-11 14:46:27 -0500260 /*! \brief Schedules a refresh/expire event in the scheduler.
261 \param key The name of the router that published the LSA.
262 \param seqNo The seq. no. associated with the LSA.
263 \param expTime How many seconds to wait before triggering the event.
264 */
akmhoque53353462014-04-22 08:43:45 -0500265 ndn::EventId
akmhoquec7a79b22014-05-26 08:06:19 -0500266 scheduleNameLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700267 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500268
Nick G97e34942016-07-11 14:46:27 -0500269 /*! \brief Either allow to expire, or refresh a name LSA.
270 \param lsaKey The name of the router that published the LSA.
271 \param seqNo The seq. no. of the LSA to check.
272 */
akmhoque53353462014-04-22 08:43:45 -0500273 void
Ashlesh Gawande90173ad2017-08-09 15:19:50 -0500274 expireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500275
Vince Lehman199e9cf2015-04-07 13:22:16 -0500276PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Nick G97e34942016-07-11 14:46:27 -0500277 /*! \brief Schedules an expire/refresh event in the LSA.
278 \param key The name of the router whose LSA is in question.
279 \param seqNo The sequence number of the LSA to check.
280 \param expTime The number of seconds to wait before triggering the event.
281 */
akmhoque53353462014-04-22 08:43:45 -0500282 ndn::EventId
akmhoquec7a79b22014-05-26 08:06:19 -0500283 scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700284 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500285
Vince Lehman199e9cf2015-04-07 13:22:16 -0500286private:
Nick G97e34942016-07-11 14:46:27 -0500287
akmhoque53353462014-04-22 08:43:45 -0500288 void
Ashlesh Gawande90173ad2017-08-09 15:19:50 -0500289 expireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500290
291 ndn::EventId
akmhoque31d1d4b2014-05-05 22:08:14 -0500292 scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700293 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500294
295 void
Ashlesh Gawande90173ad2017-08-09 15:19:50 -0500296 expireOrRefreshCoordinateLsa(const ndn::Name& lsaKey,
akmhoqueb6450b12014-04-24 00:01:03 -0500297 uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500298
Nick G97e34942016-07-11 14:46:27 -0500299private:
300
akmhoque31d1d4b2014-05-05 22:08:14 -0500301 void
akmhoque69c9aa92014-07-23 15:15:05 -0500302 putLsaData(const ndn::Interest& interest, const std::string& content);
303
304 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500305 processInterestForNameLsa(const ndn::Interest& interest,
306 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500307 uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500308
akmhoque31d1d4b2014-05-05 22:08:14 -0500309 void
310 processInterestForAdjacencyLsa(const ndn::Interest& interest,
311 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500312 uint64_t seqNo);
akmhoque31d1d4b2014-05-05 22:08:14 -0500313
314 void
315 processInterestForCoordinateLsa(const ndn::Interest& interest,
316 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500317 uint64_t seqNo);
akmhoque31d1d4b2014-05-05 22:08:14 -0500318 void
dmcoomes9f936662017-03-02 10:33:09 -0600319 onContentValidated(const std::shared_ptr<const ndn::Data>& data);
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700320
321 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500322 processContentNameLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500323 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500324
325 void
326 processContentAdjacencyLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500327 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500328
329 void
330 processContentCoordinateLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500331 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500332
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500333PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Nick G97e34942016-07-11 14:46:27 -0500334 /*!
335 \brief Error callback when SegmentFetcher fails to return an LSA
336
337 In all error cases, a reattempt to fetch the LSA will be made.
338
339 Segment validation can fail either because the packet does not have a
340 valid signature (fatal) or because some of the certificates in the trust chain
341 could not be fetched (non-fatal).
342
343 Currently, the library does not provide clear indication (besides a plain-text message
344 in the error callback) of the reason for the failure nor the segment that failed
345 to be validated, thus we will continue to try to fetch the LSA until the deadline
346 is reached.
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500347 */
akmhoque31d1d4b2014-05-05 22:08:14 -0500348 void
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500349 onFetchLsaError(uint32_t errorCode,
350 const std::string& msg,
351 ndn::Name& interestName,
352 uint32_t retransmitNo,
353 const ndn::time::steady_clock::TimePoint& deadline,
354 ndn::Name lsaName,
355 uint64_t seqNo);
356
Nick G97e34942016-07-11 14:46:27 -0500357 /*!
358 \brief Success callback when SegmentFetcher returns a valid LSA
359
Nick Gordonb50e51b2016-07-22 16:05:57 -0500360 \param interestName The base Interest used to fetch the LSA in the format:
Nick G97e34942016-07-11 14:46:27 -0500361 /<network>/NLSR/LSA/<site>/%C1.Router/<router>/<lsa-type>/<seqNo>
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500362 */
363 void
364 afterFetchLsa(const ndn::ConstBufferPtr& data, ndn::Name& interestName);
akmhoque31d1d4b2014-05-05 22:08:14 -0500365
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500366private:
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700367 system_clock::TimePoint
akmhoquec7a79b22014-05-26 08:06:19 -0500368 getLsaExpirationTimePoint();
369
Nick G97e34942016-07-11 14:46:27 -0500370 /*! \brief Cancels an event in the event scheduler. */
akmhoque31d1d4b2014-05-05 22:08:14 -0500371 void
372 cancelScheduleLsaExpiringEvent(ndn::EventId eid);
373
Jiewen Tana0497d82015-02-02 21:59:18 -0800374public:
375 static const ndn::Name::Component NAME_COMPONENT;
376
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500377private:
akmhoque31d1d4b2014-05-05 22:08:14 -0500378 Nlsr& m_nlsr;
Vince Lehman7c603292014-09-11 17:48:16 -0500379 ndn::Scheduler& m_scheduler;
Ashlesh Gawande3e105a02017-05-16 17:36:56 -0500380 SyncLogicHandler m_sync;
Vince Lehman7c603292014-09-11 17:48:16 -0500381
akmhoque53353462014-04-22 08:43:45 -0500382 std::list<NameLsa> m_nameLsdb;
383 std::list<AdjLsa> m_adjLsdb;
akmhoqueb6450b12014-04-24 00:01:03 -0500384 std::list<CoordinateLsa> m_corLsdb;
akmhoque53353462014-04-22 08:43:45 -0500385
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700386 seconds m_lsaRefreshTime;
akmhoque53353462014-04-22 08:43:45 -0500387 std::string m_thisRouterPrefix;
388
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500389 typedef std::map<ndn::Name, uint64_t> SequenceNumberMap;
390
391 // Maps the name of an LSA to its highest known sequence number from sync;
392 // Used to stop NLSR from trying to fetch outdated LSAs
393 SequenceNumberMap m_highestSeqNo;
394
Vince Lehman18841082014-08-19 17:15:24 -0500395 static const ndn::time::seconds GRACE_PERIOD;
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500396 static const steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE;
Vince Lehman50df6b72015-03-03 12:06:40 -0600397
398 ndn::time::seconds m_adjLsaBuildInterval;
Ashlesh Gawande3e105a02017-05-16 17:36:56 -0500399
400 SequencingManager m_sequencingManager;
akmhoque53353462014-04-22 08:43:45 -0500401};
402
Nick Gordonfad8e252016-08-11 14:21:38 -0500403} // namespace nlsr
akmhoque53353462014-04-22 08:43:45 -0500404
dmcoomes9f936662017-03-02 10:33:09 -0600405#endif // NLSR_LSDB_HPP