akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 3 | * Copyright (c) 2014-2015, The University of Memphis, |
| 4 | * Regents of the University of California, |
| 5 | * Arizona Board of Regents. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 6 | * |
| 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/>. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 20 | **/ |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 21 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 22 | #ifndef NLSR_LSDB_HPP |
| 23 | #define NLSR_LSDB_HPP |
| 24 | |
| 25 | #include <utility> |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 26 | #include <boost/cstdint.hpp> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 27 | #include <ndn-cxx/security/key-chain.hpp> |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 28 | #include <ndn-cxx/util/time.hpp> |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 29 | |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 30 | #include "conf-parameter.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 31 | #include "lsa.hpp" |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 32 | #include "test-access-control.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 33 | |
| 34 | namespace nlsr { |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 35 | |
| 36 | using namespace ndn::time; |
| 37 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 38 | class Nlsr; |
Vince Lehman | 0bcf9a3 | 2014-12-10 11:24:45 -0600 | [diff] [blame] | 39 | class SyncLogicHandler; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 40 | |
| 41 | class Lsdb |
| 42 | { |
| 43 | public: |
Vince Lehman | 0bcf9a3 | 2014-12-10 11:24:45 -0600 | [diff] [blame] | 44 | Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler, SyncLogicHandler& sync) |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 45 | : m_nlsr(nlsr) |
Vince Lehman | 7c60329 | 2014-09-11 17:48:16 -0500 | [diff] [blame] | 46 | , m_scheduler(scheduler) |
Vince Lehman | 0bcf9a3 | 2014-12-10 11:24:45 -0600 | [diff] [blame] | 47 | , m_sync(sync) |
Vince Lehman | 904c241 | 2014-09-23 19:36:11 -0500 | [diff] [blame] | 48 | , m_hasSyncPrefixBeenRegistered(false) |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 49 | , m_lsaRefreshTime(0) |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 50 | , m_adjLsaBuildInterval(static_cast<uint32_t>(ADJ_LSA_BUILD_INTERVAL_DEFAULT)) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 51 | { |
| 52 | } |
| 53 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 54 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 55 | doesLsaExist(const ndn::Name& key, const std::string& lsType); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 56 | // function related to Name LSDB |
| 57 | |
| 58 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 59 | buildAndInstallOwnNameLsa(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 60 | |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 61 | NameLsa* |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 62 | findNameLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 63 | |
| 64 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 65 | installNameLsa(NameLsa& nlsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 66 | |
| 67 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 68 | removeNameLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 69 | |
| 70 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 71 | isNameLsaNew(const ndn::Name& key, uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 72 | |
| 73 | void |
akmhoque | 2f42335 | 2014-06-03 11:49:35 -0500 | [diff] [blame] | 74 | writeNameLsdbLog(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 75 | |
| 76 | //function related to Cor LSDB |
| 77 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 78 | buildAndInstallOwnCoordinateLsa(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 79 | |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 80 | CoordinateLsa* |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 81 | findCoordinateLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 82 | |
| 83 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 84 | installCoordinateLsa(CoordinateLsa& clsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 85 | |
| 86 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 87 | removeCoordinateLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 88 | |
| 89 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 90 | isCoordinateLsaNew(const ndn::Name& key, uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 91 | |
| 92 | void |
akmhoque | 2f42335 | 2014-06-03 11:49:35 -0500 | [diff] [blame] | 93 | writeCorLsdbLog(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 94 | |
| 95 | //function related to Adj LSDB |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 96 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 97 | void |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 98 | scheduleAdjLsaBuild(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 99 | |
| 100 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 101 | buildAndInstallOwnAdjLsa(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 102 | |
| 103 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 104 | removeAdjLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 105 | |
| 106 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 107 | isAdjLsaNew(const ndn::Name& key, uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 108 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 109 | installAdjLsa(AdjLsa& alsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 110 | |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 111 | AdjLsa* |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 112 | findAdjLsa(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 113 | |
| 114 | std::list<AdjLsa>& |
| 115 | getAdjLsdb(); |
| 116 | |
| 117 | void |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 118 | setAdjLsaBuildInterval(uint32_t interval) |
| 119 | { |
| 120 | m_adjLsaBuildInterval = ndn::time::seconds(interval); |
| 121 | } |
| 122 | |
| 123 | const ndn::time::seconds& |
| 124 | getAdjLsaBuildInterval() const |
| 125 | { |
| 126 | return m_adjLsaBuildInterval; |
| 127 | } |
| 128 | |
| 129 | void |
akmhoque | 2f42335 | 2014-06-03 11:49:35 -0500 | [diff] [blame] | 130 | writeAdjLsdbLog(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 131 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 132 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 133 | setLsaRefreshTime(const seconds& lsaRefreshTime); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 134 | |
| 135 | void |
| 136 | setThisRouterPrefix(std::string trp); |
| 137 | |
| 138 | private: |
| 139 | bool |
| 140 | addNameLsa(NameLsa& nlsa); |
| 141 | |
| 142 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 143 | doesNameLsaExist(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 144 | |
| 145 | |
| 146 | bool |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 147 | addCoordinateLsa(CoordinateLsa& clsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 148 | |
| 149 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 150 | doesCoordinateLsaExist(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 151 | |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 152 | void |
| 153 | buildAdjLsa(); |
| 154 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 155 | bool |
| 156 | addAdjLsa(AdjLsa& alsa); |
| 157 | |
| 158 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 159 | doesAdjLsaExist(const ndn::Name& key); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 160 | |
| 161 | ndn::EventId |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 162 | scheduleNameLsaExpiration(const ndn::Name& key, int seqNo, |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 163 | const seconds& expTime); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 164 | |
| 165 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 166 | exprireOrRefreshNameLsa(const ndn::Name& lsaKey, uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 167 | |
| 168 | ndn::EventId |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 169 | scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo, |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 170 | const seconds& expTime); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 171 | |
| 172 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 173 | exprireOrRefreshAdjLsa(const ndn::Name& lsaKey, uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 174 | |
| 175 | ndn::EventId |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 176 | scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo, |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 177 | const seconds& expTime); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 178 | |
| 179 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 180 | exprireOrRefreshCoordinateLsa(const ndn::Name& lsaKey, |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 181 | uint64_t seqNo); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 182 | public: |
| 183 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 184 | expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 185 | steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 186 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 187 | void |
| 188 | processInterest(const ndn::Name& name, const ndn::Interest& interest); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 189 | |
| 190 | private: |
| 191 | void |
akmhoque | 69c9aa9 | 2014-07-23 15:15:05 -0500 | [diff] [blame] | 192 | putLsaData(const ndn::Interest& interest, const std::string& content); |
| 193 | |
| 194 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 195 | processInterestForNameLsa(const ndn::Interest& interest, |
| 196 | const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 197 | uint64_t seqNo); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 198 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 199 | void |
| 200 | processInterestForAdjacencyLsa(const ndn::Interest& interest, |
| 201 | const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 202 | uint64_t seqNo); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 203 | |
| 204 | void |
| 205 | processInterestForCoordinateLsa(const ndn::Interest& interest, |
| 206 | const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 207 | uint64_t seqNo); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 208 | |
| 209 | void |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 210 | onContent(const ndn::Data& data, const steady_clock::TimePoint& deadline, |
| 211 | ndn::Name lsaName, uint64_t seqNo); |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 212 | |
| 213 | /** |
| 214 | * @brief Retry validation after it fails |
| 215 | * |
| 216 | * Data packet validation can fail either because the packet does not have |
| 217 | * valid signature (fatal) or because some of the certificate chain Data packets |
| 218 | * failed to be fetched (non-fatal). Currently, the library does not provide |
| 219 | * clear indication (besides plain-text message in error callback) of what is |
| 220 | * the reason for failure and we will try to re-validate for as long as it the deadline. |
| 221 | */ |
| 222 | void |
| 223 | retryContentValidation(const ndn::shared_ptr<const ndn::Data>& data, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 224 | const steady_clock::TimePoint& deadline, ndn::Name lsaName, |
| 225 | uint64_t seqNo); |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 226 | |
| 227 | void |
| 228 | onContentValidated(const ndn::shared_ptr<const ndn::Data>& data); |
| 229 | |
| 230 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 231 | onContentValidationFailed(const ndn::shared_ptr<const ndn::Data>& data, const std::string& msg, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 232 | const steady_clock::TimePoint& deadline, ndn::Name lsaName, |
| 233 | uint64_t seqNo); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 234 | |
| 235 | void |
| 236 | processContentNameLsa(const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 237 | uint64_t lsSeqNo, std::string& dataContent); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 238 | |
| 239 | void |
| 240 | processContentAdjacencyLsa(const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 241 | uint64_t lsSeqNo, std::string& dataContent); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 242 | |
| 243 | void |
| 244 | processContentCoordinateLsa(const ndn::Name& lsaKey, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 245 | uint64_t lsSeqNo, std::string& dataContent); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 246 | |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 247 | PUBLIC_WITH_TESTS_ELSE_PRIVATE: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 248 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 249 | processInterestTimedOut(const ndn::Interest& interest, uint32_t retransmitNo, |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 250 | const steady_clock::TimePoint& deadline, ndn::Name lsaName, |
| 251 | uint64_t seqNo); |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 252 | |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 253 | private: |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 254 | system_clock::TimePoint |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 255 | getLsaExpirationTimePoint(); |
| 256 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 257 | void |
| 258 | cancelScheduleLsaExpiringEvent(ndn::EventId eid); |
| 259 | |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 260 | private: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 261 | Nlsr& m_nlsr; |
Vince Lehman | 7c60329 | 2014-09-11 17:48:16 -0500 | [diff] [blame] | 262 | ndn::Scheduler& m_scheduler; |
Vince Lehman | 0bcf9a3 | 2014-12-10 11:24:45 -0600 | [diff] [blame] | 263 | SyncLogicHandler& m_sync; |
Vince Lehman | 7c60329 | 2014-09-11 17:48:16 -0500 | [diff] [blame] | 264 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 265 | std::list<NameLsa> m_nameLsdb; |
| 266 | std::list<AdjLsa> m_adjLsdb; |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 267 | std::list<CoordinateLsa> m_corLsdb; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 268 | |
Vince Lehman | 904c241 | 2014-09-23 19:36:11 -0500 | [diff] [blame] | 269 | bool m_hasSyncPrefixBeenRegistered; |
| 270 | |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 271 | seconds m_lsaRefreshTime; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 272 | std::string m_thisRouterPrefix; |
| 273 | |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 274 | typedef std::map<ndn::Name, uint64_t> SequenceNumberMap; |
| 275 | |
| 276 | // Maps the name of an LSA to its highest known sequence number from sync; |
| 277 | // Used to stop NLSR from trying to fetch outdated LSAs |
| 278 | SequenceNumberMap m_highestSeqNo; |
| 279 | |
Vince Lehman | 1884108 | 2014-08-19 17:15:24 -0500 | [diff] [blame] | 280 | static const ndn::time::seconds GRACE_PERIOD; |
Ashlesh Gawande | 5bf8317 | 2014-09-19 12:38:17 -0500 | [diff] [blame] | 281 | static const steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE; |
Vince Lehman | 50df6b7 | 2015-03-03 12:06:40 -0600 | [diff] [blame^] | 282 | |
| 283 | ndn::time::seconds m_adjLsaBuildInterval; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 284 | }; |
| 285 | |
| 286 | }//namespace nlsr |
| 287 | |
| 288 | #endif //NLSR_LSDB_HPP |