25 #include "version.hpp" 27 #include <boost/exception/get_error_info.hpp> 34 std::ostringstream errorMessage;
35 errorMessage << exception.what();
37 const char*
const* file = boost::get_error_info<boost::throw_file>(exception);
38 const int* line = boost::get_error_info<boost::throw_line>(exception);
39 const char*
const* func = boost::get_error_info<boost::throw_function>(exception);
41 errorMessage <<
" [from " << *file <<
":" << *line;
43 errorMessage <<
" in " << *func;
48 return errorMessage.str();
52 printUsage(std::ostream& os,
const std::string& programName)
54 os <<
"Usage: " << programName <<
" [OPTIONS...]\n" 57 <<
" -f <FILE> Path to configuration file\n" 58 <<
" -h Display this help message\n" 59 <<
" -V Display version information\n" 64 main(
int argc,
char** argv)
66 std::string programName(argv[0]);
67 std::string configFileName(
"nlsr.conf");
70 while ((opt = getopt(argc, argv,
"hf:V")) != -1) {
76 configFileName = optarg;
79 std::cout << NLSR_VERSION_BUILD_STRING << std::endl;
87 boost::asio::io_service ioService;
88 ndn::Face face(ioService);
89 ndn::KeyChain keyChain;
95 std::cerr <<
"Error in configuration file processing" << std::endl;
107 certStore.
insert(*certificate);
111 face.processEvents();
113 catch (
const std::exception& e) {
A class to house all the configuration parameters for NLSR.
Store certificates for names.
int main(int argc, char **argv)
static void printUsage(std::ostream &os, const std::string &programName)
void insert(const ndn::security::v2::Certificate &certificate)
shared_ptr< ndn::security::v2::Certificate > initializeKey()
void clean()
Remove all entries from the FIB.
static std::string getExtendedErrorMessage(const E &exception)
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.
bool processConfFile()
Load and parse the configuration file, then populate NLSR.