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 | * \author Minsheng Zhang <mzhang4@memphis.edu> |
| 22 | * |
| 23 | **/ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 24 | #include <iostream> |
| 25 | #include <fstream> |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 26 | #include <boost/algorithm/string.hpp> |
| 27 | #include <boost/property_tree/info_parser.hpp> |
| 28 | #include <boost/property_tree/ptree.hpp> |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 29 | #include <boost/filesystem.hpp> |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 30 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 31 | #include <ndn-cxx/name.hpp> |
| 32 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 33 | #include "conf-parameter.hpp" |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 34 | #include "conf-file-processor.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 35 | #include "adjacent.hpp" |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 36 | #include "utility/name-helper.hpp" |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 37 | |
| 38 | |
| 39 | namespace nlsr { |
| 40 | |
| 41 | using namespace std; |
| 42 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 43 | bool |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 44 | ConfFileProcessor::processConfFile() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 45 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 46 | bool ret = true; |
| 47 | ifstream inputFile; |
| 48 | inputFile.open(m_confFileName.c_str()); |
| 49 | if (!inputFile.is_open()) { |
| 50 | string msg = "Failed to read configuration file: "; |
| 51 | msg += m_confFileName; |
| 52 | cerr << msg << endl; |
| 53 | ret = false; |
| 54 | } |
| 55 | ret = load(inputFile); |
| 56 | inputFile.close(); |
| 57 | return ret; |
| 58 | } |
| 59 | |
| 60 | bool |
| 61 | ConfFileProcessor::load(istream& input) |
| 62 | { |
| 63 | boost::property_tree::ptree pt; |
| 64 | bool ret = true; |
| 65 | try { |
| 66 | boost::property_tree::read_info(input, pt); |
| 67 | } |
| 68 | catch (const boost::property_tree::info_parser_error& error) { |
| 69 | stringstream msg; |
| 70 | std::cerr << "Failed to parse configuration file " << std::endl; |
| 71 | std::cerr << m_confFileName << std::endl; |
| 72 | return false; |
| 73 | } |
| 74 | for (boost::property_tree::ptree::const_iterator tn = pt.begin(); |
| 75 | tn != pt.end(); ++tn) { |
| 76 | std::string section = tn->first; |
| 77 | boost::property_tree::ptree SectionAttributeTree = tn ->second; |
| 78 | ret = processSection(section, SectionAttributeTree); |
| 79 | if (ret == false) { |
| 80 | break; |
| 81 | } |
| 82 | } |
| 83 | return ret; |
| 84 | } |
| 85 | |
| 86 | bool |
| 87 | ConfFileProcessor::processSection(const std::string& section, |
| 88 | boost::property_tree::ptree SectionAttributeTree) |
| 89 | { |
| 90 | bool ret = true; |
| 91 | if (section == "general") |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 92 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 93 | ret = processConfSectionGeneral(SectionAttributeTree); |
| 94 | } |
| 95 | else if (section == "neighbors") |
| 96 | { |
| 97 | ret = processConfSectionNeighbors(SectionAttributeTree); |
| 98 | } |
| 99 | else if (section == "hyperbolic") |
| 100 | { |
| 101 | ret = processConfSectionHyperbolic(SectionAttributeTree); |
| 102 | } |
| 103 | else if (section == "fib") |
| 104 | { |
| 105 | ret = processConfSectionFib(SectionAttributeTree); |
| 106 | } |
| 107 | else if (section == "advertising") |
| 108 | { |
| 109 | ret = processConfSectionAdvertising(SectionAttributeTree); |
| 110 | } |
| 111 | else |
| 112 | { |
| 113 | std::cerr << "Wrong configuration Command: " << section << std::endl; |
| 114 | } |
| 115 | return ret; |
| 116 | } |
| 117 | |
| 118 | bool |
| 119 | ConfFileProcessor::processConfSectionGeneral(boost::property_tree::ptree |
| 120 | SectionAttributeTree) |
| 121 | { |
| 122 | try { |
| 123 | std::string network = SectionAttributeTree.get<string>("network"); |
| 124 | std::string site = SectionAttributeTree.get<string>("site"); |
| 125 | std::string router = SectionAttributeTree.get<string>("router"); |
| 126 | ndn::Name networkName(network); |
| 127 | if (!networkName.empty()) { |
| 128 | m_nlsr.getConfParameter().setNetwork(networkName); |
| 129 | } |
| 130 | else { |
| 131 | cerr << " Network can not be null or empty or in bad URI format :(!" << endl; |
| 132 | return false; |
| 133 | } |
| 134 | ndn::Name siteName(site); |
| 135 | if (!siteName.empty()) { |
| 136 | m_nlsr.getConfParameter().setSiteName(siteName); |
| 137 | } |
| 138 | else { |
| 139 | cerr << "Site can not be null or empty or in bad URI format:( !" << endl; |
| 140 | return false; |
| 141 | } |
| 142 | ndn::Name routerName(router); |
| 143 | if (!routerName.empty()) { |
| 144 | m_nlsr.getConfParameter().setRouterName(routerName); |
| 145 | } |
| 146 | else { |
| 147 | cerr << " Router name can not be null or empty or in bad URI format:( !" << endl; |
| 148 | return false; |
| 149 | } |
| 150 | } |
| 151 | catch (const std::exception& ex) { |
| 152 | cerr << ex.what() << endl; |
| 153 | return false; |
| 154 | } |
| 155 | |
| 156 | try { |
| 157 | int32_t lsaRefreshTime = SectionAttributeTree.get<int32_t>("lsa-refresh-time"); |
| 158 | if (lsaRefreshTime >= LSA_REFRESH_TIME_MIN && |
| 159 | lsaRefreshTime <= LSA_REFRESH_TIME_MAX) { |
| 160 | m_nlsr.getConfParameter().setLsaRefreshTime(lsaRefreshTime); |
| 161 | } |
| 162 | else { |
| 163 | std::cerr << "Wrong value for lsa-refresh-time "; |
| 164 | std::cerr << "Allowed value: " << LSA_REFRESH_TIME_MIN << "-";; |
| 165 | std::cerr << LSA_REFRESH_TIME_MAX << std::endl; |
| 166 | return false; |
| 167 | } |
| 168 | } |
| 169 | catch (const std::exception& ex) { |
| 170 | std::cerr << ex.what() << std::endl; |
| 171 | return false; |
| 172 | } |
| 173 | |
| 174 | try { |
| 175 | std::string logLevel = SectionAttributeTree.get<string>("log-level"); |
| 176 | if ( boost::iequals(logLevel, "info") || boost::iequals(logLevel, "debug")) { |
| 177 | m_nlsr.getConfParameter().setLogLevel(logLevel); |
| 178 | } |
| 179 | else { |
| 180 | std::cerr << "Wrong value for log-level "; |
| 181 | std::cerr << "Allowed value: INFO, DEBUG" << std::endl; |
| 182 | return false; |
| 183 | } |
| 184 | } |
| 185 | catch (const std::exception& ex) { |
| 186 | std::cerr << ex.what() << std::endl; |
| 187 | return false; |
| 188 | } |
| 189 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 190 | try { |
| 191 | std::string logDir = SectionAttributeTree.get<string>("log-dir"); |
| 192 | if (boost::filesystem::exists(logDir)) { |
| 193 | if (boost::filesystem::is_directory(logDir)) { |
| 194 | std::string testFileName=logDir+"/test.log"; |
| 195 | ofstream testOutFile; |
| 196 | testOutFile.open(testFileName.c_str()); |
| 197 | if (testOutFile.is_open() && testOutFile.good()) { |
| 198 | m_nlsr.getConfParameter().setLogDir(logDir); |
| 199 | } |
| 200 | else { |
| 201 | std::cerr << "User does not have read and write permission on the directory"; |
| 202 | std::cerr << std::endl; |
| 203 | return false; |
| 204 | } |
| 205 | testOutFile.close(); |
| 206 | remove(testFileName.c_str()); |
| 207 | } |
| 208 | else { |
| 209 | std::cerr << "Provided path is not a directory" << std::endl; |
| 210 | return false; |
| 211 | } |
| 212 | } |
| 213 | else { |
| 214 | std::cerr << "Log directory provided does not exists" << std::endl; |
| 215 | return false; |
| 216 | } |
| 217 | } |
| 218 | catch (const std::exception& ex) { |
| 219 | std::cerr << "You must configure log directory" << std::endl; |
| 220 | std::cerr << ex.what() << std::endl; |
| 221 | return false; |
| 222 | } |
| 223 | try { |
| 224 | std::string seqDir = SectionAttributeTree.get<string>("seq-dir"); |
| 225 | if (boost::filesystem::exists(seqDir)) { |
| 226 | if (boost::filesystem::is_directory(seqDir)) { |
| 227 | std::string testFileName=seqDir+"/test.seq"; |
| 228 | ofstream testOutFile; |
| 229 | testOutFile.open(testFileName.c_str()); |
| 230 | if (testOutFile.is_open() && testOutFile.good()) { |
| 231 | m_nlsr.getConfParameter().setSeqFileDir(seqDir); |
| 232 | } |
| 233 | else { |
| 234 | std::cerr << "User does not have read and write permission on the directory"; |
| 235 | std::cerr << std::endl; |
| 236 | return false; |
| 237 | } |
| 238 | testOutFile.close(); |
| 239 | remove(testFileName.c_str()); |
| 240 | } |
| 241 | else { |
| 242 | std::cerr << "Provided path is not a directory" << std::endl; |
| 243 | return false; |
| 244 | } |
| 245 | } |
| 246 | else { |
| 247 | std::cerr << "Seq directory provided does not exists" << std::endl; |
| 248 | return false; |
| 249 | } |
| 250 | } |
| 251 | catch (const std::exception& ex) { |
| 252 | std::cerr << "You must configure sequence directory" << std::endl; |
| 253 | std::cerr << ex.what() << std::endl; |
| 254 | return false; |
| 255 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 256 | return true; |
| 257 | } |
| 258 | |
| 259 | bool |
| 260 | ConfFileProcessor::processConfSectionNeighbors(boost::property_tree::ptree |
| 261 | SectionAttributeTree) |
| 262 | { |
| 263 | try { |
| 264 | int retrials = SectionAttributeTree.get<int>("hello-retries"); |
| 265 | if (retrials >= HELLO_RETRIES_MIN && retrials <= HELLO_RETRIES_MAX) { |
| 266 | m_nlsr.getConfParameter().setInterestRetryNumber(retrials); |
| 267 | } |
| 268 | else { |
| 269 | std::cerr << "Wrong value for hello-retries. "; |
| 270 | std::cerr << "Allowed value:" << HELLO_RETRIES_MIN << "-"; |
| 271 | std::cerr << HELLO_RETRIES_MAX << std::endl; |
| 272 | return false; |
| 273 | } |
| 274 | } |
| 275 | catch (const std::exception& ex) { |
| 276 | std::cerr << ex.what() << std::endl; |
| 277 | return false; |
| 278 | } |
| 279 | try { |
| 280 | int timeOut = SectionAttributeTree.get<int>("hello-timeout"); |
| 281 | if (timeOut >= HELLO_TIMEOUT_MIN && timeOut <= HELLO_TIMEOUT_MAX) { |
| 282 | m_nlsr.getConfParameter().setInterestResendTime(timeOut); |
| 283 | } |
| 284 | else { |
| 285 | std::cerr << "Wrong value for hello-timeout. "; |
| 286 | std::cerr << "Allowed value:" << HELLO_TIMEOUT_MIN << "-"; |
| 287 | std::cerr << HELLO_TIMEOUT_MAX << std::endl; |
| 288 | return false; |
| 289 | } |
| 290 | } |
| 291 | catch (const std::exception& ex) { |
| 292 | std::cerr << ex.what() << std::endl; |
| 293 | } |
| 294 | try { |
| 295 | int interval = SectionAttributeTree.get<int>("hello-interval"); |
| 296 | if (interval >= HELLO_INTERVAL_MIN && interval <= HELLO_INTERVAL_MAX) { |
| 297 | m_nlsr.getConfParameter().setInfoInterestInterval(interval); |
| 298 | } |
| 299 | else { |
| 300 | std::cerr << "Wrong value for hello-interval. "; |
| 301 | std::cerr << "Allowed value:" << HELLO_INTERVAL_MIN << "-"; |
| 302 | std::cerr << HELLO_INTERVAL_MAX << std::endl; |
| 303 | return false; |
| 304 | } |
| 305 | } |
| 306 | catch (const std::exception& ex) { |
| 307 | std::cerr << ex.what() << std::endl; |
| 308 | } |
| 309 | for (boost::property_tree::ptree::const_iterator tn = |
| 310 | SectionAttributeTree.begin(); tn != SectionAttributeTree.end(); ++tn) { |
| 311 | |
| 312 | if (tn->first == "neighbor") |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 313 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 314 | try { |
| 315 | boost::property_tree::ptree CommandAttriTree = tn->second; |
| 316 | std::string name = CommandAttriTree.get<std::string>("name"); |
| 317 | std::string faceUri = CommandAttriTree.get<std::string>("face-uri"); |
| 318 | double linkCost = CommandAttriTree.get<double>("link-cost", |
| 319 | Adjacent::DEFAULT_LINK_COST); |
| 320 | ndn::Name neighborName(name); |
| 321 | if (!neighborName.empty()) { |
| 322 | Adjacent adj(name, faceUri, linkCost, ADJACENT_STATUS_INACTIVE, 0); |
| 323 | m_nlsr.getAdjacencyList().insert(adj); |
| 324 | } |
| 325 | else { |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 326 | std::cerr << " Wrong command format ! [name /nbr/name/ \n face-uri /uri\n]"; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 327 | std::cerr << " or bad URI format" << std::endl; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 328 | } |
| 329 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 330 | catch (const std::exception& ex) { |
| 331 | std::cerr << ex.what() << std::endl; |
| 332 | return false; |
| 333 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 334 | } |
| 335 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 336 | return true; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 337 | } |
| 338 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 339 | bool |
| 340 | ConfFileProcessor::processConfSectionHyperbolic(boost::property_tree::ptree |
| 341 | SectionAttributeTree) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 342 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 343 | std::string state; |
| 344 | try { |
| 345 | state= SectionAttributeTree.get<string>("state","off"); |
| 346 | if (boost::iequals(state, "off")) { |
| 347 | m_nlsr.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_OFF); |
| 348 | } |
| 349 | else if (boost::iequals(state, "on")) { |
| 350 | m_nlsr.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_ON); |
| 351 | } |
| 352 | else if (state == "dry-run") { |
| 353 | m_nlsr.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_DRY_RUN); |
| 354 | } |
| 355 | else { |
| 356 | std::cerr << "Wrong format for hyperbolic state." << std::endl; |
| 357 | std::cerr << "Allowed value: off, on, dry-run" << std::endl; |
| 358 | return false; |
| 359 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 360 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 361 | catch (const std::exception& ex) { |
| 362 | std::cerr << ex.what() << std::endl; |
| 363 | return false; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 364 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 365 | |
| 366 | try { |
| 367 | /* Radius and angle is mandatory configuration parameter in hyperbolic section. |
| 368 | * Even if router can have hyperbolic routing calculation off but other router |
| 369 | * in the network may use hyperbolic routing calculation for FIB generation. |
| 370 | * So each router need to advertise its hyperbolic coordinates in the network |
| 371 | */ |
| 372 | double radius = SectionAttributeTree.get<double>("radius"); |
| 373 | double angle = SectionAttributeTree.get<double>("angle"); |
| 374 | if (!m_nlsr.getConfParameter().setCorR(radius)) { |
| 375 | return false; |
| 376 | } |
| 377 | m_nlsr.getConfParameter().setCorTheta(angle); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 378 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 379 | catch (const std::exception& ex) { |
| 380 | std::cerr << ex.what() << std::endl; |
| 381 | if (state == "on" || state == "dry-run") { |
| 382 | return false; |
| 383 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 384 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 385 | |
| 386 | return true; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 387 | } |
| 388 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 389 | bool |
| 390 | ConfFileProcessor::processConfSectionFib(boost::property_tree::ptree |
| 391 | SectionAttributeTree) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 392 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 393 | try { |
| 394 | int maxFacesPerPrefixNumber = |
| 395 | SectionAttributeTree.get<int>("max-faces-per-prefix"); |
| 396 | if (maxFacesPerPrefixNumber >= MAX_FACES_PER_PREFIX_MIN && |
| 397 | maxFacesPerPrefixNumber <= MAX_FACES_PER_PREFIX_MAX) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 398 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 399 | m_nlsr.getConfParameter().setMaxFacesPerPrefix(maxFacesPerPrefixNumber); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 400 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 401 | else { |
| 402 | std::cerr << "Wrong value for max-faces-per-prefix. "; |
| 403 | std::cerr << "NLSR will user default value"; |
| 404 | std::cerr << MAX_FACES_PER_PREFIX_MIN << std::endl; |
| 405 | return false; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 406 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 407 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 408 | catch (const std::exception& ex) { |
| 409 | cerr << ex.what() << endl; |
| 410 | return false; |
| 411 | } |
| 412 | return true; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 413 | } |
| 414 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 415 | bool |
| 416 | ConfFileProcessor::processConfSectionAdvertising(boost::property_tree::ptree |
| 417 | SectionAttributeTree) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 418 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 419 | for (boost::property_tree::ptree::const_iterator tn = |
| 420 | SectionAttributeTree.begin(); tn != SectionAttributeTree.end(); ++tn) { |
| 421 | if (tn->first == "prefix") { |
| 422 | try { |
| 423 | std::string prefix = tn->second.data(); |
| 424 | ndn::Name namePrefix(prefix); |
| 425 | if (!namePrefix.empty()) { |
| 426 | m_nlsr.getNamePrefixList().insert(namePrefix); |
| 427 | } |
| 428 | else { |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 429 | std::cerr << " Wrong command format ! [prefix /name/prefix] or bad URI" << std::endl; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 430 | return false; |
| 431 | } |
| 432 | } |
| 433 | catch (const std::exception& ex) { |
| 434 | std::cerr << ex.what() << std::endl; |
| 435 | return false; |
| 436 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 437 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 438 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 439 | return true; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 440 | } |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 441 | }//namespace NLSR |