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> 64 shared_ptr<InternalFace> face,
65 ndn::KeyChain& keyChain);
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);
100 destroyFace(
const Interest& request,
104 extractLocalControlParameters(
const Interest& request,
107 shared_ptr<LocalFace>& outFace,
111 enableLocalControl(
const Interest& request,
115 disableLocalControl(
const Interest& request,
119 ignoreUnsignedVerb(
const Interest& request);
122 addCreatedFaceToForwarder(
const shared_ptr<Face>& newFace);
125 onCreated(
const Name& requestName,
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;
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")
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)
represents parameters in a ControlCommand request or response
provides a publisher of Notification Stream
contains information about a network interface
base class of NFD ControlCommand
represents an Interest packet
#define PROTECTED_WITH_TESTS_ELSE_PRIVATE
Copyright (c) 2011-2015 Regents of the University of California.
void onFaceRequest(const Interest &request)
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
disconnects a Connection automatically upon destruction
const std::string FACE_MANAGER_PRIVILEGE
boost::property_tree::ptree ConfigSection
Name abstraction to represent an absolute name.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE