blob: 2e94de66eb2cb1e04839ae6436ba9f4abcacab6d [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:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070027 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080028 typedef function<void(const PrefixRegOptions&)> CommandSucceedCallback;
29
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070030 explicit
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080031 Controller(Face& face);
32
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070033public: // selfreg using RIB Management commands
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080034 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 Shi5f6c74f2014-04-18 16:29:44 -070044public:
45 /// \deprecated .start<RibRegisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050046 void
47 registerPrefix(const PrefixRegOptions& options,
48 const CommandSucceedCallback& onSuccess,
49 const FailCallback& onFail);
50
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070051 /// \deprecated .start<RibUnregisterCommand>
Obaid6e7f5f12014-03-11 14:46:10 -050052 void
53 unregisterPrefix(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 advertisePrefix(const PrefixRegOptions& options,
60 const CommandSucceedCallback& onSuccess,
61 const FailCallback& onFail);
62
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070063 /// \deprecated
Obaid6e7f5f12014-03-11 14:46:10 -050064 void
65 withdrawPrefix(const PrefixRegOptions& options,
66 const CommandSucceedCallback& onSuccess,
67 const FailCallback& onFail);
68
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080069protected:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070070 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080071 void
72 startCommand(const std::string& command,
73 const PrefixRegOptions& options,
74 const CommandSucceedCallback& onSuccess,
75 const FailCallback& onFailure);
76
77private:
Junxiao Shi5f6c74f2014-04-18 16:29:44 -070078 /// \deprecated
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080079 void
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080080 processCommandResponse(Data& data,
81 const CommandSucceedCallback& onSuccess,
82 const FailCallback& onFail);
Alexander Afanasyevefe3ab22014-02-19 14:57:50 -080083};
84
85} // namespace nrd
86} // namespace ndn
87
Alexander Afanasyev26c24d22014-03-20 09:31:21 -070088#endif // NDN_MANAGEMENT_NRD_CONTROLLER_HPP