25 #include "version.hpp"
27 #include <boost/exception/diagnostic_information.hpp>
31 printUsage(std::ostream& os,
const std::string& programName)
33 os <<
"Usage: " << programName <<
" [OPTIONS...]\n"
36 <<
" -f <FILE> Path to configuration file\n"
37 <<
" -h Display this help message\n"
38 <<
" -V Display version information\n"
43 main(
int argc,
char** argv)
45 std::string programName(argv[0]);
46 std::string configFileName(
"nlsr.conf");
49 while ((opt = getopt(argc, argv,
"hf:V")) != -1) {
55 configFileName = optarg;
58 std::cout << NLSR_VERSION_BUILD_STRING << std::endl;
66 ndn::KeyChain keyChain;
67 ndn::Face face(
nullptr, keyChain);
72 std::cerr <<
"Error in configuration file processing" << std::endl;
84 certStore.
insert(*certificate);
90 catch (
const std::exception& e) {
91 nlsr.getFib().clean();
92 std::cerr <<
"FATAL: " << boost::diagnostic_information(e) << std::endl;
A class containing methods to parse an NLSR configuration file.
bool processConfFile()
Load and parse the configuration file, then populate NLSR.
A class to house all the configuration parameters for NLSR.
std::optional< ndn::security::Certificate > initializeKey()
Store certificates for names.
void insert(const ndn::security::Certificate &certificate)
int main(int argc, char **argv)
static void printUsage(std::ostream &os, const std::string &programName)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.