Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 2 | /** |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 6 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 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. |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #ifndef NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP |
| 23 | #define NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP |
| 24 | |
| 25 | #include "nfd-control-parameters.hpp" |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ndn { |
| 28 | namespace nfd { |
| 29 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 30 | /** |
| 31 | * \ingroup management |
| 32 | * \brief base class of NFD ControlCommand |
| 33 | * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 34 | */ |
Junxiao Shi | 7b6b79d | 2014-03-26 20:59:35 -0700 | [diff] [blame] | 35 | class ControlCommand : noncopyable |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 36 | { |
| 37 | public: |
| 38 | /** \brief represents an error in ControlParameters |
| 39 | */ |
| 40 | class ArgumentError : public std::invalid_argument |
| 41 | { |
| 42 | public: |
| 43 | explicit |
| 44 | ArgumentError(const std::string& what) |
| 45 | : std::invalid_argument(what) |
| 46 | { |
| 47 | } |
| 48 | }; |
| 49 | |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 50 | virtual |
| 51 | ~ControlCommand(); |
| 52 | |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 53 | /** \brief validate request parameters |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 54 | * \throw ArgumentError if parameters are invalid |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 55 | */ |
| 56 | virtual void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 57 | validateRequest(const ControlParameters& parameters) const; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 58 | |
| 59 | /** \brief apply default values to missing fields in request |
| 60 | */ |
| 61 | virtual void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 62 | applyDefaultsToRequest(ControlParameters& parameters) const; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 63 | |
| 64 | /** \brief validate response parameters |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 65 | * \throw ArgumentError if parameters are invalid |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 66 | */ |
| 67 | virtual void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 68 | validateResponse(const ControlParameters& parameters) const; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 69 | |
| 70 | /** \brief apply default values to missing fields in response |
| 71 | */ |
| 72 | virtual void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 73 | applyDefaultsToResponse(ControlParameters& parameters) const; |
| 74 | |
| 75 | /** \brief construct the Name for a request Interest |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 76 | * \throw ArgumentError if parameters are invalid |
| 77 | */ |
| 78 | Name |
| 79 | getRequestName(const Name& commandPrefix, const ControlParameters& parameters) const; |
| 80 | |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 81 | protected: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 82 | ControlCommand(const std::string& module, const std::string& verb); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 83 | |
| 84 | class FieldValidator |
| 85 | { |
| 86 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 87 | FieldValidator(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 88 | |
| 89 | /** \brief declare a required field |
| 90 | */ |
| 91 | FieldValidator& |
| 92 | required(ControlParameterField field) |
| 93 | { |
| 94 | m_required[field] = true; |
| 95 | return *this; |
| 96 | } |
| 97 | |
| 98 | /** \brief declare an optional field |
| 99 | */ |
| 100 | FieldValidator& |
| 101 | optional(ControlParameterField field) |
| 102 | { |
| 103 | m_optional[field] = true; |
| 104 | return *this; |
| 105 | } |
| 106 | |
| 107 | /** \brief verify that all required fields are present, |
| 108 | * and all present fields are either required or optional |
| 109 | * \throw ArgumentError |
| 110 | */ |
| 111 | void |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 112 | validate(const ControlParameters& parameters) const; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 113 | |
| 114 | private: |
| 115 | std::vector<bool> m_required; |
| 116 | std::vector<bool> m_optional; |
| 117 | }; |
| 118 | |
| 119 | protected: |
| 120 | /** \brief FieldValidator for request ControlParameters |
| 121 | * |
| 122 | * Constructor of subclass should populate this validator. |
| 123 | */ |
| 124 | FieldValidator m_requestValidator; |
| 125 | /** \brief FieldValidator for response ControlParameters |
| 126 | * |
| 127 | * Constructor of subclass should populate this validator. |
| 128 | */ |
| 129 | FieldValidator m_responseValidator; |
| 130 | |
| 131 | private: |
Junxiao Shi | 5de006b | 2014-10-26 20:20:52 -0700 | [diff] [blame] | 132 | name::Component m_module; |
| 133 | name::Component m_verb; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 134 | }; |
| 135 | |
| 136 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 137 | /** |
| 138 | * \ingroup management |
| 139 | * \brief represents a faces/create command |
| 140 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 141 | */ |
| 142 | class FaceCreateCommand : public ControlCommand |
| 143 | { |
| 144 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 145 | FaceCreateCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 146 | |
| 147 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 148 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
Yukai Tu | d93c5fc | 2015-08-25 11:37:16 +0800 | [diff] [blame] | 149 | |
| 150 | virtual void |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 151 | validateRequest(const ControlParameters& parameters) const override; |
| 152 | |
| 153 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 154 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 155 | }; |
| 156 | |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 157 | |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 158 | /** |
| 159 | * \ingroup management |
| 160 | * \brief represents a faces/update command |
| 161 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Update-a-face |
| 162 | */ |
| 163 | class FaceUpdateCommand : public ControlCommand |
| 164 | { |
| 165 | public: |
| 166 | FaceUpdateCommand(); |
| 167 | |
| 168 | virtual void |
Eric Newberry | da916d6 | 2016-08-11 23:04:34 -0700 | [diff] [blame] | 169 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
| 170 | |
| 171 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 172 | validateRequest(const ControlParameters& parameters) const override; |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 173 | |
Eric Newberry | 138ef2c | 2016-08-15 20:29:03 -0700 | [diff] [blame] | 174 | /** |
| 175 | * \note This can only validate ControlParameters in a success response. |
| 176 | * Failure responses should be validated with validateRequest. |
| 177 | */ |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 178 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 179 | validateResponse(const ControlParameters& parameters) const override; |
Yanbiao Li | cbdacb2 | 2016-08-02 16:02:35 +0800 | [diff] [blame] | 180 | }; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 181 | |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 182 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 183 | /** |
| 184 | * \ingroup management |
| 185 | * \brief represents a faces/destroy command |
| 186 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 187 | */ |
| 188 | class FaceDestroyCommand : public ControlCommand |
| 189 | { |
| 190 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 191 | FaceDestroyCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 192 | |
| 193 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 194 | validateRequest(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 195 | |
| 196 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 197 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 198 | }; |
| 199 | |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 200 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 201 | /** |
| 202 | * \ingroup management |
| 203 | * \brief Base class for faces/[*]-local-control commands |
| 204 | */ |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 205 | class FaceLocalControlCommand : public ControlCommand |
| 206 | { |
Junxiao Shi | 6888bc1 | 2014-03-29 23:01:41 -0700 | [diff] [blame] | 207 | public: |
| 208 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 209 | validateRequest(const ControlParameters& parameters) const override; |
Junxiao Shi | 6888bc1 | 2014-03-29 23:01:41 -0700 | [diff] [blame] | 210 | |
| 211 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 212 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 6888bc1 | 2014-03-29 23:01:41 -0700 | [diff] [blame] | 213 | |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 214 | protected: |
| 215 | explicit |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 216 | FaceLocalControlCommand(const std::string& verb); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 217 | }; |
| 218 | |
| 219 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 220 | /** |
| 221 | * \ingroup management |
| 222 | * \brief represents a faces/enable-local-control command |
| 223 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 224 | */ |
| 225 | class FaceEnableLocalControlCommand : public FaceLocalControlCommand |
| 226 | { |
| 227 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 228 | FaceEnableLocalControlCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 229 | }; |
| 230 | |
| 231 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 232 | /** |
| 233 | * \ingroup management |
| 234 | * \brief represents a faces/disable-local-control command |
| 235 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 236 | */ |
| 237 | class FaceDisableLocalControlCommand : public FaceLocalControlCommand |
| 238 | { |
| 239 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 240 | FaceDisableLocalControlCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 241 | }; |
| 242 | |
| 243 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 244 | /** |
| 245 | * \ingroup management |
| 246 | * \brief represents a fib/add-nexthop command |
| 247 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 248 | */ |
| 249 | class FibAddNextHopCommand : public ControlCommand |
| 250 | { |
| 251 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 252 | FibAddNextHopCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 253 | |
| 254 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 255 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 256 | |
| 257 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 258 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 259 | }; |
| 260 | |
| 261 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 262 | /** |
| 263 | * \ingroup management |
| 264 | * \brief represents a fib/remove-nexthop command |
| 265 | * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 266 | */ |
| 267 | class FibRemoveNextHopCommand : public ControlCommand |
| 268 | { |
| 269 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 270 | FibRemoveNextHopCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 271 | |
| 272 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 273 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
Junxiao Shi | caac54e | 2014-05-20 15:27:01 -0700 | [diff] [blame] | 274 | |
| 275 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 276 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 277 | }; |
| 278 | |
| 279 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 280 | /** |
| 281 | * \ingroup management |
| 282 | * \brief represents a strategy-choice/set command |
| 283 | * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 284 | */ |
| 285 | class StrategyChoiceSetCommand : public ControlCommand |
| 286 | { |
| 287 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 288 | StrategyChoiceSetCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 289 | }; |
| 290 | |
| 291 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 292 | /** |
| 293 | * \ingroup management |
| 294 | * \brief represents a strategy-choice/set command |
| 295 | * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 296 | */ |
| 297 | class StrategyChoiceUnsetCommand : public ControlCommand |
| 298 | { |
| 299 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 300 | StrategyChoiceUnsetCommand(); |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 301 | |
| 302 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 303 | validateRequest(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 304 | |
| 305 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 306 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 307 | }; |
| 308 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 309 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 310 | /** |
| 311 | * \ingroup management |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 312 | * \brief represents a rib/register command |
| 313 | * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 314 | */ |
| 315 | class RibRegisterCommand : public ControlCommand |
| 316 | { |
| 317 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 318 | RibRegisterCommand(); |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 319 | |
| 320 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 321 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 322 | |
| 323 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 324 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 325 | }; |
| 326 | |
| 327 | |
Alexander Afanasyev | 4671bf7 | 2014-05-19 09:01:37 -0400 | [diff] [blame] | 328 | /** |
| 329 | * \ingroup management |
| 330 | * \brief represents a rib/unregister command |
| 331 | * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 332 | */ |
| 333 | class RibUnregisterCommand : public ControlCommand |
| 334 | { |
| 335 | public: |
Junxiao Shi | 7091165 | 2014-08-12 10:14:24 -0700 | [diff] [blame] | 336 | RibUnregisterCommand(); |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 337 | |
| 338 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 339 | applyDefaultsToRequest(ControlParameters& parameters) const override; |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 340 | |
| 341 | virtual void |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 342 | validateResponse(const ControlParameters& parameters) const override; |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 343 | }; |
| 344 | |
Junxiao Shi | 5ec8022 | 2014-03-25 20:08:05 -0700 | [diff] [blame] | 345 | } // namespace nfd |
| 346 | } // namespace ndn |
| 347 | |
| 348 | #endif // NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP |