Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 3 | * Copyright (c) 2014, Regents of the University of California, |
| 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 24 | */ |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 25 | |
| 26 | #include "rib-manager.hpp" |
Alexander Afanasyev | 03ea3eb | 2014-04-17 18:19:06 -0700 | [diff] [blame] | 27 | #include "core/global-io.hpp" |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 28 | #include "core/logger.hpp" |
Alexander Afanasyev | 63108c4 | 2014-07-07 19:10:47 -0700 | [diff] [blame] | 29 | #include "core/scheduler.hpp" |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 30 | |
| 31 | namespace nfd { |
| 32 | namespace rib { |
| 33 | |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 34 | NFD_LOG_INIT("RibManager"); |
| 35 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 36 | const Name RibManager::COMMAND_PREFIX = "/localhost/nfd/rib"; |
| 37 | const Name RibManager::REMOTE_COMMAND_PREFIX = "/localhop/nfd/rib"; |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 38 | |
| 39 | const size_t RibManager::COMMAND_UNSIGNED_NCOMPS = |
| 40 | RibManager::COMMAND_PREFIX.size() + |
| 41 | 1 + // verb |
| 42 | 1; // verb options |
| 43 | |
| 44 | const size_t RibManager::COMMAND_SIGNED_NCOMPS = |
| 45 | RibManager::COMMAND_UNSIGNED_NCOMPS + |
| 46 | 4; // (timestamp, nonce, signed info tlv, signature tlv) |
| 47 | |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 48 | const RibManager::SignedVerbAndProcessor RibManager::SIGNED_COMMAND_VERBS[] = |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 49 | { |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 50 | SignedVerbAndProcessor( |
| 51 | Name::Component("register"), |
| 52 | &RibManager::registerEntry |
| 53 | ), |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 54 | |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 55 | SignedVerbAndProcessor( |
| 56 | Name::Component("unregister"), |
| 57 | &RibManager::unregisterEntry |
| 58 | ), |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 61 | const RibManager::UnsignedVerbAndProcessor RibManager::UNSIGNED_COMMAND_VERBS[] = |
| 62 | { |
| 63 | UnsignedVerbAndProcessor( |
| 64 | Name::Component("list"), |
| 65 | &RibManager::listEntries |
| 66 | ), |
| 67 | }; |
| 68 | |
| 69 | const Name RibManager::LIST_COMMAND_PREFIX("/localhost/nfd/rib/list"); |
| 70 | const size_t RibManager::LIST_COMMAND_NCOMPS = LIST_COMMAND_PREFIX.size(); |
| 71 | |
Vince Lehman | 72446ec | 2014-07-09 10:50:02 -0500 | [diff] [blame] | 72 | RibManager::RibManager(ndn::Face& face) |
| 73 | : m_face(face) |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 74 | , m_nfdController(m_face) |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 75 | , m_localhostValidator(m_face) |
| 76 | , m_localhopValidator(m_face) |
Yingdi Yu | f4db0b5 | 2014-04-17 13:17:39 -0700 | [diff] [blame] | 77 | , m_faceMonitor(m_face) |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 78 | , m_isLocalhopEnabled(false) |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 79 | , m_ribStatusPublisher(m_managedRib, face, LIST_COMMAND_PREFIX, m_keyChain) |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 80 | , m_lastTransactionId(0) |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 81 | , m_signedVerbDispatch(SIGNED_COMMAND_VERBS, |
| 82 | SIGNED_COMMAND_VERBS + |
| 83 | (sizeof(SIGNED_COMMAND_VERBS) / sizeof(SignedVerbAndProcessor))) |
| 84 | , m_unsignedVerbDispatch(UNSIGNED_COMMAND_VERBS, |
| 85 | UNSIGNED_COMMAND_VERBS + |
| 86 | (sizeof(UNSIGNED_COMMAND_VERBS) / sizeof(UnsignedVerbAndProcessor))) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 87 | { |
| 88 | } |
| 89 | |
| 90 | void |
Junxiao Shi | a329574 | 2014-05-16 22:40:10 -0700 | [diff] [blame] | 91 | RibManager::startListening(const Name& commandPrefix, const ndn::OnInterest& onRequest) |
| 92 | { |
| 93 | NFD_LOG_INFO("Listening on: " << commandPrefix); |
| 94 | |
| 95 | m_nfdController.start<ndn::nfd::FibAddNextHopCommand>( |
| 96 | ControlParameters() |
| 97 | .setName(commandPrefix) |
| 98 | .setFaceId(0), |
| 99 | bind(&RibManager::onNrdCommandPrefixAddNextHopSuccess, this, cref(commandPrefix)), |
| 100 | bind(&RibManager::onNrdCommandPrefixAddNextHopError, this, cref(commandPrefix), _2)); |
| 101 | |
| 102 | m_face.setInterestFilter(commandPrefix, onRequest); |
| 103 | } |
| 104 | |
| 105 | void |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 106 | RibManager::registerWithNfd() |
| 107 | { |
| 108 | //check whether the components of localhop and localhost prefixes are same |
| 109 | BOOST_ASSERT(COMMAND_PREFIX.size() == REMOTE_COMMAND_PREFIX.size()); |
| 110 | |
Junxiao Shi | a329574 | 2014-05-16 22:40:10 -0700 | [diff] [blame] | 111 | this->startListening(COMMAND_PREFIX, bind(&RibManager::onLocalhostRequest, this, _2)); |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 112 | |
Junxiao Shi | a329574 | 2014-05-16 22:40:10 -0700 | [diff] [blame] | 113 | if (m_isLocalhopEnabled) { |
| 114 | this->startListening(REMOTE_COMMAND_PREFIX, |
| 115 | bind(&RibManager::onLocalhopRequest, this, _2)); |
| 116 | } |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 117 | |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 118 | NFD_LOG_INFO("Start monitoring face create/destroy events"); |
Alexander Afanasyev | f698028 | 2014-05-13 18:28:40 -0700 | [diff] [blame] | 119 | m_faceMonitor.addSubscriber(bind(&RibManager::onNotification, this, _1)); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 120 | m_faceMonitor.startNotifications(); |
| 121 | } |
| 122 | |
| 123 | void |
| 124 | RibManager::setConfigFile(ConfigFile& configFile) |
| 125 | { |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 126 | configFile.addSectionHandler("rib", |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 127 | bind(&RibManager::onConfig, this, _1, _2, _3)); |
| 128 | } |
| 129 | |
| 130 | void |
| 131 | RibManager::onConfig(const ConfigSection& configSection, |
Yingdi Yu | f4db0b5 | 2014-04-17 13:17:39 -0700 | [diff] [blame] | 132 | bool isDryRun, |
| 133 | const std::string& filename) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 134 | { |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 135 | for (ConfigSection::const_iterator i = configSection.begin(); |
| 136 | i != configSection.end(); ++i) |
| 137 | { |
| 138 | if (i->first == "localhost_security") |
| 139 | m_localhostValidator.load(i->second, filename); |
| 140 | else if (i->first == "localhop_security") |
| 141 | { |
| 142 | m_localhopValidator.load(i->second, filename); |
| 143 | m_isLocalhopEnabled = true; |
| 144 | } |
| 145 | else |
| 146 | throw Error("Unrecognized rib property: " + i->first); |
| 147 | } |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | void |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 151 | RibManager::sendResponse(const Name& name, |
| 152 | const ControlResponse& response) |
| 153 | { |
| 154 | const Block& encodedControl = response.wireEncode(); |
| 155 | |
Alexander Afanasyev | 97a9c2c | 2014-07-18 16:57:57 -0700 | [diff] [blame] | 156 | shared_ptr<Data> responseData = make_shared<Data>(name); |
| 157 | responseData->setContent(encodedControl); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 158 | |
Alexander Afanasyev | 97a9c2c | 2014-07-18 16:57:57 -0700 | [diff] [blame] | 159 | m_keyChain.sign(*responseData); |
| 160 | m_face.put(*responseData); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | void |
| 164 | RibManager::sendResponse(const Name& name, |
| 165 | uint32_t code, |
| 166 | const std::string& text) |
| 167 | { |
| 168 | ControlResponse response(code, text); |
| 169 | sendResponse(name, response); |
| 170 | } |
| 171 | |
| 172 | void |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 173 | RibManager::onLocalhostRequest(const Interest& request) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 174 | { |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 175 | const Name& command = request.getName(); |
| 176 | const Name::Component& verb = command.get(COMMAND_PREFIX.size()); |
| 177 | |
| 178 | UnsignedVerbDispatchTable::const_iterator unsignedVerbProcessor = m_unsignedVerbDispatch.find(verb); |
| 179 | |
| 180 | if (unsignedVerbProcessor != m_unsignedVerbDispatch.end()) |
| 181 | { |
| 182 | NFD_LOG_DEBUG("command result: processing unsigned verb: " << verb); |
| 183 | (unsignedVerbProcessor->second)(this, request); |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | m_localhostValidator.validate(request, |
| 188 | bind(&RibManager::onCommandValidated, this, _1), |
| 189 | bind(&RibManager::onCommandValidationFailed, this, _1, _2)); |
| 190 | } |
Yingdi Yu | e5224e9 | 2014-04-29 18:04:02 -0700 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | void |
| 194 | RibManager::onLocalhopRequest(const Interest& request) |
| 195 | { |
| 196 | m_localhopValidator.validate(request, |
| 197 | bind(&RibManager::onCommandValidated, this, _1), |
| 198 | bind(&RibManager::onCommandValidationFailed, this, _1, _2)); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | void |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 202 | RibManager::onCommandValidated(const shared_ptr<const Interest>& request) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 203 | { |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 204 | // REMOTE_COMMAND_PREFIX number of componenets are same as |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 205 | // NRD_COMMAND_PREFIX's so no extra checks are required. |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 206 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 207 | const Name& command = request->getName(); |
| 208 | const Name::Component& verb = command[COMMAND_PREFIX.size()]; |
| 209 | const Name::Component& parameterComponent = command[COMMAND_PREFIX.size() + 1]; |
| 210 | |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 211 | SignedVerbDispatchTable::const_iterator verbProcessor = m_signedVerbDispatch.find(verb); |
| 212 | if (verbProcessor != m_signedVerbDispatch.end()) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 213 | { |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 214 | ControlParameters parameters; |
| 215 | if (!extractParameters(parameterComponent, parameters)) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 216 | { |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 217 | NFD_LOG_DEBUG("command result: malformed verb: " << verb); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 218 | if (static_cast<bool>(request)) |
| 219 | sendResponse(command, 400, "Malformed command"); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 220 | return; |
| 221 | } |
| 222 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 223 | if (!parameters.hasFaceId() || parameters.getFaceId() == 0) |
| 224 | { |
| 225 | parameters.setFaceId(request->getIncomingFaceId()); |
| 226 | } |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 227 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 228 | NFD_LOG_DEBUG("command result: processing verb: " << verb); |
| 229 | (verbProcessor->second)(this, request, parameters); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 230 | } |
| 231 | else |
| 232 | { |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 233 | NFD_LOG_DEBUG("Unsupported command: " << verb); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 234 | if (static_cast<bool>(request)) |
| 235 | sendResponse(request->getName(), 501, "Unsupported command"); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | |
| 239 | void |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 240 | RibManager::registerEntry(const shared_ptr<const Interest>& request, |
| 241 | ControlParameters& parameters) |
| 242 | { |
| 243 | ndn::nfd::RibRegisterCommand command; |
| 244 | |
| 245 | if (!validateParameters(command, parameters)) |
| 246 | { |
| 247 | NFD_LOG_DEBUG("register result: FAIL reason: malformed"); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 248 | if (static_cast<bool>(request)) |
| 249 | sendResponse(request->getName(), 400, "Malformed command"); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 250 | return; |
| 251 | } |
| 252 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 253 | FaceEntry faceEntry; |
| 254 | faceEntry.faceId = parameters.getFaceId(); |
| 255 | faceEntry.origin = parameters.getOrigin(); |
| 256 | faceEntry.cost = parameters.getCost(); |
| 257 | faceEntry.flags = parameters.getFlags(); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 258 | |
Alexander Afanasyev | f67cf08 | 2014-07-18 16:47:29 -0700 | [diff] [blame] | 259 | if (parameters.hasExpirationPeriod() && |
| 260 | parameters.getExpirationPeriod() != time::milliseconds::max()) |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 261 | { |
| 262 | faceEntry.expires = time::steady_clock::now() + parameters.getExpirationPeriod(); |
| 263 | |
| 264 | // Schedule a new event, the old one will be cancelled during rib insertion. |
| 265 | EventId eventId; |
| 266 | NFD_LOG_TRACE("scheduling unregistration at: " << faceEntry.expires); |
| 267 | eventId = scheduler::schedule(parameters.getExpirationPeriod(), |
| 268 | bind(&RibManager::unregisterEntry, |
| 269 | this, shared_ptr<Interest>(), parameters)); |
| 270 | |
| 271 | //set the NewEventId of this entry |
| 272 | faceEntry.setExpirationEvent(eventId); |
| 273 | } |
| 274 | else |
| 275 | { |
| 276 | faceEntry.expires = time::steady_clock::TimePoint::max(); |
| 277 | } |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 278 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 279 | NFD_LOG_TRACE("register prefix: " << faceEntry); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 280 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 281 | m_managedRib.insert(parameters.getName(), faceEntry); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 282 | |
| 283 | sendUpdatesToFib(request, parameters); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | void |
| 287 | RibManager::unregisterEntry(const shared_ptr<const Interest>& request, |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 288 | ControlParameters& params) |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 289 | { |
Alexander Afanasyev | ce7520e | 2014-04-28 09:40:06 -0700 | [diff] [blame] | 290 | ndn::nfd::RibUnregisterCommand command; |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 291 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 292 | //passing all parameters gives error in validation. |
| 293 | //so passing only the required arguments. |
| 294 | ControlParameters parameters; |
| 295 | parameters.setName(params.getName()); |
Alexander Afanasyev | 56356b2 | 2014-07-18 16:56:34 -0700 | [diff] [blame] | 296 | if (params.hasFaceId()) |
| 297 | parameters.setFaceId(params.getFaceId()); |
| 298 | if (params.hasOrigin()) |
| 299 | parameters.setOrigin(params.getOrigin()); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 300 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 301 | if (!validateParameters(command, parameters)) |
| 302 | { |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 303 | NFD_LOG_DEBUG("unregister result: FAIL reason: malformed"); |
| 304 | if (static_cast<bool>(request)) |
| 305 | sendResponse(request->getName(), 400, "Malformed command"); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 306 | return; |
| 307 | } |
| 308 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 309 | FaceEntry faceEntry; |
| 310 | faceEntry.faceId = parameters.getFaceId(); |
| 311 | faceEntry.origin = parameters.getOrigin(); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 312 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 313 | NFD_LOG_TRACE("unregister prefix: " << faceEntry); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 314 | |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 315 | m_managedRib.erase(parameters.getName(), faceEntry); |
| 316 | |
| 317 | sendUpdatesToFib(request, parameters); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | void |
| 321 | RibManager::onCommandValidationFailed(const shared_ptr<const Interest>& request, |
| 322 | const std::string& failureInfo) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 323 | { |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 324 | NFD_LOG_DEBUG("RibRequestValidationFailed: " << failureInfo); |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 325 | if (static_cast<bool>(request)) |
| 326 | sendResponse(request->getName(), 403, failureInfo); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 327 | } |
| 328 | |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 329 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 330 | bool |
| 331 | RibManager::extractParameters(const Name::Component& parameterComponent, |
| 332 | ControlParameters& extractedParameters) |
| 333 | { |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 334 | try |
| 335 | { |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 336 | Block rawParameters = parameterComponent.blockFromValue(); |
| 337 | extractedParameters.wireDecode(rawParameters); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 338 | } |
| 339 | catch (const ndn::Tlv::Error& e) |
| 340 | { |
| 341 | return false; |
| 342 | } |
| 343 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 344 | NFD_LOG_DEBUG("Parameters parsed OK"); |
| 345 | return true; |
| 346 | } |
| 347 | |
| 348 | bool |
| 349 | RibManager::validateParameters(const ControlCommand& command, |
| 350 | ControlParameters& parameters) |
| 351 | { |
| 352 | try |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 353 | { |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 354 | command.validateRequest(parameters); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 355 | } |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 356 | catch (const ControlCommand::ArgumentError&) |
| 357 | { |
| 358 | return false; |
| 359 | } |
| 360 | |
| 361 | command.applyDefaultsToRequest(parameters); |
| 362 | |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 363 | return true; |
| 364 | } |
| 365 | |
| 366 | void |
| 367 | RibManager::onCommandError(uint32_t code, const std::string& error, |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 368 | const shared_ptr<const Interest>& request, |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 369 | const FaceEntry& faceEntry) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 370 | { |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 371 | NFD_LOG_ERROR("NFD returned an error: " << error << " (code: " << code << ")"); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 372 | |
| 373 | ControlResponse response; |
| 374 | |
| 375 | if (code == 404) |
| 376 | { |
| 377 | response.setCode(code); |
| 378 | response.setText(error); |
| 379 | } |
| 380 | else |
| 381 | { |
| 382 | response.setCode(533); |
| 383 | std::ostringstream os; |
| 384 | os << "Failure to update NFD " << "(NFD Error: " << code << " " << error << ")"; |
| 385 | response.setText(os.str()); |
| 386 | } |
| 387 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 388 | if (static_cast<bool>(request)) |
| 389 | sendResponse(request->getName(), response); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | void |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 393 | RibManager::onRegSuccess(const shared_ptr<const Interest>& request, |
| 394 | const ControlParameters& parameters, |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 395 | const FaceEntry& faceEntry) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 396 | { |
| 397 | ControlResponse response; |
| 398 | |
| 399 | response.setCode(200); |
| 400 | response.setText("Success"); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 401 | response.setBody(parameters.wireEncode()); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 402 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 403 | NFD_LOG_TRACE("onRegSuccess: registered " << faceEntry); |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 404 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 405 | if (static_cast<bool>(request)) |
| 406 | sendResponse(request->getName(), response); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 407 | } |
| 408 | |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 409 | |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 410 | void |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 411 | RibManager::onUnRegSuccess(const shared_ptr<const Interest>& request, |
| 412 | const ControlParameters& parameters, |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 413 | const FaceEntry& faceEntry) |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 414 | { |
| 415 | ControlResponse response; |
| 416 | |
| 417 | response.setCode(200); |
| 418 | response.setText("Success"); |
Alexander Afanasyev | 20d3144 | 2014-04-19 17:00:53 -0700 | [diff] [blame] | 419 | response.setBody(parameters.wireEncode()); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 420 | |
Vince | 12e4946 | 2014-06-09 13:29:32 -0500 | [diff] [blame] | 421 | NFD_LOG_TRACE("onUnRegSuccess: unregistered " << faceEntry); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 422 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 423 | if (static_cast<bool>(request)) |
| 424 | sendResponse(request->getName(), response); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 425 | } |
| 426 | |
| 427 | void |
| 428 | RibManager::sendSuccessResponse(const shared_ptr<const Interest>& request, |
| 429 | const ControlParameters& parameters) |
| 430 | { |
| 431 | if (!static_cast<bool>(request)) |
| 432 | { |
| 433 | return; |
| 434 | } |
| 435 | |
| 436 | ControlResponse response; |
| 437 | |
| 438 | response.setCode(200); |
| 439 | response.setText("Success"); |
| 440 | response.setBody(parameters.wireEncode()); |
| 441 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 442 | if (static_cast<bool>(request)) |
| 443 | sendResponse(request->getName(), response); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | void |
| 447 | RibManager::sendErrorResponse(uint32_t code, const std::string& error, |
| 448 | const shared_ptr<const Interest>& request) |
| 449 | { |
| 450 | NFD_LOG_ERROR("NFD returned an error: " << error << " (code: " << code << ")"); |
| 451 | |
| 452 | if (!static_cast<bool>(request)) |
| 453 | { |
| 454 | return; |
| 455 | } |
| 456 | |
| 457 | ControlResponse response; |
| 458 | |
| 459 | if (code == 404) |
| 460 | { |
| 461 | response.setCode(code); |
| 462 | response.setText(error); |
| 463 | } |
| 464 | else |
| 465 | { |
| 466 | response.setCode(533); |
| 467 | std::ostringstream os; |
| 468 | os << "Failure to update NFD " << "(NFD Error: " << code << " " << error << ")"; |
| 469 | response.setText(os.str()); |
| 470 | } |
| 471 | |
Syed Obaid | 3313a37 | 2014-07-01 01:31:33 -0500 | [diff] [blame] | 472 | if (static_cast<bool>(request)) |
| 473 | sendResponse(request->getName(), response); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 474 | } |
| 475 | |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 476 | void |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 477 | RibManager::onNrdCommandPrefixAddNextHopSuccess(const Name& prefix) |
| 478 | { |
| 479 | NFD_LOG_DEBUG("Successfully registered " + prefix.toUri() + " with NFD"); |
| 480 | } |
| 481 | |
| 482 | void |
| 483 | RibManager::onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg) |
| 484 | { |
| 485 | throw Error("Error in setting interest filter (" + name.toUri() + "): " + msg); |
| 486 | } |
| 487 | |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 488 | bool |
| 489 | RibManager::isTransactionComplete(const TransactionId transactionId) |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 490 | { |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 491 | FibTransactionTable::iterator it = m_pendingFibTransactions.find(transactionId); |
| 492 | |
| 493 | if (it != m_pendingFibTransactions.end()) |
| 494 | { |
| 495 | int& updatesLeft = it->second; |
| 496 | |
| 497 | updatesLeft--; |
| 498 | |
| 499 | // All of the updates have been applied successfully |
| 500 | if (updatesLeft == 0) |
| 501 | { |
| 502 | m_pendingFibTransactions.erase(it); |
| 503 | return true; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | return false; |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | void |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 511 | RibManager::invalidateTransaction(const TransactionId transactionId) |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 512 | { |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 513 | FibTransactionTable::iterator it = m_pendingFibTransactions.find(transactionId); |
| 514 | |
| 515 | if (it != m_pendingFibTransactions.end()) |
| 516 | { |
| 517 | m_pendingFibTransactions.erase(it); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | void |
| 522 | RibManager::onAddNextHopSuccess(const shared_ptr<const Interest>& request, |
| 523 | const ControlParameters& parameters, |
| 524 | const TransactionId transactionId, |
| 525 | const bool shouldSendResponse) |
| 526 | { |
| 527 | if (isTransactionComplete(transactionId) && shouldSendResponse) |
| 528 | { |
| 529 | sendSuccessResponse(request, parameters); |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | void |
| 534 | RibManager::onAddNextHopError(uint32_t code, const std::string& error, |
| 535 | const shared_ptr<const Interest>& request, |
| 536 | const TransactionId transactionId, const bool shouldSendResponse) |
| 537 | { |
| 538 | invalidateTransaction(transactionId); |
| 539 | |
| 540 | if (shouldSendResponse) |
| 541 | { |
| 542 | sendErrorResponse(code, error, request); |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | void |
| 547 | RibManager::onRemoveNextHopSuccess(const shared_ptr<const Interest>& request, |
| 548 | const ControlParameters& parameters, |
| 549 | const TransactionId transactionId, |
| 550 | const bool shouldSendResponse) |
| 551 | { |
| 552 | if (isTransactionComplete(transactionId) && shouldSendResponse) |
| 553 | { |
| 554 | sendSuccessResponse(request, parameters); |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | void |
| 559 | RibManager::onRemoveNextHopError(uint32_t code, const std::string& error, |
| 560 | const shared_ptr<const Interest>& request, |
| 561 | const TransactionId transactionId, const bool shouldSendResponse) |
| 562 | { |
| 563 | invalidateTransaction(transactionId); |
| 564 | |
| 565 | if (shouldSendResponse) |
| 566 | { |
| 567 | sendErrorResponse(code, error, request); |
| 568 | } |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | void |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 572 | RibManager::onControlHeaderSuccess() |
| 573 | { |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 574 | NFD_LOG_DEBUG("Local control header enabled"); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 575 | } |
| 576 | |
| 577 | void |
| 578 | RibManager::onControlHeaderError(uint32_t code, const std::string& reason) |
| 579 | { |
Alexander Afanasyev | b305165 | 2014-04-30 17:50:26 -0700 | [diff] [blame] | 580 | std::ostringstream os; |
| 581 | os << "Couldn't enable local control header " |
| 582 | << "(code: " << code << ", info: " << reason << ")"; |
| 583 | throw Error(os.str()); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | void |
| 587 | RibManager::enableLocalControlHeader() |
| 588 | { |
Alexander Afanasyev | b3893c9 | 2014-05-15 01:49:54 -0700 | [diff] [blame] | 589 | m_nfdController.start<ndn::nfd::FaceEnableLocalControlCommand>( |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 590 | ControlParameters() |
| 591 | .setLocalControlFeature(ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID), |
| 592 | bind(&RibManager::onControlHeaderSuccess, this), |
| 593 | bind(&RibManager::onControlHeaderError, this, _1, _2)); |
| 594 | } |
| 595 | |
| 596 | void |
| 597 | RibManager::onNotification(const FaceEventNotification& notification) |
| 598 | { |
| 599 | /// \todo A notification can be missed, in this case check Facelist |
Alexander Afanasyev | 89cf5e0 | 2014-04-17 12:08:57 -0700 | [diff] [blame] | 600 | NFD_LOG_TRACE("onNotification: " << notification); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 601 | if (notification.getKind() == ndn::nfd::FACE_EVENT_DESTROYED) //face destroyed |
| 602 | { |
Alexander Afanasyev | 63108c4 | 2014-07-07 19:10:47 -0700 | [diff] [blame] | 603 | scheduler::schedule(time::seconds(0), |
| 604 | bind(&RibManager::processErasureAfterNotification, this, |
| 605 | notification.getFaceId())); |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 606 | } |
| 607 | } |
| 608 | |
| 609 | void |
Alexander Afanasyev | 63108c4 | 2014-07-07 19:10:47 -0700 | [diff] [blame] | 610 | RibManager::processErasureAfterNotification(uint64_t faceId) |
| 611 | { |
| 612 | m_managedRib.erase(faceId); |
| 613 | |
| 614 | sendUpdatesToFibAfterFaceDestroyEvent(); |
| 615 | } |
| 616 | |
| 617 | void |
Vince Lehman | 4387e78 | 2014-06-19 16:57:45 -0500 | [diff] [blame] | 618 | RibManager::sendUpdatesToFib(const shared_ptr<const Interest>& request, |
| 619 | const ControlParameters& parameters) |
| 620 | { |
| 621 | const Rib::FibUpdateList& updates = m_managedRib.getFibUpdates(); |
| 622 | |
| 623 | // If no updates were generated, consider the operation a success |
| 624 | if (updates.empty()) |
| 625 | { |
| 626 | sendSuccessResponse(request, parameters); |
| 627 | return; |
| 628 | } |
| 629 | |
| 630 | bool shouldWaitToRespond = false; |
| 631 | |
| 632 | // An application request should wait for all FIB updates to be applied |
| 633 | // successfully before sending a response |
| 634 | if (parameters.getOrigin() == ndn::nfd::ROUTE_ORIGIN_APP) |
| 635 | { |
| 636 | shouldWaitToRespond = true; |
| 637 | } |
| 638 | else // Respond immediately |
| 639 | { |
| 640 | sendSuccessResponse(request, parameters); |
| 641 | } |
| 642 | |
| 643 | NFD_LOG_DEBUG("Applying " << updates.size() << " updates to FIB"); |
| 644 | |
| 645 | // Assign an ID to this FIB transaction |
| 646 | TransactionId currentTransactionId = ++m_lastTransactionId; |
| 647 | |
| 648 | // Add this transaction to the transaction table |
| 649 | m_pendingFibTransactions[currentTransactionId] = updates.size(); |
| 650 | |
| 651 | for (Rib::FibUpdateList::const_iterator it = updates.begin(); it != updates.end(); ++it) |
| 652 | { |
| 653 | shared_ptr<const FibUpdate> update(*it); |
| 654 | |
| 655 | if (update->action == FibUpdate::ADD_NEXTHOP) |
| 656 | { |
| 657 | FaceEntry faceEntry; |
| 658 | faceEntry.faceId = update->faceId; |
| 659 | faceEntry.cost = update->cost; |
| 660 | |
| 661 | m_nfdController.start<ndn::nfd::FibAddNextHopCommand>( |
| 662 | ControlParameters() |
| 663 | .setName(update->name) |
| 664 | .setFaceId(faceEntry.faceId) |
| 665 | .setCost(faceEntry.cost), |
| 666 | bind(&RibManager::onAddNextHopSuccess, this, request, |
| 667 | parameters, |
| 668 | currentTransactionId, |
| 669 | shouldWaitToRespond), |
| 670 | bind(&RibManager::onAddNextHopError, this, _1, _2, request, currentTransactionId, |
| 671 | shouldWaitToRespond)); |
| 672 | } |
| 673 | else if (update->action == FibUpdate::REMOVE_NEXTHOP) |
| 674 | { |
| 675 | FaceEntry faceEntry; |
| 676 | faceEntry.faceId = update->faceId; |
| 677 | |
| 678 | m_nfdController.start<ndn::nfd::FibRemoveNextHopCommand>( |
| 679 | ControlParameters() |
| 680 | .setName(update->name) |
| 681 | .setFaceId(faceEntry.faceId), |
| 682 | bind(&RibManager::onRemoveNextHopSuccess, this, request, |
| 683 | parameters, |
| 684 | currentTransactionId, |
| 685 | shouldWaitToRespond), |
| 686 | bind(&RibManager::onRemoveNextHopError, this, _1, _2, request, currentTransactionId, |
| 687 | shouldWaitToRespond)); |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | m_managedRib.clearFibUpdates(); |
| 692 | } |
| 693 | |
| 694 | void |
| 695 | RibManager::sendUpdatesToFibAfterFaceDestroyEvent() |
| 696 | { |
| 697 | ControlParameters parameters; |
| 698 | parameters.setOrigin(ndn::nfd::ROUTE_ORIGIN_STATIC); |
| 699 | |
| 700 | sendUpdatesToFib(shared_ptr<const Interest>(), parameters); |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 701 | } |
| 702 | |
Vince Lehman | cd16c83 | 2014-07-23 15:14:55 -0700 | [diff] [blame^] | 703 | void |
| 704 | RibManager::listEntries(const Interest& request) |
| 705 | { |
| 706 | const Name& command = request.getName(); |
| 707 | const size_t commandNComps = command.size(); |
| 708 | |
| 709 | if (commandNComps < LIST_COMMAND_NCOMPS || |
| 710 | !LIST_COMMAND_PREFIX.isPrefixOf(command)) |
| 711 | { |
| 712 | NFD_LOG_DEBUG("command result: malformed"); |
| 713 | sendResponse(command, 400, "Malformed command"); |
| 714 | return; |
| 715 | } |
| 716 | |
| 717 | m_ribStatusPublisher.publish(); |
| 718 | } |
| 719 | |
Alexander Afanasyev | 3ecec50 | 2014-04-16 13:42:44 -0700 | [diff] [blame] | 720 | } // namespace rib |
| 721 | } // namespace nfd |