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) |
Teng Liang | f4908b1 | 2017-03-29 15:24:03 -0700 | [diff] [blame] | 99 | .optional(CONTROL_PARAMETER_LOCAL_URI) |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 100 | .optional(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 101 | .optional(CONTROL_PARAMETER_FLAGS) |
| 102 | .optional(CONTROL_PARAMETER_MASK); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 103 | m_responseValidator |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 104 | .required(CONTROL_PARAMETER_FACE_ID) |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 105 | .required(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 106 | .optional(CONTROL_PARAMETER_FLAGS) |
| 107 | .optional(CONTROL_PARAMETER_URI); |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | void |
| 111 | FaceCreateCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 112 | { |
| 113 | if (!parameters.hasFacePersistency()) { |
| 114 | parameters.setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT); |
| 115 | } |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | void |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 119 | FaceCreateCommand::validateRequest(const ControlParameters& parameters) const |
| 120 | { |
| 121 | this->ControlCommand::validateRequest(parameters); |
| 122 | |
| 123 | if (parameters.hasFlags() != parameters.hasMask()) { |
| 124 | BOOST_THROW_EXCEPTION(ArgumentError("Flags must be accompanied by Mask")); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 129 | FaceCreateCommand::validateResponse(const ControlParameters& parameters) const |
| 130 | { |
| 131 | this->ControlCommand::validateResponse(parameters); |
| 132 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 133 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 134 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 135 | } |
| 136 | } |
| 137 | |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 138 | FaceUpdateCommand::FaceUpdateCommand() |
| 139 | : ControlCommand("faces", "update") |
| 140 | { |
| 141 | m_requestValidator |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 142 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 143 | .optional(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 144 | .optional(CONTROL_PARAMETER_FLAGS) |
| 145 | .optional(CONTROL_PARAMETER_MASK); |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 146 | m_responseValidator |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 147 | .required(CONTROL_PARAMETER_FACE_ID) |
| 148 | .required(CONTROL_PARAMETER_FACE_PERSISTENCY) |
| 149 | .required(CONTROL_PARAMETER_FLAGS); |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | void |
| 153 | FaceUpdateCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 154 | { |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 155 | if (!parameters.hasFaceId()) { |
| 156 | parameters.setFaceId(0); |
| 157 | } |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | void |
| 161 | FaceUpdateCommand::validateRequest(const ControlParameters& parameters) const |
| 162 | { |
| 163 | this->ControlCommand::validateRequest(parameters); |
| 164 | |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 165 | if (parameters.hasFlags() != parameters.hasMask()) { |
| 166 | BOOST_THROW_EXCEPTION(ArgumentError("Flags must be accompanied by Mask")); |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | |
| 170 | void |
| 171 | FaceUpdateCommand::validateResponse(const ControlParameters& parameters) const |
| 172 | { |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 173 | this->ControlCommand::validateResponse(parameters); |
| 174 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 175 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 176 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 177 | } |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 178 | } |
| 179 | |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 180 | FaceDestroyCommand::FaceDestroyCommand() |
| 181 | : ControlCommand("faces", "destroy") |
| 182 | { |
| 183 | m_requestValidator |
| 184 | .required(CONTROL_PARAMETER_FACE_ID); |
| 185 | m_responseValidator = m_requestValidator; |
| 186 | } |
| 187 | |
| 188 | void |
| 189 | FaceDestroyCommand::validateRequest(const ControlParameters& parameters) const |
| 190 | { |
| 191 | this->ControlCommand::validateRequest(parameters); |
| 192 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 193 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 194 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | |
| 198 | void |
| 199 | FaceDestroyCommand::validateResponse(const ControlParameters& parameters) const |
| 200 | { |
| 201 | this->validateRequest(parameters); |
| 202 | } |
| 203 | |
| 204 | FaceLocalControlCommand::FaceLocalControlCommand(const std::string& verb) |
| 205 | : ControlCommand("faces", verb) |
| 206 | { |
| 207 | m_requestValidator |
| 208 | .required(CONTROL_PARAMETER_LOCAL_CONTROL_FEATURE); |
| 209 | m_responseValidator = m_requestValidator; |
| 210 | } |
| 211 | |
| 212 | void |
| 213 | FaceLocalControlCommand::validateRequest(const ControlParameters& parameters) const |
| 214 | { |
| 215 | this->ControlCommand::validateRequest(parameters); |
| 216 | |
| 217 | switch (parameters.getLocalControlFeature()) { |
| 218 | case LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID: |
| 219 | case LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID: |
| 220 | break; |
| 221 | default: |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 222 | BOOST_THROW_EXCEPTION(ArgumentError("LocalControlFeature is invalid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 223 | } |
| 224 | } |
| 225 | |
| 226 | void |
| 227 | FaceLocalControlCommand::validateResponse(const ControlParameters& parameters) const |
| 228 | { |
| 229 | this->validateRequest(parameters); |
| 230 | } |
| 231 | |
| 232 | FaceEnableLocalControlCommand::FaceEnableLocalControlCommand() |
| 233 | : FaceLocalControlCommand("enable-local-control") |
| 234 | { |
| 235 | } |
| 236 | |
| 237 | FaceDisableLocalControlCommand::FaceDisableLocalControlCommand() |
| 238 | : FaceLocalControlCommand("disable-local-control") |
| 239 | { |
| 240 | } |
| 241 | |
| 242 | FibAddNextHopCommand::FibAddNextHopCommand() |
| 243 | : ControlCommand("fib", "add-nexthop") |
| 244 | { |
| 245 | m_requestValidator |
| 246 | .required(CONTROL_PARAMETER_NAME) |
| 247 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 248 | .optional(CONTROL_PARAMETER_COST); |
| 249 | m_responseValidator |
| 250 | .required(CONTROL_PARAMETER_NAME) |
| 251 | .required(CONTROL_PARAMETER_FACE_ID) |
| 252 | .required(CONTROL_PARAMETER_COST); |
| 253 | } |
| 254 | |
| 255 | void |
| 256 | FibAddNextHopCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 257 | { |
| 258 | if (!parameters.hasFaceId()) { |
| 259 | parameters.setFaceId(0); |
| 260 | } |
| 261 | if (!parameters.hasCost()) { |
| 262 | parameters.setCost(0); |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | void |
| 267 | FibAddNextHopCommand::validateResponse(const ControlParameters& parameters) const |
| 268 | { |
| 269 | this->ControlCommand::validateResponse(parameters); |
| 270 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 271 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 272 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 273 | } |
| 274 | } |
| 275 | |
| 276 | FibRemoveNextHopCommand::FibRemoveNextHopCommand() |
| 277 | : ControlCommand("fib", "remove-nexthop") |
| 278 | { |
| 279 | m_requestValidator |
| 280 | .required(CONTROL_PARAMETER_NAME) |
| 281 | .optional(CONTROL_PARAMETER_FACE_ID); |
| 282 | m_responseValidator |
| 283 | .required(CONTROL_PARAMETER_NAME) |
| 284 | .required(CONTROL_PARAMETER_FACE_ID); |
| 285 | } |
| 286 | |
| 287 | void |
| 288 | FibRemoveNextHopCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 289 | { |
| 290 | if (!parameters.hasFaceId()) { |
| 291 | parameters.setFaceId(0); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | void |
| 296 | FibRemoveNextHopCommand::validateResponse(const ControlParameters& parameters) const |
| 297 | { |
| 298 | this->ControlCommand::validateResponse(parameters); |
| 299 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 300 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 301 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 302 | } |
| 303 | } |
| 304 | |
| 305 | StrategyChoiceSetCommand::StrategyChoiceSetCommand() |
| 306 | : ControlCommand("strategy-choice", "set") |
| 307 | { |
| 308 | m_requestValidator |
| 309 | .required(CONTROL_PARAMETER_NAME) |
| 310 | .required(CONTROL_PARAMETER_STRATEGY); |
| 311 | m_responseValidator = m_requestValidator; |
| 312 | } |
| 313 | |
| 314 | StrategyChoiceUnsetCommand::StrategyChoiceUnsetCommand() |
| 315 | : ControlCommand("strategy-choice", "unset") |
| 316 | { |
| 317 | m_requestValidator |
| 318 | .required(CONTROL_PARAMETER_NAME); |
| 319 | m_responseValidator = m_requestValidator; |
| 320 | } |
| 321 | |
| 322 | void |
| 323 | StrategyChoiceUnsetCommand::validateRequest(const ControlParameters& parameters) const |
| 324 | { |
| 325 | this->ControlCommand::validateRequest(parameters); |
| 326 | |
| 327 | if (parameters.getName().size() == 0) { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 328 | BOOST_THROW_EXCEPTION(ArgumentError("Name must not be ndn:/")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 329 | } |
| 330 | } |
| 331 | |
| 332 | void |
| 333 | StrategyChoiceUnsetCommand::validateResponse(const ControlParameters& parameters) const |
| 334 | { |
| 335 | this->validateRequest(parameters); |
| 336 | } |
| 337 | |
| 338 | RibRegisterCommand::RibRegisterCommand() |
| 339 | : ControlCommand("rib", "register") |
| 340 | { |
| 341 | m_requestValidator |
| 342 | .required(CONTROL_PARAMETER_NAME) |
| 343 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 344 | .optional(CONTROL_PARAMETER_ORIGIN) |
| 345 | .optional(CONTROL_PARAMETER_COST) |
| 346 | .optional(CONTROL_PARAMETER_FLAGS) |
| 347 | .optional(CONTROL_PARAMETER_EXPIRATION_PERIOD); |
| 348 | m_responseValidator |
| 349 | .required(CONTROL_PARAMETER_NAME) |
| 350 | .required(CONTROL_PARAMETER_FACE_ID) |
| 351 | .required(CONTROL_PARAMETER_ORIGIN) |
| 352 | .required(CONTROL_PARAMETER_COST) |
| 353 | .required(CONTROL_PARAMETER_FLAGS) |
| 354 | .optional(CONTROL_PARAMETER_EXPIRATION_PERIOD); |
| 355 | } |
| 356 | |
| 357 | void |
| 358 | RibRegisterCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 359 | { |
| 360 | if (!parameters.hasFaceId()) { |
| 361 | parameters.setFaceId(0); |
| 362 | } |
| 363 | if (!parameters.hasOrigin()) { |
| 364 | parameters.setOrigin(ROUTE_ORIGIN_APP); |
| 365 | } |
| 366 | if (!parameters.hasCost()) { |
| 367 | parameters.setCost(0); |
| 368 | } |
| 369 | if (!parameters.hasFlags()) { |
| 370 | parameters.setFlags(ROUTE_FLAG_CHILD_INHERIT); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | void |
| 375 | RibRegisterCommand::validateResponse(const ControlParameters& parameters) const |
| 376 | { |
| 377 | this->ControlCommand::validateResponse(parameters); |
| 378 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 379 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 380 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 381 | } |
| 382 | } |
| 383 | |
| 384 | RibUnregisterCommand::RibUnregisterCommand() |
| 385 | : ControlCommand("rib", "unregister") |
| 386 | { |
| 387 | m_requestValidator |
| 388 | .required(CONTROL_PARAMETER_NAME) |
| 389 | .optional(CONTROL_PARAMETER_FACE_ID) |
| 390 | .optional(CONTROL_PARAMETER_ORIGIN); |
| 391 | m_responseValidator |
| 392 | .required(CONTROL_PARAMETER_NAME) |
| 393 | .required(CONTROL_PARAMETER_FACE_ID) |
| 394 | .required(CONTROL_PARAMETER_ORIGIN); |
| 395 | } |
| 396 | |
| 397 | void |
| 398 | RibUnregisterCommand::applyDefaultsToRequest(ControlParameters& parameters) const |
| 399 | { |
| 400 | if (!parameters.hasFaceId()) { |
| 401 | parameters.setFaceId(0); |
| 402 | } |
| 403 | if (!parameters.hasOrigin()) { |
| 404 | parameters.setOrigin(ROUTE_ORIGIN_APP); |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | void |
| 409 | RibUnregisterCommand::validateResponse(const ControlParameters& parameters) const |
| 410 | { |
| 411 | this->ControlCommand::validateResponse(parameters); |
| 412 | |
Davide Pesavento | f8503d2 | 2017-02-17 01:19:10 -0500 | [diff] [blame] | 413 | if (parameters.getFaceId() == INVALID_FACE_ID) { |
| 414 | BOOST_THROW_EXCEPTION(ArgumentError("FaceId must be valid")); |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 415 | } |
| 416 | } |
| 417 | |
| 418 | } // namespace nfd |
| 419 | } // namespace ndn |