akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2014 University of Memphis, |
| 4 | * Regents of the University of California |
| 5 | * |
| 6 | * This file is part of NLSR (Named-data Link State Routing). |
| 7 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 8 | * |
| 9 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 10 | * of the GNU General Public License as published by the Free Software Foundation, |
| 11 | * either version 3 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 14 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along with |
| 18 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 19 | * |
| 20 | * \author A K M Mahmudul Hoque <ahoque1@memphis.edu> |
| 21 | * |
| 22 | **/ |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 23 | #ifndef NLSR_HPP |
| 24 | #define NLSR_HPP |
| 25 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 26 | #include <boost/cstdint.hpp> |
| 27 | #include <stdexcept> |
| 28 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 29 | #include <ndn-cxx/face.hpp> |
| 30 | #include <ndn-cxx/security/key-chain.hpp> |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 31 | #include <ndn-cxx/security/certificate-cache-ttl.hpp> |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 32 | #include <ndn-cxx/util/scheduler.hpp> |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 33 | #include <ndn-cxx/management/nfd-face-event-notification.hpp> |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 34 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 35 | #include "conf-parameter.hpp" |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 36 | #include "adjacency-list.hpp" |
| 37 | #include "name-prefix-list.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 38 | #include "lsdb.hpp" |
| 39 | #include "sequencing-manager.hpp" |
| 40 | #include "route/routing-table.hpp" |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 41 | #include "route/name-prefix-table.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 42 | #include "route/fib.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 43 | #include "communication/sync-logic-handler.hpp" |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 44 | #include "hello-protocol.hpp" |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 45 | #include "face-monitor.hpp" |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 46 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 47 | #include "validator.hpp" |
| 48 | |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 49 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 50 | namespace nlsr { |
| 51 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 52 | static ndn::Name DEFAULT_BROADCAST_PREFIX("/ndn/broadcast"); |
| 53 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 54 | class Nlsr |
| 55 | { |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 56 | class Error : public std::runtime_error |
| 57 | { |
| 58 | public: |
| 59 | explicit |
| 60 | Error(const std::string& what) |
| 61 | : std::runtime_error(what) |
| 62 | { |
| 63 | } |
| 64 | }; |
| 65 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 66 | public: |
| 67 | Nlsr() |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 68 | : m_scheduler(m_nlsrFace.getIoService()) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 69 | , m_confParam() |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 70 | , m_adjacencyList() |
| 71 | , m_namePrefixList() |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 72 | , m_sequencingManager() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 73 | , m_isDaemonProcess(false) |
| 74 | , m_configFileName("nlsr.conf") |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 75 | , m_nlsrLsdb(*this) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 76 | , m_adjBuildCount(0) |
| 77 | , m_isBuildAdjLsaSheduled(false) |
| 78 | , m_isRouteCalculationScheduled(false) |
| 79 | , m_isRoutingTableCalculating(false) |
| 80 | , m_routingTable() |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 81 | , m_fib(*this, m_nlsrFace) |
| 82 | , m_namePrefixTable(*this) |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 83 | , m_syncLogicHandler(m_nlsrFace.getIoService()) |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 84 | , m_helloProtocol(*this) |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 85 | |
| 86 | , m_certificateCache(new ndn::CertificateCacheTtl(m_nlsrFace.getIoService())) |
| 87 | , m_validator(m_nlsrFace, DEFAULT_BROADCAST_PREFIX, m_certificateCache) |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 88 | |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 89 | , m_faceMonitor(m_nlsrFace.getIoService(), |
| 90 | ndn::bind(&Nlsr::onFaceEventNotification, this, _1)) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 91 | {} |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 92 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 93 | void |
| 94 | registrationFailed(const ndn::Name& name); |
| 95 | |
| 96 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 97 | onRegistrationSuccess(const ndn::Name& name); |
| 98 | |
| 99 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 100 | setInfoInterestFilter(); |
| 101 | |
| 102 | void |
| 103 | setLsaInterestFilter(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 104 | |
| 105 | void |
| 106 | startEventLoop(); |
| 107 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 108 | void |
| 109 | usage(const std::string& progname); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 110 | |
| 111 | std::string |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 112 | getConfFileName() const |
Yingdi Yu | 40cd1c3 | 2014-04-17 15:02:17 -0700 | [diff] [blame] | 113 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 114 | return m_configFileName; |
Yingdi Yu | 40cd1c3 | 2014-04-17 15:02:17 -0700 | [diff] [blame] | 115 | } |
| 116 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 117 | void |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 118 | setConfFileName(const std::string& fileName) |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 119 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 120 | m_configFileName = fileName; |
| 121 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 122 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 123 | bool |
| 124 | getIsSetDaemonProcess() |
| 125 | { |
| 126 | return m_isDaemonProcess; |
| 127 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 128 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 129 | void |
| 130 | setIsDaemonProcess(bool value) |
| 131 | { |
| 132 | m_isDaemonProcess = value; |
| 133 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 134 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 135 | ConfParameter& |
| 136 | getConfParameter() |
| 137 | { |
| 138 | return m_confParam; |
| 139 | } |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 140 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 141 | AdjacencyList& |
| 142 | getAdjacencyList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 143 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 144 | return m_adjacencyList; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 145 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 146 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 147 | NamePrefixList& |
| 148 | getNamePrefixList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 149 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 150 | return m_namePrefixList; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 151 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 152 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 153 | ndn::Scheduler& |
| 154 | getScheduler() |
| 155 | { |
| 156 | return m_scheduler; |
| 157 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 158 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 159 | ndn::Face& |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 160 | getNlsrFace() |
| 161 | { |
| 162 | return m_nlsrFace; |
| 163 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 164 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 165 | SequencingManager& |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 166 | getSequencingManager() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 167 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 168 | return m_sequencingManager; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 169 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 170 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 171 | Lsdb& |
| 172 | getLsdb() |
| 173 | { |
| 174 | return m_nlsrLsdb; |
| 175 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 176 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 177 | RoutingTable& |
| 178 | getRoutingTable() |
| 179 | { |
| 180 | return m_routingTable; |
| 181 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 182 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 183 | NamePrefixTable& |
| 184 | getNamePrefixTable() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 185 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 186 | return m_namePrefixTable; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 187 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 188 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 189 | Fib& |
| 190 | getFib() |
| 191 | { |
| 192 | return m_fib; |
| 193 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 194 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 195 | long int |
| 196 | getAdjBuildCount() |
| 197 | { |
| 198 | return m_adjBuildCount; |
| 199 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 200 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 201 | void |
| 202 | incrementAdjBuildCount() |
| 203 | { |
| 204 | m_adjBuildCount++; |
| 205 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 206 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 207 | void |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 208 | setAdjBuildCount(int64_t abc) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 209 | { |
| 210 | m_adjBuildCount = abc; |
| 211 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 212 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 213 | bool |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 214 | getIsBuildAdjLsaSheduled() |
| 215 | { |
| 216 | return m_isBuildAdjLsaSheduled; |
| 217 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 218 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 219 | void |
| 220 | setIsBuildAdjLsaSheduled(bool iabls) |
| 221 | { |
| 222 | m_isBuildAdjLsaSheduled = iabls; |
| 223 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 224 | |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 225 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 226 | void |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 227 | setApiPort(int32_t ap) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 228 | { |
| 229 | m_apiPort = ap; |
| 230 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 231 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 232 | int32_t |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 233 | getApiPort() |
| 234 | { |
| 235 | return m_apiPort; |
| 236 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 237 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 238 | bool |
| 239 | getIsRoutingTableCalculating() |
| 240 | { |
| 241 | return m_isRoutingTableCalculating; |
| 242 | } |
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 243 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 244 | void |
| 245 | setIsRoutingTableCalculating(bool irtc) |
| 246 | { |
| 247 | m_isRoutingTableCalculating = irtc; |
| 248 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 249 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 250 | bool |
| 251 | getIsRouteCalculationScheduled() |
| 252 | { |
| 253 | return m_isRouteCalculationScheduled; |
| 254 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 255 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 256 | void |
| 257 | setIsRouteCalculationScheduled(bool ircs) |
| 258 | { |
| 259 | m_isRouteCalculationScheduled = ircs; |
| 260 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 261 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 262 | SyncLogicHandler& |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 263 | getSyncLogicHandler() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 264 | { |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 265 | return m_syncLogicHandler; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 266 | } |
akmhoque | 2bb198e | 2014-02-28 11:46:27 -0600 | [diff] [blame] | 267 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 268 | void |
| 269 | initialize(); |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 270 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 271 | void |
| 272 | intializeKey(); |
| 273 | |
| 274 | void |
| 275 | loadValidator(boost::property_tree::ptree section, |
| 276 | const std::string& filename) |
| 277 | { |
| 278 | m_validator.load(section, filename); |
| 279 | } |
| 280 | |
| 281 | Validator& |
| 282 | getValidator() |
| 283 | { |
| 284 | return m_validator; |
| 285 | } |
| 286 | |
| 287 | void |
| 288 | loadCertToPublish(ndn::shared_ptr<ndn::IdentityCertificate> certificate) |
| 289 | { |
| 290 | if (static_cast<bool>(certificate)) |
| 291 | m_certToPublish[certificate->getName().getPrefix(-1)] = certificate; // key is cert name |
| 292 | // without version |
| 293 | } |
| 294 | |
| 295 | ndn::shared_ptr<const ndn::IdentityCertificate> |
| 296 | getCertificate(const ndn::Name& certificateNameWithoutVersion) |
| 297 | { |
| 298 | CertMap::iterator it = m_certToPublish.find(certificateNameWithoutVersion); |
| 299 | |
| 300 | if (it != m_certToPublish.end()) |
| 301 | { |
| 302 | return it->second; |
| 303 | } |
| 304 | |
| 305 | return m_certificateCache->getCertificate(certificateNameWithoutVersion); |
| 306 | } |
| 307 | |
| 308 | ndn::KeyChain& |
| 309 | getKeyChain() |
| 310 | { |
| 311 | return m_keyChain; |
| 312 | } |
| 313 | |
| 314 | const ndn::Name& |
| 315 | getDefaultCertName() |
| 316 | { |
| 317 | return m_defaultCertName; |
| 318 | } |
| 319 | |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 320 | void |
| 321 | createFace(const std::string& faceUri, |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 322 | const CommandSucceedCallback& onSuccess, |
| 323 | const CommandFailCallback& onFailure); |
| 324 | |
| 325 | void |
| 326 | destroyFaces(); |
| 327 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 328 | private: |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 329 | void |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 330 | setStrategies(); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 331 | |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 332 | void |
| 333 | registerKeyPrefix(); |
| 334 | |
| 335 | void |
| 336 | onKeyInterest(const ndn::Name& name, const ndn::Interest& interest); |
| 337 | |
| 338 | void |
| 339 | onKeyPrefixRegSuccess(const ndn::Name& name); |
| 340 | |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 341 | void |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 342 | onDestroyFaceSuccess(const ndn::nfd::ControlParameters& commandSuccessResult); |
| 343 | |
| 344 | void |
| 345 | onDestroyFaceFailure(int32_t code, const std::string& error); |
| 346 | |
| 347 | void |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 348 | onFaceEventNotification(const ndn::nfd::FaceEventNotification& faceEventNotification); |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 349 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 350 | private: |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 351 | typedef std::map<ndn::Name, ndn::shared_ptr<ndn::IdentityCertificate> > CertMap; |
| 352 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 353 | ndn::Face m_nlsrFace; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 354 | ndn::Scheduler m_scheduler; |
| 355 | ConfParameter m_confParam; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 356 | AdjacencyList m_adjacencyList; |
| 357 | NamePrefixList m_namePrefixList; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 358 | SequencingManager m_sequencingManager; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 359 | bool m_isDaemonProcess; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 360 | std::string m_configFileName; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 361 | Lsdb m_nlsrLsdb; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 362 | int64_t m_adjBuildCount; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 363 | bool m_isBuildAdjLsaSheduled; |
| 364 | bool m_isRouteCalculationScheduled; |
| 365 | bool m_isRoutingTableCalculating; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 366 | RoutingTable m_routingTable; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 367 | Fib m_fib; |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 368 | NamePrefixTable m_namePrefixTable; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 369 | SyncLogicHandler m_syncLogicHandler; |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 370 | int32_t m_apiPort; |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 371 | HelloProtocol m_helloProtocol; |
Yingdi Yu | 20e3a6e | 2014-05-26 23:16:10 -0700 | [diff] [blame] | 372 | |
| 373 | ndn::shared_ptr<ndn::CertificateCacheTtl> m_certificateCache; |
| 374 | CertMap m_certToPublish; |
| 375 | Validator m_validator; |
| 376 | ndn::KeyChain m_keyChain; |
| 377 | ndn::Name m_defaultIdentity; |
| 378 | ndn::Name m_defaultCertName; |
akmhoque | e176515 | 2014-06-30 11:32:01 -0500 | [diff] [blame] | 379 | |
akmhoque | c04e727 | 2014-07-02 11:00:14 -0500 | [diff] [blame^] | 380 | FaceMonitor m_faceMonitor; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 381 | }; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 382 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 383 | } //namespace nlsr |
| 384 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 385 | #endif //NLSR_HPP |