blob: acd030dbce62beba1a9415d783a18cd4dfaa0c3c [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -05003 * Copyright (c) 2014-2016, 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
25#include <utility>
akmhoquefdbddb12014-05-02 18:35:19 -050026#include <boost/cstdint.hpp>
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -050027
akmhoque31d1d4b2014-05-05 22:08:14 -050028#include <ndn-cxx/security/key-chain.hpp>
akmhoquec7a79b22014-05-26 08:06:19 -050029#include <ndn-cxx/util/time.hpp>
akmhoquefdbddb12014-05-02 18:35:19 -050030
Vince Lehman50df6b72015-03-03 12:06:40 -060031#include "conf-parameter.hpp"
akmhoque53353462014-04-22 08:43:45 -050032#include "lsa.hpp"
Ashlesh Gawande5bf83172014-09-19 12:38:17 -050033#include "test-access-control.hpp"
akmhoque53353462014-04-22 08:43:45 -050034
35namespace nlsr {
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -070036
37using namespace ndn::time;
38
akmhoque53353462014-04-22 08:43:45 -050039class Nlsr;
Vince Lehman0bcf9a32014-12-10 11:24:45 -060040class SyncLogicHandler;
akmhoque53353462014-04-22 08:43:45 -050041
42class Lsdb
43{
44public:
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -050045 Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler, SyncLogicHandler& sync);
akmhoque53353462014-04-22 08:43:45 -050046
akmhoque53353462014-04-22 08:43:45 -050047 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050048 doesLsaExist(const ndn::Name& key, const std::string& lsType);
akmhoque53353462014-04-22 08:43:45 -050049
Nick G97e34942016-07-11 14:46:27 -050050
51 /*! \brief Builds a name LSA for this router and then installs it
52 into the LSDB.
53 */
akmhoque53353462014-04-22 08:43:45 -050054 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050055 buildAndInstallOwnNameLsa();
akmhoque53353462014-04-22 08:43:45 -050056
Nick G97e34942016-07-11 14:46:27 -050057 /*! \brief Returns the name LSA with the given key.
58 \param key The name of the router that the desired LSA comes from.
59 */
akmhoqueb6450b12014-04-24 00:01:03 -050060 NameLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -050061 findNameLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -050062
Nick G97e34942016-07-11 14:46:27 -050063 /*! \brief Installs a name LSA into the LSDB
64 \param nlsa The name LSA to install into the LSDB.
65 */
akmhoque53353462014-04-22 08:43:45 -050066 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050067 installNameLsa(NameLsa& nlsa);
akmhoque53353462014-04-22 08:43:45 -050068
Nick G97e34942016-07-11 14:46:27 -050069 /*! \brief Remove a name LSA from the LSDB.
70 \param key The name of the router that published the LSA to remove.
71
72 This function will remove a name LSA from the LSDB by finding an
73 LSA whose name matches key. This removal also causes the NPT to
74 remove those name prefixes if no more LSAs advertise them.
75 */
akmhoque53353462014-04-22 08:43:45 -050076 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050077 removeNameLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -050078
Nick G97e34942016-07-11 14:46:27 -050079 /*! Returns whether a seq. no. from a certain router signals a new LSA.
80 \param key The name of the originating router.
81 \param seqNo The sequence number to check.
82 */
akmhoque53353462014-04-22 08:43:45 -050083 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050084 isNameLsaNew(const ndn::Name& key, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -050085
86 void
akmhoque2f423352014-06-03 11:49:35 -050087 writeNameLsdbLog();
akmhoque53353462014-04-22 08:43:45 -050088
Jiewen Tana0497d82015-02-02 21:59:18 -080089 const std::list<NameLsa>&
90 getNameLsdb();
91
Nick G97e34942016-07-11 14:46:27 -050092 /*! \brief Builds a cor. LSA for this router and installs it into the LSDB. */
akmhoque53353462014-04-22 08:43:45 -050093 bool
akmhoque31d1d4b2014-05-05 22:08:14 -050094 buildAndInstallOwnCoordinateLsa();
akmhoque53353462014-04-22 08:43:45 -050095
Nick G97e34942016-07-11 14:46:27 -050096 /*! \brief Finds a cor. LSA in the LSDB.
97 \param key The name of the originating router that published the LSA.
98 */
akmhoqueb6450b12014-04-24 00:01:03 -050099 CoordinateLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -0500100 findCoordinateLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500101
Nick G97e34942016-07-11 14:46:27 -0500102 /*! \brief Installs a cor. LSA into the LSDB.
103 \param clsa The cor. LSA to install.
104 */
akmhoque53353462014-04-22 08:43:45 -0500105 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500106 installCoordinateLsa(CoordinateLsa& clsa);
akmhoque53353462014-04-22 08:43:45 -0500107
Nick G97e34942016-07-11 14:46:27 -0500108 /*! \brief Removes a cor. LSA from the LSDB.
109 \param key The name of the router that published the LSA to remove.
110
111 Removes the coordinate LSA whose origin router name matches that
112 given by key. Additionally, ask the NPT to remove the prefix,
113 which will occur if no other LSAs point there.
114 */
akmhoque53353462014-04-22 08:43:45 -0500115 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500116 removeCoordinateLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500117
Nick G97e34942016-07-11 14:46:27 -0500118 /*! \brief Returns whether a cor. LSA from a router is new or not.
119 \param key The name prefix of the originating router.
120 \param seqNo The sequence number of the candidate LSA.
121 */
akmhoque53353462014-04-22 08:43:45 -0500122 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500123 isCoordinateLsaNew(const ndn::Name& key, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500124
125 void
akmhoque2f423352014-06-03 11:49:35 -0500126 writeCorLsdbLog();
akmhoque53353462014-04-22 08:43:45 -0500127
Jiewen Tana0497d82015-02-02 21:59:18 -0800128 const std::list<CoordinateLsa>&
129 getCoordinateLsdb();
130
Nick G97e34942016-07-11 14:46:27 -0500131 //function related to Adj LSDB
132
133 /*! \brief Schedules a build of this router's LSA. */
akmhoque53353462014-04-22 08:43:45 -0500134 void
Vince Lehman50df6b72015-03-03 12:06:40 -0600135 scheduleAdjLsaBuild();
akmhoque53353462014-04-22 08:43:45 -0500136
Nick G97e34942016-07-11 14:46:27 -0500137 /*! \brief Wrapper event to build and install an adj. LSA for this router. */
akmhoque53353462014-04-22 08:43:45 -0500138 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500139 buildAndInstallOwnAdjLsa();
akmhoque53353462014-04-22 08:43:45 -0500140
Nick G97e34942016-07-11 14:46:27 -0500141 /*! \brief Removes an adj. LSA from the LSDB.
142 \param key The name of the publishing router whose LSA to remove.
143 */
akmhoque53353462014-04-22 08:43:45 -0500144 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500145 removeAdjLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500146
Nick G97e34942016-07-11 14:46:27 -0500147 /*! \brief Returns whether an LSA is new.
148 \param key The name of the publishing router.
149 \param seqNo The seq. no. of the candidate LSA.
150
151 This function determines whether the LSA with the name key and
152 seq. no. seqNo would be new to this LSDB.
153 */
akmhoque53353462014-04-22 08:43:45 -0500154 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500155 isAdjLsaNew(const ndn::Name& key, uint64_t seqNo);
Jiewen Tana0497d82015-02-02 21:59:18 -0800156
Nick G97e34942016-07-11 14:46:27 -0500157 /*! \brief Installs an adj. LSA into the LSDB.
158 \param alsa The adj. LSA to add to the LSDB.
159 */
akmhoque53353462014-04-22 08:43:45 -0500160 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500161 installAdjLsa(AdjLsa& alsa);
akmhoque53353462014-04-22 08:43:45 -0500162
Nick G97e34942016-07-11 14:46:27 -0500163 /*! \brief Finds an adj. LSA in the LSDB.
164 \param key The name of the publishing router whose LSA to find.
165 */
akmhoqueb6450b12014-04-24 00:01:03 -0500166 AdjLsa*
akmhoque31d1d4b2014-05-05 22:08:14 -0500167 findAdjLsa(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500168
Jiewen Tana0497d82015-02-02 21:59:18 -0800169 const std::list<AdjLsa>&
akmhoque53353462014-04-22 08:43:45 -0500170 getAdjLsdb();
171
172 void
Vince Lehman50df6b72015-03-03 12:06:40 -0600173 setAdjLsaBuildInterval(uint32_t interval)
174 {
175 m_adjLsaBuildInterval = ndn::time::seconds(interval);
176 }
177
178 const ndn::time::seconds&
179 getAdjLsaBuildInterval() const
180 {
181 return m_adjLsaBuildInterval;
182 }
183
184 void
akmhoque2f423352014-06-03 11:49:35 -0500185 writeAdjLsdbLog();
akmhoque53353462014-04-22 08:43:45 -0500186
akmhoque53353462014-04-22 08:43:45 -0500187 void
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700188 setLsaRefreshTime(const seconds& lsaRefreshTime);
akmhoque53353462014-04-22 08:43:45 -0500189
190 void
191 setThisRouterPrefix(std::string trp);
192
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500193 void
194 expressInterest(const ndn::Name& interestName, uint32_t timeoutCount,
195 steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE);
196
197 void
198 processInterest(const ndn::Name& name, const ndn::Interest& interest);
199
akmhoque53353462014-04-22 08:43:45 -0500200private:
Nick G97e34942016-07-11 14:46:27 -0500201 /* \brief Add a name LSA to the LSDB if it isn't already there.
202 \param nlsa The candidade name LSA.
203 */
akmhoque53353462014-04-22 08:43:45 -0500204 bool
205 addNameLsa(NameLsa& nlsa);
206
Nick G97e34942016-07-11 14:46:27 -0500207 /*! \brief Returns whether the LSDB contains some LSA.
208 \param key The name of the publishing router whose LSA to check for.
209 */
akmhoque53353462014-04-22 08:43:45 -0500210 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500211 doesNameLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500212
Nick G97e34942016-07-11 14:46:27 -0500213 /*! \brief Adds a cor. LSA to the LSDB if it isn't already there.
214 \param clsa The candidate cor. LSA.
215 */
akmhoque53353462014-04-22 08:43:45 -0500216 bool
akmhoqueb6450b12014-04-24 00:01:03 -0500217 addCoordinateLsa(CoordinateLsa& clsa);
akmhoque53353462014-04-22 08:43:45 -0500218
Nick G97e34942016-07-11 14:46:27 -0500219 /*! \brief Returns whether a cor. LSA is in the LSDB.
220 \param key The name of the router that published the queried LSA.
221 */
akmhoque53353462014-04-22 08:43:45 -0500222 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500223 doesCoordinateLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500224
Nick G97e34942016-07-11 14:46:27 -0500225 /*! \brief Attempts to construct an adj. LSA.
226
227 This function will attempt to construct an adjacency LSA. An LSA
228 can only be built when the status of all of the router's neighbors
229 is known. That is, when we are not currently trying to contact any
230 neighbor.
231 */
Vince Lehman50df6b72015-03-03 12:06:40 -0600232 void
233 buildAdjLsa();
234
Nick G97e34942016-07-11 14:46:27 -0500235 /*! \brief Adds an adj. LSA to the LSDB if it isn't already there.
236 \param alsa The candidate adj. LSA to add to the LSDB.
237 */
akmhoque53353462014-04-22 08:43:45 -0500238 bool
239 addAdjLsa(AdjLsa& alsa);
240
Nick G97e34942016-07-11 14:46:27 -0500241 /*! \brief Returns whether the LSDB contains an LSA.
242 \param key The name of a router whose LSA to check for in the LSDB.
243 */
akmhoque53353462014-04-22 08:43:45 -0500244 bool
akmhoque31d1d4b2014-05-05 22:08:14 -0500245 doesAdjLsaExist(const ndn::Name& key);
akmhoque53353462014-04-22 08:43:45 -0500246
Nick G97e34942016-07-11 14:46:27 -0500247 /*! \brief Schedules a refresh/expire event in the scheduler.
248 \param key The name of the router that published the LSA.
249 \param seqNo The seq. no. associated with the LSA.
250 \param expTime How many seconds to wait before triggering the event.
251 */
akmhoque53353462014-04-22 08:43:45 -0500252 ndn::EventId
akmhoquec7a79b22014-05-26 08:06:19 -0500253 scheduleNameLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700254 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500255
Nick G97e34942016-07-11 14:46:27 -0500256 /*! \brief Either allow to expire, or refresh a name LSA.
257 \param lsaKey The name of the router that published the LSA.
258 \param seqNo The seq. no. of the LSA to check.
259 */
akmhoque53353462014-04-22 08:43:45 -0500260 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500261 exprireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500262
Vince Lehman199e9cf2015-04-07 13:22:16 -0500263PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Nick G97e34942016-07-11 14:46:27 -0500264 /*! \brief Schedules an expire/refresh event in the LSA.
265 \param key The name of the router whose LSA is in question.
266 \param seqNo The sequence number of the LSA to check.
267 \param expTime The number of seconds to wait before triggering the event.
268 */
akmhoque53353462014-04-22 08:43:45 -0500269 ndn::EventId
akmhoquec7a79b22014-05-26 08:06:19 -0500270 scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700271 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500272
Vince Lehman199e9cf2015-04-07 13:22:16 -0500273private:
Nick G97e34942016-07-11 14:46:27 -0500274
akmhoque53353462014-04-22 08:43:45 -0500275 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500276 exprireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500277
278 ndn::EventId
akmhoque31d1d4b2014-05-05 22:08:14 -0500279 scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo,
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700280 const seconds& expTime);
akmhoque53353462014-04-22 08:43:45 -0500281
282 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500283 exprireOrRefreshCoordinateLsa(const ndn::Name& lsaKey,
akmhoqueb6450b12014-04-24 00:01:03 -0500284 uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500285
Nick G97e34942016-07-11 14:46:27 -0500286private:
287
akmhoque31d1d4b2014-05-05 22:08:14 -0500288 void
akmhoque69c9aa92014-07-23 15:15:05 -0500289 putLsaData(const ndn::Interest& interest, const std::string& content);
290
291 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500292 processInterestForNameLsa(const ndn::Interest& interest,
293 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500294 uint64_t seqNo);
akmhoque53353462014-04-22 08:43:45 -0500295
akmhoque31d1d4b2014-05-05 22:08:14 -0500296 void
297 processInterestForAdjacencyLsa(const ndn::Interest& interest,
298 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500299 uint64_t seqNo);
akmhoque31d1d4b2014-05-05 22:08:14 -0500300
301 void
302 processInterestForCoordinateLsa(const ndn::Interest& interest,
303 const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500304 uint64_t seqNo);
akmhoque31d1d4b2014-05-05 22:08:14 -0500305 void
Yingdi Yu20e3a6e2014-05-26 23:16:10 -0700306 onContentValidated(const ndn::shared_ptr<const ndn::Data>& data);
307
308 void
akmhoque31d1d4b2014-05-05 22:08:14 -0500309 processContentNameLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500310 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500311
312 void
313 processContentAdjacencyLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500314 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500315
316 void
317 processContentCoordinateLsa(const ndn::Name& lsaKey,
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500318 uint64_t lsSeqNo, std::string& dataContent);
akmhoque31d1d4b2014-05-05 22:08:14 -0500319
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500320PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Nick G97e34942016-07-11 14:46:27 -0500321 /*!
322 \brief Error callback when SegmentFetcher fails to return an LSA
323
324 In all error cases, a reattempt to fetch the LSA will be made.
325
326 Segment validation can fail either because the packet does not have a
327 valid signature (fatal) or because some of the certificates in the trust chain
328 could not be fetched (non-fatal).
329
330 Currently, the library does not provide clear indication (besides a plain-text message
331 in the error callback) of the reason for the failure nor the segment that failed
332 to be validated, thus we will continue to try to fetch the LSA until the deadline
333 is reached.
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500334 */
akmhoque31d1d4b2014-05-05 22:08:14 -0500335 void
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500336 onFetchLsaError(uint32_t errorCode,
337 const std::string& msg,
338 ndn::Name& interestName,
339 uint32_t retransmitNo,
340 const ndn::time::steady_clock::TimePoint& deadline,
341 ndn::Name lsaName,
342 uint64_t seqNo);
343
Nick G97e34942016-07-11 14:46:27 -0500344 /*!
345 \brief Success callback when SegmentFetcher returns a valid LSA
346
Nick Gordonb50e51b2016-07-22 16:05:57 -0500347 \param interestName The base Interest used to fetch the LSA in the format:
Nick G97e34942016-07-11 14:46:27 -0500348 /<network>/NLSR/LSA/<site>/%C1.Router/<router>/<lsa-type>/<seqNo>
Muktadir R Chowdhuryaa3b0852015-08-06 13:08:56 -0500349 */
350 void
351 afterFetchLsa(const ndn::ConstBufferPtr& data, ndn::Name& interestName);
akmhoque31d1d4b2014-05-05 22:08:14 -0500352
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500353private:
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700354 system_clock::TimePoint
akmhoquec7a79b22014-05-26 08:06:19 -0500355 getLsaExpirationTimePoint();
356
Nick G97e34942016-07-11 14:46:27 -0500357 /*! \brief Cancels an event in the event scheduler. */
akmhoque31d1d4b2014-05-05 22:08:14 -0500358 void
359 cancelScheduleLsaExpiringEvent(ndn::EventId eid);
360
Jiewen Tana0497d82015-02-02 21:59:18 -0800361public:
362 static const ndn::Name::Component NAME_COMPONENT;
363
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500364private:
akmhoque31d1d4b2014-05-05 22:08:14 -0500365 Nlsr& m_nlsr;
Vince Lehman7c603292014-09-11 17:48:16 -0500366 ndn::Scheduler& m_scheduler;
Vince Lehman0bcf9a32014-12-10 11:24:45 -0600367 SyncLogicHandler& m_sync;
Vince Lehman7c603292014-09-11 17:48:16 -0500368
akmhoque53353462014-04-22 08:43:45 -0500369 std::list<NameLsa> m_nameLsdb;
370 std::list<AdjLsa> m_adjLsdb;
akmhoqueb6450b12014-04-24 00:01:03 -0500371 std::list<CoordinateLsa> m_corLsdb;
akmhoque53353462014-04-22 08:43:45 -0500372
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700373 seconds m_lsaRefreshTime;
akmhoque53353462014-04-22 08:43:45 -0500374 std::string m_thisRouterPrefix;
375
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500376 typedef std::map<ndn::Name, uint64_t> SequenceNumberMap;
377
378 // Maps the name of an LSA to its highest known sequence number from sync;
379 // Used to stop NLSR from trying to fetch outdated LSAs
380 SequenceNumberMap m_highestSeqNo;
381
Vince Lehman18841082014-08-19 17:15:24 -0500382 static const ndn::time::seconds GRACE_PERIOD;
Ashlesh Gawande5bf83172014-09-19 12:38:17 -0500383 static const steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE;
Vince Lehman50df6b72015-03-03 12:06:40 -0600384
385 ndn::time::seconds m_adjLsaBuildInterval;
akmhoque53353462014-04-22 08:43:45 -0500386};
387
Nick Gordonfad8e252016-08-11 14:21:38 -0500388} // namespace nlsr
akmhoque53353462014-04-22 08:43:45 -0500389
390#endif //NLSR_LSDB_HPP