conf-file-processor.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
21 #ifndef NLSR_CONF_FILE_PROCESSOR_HPP
22 #define NLSR_CONF_FILE_PROCESSOR_HPP
23 
24 #include "common.hpp"
25 #include "conf-parameter.hpp"
26 
27 #include <boost/algorithm/string.hpp>
28 #include <boost/property_tree/info_parser.hpp>
29 #include <boost/filesystem.hpp>
30 
31 namespace nlsr {
32 
47 {
48 public:
49  ConfFileProcessor(ConfParameter& confParam);
50 
58  bool
60 
61 private:
62  typedef boost::property_tree::ptree ConfigSection;
63 
74  bool
75  load(std::istream& input);
76 
79  bool
80  processSection(const std::string& sectionName, const ConfigSection& section);
81 
84  bool
85  processConfSectionGeneral(const ConfigSection& section);
86 
94  bool
95  processConfSectionNeighbors(const ConfigSection& section);
96 
99  bool
100  processConfSectionHyperbolic(const ConfigSection& section);
101 
104  bool
105  processConfSectionFib(const ConfigSection& section);
106 
109  bool
110  processConfSectionAdvertising(const ConfigSection& section);
111 
118  bool
119  processConfSectionSecurity(const ConfigSection& section);
120 
121 private:
123  std::string m_confFileName;
125  ConfParameter& m_confParam;
127  boost::asio::io_service m_io;
128 };
129 
130 } // namespace nlsr
131 #endif // NLSR_CONF_FILE_PROCESSOR_HPP
A class to house all the configuration parameters for NLSR.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
A class containing methods to parse an NLSR configuration file.
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
ConfFileProcessor(ConfParameter &confParam)
bool processConfFile()
Load and parse the configuration file, then populate NLSR.