|
|
|
@ -261,10 +261,13 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
// extract type
|
|
|
|
|
std::string endpointType = "tun";
|
|
|
|
|
std::string keyfile = "";
|
|
|
|
|
for(const auto &option : conf.second)
|
|
|
|
|
{
|
|
|
|
|
if(option.first == "type")
|
|
|
|
|
endpointType = option.second;
|
|
|
|
|
if(option.first == "keyfile")
|
|
|
|
|
keyfile = option.second;
|
|
|
|
|
}
|
|
|
|
|
std::unique_ptr< llarp::service::Endpoint > service;
|
|
|
|
|
|
|
|
|
@ -294,6 +297,14 @@ namespace llarp
|
|
|
|
|
|
|
|
|
|
// construct
|
|
|
|
|
service.reset(itr->second(conf.first, m_Router));
|
|
|
|
|
if(keyfile != "")
|
|
|
|
|
{
|
|
|
|
|
llarp::LogInfo("Found keyfile, prestarting endpoint");
|
|
|
|
|
service->SetOption("keyfile", keyfile);
|
|
|
|
|
// load keyfile, so we have the correct name for logging
|
|
|
|
|
service->LoadKeyFile(); // only start endpoint not tun
|
|
|
|
|
llarp::LogInfo("Endpoint prestarted");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// configure
|
|
|
|
|
for(const auto &option : conf.second)
|
|
|
|
|