prefix-update-processor.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NLSR_UPDATE_PREFIX_UPDATE_PROCESSOR_HPP
23 #define NLSR_UPDATE_PREFIX_UPDATE_PROCESSOR_HPP
24 
25 #include "manager-base.hpp"
27 #include <ndn-cxx/util/io.hpp>
28 #include <ndn-cxx/security/key-chain.hpp>
29 #include <ndn-cxx/util/io.hpp>
30 #include <boost/property_tree/ptree.hpp>
31 #include <boost/property_tree/info_parser.hpp>
32 
33 namespace nlsr {
34 
35 namespace security {
36  class CertificateStore;
37 } // namespace security
38 
39 namespace update {
40 
41 typedef boost::property_tree::ptree ConfigSection;
42 
44 {
45 public:
46  PrefixUpdateProcessor(ndn::mgmt::Dispatcher& dispatcher,
47  ndn::security::ValidatorConfig& validator,
48  NamePrefixList& namePrefixList,
49  Lsdb& lsdb, const std::string& configFileName);
50 
62  void
63  loadValidator(ConfigSection section, const std::string& filename);
64 
68  bool
69  addOrDeletePrefix(const ndn::Name& prefix, bool addPrefix);
70 
71  ndn::optional<bool>
72  afterAdvertise(const ndn::Name& prefix);
73 
74  ndn::optional<bool>
75  afterWithdraw(const ndn::Name& prefix);
76 
78  bool
79  checkForPrefixInFile(const std::string prefix);
80 
81  ndn::security::ValidatorConfig&
83  {
84  return m_validator;
85  }
86 
87 private:
94  ndn::mgmt::Authorization
95  makeAuthorization();
96 
97 private:
98  ndn::security::ValidatorConfig& m_validator;
99  const std::string& m_confFileNameDynamic;
100 };
101 
102 } // namespace update
103 } // namespace nlsr
104 
105 #endif // NLSR_UPDATE_PREFIX_UPDATE_PROCESSOR_HPP
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
ndn::security::ValidatorConfig & getValidator()
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
boost::property_tree::ptree ConfigSection