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 | 800833b | 2016-07-29 13:43:59 -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 | **/ |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 21 | |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 22 | #ifndef NLSR_HPP |
| 23 | #define NLSR_HPP |
| 24 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 25 | #include <boost/cstdint.hpp> |
| 26 | #include <stdexcept> |
| 27 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 28 | #include <ndn-cxx/face.hpp> |
| 29 | #include <ndn-cxx/security/key-chain.hpp> |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 30 | #include <ndn-cxx/security/certificate-cache-ttl.hpp> |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 31 | #include <ndn-cxx/util/scheduler.hpp> |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 32 | #include <ndn-cxx/management/nfd-face-event-notification.hpp> |
akmhoque | 060d302 | 2014-08-12 13:35:06 -0500 | [diff] [blame] | 33 | #include <ndn-cxx/management/nfd-face-monitor.hpp> |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 34 | |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 35 | #include "adjacency-list.hpp" |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 36 | #include "common.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 37 | #include "conf-parameter.hpp" |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 38 | #include "hello-protocol.hpp" |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 39 | #include "lsdb.hpp" |
| 40 | #include "name-prefix-list.hpp" |
| 41 | #include "sequencing-manager.hpp" |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 42 | #include "test-access-control.hpp" |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 43 | #include "validator.hpp" |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 44 | #include "communication/sync-logic-handler.hpp" |
| 45 | #include "publisher/lsdb-dataset-interest-handler.hpp" |
| 46 | #include "route/fib.hpp" |
| 47 | #include "route/name-prefix-table.hpp" |
| 48 | #include "route/routing-table.hpp" |
| 49 | #include "security/certificate-store.hpp" |
| 50 | #include "update/prefix-update-processor.hpp" |
| 51 | #include "utility/name-helper.hpp" |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 52 | |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 53 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 54 | namespace nlsr { |
| 55 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 56 | static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast"); |
| 57 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 58 | class Nlsr |
| 59 | { |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 60 | class Error : public std::runtime_error |
| 61 | { |
| 62 | public: |
| 63 | explicit |
| 64 | Error(const std::string& what) |
| 65 | : std::runtime_error(what) |
| 66 | { |
| 67 | } |
| 68 | }; |
| 69 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 70 | public: |
Vince Lehman | d6bb3fa | 2015-04-24 14:21:39 -0500 | [diff] [blame] | 71 | Nlsr(boost::asio::io_service& ioService, ndn::Scheduler& scheduler, ndn::Face& face); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 72 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 73 | void |
| 74 | registrationFailed(const ndn::Name& name); |
| 75 | |
| 76 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 77 | onRegistrationSuccess(const ndn::Name& name); |
| 78 | |
| 79 | void |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 80 | onLocalhostRegistrationSuccess(const ndn::Name& name); |
| 81 | |
| 82 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 83 | setInfoInterestFilter(); |
| 84 | |
| 85 | void |
| 86 | setLsaInterestFilter(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 87 | |
| 88 | void |
| 89 | startEventLoop(); |
| 90 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 91 | std::string |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 92 | getConfFileName() const |
Yingdi Yu | 40cd1c3 | 2014-04-17 15:02:17 -0700 | [diff] [blame] | 93 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 94 | return m_configFileName; |
Yingdi Yu | 40cd1c3 | 2014-04-17 15:02:17 -0700 | [diff] [blame] | 95 | } |
| 96 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 97 | void |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 98 | setConfFileName(const std::string& fileName) |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 99 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 100 | m_configFileName = fileName; |
| 101 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 102 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 103 | bool |
| 104 | getIsSetDaemonProcess() |
| 105 | { |
| 106 | return m_isDaemonProcess; |
| 107 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 108 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 109 | void |
| 110 | setIsDaemonProcess(bool value) |
| 111 | { |
| 112 | m_isDaemonProcess = value; |
| 113 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 114 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 115 | ConfParameter& |
| 116 | getConfParameter() |
| 117 | { |
| 118 | return m_confParam; |
| 119 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 120 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 121 | AdjacencyList& |
| 122 | getAdjacencyList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 123 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 124 | return m_adjacencyList; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 125 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 126 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 127 | NamePrefixList& |
| 128 | getNamePrefixList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 129 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 130 | return m_namePrefixList; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 131 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 132 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 133 | ndn::Face& |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 134 | getNlsrFace() |
| 135 | { |
| 136 | return m_nlsrFace; |
| 137 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 138 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 139 | SequencingManager& |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 140 | getSequencingManager() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 141 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 142 | return m_sequencingManager; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 143 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 144 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 145 | Lsdb& |
| 146 | getLsdb() |
| 147 | { |
| 148 | return m_nlsrLsdb; |
| 149 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 150 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 151 | RoutingTable& |
| 152 | getRoutingTable() |
| 153 | { |
| 154 | return m_routingTable; |
| 155 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 156 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 157 | NamePrefixTable& |
| 158 | getNamePrefixTable() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 159 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 160 | return m_namePrefixTable; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 161 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 162 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 163 | Fib& |
| 164 | getFib() |
| 165 | { |
| 166 | return m_fib; |
| 167 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 168 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 169 | long int |
| 170 | getAdjBuildCount() |
| 171 | { |
| 172 | return m_adjBuildCount; |
| 173 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 174 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 175 | void |
| 176 | incrementAdjBuildCount() |
| 177 | { |
| 178 | m_adjBuildCount++; |
| 179 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 180 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 181 | void |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 182 | setAdjBuildCount(int64_t abc) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 183 | { |
| 184 | m_adjBuildCount = abc; |
| 185 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 186 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 187 | bool |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 188 | getIsBuildAdjLsaSheduled() |
| 189 | { |
| 190 | return m_isBuildAdjLsaSheduled; |
| 191 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 192 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 193 | void |
| 194 | setIsBuildAdjLsaSheduled(bool iabls) |
| 195 | { |
| 196 | m_isBuildAdjLsaSheduled = iabls; |
| 197 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 198 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 199 | bool |
| 200 | getIsRoutingTableCalculating() |
| 201 | { |
| 202 | return m_isRoutingTableCalculating; |
| 203 | } |
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 204 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 205 | void |
| 206 | setIsRoutingTableCalculating(bool irtc) |
| 207 | { |
| 208 | m_isRoutingTableCalculating = irtc; |
| 209 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 210 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 211 | bool |
| 212 | getIsRouteCalculationScheduled() |
| 213 | { |
| 214 | return m_isRouteCalculationScheduled; |
| 215 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 216 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 217 | void |
| 218 | setIsRouteCalculationScheduled(bool ircs) |
| 219 | { |
| 220 | m_isRouteCalculationScheduled = ircs; |
| 221 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 222 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 223 | SyncLogicHandler& |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 224 | getSyncLogicHandler() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 225 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 226 | return m_syncLogicHandler; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 227 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 228 | |
Muktadir R Chowdhury | 3ac0728 | 2016-06-17 16:30:29 -0500 | [diff] [blame] | 229 | LsdbDatasetInterestHandler& |
| 230 | getLsdbDatasetHandler() |
| 231 | { |
| 232 | return m_lsdbDatasetHandler; |
| 233 | } |
| 234 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 235 | void |
| 236 | initialize(); |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 237 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 238 | void |
akmhoque | 443ad81 | 2014-07-29 10:26:56 -0500 | [diff] [blame] | 239 | initializeKey(); |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 240 | |
| 241 | void |
| 242 | loadValidator(boost::property_tree::ptree section, |
| 243 | const std::string& filename) |
| 244 | { |
| 245 | m_validator.load(section, filename); |
| 246 | } |
| 247 | |
| 248 | Validator& |
| 249 | getValidator() |
| 250 | { |
| 251 | return m_validator; |
| 252 | } |
| 253 | |
| 254 | void |
| 255 | loadCertToPublish(ndn::shared_ptr<ndn::IdentityCertificate> certificate) |
| 256 | { |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 257 | m_certStore.insert(certificate); |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | ndn::shared_ptr<const ndn::IdentityCertificate> |
| 261 | getCertificate(const ndn::Name& certificateNameWithoutVersion) |
| 262 | { |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 263 | shared_ptr<const ndn::IdentityCertificate> cert = |
| 264 | m_certStore.find(certificateNameWithoutVersion); |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 265 | |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 266 | if (cert != nullptr) { |
| 267 | return cert; |
| 268 | } |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 269 | |
| 270 | return m_certificateCache->getCertificate(certificateNameWithoutVersion); |
| 271 | } |
| 272 | |
| 273 | ndn::KeyChain& |
| 274 | getKeyChain() |
| 275 | { |
| 276 | return m_keyChain; |
| 277 | } |
| 278 | |
| 279 | const ndn::Name& |
| 280 | getDefaultCertName() |
| 281 | { |
| 282 | return m_defaultCertName; |
| 283 | } |
| 284 | |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 285 | update::PrefixUpdateProcessor& |
| 286 | getPrefixUpdateProcessor() |
| 287 | { |
| 288 | return m_prefixUpdateProcessor; |
| 289 | } |
| 290 | |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 291 | void |
| 292 | createFace(const std::string& faceUri, |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 293 | const CommandSucceedCallback& onSuccess, |
| 294 | const CommandFailCallback& onFailure); |
| 295 | |
| 296 | void |
| 297 | destroyFaces(); |
| 298 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 299 | void |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 300 | setStrategies(); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 301 | |
akmhoque | 0494c25 | 2014-07-23 23:46:44 -0500 | [diff] [blame] | 302 | void |
| 303 | daemonize(); |
| 304 | |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 305 | uint32_t |
| 306 | getFirstHelloInterval() const |
| 307 | { |
| 308 | return m_firstHelloInterval; |
| 309 | } |
| 310 | |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 311 | PUBLIC_WITH_TESTS_ELSE_PRIVATE: |
| 312 | void |
| 313 | addCertificateToCache(ndn::shared_ptr<ndn::IdentityCertificate> certificate) |
| 314 | { |
| 315 | if (certificate != nullptr) { |
| 316 | m_certificateCache->insertCertificate(certificate); |
| 317 | } |
| 318 | } |
| 319 | |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 320 | security::CertificateStore& |
| 321 | getCertificateStore() |
| 322 | { |
| 323 | return m_certStore; |
| 324 | } |
| 325 | |
akmhoque | 393d4ff | 2014-07-16 14:27:03 -0500 | [diff] [blame] | 326 | private: |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 327 | void |
| 328 | registerKeyPrefix(); |
| 329 | |
| 330 | void |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 331 | registerLocalhostPrefix(); |
| 332 | |
| 333 | void |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 334 | onKeyInterest(const ndn::Name& name, const ndn::Interest& interest); |
| 335 | |
| 336 | void |
| 337 | onKeyPrefixRegSuccess(const ndn::Name& name); |
| 338 | |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 339 | void |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 340 | onDestroyFaceSuccess(const ndn::nfd::ControlParameters& commandSuccessResult); |
| 341 | |
| 342 | void |
| 343 | onDestroyFaceFailure(int32_t code, const std::string& error); |
| 344 | |
| 345 | void |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame] | 346 | onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification); |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 347 | |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 348 | void |
| 349 | setFirstHelloInterval(uint32_t interval) |
| 350 | { |
| 351 | m_firstHelloInterval = interval; |
| 352 | } |
| 353 | |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 354 | public: |
| 355 | static const ndn::Name LOCALHOST_PREFIX; |
| 356 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 357 | private: |
Vince Lehman | 904c241 | 2014-09-23 19:36:11 -0500 | [diff] [blame] | 358 | ndn::Face& m_nlsrFace; |
Vince Lehman | 7c60329 | 2014-09-11 17:48:16 -0500 | [diff] [blame] | 359 | ndn::Scheduler& m_scheduler; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 360 | ConfParameter m_confParam; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 361 | AdjacencyList m_adjacencyList; |
| 362 | NamePrefixList m_namePrefixList; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 363 | SequencingManager m_sequencingManager; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 364 | bool m_isDaemonProcess; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 365 | std::string m_configFileName; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 366 | Lsdb m_nlsrLsdb; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 367 | int64_t m_adjBuildCount; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 368 | bool m_isBuildAdjLsaSheduled; |
| 369 | bool m_isRouteCalculationScheduled; |
| 370 | bool m_isRoutingTableCalculating; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 371 | RoutingTable m_routingTable; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 372 | Fib m_fib; |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 373 | NamePrefixTable m_namePrefixTable; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 374 | SyncLogicHandler m_syncLogicHandler; |
Vince Lehman | d6bb3fa | 2015-04-24 14:21:39 -0500 | [diff] [blame] | 375 | LsdbDatasetInterestHandler m_lsdbDatasetHandler; |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 376 | |
Vince Lehman | f7eec4f | 2015-05-08 19:02:31 -0500 | [diff] [blame] | 377 | PUBLIC_WITH_TESTS_ELSE_PRIVATE: |
| 378 | HelloProtocol m_helloProtocol; |
| 379 | |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 380 | private: |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 381 | ndn::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache; |
Vince Lehman | c2acdcb | 2015-04-29 11:14:35 -0500 | [diff] [blame] | 382 | security::CertificateStore m_certStore; |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 383 | Validator m_validator; |
| 384 | ndn::KeyChain m_keyChain; |
Joao Pereira | 97473d4 | 2015-07-03 16:57:27 -0400 | [diff] [blame] | 385 | ndn::security::SigningInfo m_signingInfo; |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 386 | ndn::Name m_defaultCertName; |
alvy | 297f416 | 2015-03-03 17:15:33 -0600 | [diff] [blame] | 387 | update::PrefixUpdateProcessor m_prefixUpdateProcessor; |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 388 | |
akmhoque | 060d302 | 2014-08-12 13:35:06 -0500 | [diff] [blame] | 389 | ndn::nfd::FaceMonitor m_faceMonitor; |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 390 | |
| 391 | uint32_t m_firstHelloInterval; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 392 | }; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 393 | |
Nick Gordon | fad8e25 | 2016-08-11 14:21:38 -0500 | [diff] [blame^] | 394 | } // namespace nlsr |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 395 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 396 | #endif //NLSR_HPP |