Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2014, Regents of the University of California. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 7 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 8 | * |
| 9 | * This file licensed under New BSD License. See COPYING for detailed information about |
| 10 | * ndn-cxx library copyright, permissions, and redistribution restrictions. |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 11 | */ |
| 12 | |
Alexander Afanasyev | 26c24d2 | 2014-03-20 09:31:21 -0700 | [diff] [blame] | 13 | #ifndef NDN_MANAGEMENT_NRD_CONTROLLER_HPP |
| 14 | #define NDN_MANAGEMENT_NRD_CONTROLLER_HPP |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 15 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 16 | #include "nfd-controller.hpp" |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 17 | |
| 18 | namespace ndn { |
| 19 | namespace nrd { |
| 20 | |
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 | class PrefixRegOptions; |
| 23 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 24 | class Controller : public nfd::Controller |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 25 | { |
| 26 | public: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 27 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 28 | typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback; |
| 29 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 30 | explicit |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 31 | Controller(Face& face); |
| 32 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 33 | public: // selfreg using RIB Management commands |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 34 | virtual void |
| 35 | selfRegisterPrefix(const Name& prefixToRegister, |
| 36 | const SuccessCallback& onSuccess, |
| 37 | const FailCallback& onFail); |
| 38 | |
| 39 | virtual void |
| 40 | selfDeregisterPrefix(const Name& prefixToRegister, |
| 41 | const SuccessCallback& onSuccess, |
| 42 | const FailCallback& onFail); |
| 43 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 44 | public: |
| 45 | /// \deprecated .start<RibRegisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 46 | void |
| 47 | registerPrefix(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 .start<RibUnregisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 52 | void |
| 53 | unregisterPrefix(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 | advertisePrefix(const PrefixRegOptions& options, |
| 60 | const CommandSucceedCallback& onSuccess, |
| 61 | const FailCallback& onFail); |
| 62 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 63 | /// \deprecated |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 64 | void |
| 65 | withdrawPrefix(const PrefixRegOptions& options, |
| 66 | const CommandSucceedCallback& onSuccess, |
| 67 | const FailCallback& onFail); |
| 68 | |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 69 | protected: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 70 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 71 | void |
| 72 | startCommand(const std::string& command, |
| 73 | const PrefixRegOptions& options, |
| 74 | const CommandSucceedCallback& onSuccess, |
| 75 | const FailCallback& onFailure); |
| 76 | |
| 77 | private: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 78 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 79 | void |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 80 | processCommandResponse(Data& data, |
| 81 | const CommandSucceedCallback& onSuccess, |
| 82 | const FailCallback& onFail); |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | } // namespace nrd |
| 86 | } // namespace ndn |
| 87 | |
Alexander Afanasyev | 26c24d2 | 2014-03-20 09:31:21 -0700 | [diff] [blame] | 88 | #endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP |