mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
Allow test/cli.cpp to be used with NetCfg Tunbuilder client
This requires cli.cpp to be included in openvpn3-linux build environment and the right defines set before the test.cpp is included. This workaround is necessary since the dbus dependencies are not part of the core and to adding an extra copy of cli.cpp to openvpn3-linux Signed-off-by: Arne Schwabe <arne@openvpn.net>
This commit is contained in:
parent
80fed2c55a
commit
84dbc5b9b2
@ -80,6 +80,10 @@
|
||||
#include <openvpn/win/console.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef USE_NETCFG
|
||||
#include "client/core-client-netcfg.hpp"
|
||||
#endif
|
||||
|
||||
using namespace openvpn;
|
||||
|
||||
namespace {
|
||||
@ -911,7 +915,13 @@ int openvpn_client(int argc, char *argv[], const std::string* profile_content)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(USE_NETCFG)
|
||||
DBus conn(G_BUS_TYPE_SYSTEM);
|
||||
conn.Connect();
|
||||
NetCfgTunBuilder<Client> client(conn.GetConnection());
|
||||
#else
|
||||
Client client;
|
||||
#endif
|
||||
const ClientAPI::EvalConfig eval = client.eval_config(config);
|
||||
if (eval.error)
|
||||
OPENVPN_THROW_EXCEPTION("eval config error: " << eval.message);
|
||||
|
Loading…
Reference in New Issue
Block a user