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