blob: 5b243780c835c33488c979eabb53972e251794f9 [file] [log] [blame]
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -08001/* -*- 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 Afanasyev26c24d22014-03-20 09:31:21 -07007#ifndef NDN_MANAGEMENT_NRD_CONTROLLER_HPP
8#define NDN_MANAGEMENT_NRD_CONTROLLER_HPP
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -08009
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070010#include "nfd-controller.hpp"
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080011
12namespace ndn {
13namespace nrd {
14
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070015/// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080016class PrefixRegOptions;
17
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070018class Controller : public nfd::Controller
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080019{
20public:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070021 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080022 typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback;
23
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070024 explicit
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080025 Controller(Face& face);
26
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070027public: // selfreg using RIB Management commands
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080028 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 Shi5f6c74f2014-04-18 16:29:44 -070038public:
39 /// \deprecated .start<RibRegisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050040 void
41 registerPrefix(const PrefixRegOptions& options,
42 const CommandSucceedCallback& onSuccess,
43 const FailCallback& onFail);
44
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070045 /// \deprecated .start<RibUnregisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050046 void
47 unregisterPrefix(const PrefixRegOptions& options,
48 const CommandSucceedCallback& onSuccess,
49 const FailCallback& onFail);
50
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070051 /// \deprecated
Obaid6e7f5f12014-03-11 14:46:10 -050052 void
53 advertisePrefix(const PrefixRegOptions& options,
54 const CommandSucceedCallback& onSuccess,
55 const FailCallback& onFail);
56
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070057 /// \deprecated
Obaid6e7f5f12014-03-11 14:46:10 -050058 void
59 withdrawPrefix(const PrefixRegOptions& options,
60 const CommandSucceedCallback& onSuccess,
61 const FailCallback& onFail);
62
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080063protected:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070064 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080065 void
66 startCommand(const std::string& command,
67 const PrefixRegOptions& options,
68 const CommandSucceedCallback& onSuccess,
69 const FailCallback& onFailure);
70
71private:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070072 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080073 void
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080074 processCommandResponse(Data& data,
75 const CommandSucceedCallback& onSuccess,
76 const FailCallback& onFail);
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080077};
78
79} // namespace nrd
80} // namespace ndn
81
Alexander Afanasyev26c24d22014-03-20 09:31:21 -070082#endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP