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: |
Yingdi Yu | e66bf2a | 2014-04-28 17:07:36 -0700 | [diff] [blame] | 27 | /** \brief a callback on signing command interest |
| 28 | */ |
| 29 | typedef function<void(Interest&)> Sign; |
| 30 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 31 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 32 | typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback; |
| 33 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 34 | explicit |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 35 | Controller(Face& face); |
| 36 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 37 | public: |
| 38 | /// \deprecated .start<RibRegisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 39 | void |
| 40 | registerPrefix(const PrefixRegOptions& options, |
| 41 | const CommandSucceedCallback& onSuccess, |
| 42 | const FailCallback& onFail); |
| 43 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 44 | /// \deprecated .start<RibUnregisterCommand> |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 45 | void |
| 46 | unregisterPrefix(const PrefixRegOptions& options, |
| 47 | const CommandSucceedCallback& onSuccess, |
| 48 | const FailCallback& onFail); |
| 49 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 50 | /// \deprecated |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 51 | void |
| 52 | advertisePrefix(const PrefixRegOptions& options, |
| 53 | const CommandSucceedCallback& onSuccess, |
| 54 | const FailCallback& onFail); |
| 55 | |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 56 | /// \deprecated |
Obaid | 6e7f5f1 | 2014-03-11 14:46:10 -0500 | [diff] [blame] | 57 | void |
| 58 | withdrawPrefix(const PrefixRegOptions& options, |
| 59 | const CommandSucceedCallback& onSuccess, |
| 60 | const FailCallback& onFail); |
| 61 | |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 62 | protected: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 63 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 64 | void |
| 65 | startCommand(const std::string& command, |
| 66 | const PrefixRegOptions& options, |
| 67 | const CommandSucceedCallback& onSuccess, |
| 68 | const FailCallback& onFailure); |
| 69 | |
Yingdi Yu | e66bf2a | 2014-04-28 17:07:36 -0700 | [diff] [blame] | 70 | // selfreg using RIB Management commands |
| 71 | virtual void |
| 72 | selfRegisterPrefix(const Name& prefixToRegister, |
| 73 | const SuccessCallback& onSuccess, |
| 74 | const FailCallback& onFail, |
| 75 | const Sign& sign); |
| 76 | |
| 77 | virtual void |
| 78 | selfDeregisterPrefix(const Name& prefixToDeRegister, |
| 79 | const SuccessCallback& onSuccess, |
| 80 | const FailCallback& onFail, |
| 81 | const Sign& sign); |
| 82 | |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 83 | private: |
Junxiao Shi | 5f6c74f | 2014-04-18 16:29:44 -0700 | [diff] [blame] | 84 | /// \deprecated |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 85 | void |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 86 | processCommandResponse(Data& data, |
| 87 | const CommandSucceedCallback& onSuccess, |
| 88 | const FailCallback& onFail); |
Alexander Afanasyev | efe3ab2 | 2014-02-19 14:57:50 -0800 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | } // namespace nrd |
| 92 | } // namespace ndn |
| 93 | |
Alexander Afanasyev | 26c24d2 | 2014-03-20 09:31:21 -0700 | [diff] [blame] | 94 | #endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP |