26 #ifndef NFD_DAEMON_MGMT_FACE_MANAGER_HPP
27 #define NFD_DAEMON_MGMT_FACE_MANAGER_HPP
37 #include <ndn-cxx/management/nfd-control-parameters.hpp>
38 #include <ndn-cxx/management/nfd-control-response.hpp>
48 class NetworkInterfaceInfo;
64 shared_ptr<InternalFace> face,
65 ndn::KeyChain& keyChain);
80 listFaces(
const Interest& request);
83 listChannels(
const Interest& request);
86 listQueriedFaces(
const Interest& request);
88 shared_ptr<ProtocolFactory>
89 findFactory(
const std::string& protocol);
93 onValidatedFaceRequest(
const shared_ptr<const Interest>& request);
96 createFace(
const Interest& request,
97 ControlParameters& parameters);
100 destroyFace(
const Interest& request,
101 ControlParameters& parameters);
104 extractLocalControlParameters(
const Interest& request,
105 ControlParameters& parameters,
106 ControlCommand& command,
107 shared_ptr<LocalFace>& outFace,
108 LocalControlFeature& outFeature);
111 enableLocalControl(
const Interest& request,
112 ControlParameters& parambeters);
115 disableLocalControl(
const Interest& request,
116 ControlParameters& parameters);
119 ignoreUnsignedVerb(
const Interest& request);
122 addCreatedFaceToForwarder(
const shared_ptr<Face>& newFace);
125 onCreated(
const Name& requestName,
126 ControlParameters& parameters,
127 const shared_ptr<Face>& newFace);
130 onConnectFailed(
const Name& requestName,
const std::string& reason);
133 onAddFace(shared_ptr<Face> face);
136 onRemoveFace(shared_ptr<Face> face);
140 onConfig(
const ConfigSection& configSection,
bool isDryRun,
const std::string& filename);
147 parseYesNo(
const ConfigSection::const_iterator& i,
148 const std::string& optionName,
149 const std::string& sectionName);
152 typedef std::map<std::string, shared_ptr<ProtocolFactory>> FactoryMap;
153 FactoryMap m_factories;
157 signal::ScopedConnection m_faceAddConn;
158 signal::ScopedConnection m_faceRemoveConn;
165 ControlParameters&)> SignedVerbProcessor;
167 typedef std::map<Name::Component, SignedVerbProcessor> SignedVerbDispatchTable;
168 typedef std::pair<Name::Component, SignedVerbProcessor> SignedVerbAndProcessor;
170 typedef function<void(FaceManager*, const Interest&)> UnsignedVerbProcessor;
172 typedef std::map<Name::Component, UnsignedVerbProcessor> UnsignedVerbDispatchTable;
173 typedef std::pair<Name::Component, UnsignedVerbProcessor> UnsignedVerbAndProcessor;
175 const SignedVerbDispatchTable m_signedVerbDispatch;
176 const UnsignedVerbDispatchTable m_unsignedVerbDispatch;
178 static const Name COMMAND_PREFIX;
182 static const size_t COMMAND_UNSIGNED_NCOMPS;
186 static const size_t COMMAND_SIGNED_NCOMPS;
188 static const SignedVerbAndProcessor SIGNED_COMMAND_VERBS[];
189 static const UnsignedVerbAndProcessor UNSIGNED_COMMAND_VERBS[];
191 static const Name FACES_LIST_DATASET_PREFIX;
192 static const size_t FACES_LIST_DATASET_NCOMPS;
194 static const Name CHANNELS_LIST_DATASET_PREFIX;
195 static const size_t CHANNELS_LIST_DATASET_NCOMPS;
197 static const Name FACES_QUERY_DATASET_PREFIX;
198 static const size_t FACES_QUERY_DATASET_NCOMPS;
200 static const Name FACE_EVENTS_PREFIX;
204 FaceManager::parseYesNo(
const ConfigSection::const_iterator& i,
205 const std::string& optionName,
206 const std::string& sectionName)
208 const std::string value = i->second.get_value<std::string>();
213 else if (value ==
"no")
218 throw ConfigFile::Error(
"Invalid value for option \"" +
219 optionName +
"\" in \"" +
220 sectionName +
"\" section");
224 FaceManager::ignoreUnsignedVerb(
const Interest& request)
231 #endif // NFD_DAEMON_MGMT_FACE_MANAGER_HPP
FaceManager(FaceTable &faceTable, shared_ptr< InternalFace > face, ndn::KeyChain &keyChain)
void setConfigFile(ConfigFile &configFile)
Subscribe to a face management section(s) for the config file.
Error(const std::string &what)
provides a publisher of Notification Stream
#define PROTECTED_WITH_TESTS_ELSE_PRIVATE
void onFaceRequest(const Interest &request)
const std::string FACE_MANAGER_PRIVILEGE
boost::property_tree::ptree ConfigSection
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014, Regents of the University of California, Arizona Board of Regents, Colorado State University, University Pierre & Marie Curie, Sorbonne University, Washington University in St.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE