NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_NFD_HPP
27 #define NFD_DAEMON_NFD_HPP
28 
29 #include "common.hpp"
30 #include "core/config-file.hpp"
31 #include "core/scheduler.hpp"
32 
33 #include <ndn-cxx/security/key-chain.hpp>
34 #include <ndn-cxx/util/network-monitor.hpp>
35 
36 namespace nfd {
37 
38 class Forwarder;
39 class InternalFace;
40 class FibManager;
41 class FaceManager;
43 class StatusServer;
44 
49 class Nfd : noncopyable
50 {
51 public:
55  Nfd(const std::string& configFile, ndn::KeyChain& keyChain);
56 
64  Nfd(const ConfigSection& config, ndn::KeyChain& keyChain);
65 
69  ~Nfd();
70 
75  void
76  initialize();
77 
81  void
83 
84 private:
85  void
86  initializeLogging();
87 
88  void
89  initializeManagement();
90 
91  void
92  reloadConfigFileFaceSection();
93 
94 private:
95  std::string m_configFile;
96  ConfigSection m_configSection;
97 
98  unique_ptr<Forwarder> m_forwarder;
99 
100  shared_ptr<InternalFace> m_internalFace;
101  unique_ptr<FibManager> m_fibManager;
102  unique_ptr<FaceManager> m_faceManager;
103  unique_ptr<StrategyChoiceManager> m_strategyChoiceManager;
104  unique_ptr<StatusServer> m_statusServer;
105 
106  ndn::KeyChain& m_keyChain;
107 
108  ndn::util::NetworkMonitor m_networkMonitor;
109  scheduler::ScopedEventId m_reloadConfigEvent;
110 };
111 
112 } // namespace nfd
113 
114 #endif // NFD_DAEMON_NFD_HPP
Nfd(const std::string &configFile, ndn::KeyChain &keyChain)
Create NFD instance using absolute or relative path to configFile.
Definition: nfd.cpp:48
Network state change monitor.
FibManager
Definition: fib-manager.cpp:38
void reloadConfigFile()
Reload configuration file and apply update (if any)
Definition: nfd.cpp:177
Class representing NFD instance This class can be used to initialize all components of NFD...
Definition: nfd.hpp:49
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
cancels an event automatically upon destruction
Definition: scheduler.hpp:53
boost::property_tree::ptree ConfigSection
Forwarder
Definition: forwarder.cpp:38
void initialize()
Perform initialization of NFD instance After initialization, NFD instance can be started by invoking ...
Definition: nfd.cpp:70
~Nfd()
Destructor.
Definition: nfd.cpp:62