Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Regents of the University of California. |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
Alexander Afanasyev | 26c24d2 | 2014-03-20 09:31:21 -0700 | [diff] [blame] | 7 | #ifndef NDN_MANAGEMENT_NRD_CONTROLLER_HPP |
| 8 | #define NDN_MANAGEMENT_NRD_CONTROLLER_HPP |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 9 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 10 | #include "nfd-controller.hpp" |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 11 | |
| 12 | namespace ndn { |
| 13 | namespace nrd { |
| 14 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 15 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 16 | class PrefixRegOptions; |
| 17 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 18 | class Controller : public nfd::Controller |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 19 | { |
| 20 | public: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 21 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 22 | typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback; |
| 23 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 24 | explicit |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 25 | Controller(Face& face); |
| 26 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 27 | public: // selfreg using RIB Management commands |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 28 | virtual void |
| 29 | selfRegisterPrefix(const Name& prefixToRegister, |
| 30 | const SuccessCallback& onSuccess, |
| 31 | const FailCallback& onFail); |
| 32 | |
| 33 | virtual void |
| 34 | selfDeregisterPrefix(const Name& prefixToRegister, |
| 35 | const SuccessCallback& onSuccess, |
| 36 | const FailCallback& onFail); |
| 37 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 38 | public: |
| 39 | /// \deprecated .start<RibRegisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 40 | void |
| 41 | registerPrefix(const PrefixRegOptions& options, |
| 42 | const CommandSucceedCallback& onSuccess, |
| 43 | const FailCallback& onFail); |
| 44 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 45 | /// \deprecated .start<RibUnregisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 46 | void |
| 47 | unregisterPrefix(const PrefixRegOptions& options, |
| 48 | const CommandSucceedCallback& onSuccess, |
| 49 | const FailCallback& onFail); |
| 50 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 51 | /// \deprecated |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 52 | void |
| 53 | advertisePrefix(const PrefixRegOptions& options, |
| 54 | const CommandSucceedCallback& onSuccess, |
| 55 | const FailCallback& onFail); |
| 56 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 57 | /// \deprecated |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 58 | void |
| 59 | withdrawPrefix(const PrefixRegOptions& options, |
| 60 | const CommandSucceedCallback& onSuccess, |
| 61 | const FailCallback& onFail); |
| 62 | |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 63 | protected: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 64 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 65 | void |
| 66 | startCommand(const std::string& command, |
| 67 | const PrefixRegOptions& options, |
| 68 | const CommandSucceedCallback& onSuccess, |
| 69 | const FailCallback& onFailure); |
| 70 | |
| 71 | private: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame^] | 72 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 73 | void |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 74 | processCommandResponse(Data& data, |
| 75 | const CommandSucceedCallback& onSuccess, |
| 76 | const FailCallback& onFail); |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 77 | }; |
| 78 | |
| 79 | } // namespace nrd |
| 80 | } // namespace ndn |
| 81 | |
Alexander Afanasyev | 26c24d2 | 2014-03-20 09:31:21 -0700 | [diff] [blame] | 82 | #endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP |