program.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
27 #define NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
28 
29 #include "core/common.hpp"
30 #include <ndn-cxx/face.hpp>
31 #include <ndn-cxx/mgmt/dispatcher.hpp>
32 #include <ndn-cxx/security/key-chain.hpp>
33 
34 namespace ndn {
35 namespace tools {
36 namespace autoconfig_server {
37 
38 struct Options
39 {
40  FaceUri hubFaceUri;
41  std::vector<Name> routablePrefixes;
42 };
43 
44 class Program : noncopyable
45 {
46 public:
47  Program(const Options& options, Face& face, KeyChain& keyChain);
48 
49  void
50  run()
51  {
52  m_face.processEvents();
53  }
54 
55 private:
56  void
57  enableHubData(const FaceUri& hubFaceUri);
58 
59  void
60  enableRoutablePrefixesDataset(const std::vector<Name>& routablePrefixes);
61 
62  void
63  handlePrefixRegistrationFailure(const Name& prefix, const std::string& reason);
64 
65 private:
66  Face& m_face;
67  KeyChain& m_keyChain;
68  mgmt::Dispatcher m_dispatcher;
69 };
70 
71 } // namespace autoconfig_server
72 } // namespace tools
73 } // namespace ndn
74 
75 #endif // NFD_TOOLS_NDN_AUTOCONFIG_SERVER_PROGRAM_HPP
Copyright (c) 2014-2017, Regents of the University of California, Arizona Board of Regents...
std::vector< Name > routablePrefixes
Definition: program.hpp:41