Skip to content

Commit

Permalink
test/ovnpcli: Refactor to use GDBus++ D-Bus implementation
Browse files Browse the repository at this point in the history
The openvpn3-linux ships with a netcfg-cli client, which is essentially
the same code as test/ovpncli/cli.cpp but it uses the
net.openvpn.v3.netcfg D-Bus service to create the virtual network
adapter and the related network and DNS configuration.  This is a useful
test client when only wanting to test the Network Configuration service
openvpn3-linux ships with.

As part of the refactoring of the D-Bus implementation in
openvpn3-linux, the supporting D-Bus setup needs to be adjusted to the
new D-Bus API.

It has been considered to support both types of APIs, but the legacy
D-Bus API is deprecated and will not be used any more after the release
of OpenVPN 3 Linux v22_dev.  Prior releases will depend on an older
OpenVPN 3 Core library version, which contains the old API.

Signed-off-by: David Sommerseth <[email protected]>
  • Loading branch information
dsommers committed Apr 16, 2024
1 parent 9d54245 commit b47ef50
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/ovpncli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,9 +1321,8 @@ 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());
auto dbus_system = DBus::Connection::Create(DBus::BusType::SYSTEM);
NetCfgTunBuilder<Client> client(dbus_system);
#else
Client client;
#endif
Expand Down

0 comments on commit b47ef50

Please sign in to comment.