Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 3 | * Copyright (c) 2013-2017 Regents of the University of California. |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 6 | * |
| 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 20 | */ |
| 21 | |
Junxiao Shi | 7357ef2 | 2016-09-07 02:39:37 +0000 | [diff] [blame] | 22 | #include "control-command.hpp" |
| 23 | #include "command-options.hpp" // only used in deprecated functions |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 24 | |
| 25 | namespace ndn { |
| 26 | namespace nfd { |
| 27 | |
| 28 | ControlCommand::ControlCommand(const std::string& module, const std::string& verb) |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 29 | : m_module(module) |
| 30 | , m_verb(verb) |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 31 | { |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 32 | } |
| 33 | |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 34 | ControlCommand::~ControlCommand() = default; |
| 35 | |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 36 | void |
| 37 | ControlCommand::validateRequest(const ControlParameters& parameters) const |
| 38 | { |
| 39 | m_requestValidator.validate(parameters); |
| 40 | } |
| 41 | |
| 42 | void |
| 43 | ControlCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | void |
| 48 | ControlCommand::validateResponse(const ControlParameters& parameters) const |
| 49 | { |
| 50 | m_responseValidator.validate(parameters); |
| 51 | } |
| 52 | |
| 53 | void |
| 54 | ControlCommand::applyDefaultsToResponse(ControlParameters& parameters) const |
| 55 | { |
| 56 | } |
| 57 | |
| 58 | Name |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 59 | ControlCommand::getRequestName(const Name& commandPrefix, |
| 60 | const ControlParameters& parameters) const |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 61 | { |
| 62 | this->validateRequest(parameters); |
| 63 | |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 64 | Name name = commandPrefix; |
| 65 | name.append(m_module).append(m_verb); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 66 | name.append(parameters.wireEncode()); |
| 67 | return name; |
| 68 | } |
| 69 | |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 70 | ControlCommand::FieldValidator::FieldValidator() |
| 71 | : m_required(CONTROL_PARAMETER_UBOUND) |
| 72 | , m_optional(CONTROL_PARAMETER_UBOUND) |
| 73 | { |
| 74 | } |
| 75 | |
| 76 | void |
| 77 | ControlCommand::FieldValidator::validate(const ControlParameters& parameters) const |
| 78 | { |
| 79 | const std::vector<bool>& presentFields = parameters.getPresentFields(); |
| 80 | |
| 81 | for (size_t i = 0; i < CONTROL_PARAMETER_UBOUND; ++i) { |
| 82 | bool isPresent = presentFields[i]; |
| 83 | if (m_required[i]) { |
| 84 | if (!isPresent) { |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 85 | BOOST_THROW_EXCEPTION(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is required but missing")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 86 | } |
| 87 | } |
| 88 | else if (isPresent && !m_optional[i]) { |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 89 | BOOST_THROW_EXCEPTION(ArgumentError(CONTROL_PARAMETER_FIELD[i] + " is forbidden but present")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | FaceCreateCommand::FaceCreateCommand() |
| 95 | : ControlCommand("faces", "create") |
| 96 | { |
| 97 | m_requestValidator |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 98 | .required(CONTROL_PARAMETER_URI) |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 99 | .optional(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 100 | .optional(CONTROL_PARAMETER_FLAGS) |
| 101 | .optional(CONTROL_PARAMETER_MASK); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 102 | m_responseValidator |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 103 | .required(CONTROL_PARAMETER_FACE_ID) |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 104 | .required(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 105 | .optional(CONTROL_PARAMETER_FLAGS) |
| 106 | .optional(CONTROL_PARAMETER_URI); |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | void |
| 110 | FaceCreateCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 111 | { |
| 112 | if (!parameters.hasFacePersistency()) { |
| 113 | parameters.setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 114 | } |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | void |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 118 | FaceCreateCommand::validateRequest(const ControlParameters& parameters) const |
| 119 | { |
| 120 | this->ControlCommand::validateRequest(parameters); |
| 121 | |
| 122 | if (parameters.hasFlags() != parameters.hasMask()) { |
| 123 | BOOST_THROW_EXCEPTION(ArgumentError("Flags must be accompanied by Mask")); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 128 | FaceCreateCommand::validateResponse(const ControlParameters& parameters) const |
| 129 | { |
| 130 | this->ControlCommand::validateResponse(parameters); |
| 131 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 132 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 133 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 134 | } |
| 135 | } |
| 136 | |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 137 | FaceUpdateCommand::FaceUpdateCommand() |
| 138 | : ControlCommand("faces", "update") |
| 139 | { |
| 140 | m_requestValidator |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 141 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 142 | .optional(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 143 | .optional(CONTROL_PARAMETER_FLAGS) |
| 144 | .optional(CONTROL_PARAMETER_MASK); |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 145 | m_responseValidator |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 146 | .required(CONTROL_PARAMETER_FACE_ID) |
| 147 | .required(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 148 | .required(CONTROL_PARAMETER_FLAGS); |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | void |
| 152 | FaceUpdateCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 153 | { |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 154 | if (!parameters.hasFaceId()) { |
| 155 | parameters.setFaceId(0); |
| 156 | } |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | void |
| 160 | FaceUpdateCommand::validateRequest(const ControlParameters& parameters) const |
| 161 | { |
| 162 | this->ControlCommand::validateRequest(parameters); |
| 163 | |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 164 | if (parameters.hasFlags() != parameters.hasMask()) { |
| 165 | BOOST_THROW_EXCEPTION(ArgumentError("Flags must be accompanied by Mask")); |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 166 | } |
| 167 | } |
| 168 | |
| 169 | void |
| 170 | FaceUpdateCommand::validateResponse(const ControlParameters& parameters) const |
| 171 | { |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 172 | this->ControlCommand::validateResponse(parameters); |
| 173 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 174 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 175 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 176 | } |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 177 | } |
| 178 | |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 179 | FaceDestroyCommand::FaceDestroyCommand() |
| 180 | : ControlCommand("faces", "destroy") |
| 181 | { |
| 182 | m_requestValidator |
| 183 | .required(CONTROL_PARAMETER_FACE_ID); |
| 184 | m_responseValidator = m_requestValidator; |
| 185 | } |
| 186 | |
| 187 | void |
| 188 | FaceDestroyCommand::validateRequest(const ControlParameters& parameters) const |
| 189 | { |
| 190 | this->ControlCommand::validateRequest(parameters); |
| 191 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 192 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 193 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 194 | } |
| 195 | } |
| 196 | |
| 197 | void |
| 198 | FaceDestroyCommand::validateResponse(const ControlParameters& parameters) const |
| 199 | { |
| 200 | this->validateRequest(parameters); |
| 201 | } |
| 202 | |
| 203 | FaceLocalControlCommand::FaceLocalControlCommand(const std::string& verb) |
| 204 | : ControlCommand("faces", verb) |
| 205 | { |
| 206 | m_requestValidator |
| 207 | .required(CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE); |
| 208 | m_responseValidator = m_requestValidator; |
| 209 | } |
| 210 | |
| 211 | void |
| 212 | FaceLocalControlCommand::validateRequest(const ControlParameters& parameters) const |
| 213 | { |
| 214 | this->ControlCommand::validateRequest(parameters); |
| 215 | |
| 216 | switch (parameters.getLocalControlFeature()) { |
| 217 | case LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID: |
| 218 | case LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID: |
| 219 | break; |
| 220 | default: |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 221 | BOOST_THROW_EXCEPTION(ArgumentError("LocalControlFeature is invalid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
| 225 | void |
| 226 | FaceLocalControlCommand::validateResponse(const ControlParameters& parameters) const |
| 227 | { |
| 228 | this->validateRequest(parameters); |
| 229 | } |
| 230 | |
| 231 | FaceEnableLocalControlCommand::FaceEnableLocalControlCommand() |
| 232 | : FaceLocalControlCommand("enable-local-control") |
| 233 | { |
| 234 | } |
| 235 | |
| 236 | FaceDisableLocalControlCommand::FaceDisableLocalControlCommand() |
| 237 | : FaceLocalControlCommand("disable-local-control") |
| 238 | { |
| 239 | } |
| 240 | |
| 241 | FibAddNextHopCommand::FibAddNextHopCommand() |
| 242 | : ControlCommand("fib", "add-nexthop") |
| 243 | { |
| 244 | m_requestValidator |
| 245 | .required(CONTROL_PARAMETER_NAME) |
| 246 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 247 | .optional(CONTROL_PARAMETER_COST); |
| 248 | m_responseValidator |
| 249 | .required(CONTROL_PARAMETER_NAME) |
| 250 | .required(CONTROL_PARAMETER_FACE_ID) |
| 251 | .required(CONTROL_PARAMETER_COST); |
| 252 | } |
| 253 | |
| 254 | void |
| 255 | FibAddNextHopCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 256 | { |
| 257 | if (!parameters.hasFaceId()) { |
| 258 | parameters.setFaceId(0); |
| 259 | } |
| 260 | if (!parameters.hasCost()) { |
| 261 | parameters.setCost(0); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | void |
| 266 | FibAddNextHopCommand::validateResponse(const ControlParameters& parameters) const |
| 267 | { |
| 268 | this->ControlCommand::validateResponse(parameters); |
| 269 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 270 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 271 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 272 | } |
| 273 | } |
| 274 | |
| 275 | FibRemoveNextHopCommand::FibRemoveNextHopCommand() |
| 276 | : ControlCommand("fib", "remove-nexthop") |
| 277 | { |
| 278 | m_requestValidator |
| 279 | .required(CONTROL_PARAMETER_NAME) |
| 280 | .optional(CONTROL_PARAMETER_FACE_ID); |
| 281 | m_responseValidator |
| 282 | .required(CONTROL_PARAMETER_NAME) |
| 283 | .required(CONTROL_PARAMETER_FACE_ID); |
| 284 | } |
| 285 | |
| 286 | void |
| 287 | FibRemoveNextHopCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 288 | { |
| 289 | if (!parameters.hasFaceId()) { |
| 290 | parameters.setFaceId(0); |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | void |
| 295 | FibRemoveNextHopCommand::validateResponse(const ControlParameters& parameters) const |
| 296 | { |
| 297 | this->ControlCommand::validateResponse(parameters); |
| 298 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 299 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 300 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 301 | } |
| 302 | } |
| 303 | |
| 304 | StrategyChoiceSetCommand::StrategyChoiceSetCommand() |
| 305 | : ControlCommand("strategy-choice", "set") |
| 306 | { |
| 307 | m_requestValidator |
| 308 | .required(CONTROL_PARAMETER_NAME) |
| 309 | .required(CONTROL_PARAMETER_STRATEGY); |
| 310 | m_responseValidator = m_requestValidator; |
| 311 | } |
| 312 | |
| 313 | StrategyChoiceUnsetCommand::StrategyChoiceUnsetCommand() |
| 314 | : ControlCommand("strategy-choice", "unset") |
| 315 | { |
| 316 | m_requestValidator |
| 317 | .required(CONTROL_PARAMETER_NAME); |
| 318 | m_responseValidator = m_requestValidator; |
| 319 | } |
| 320 | |
| 321 | void |
| 322 | StrategyChoiceUnsetCommand::validateRequest(const ControlParameters& parameters) const |
| 323 | { |
| 324 | this->ControlCommand::validateRequest(parameters); |
| 325 | |
| 326 | if (parameters.getName().size() == 0) { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 327 | BOOST_THROW_EXCEPTION(ArgumentError("Name must not be ndn:/")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 328 | } |
| 329 | } |
| 330 | |
| 331 | void |
| 332 | StrategyChoiceUnsetCommand::validateResponse(const ControlParameters& parameters) const |
| 333 | { |
| 334 | this->validateRequest(parameters); |
| 335 | } |
| 336 | |
| 337 | RibRegisterCommand::RibRegisterCommand() |
| 338 | : ControlCommand("rib", "register") |
| 339 | { |
| 340 | m_requestValidator |
| 341 | .required(CONTROL_PARAMETER_NAME) |
| 342 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 343 | .optional(CONTROL_PARAMETER_ORIGIN) |
| 344 | .optional(CONTROL_PARAMETER_COST) |
| 345 | .optional(CONTROL_PARAMETER_FLAGS) |
| 346 | .optional(CONTROL_PARAMETER_EXPIRATION_PERIOD); |
| 347 | m_responseValidator |
| 348 | .required(CONTROL_PARAMETER_NAME) |
| 349 | .required(CONTROL_PARAMETER_FACE_ID) |
| 350 | .required(CONTROL_PARAMETER_ORIGIN) |
| 351 | .required(CONTROL_PARAMETER_COST) |
| 352 | .required(CONTROL_PARAMETER_FLAGS) |
| 353 | .optional(CONTROL_PARAMETER_EXPIRATION_PERIOD); |
| 354 | } |
| 355 | |
| 356 | void |
| 357 | RibRegisterCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 358 | { |
| 359 | if (!parameters.hasFaceId()) { |
| 360 | parameters.setFaceId(0); |
| 361 | } |
| 362 | if (!parameters.hasOrigin()) { |
| 363 | parameters.setOrigin(ROUTE_ORIGIN_APP); |
| 364 | } |
| 365 | if (!parameters.hasCost()) { |
| 366 | parameters.setCost(0); |
| 367 | } |
| 368 | if (!parameters.hasFlags()) { |
| 369 | parameters.setFlags(ROUTE_FLAG_CHILD_INHERIT); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | void |
| 374 | RibRegisterCommand::validateResponse(const ControlParameters& parameters) const |
| 375 | { |
| 376 | this->ControlCommand::validateResponse(parameters); |
| 377 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 378 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 379 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 380 | } |
| 381 | } |
| 382 | |
| 383 | RibUnregisterCommand::RibUnregisterCommand() |
| 384 | : ControlCommand("rib", "unregister") |
| 385 | { |
| 386 | m_requestValidator |
| 387 | .required(CONTROL_PARAMETER_NAME) |
| 388 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 389 | .optional(CONTROL_PARAMETER_ORIGIN); |
| 390 | m_responseValidator |
| 391 | .required(CONTROL_PARAMETER_NAME) |
| 392 | .required(CONTROL_PARAMETER_FACE_ID) |
| 393 | .required(CONTROL_PARAMETER_ORIGIN); |
| 394 | } |
| 395 | |
| 396 | void |
| 397 | RibUnregisterCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 398 | { |
| 399 | if (!parameters.hasFaceId()) { |
| 400 | parameters.setFaceId(0); |
| 401 | } |
| 402 | if (!parameters.hasOrigin()) { |
| 403 | parameters.setOrigin(ROUTE_ORIGIN_APP); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | void |
| 408 | RibUnregisterCommand::validateResponse(const ControlParameters& parameters) const |
| 409 | { |
| 410 | this->ControlCommand::validateResponse(parameters); |
| 411 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 412 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 413 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 414 | } |
| 415 | } |
| 416 | |
| 417 | } // namespace nfd |
| 418 | } // namespace ndn |