blob: 1aba57f0dd7987c642547205b0708a272a7ac524 [file] [log] [blame]
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07003 * 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 Afanasyevefe3ab22014-02-19 14:57:50 -080011 */
12
Alexander Afanasyev26c24d22014-03-20 09:31:21 -070013#ifndef NDN_MANAGEMENT_NRD_CONTROLLER_HPP
14#define NDN_MANAGEMENT_NRD_CONTROLLER_HPP
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080015
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070016#include "nfd-controller.hpp"
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080017
18namespace ndn {
19namespace nrd {
20
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070021/// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080022class PrefixRegOptions;
23
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070024class Controller : public nfd::Controller
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080025{
26public:
Yingdi Yue66bf2a2014-04-28 17:07:36 -070027 /** \brief a callback on signing command interest
28 */
29 typedef function<void(Interest&)> Sign;
30
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070031 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080032 typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback;
33
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070034 explicit
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080035 Controller(Face& face);
36
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070037public:
38 /// \deprecated .start<RibRegisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050039 void
40 registerPrefix(const PrefixRegOptions& options,
41 const CommandSucceedCallback& onSuccess,
42 const FailCallback& onFail);
43
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070044 /// \deprecated .start<RibUnregisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050045 void
46 unregisterPrefix(const PrefixRegOptions& options,
47 const CommandSucceedCallback& onSuccess,
48 const FailCallback& onFail);
49
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070050 /// \deprecated
Obaid6e7f5f12014-03-11 14:46:10 -050051 void
52 advertisePrefix(const PrefixRegOptions& options,
53 const CommandSucceedCallback& onSuccess,
54 const FailCallback& onFail);
55
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070056 /// \deprecated
Obaid6e7f5f12014-03-11 14:46:10 -050057 void
58 withdrawPrefix(const PrefixRegOptions& options,
59 const CommandSucceedCallback& onSuccess,
60 const FailCallback& onFail);
61
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080062protected:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070063 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080064 void
65 startCommand(const std::string& command,
66 const PrefixRegOptions& options,
67 const CommandSucceedCallback& onSuccess,
68 const FailCallback& onFailure);
69
Yingdi Yue66bf2a2014-04-28 17:07:36 -070070 // 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 Afanasyevefe3ab22014-02-19 14:57:50 -080083private:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070084 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080085 void
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080086 processCommandResponse(Data& data,
87 const CommandSucceedCallback& onSuccess,
88 const FailCallback& onFail);
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080089};
90
91} // namespace nrd
92} // namespace ndn
93
Alexander Afanasyev26c24d22014-03-20 09:31:21 -070094#endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP