2021-01-09 19:55:16 +03:00
|
|
|
|
#include <QApplication>
|
2020-12-26 15:03:51 +03:00
|
|
|
|
#include <QDebug>
|
2021-01-06 17:12:24 +03:00
|
|
|
|
#include <QFile>
|
2021-02-18 15:00:41 +03:00
|
|
|
|
#include <QJsonObject>
|
2020-12-26 15:03:51 +03:00
|
|
|
|
|
2021-04-04 23:12:36 +03:00
|
|
|
|
#include <configurators/openvpn_configurator.h>
|
|
|
|
|
|
#include <configurators/cloak_configurator.h>
|
2021-05-07 23:28:37 +03:00
|
|
|
|
#include <configurators/shadowsocks_configurator.h>
|
2021-06-12 11:59:36 +03:00
|
|
|
|
#include <configurators/wireguard_configurator.h>
|
2021-10-02 21:56:47 +03:00
|
|
|
|
#include <configurators/vpn_configurator.h>
|
2021-01-06 17:12:24 +03:00
|
|
|
|
#include <core/servercontroller.h>
|
2021-06-12 11:59:36 +03:00
|
|
|
|
#include <protocols/wireguardprotocol.h>
|
2021-01-06 17:12:24 +03:00
|
|
|
|
|
2021-09-30 18:16:41 +03:00
|
|
|
|
#ifdef Q_OS_ANDROID
|
|
|
|
|
|
#include <protocols/android_vpnprotocol.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2021-02-02 01:47:40 +03:00
|
|
|
|
#include "ipc.h"
|
2021-02-18 15:00:41 +03:00
|
|
|
|
#include "core/ipcclient.h"
|
2021-01-06 17:12:24 +03:00
|
|
|
|
#include "protocols/openvpnprotocol.h"
|
2021-04-04 23:12:36 +03:00
|
|
|
|
#include "protocols/openvpnovercloakprotocol.h"
|
2021-01-15 23:36:35 +03:00
|
|
|
|
#include "protocols/shadowsocksvpnprotocol.h"
|
2021-04-04 23:12:36 +03:00
|
|
|
|
|
2021-01-06 17:12:24 +03:00
|
|
|
|
#include "utils.h"
|
2020-12-26 15:03:51 +03:00
|
|
|
|
#include "vpnconnection.h"
|
|
|
|
|
|
|
|
|
|
|
|
VpnConnection::VpnConnection(QObject* parent) : QObject(parent)
|
|
|
|
|
|
{
|
2021-02-18 15:00:41 +03:00
|
|
|
|
QTimer::singleShot(0, this, [this](){
|
2021-02-03 15:42:36 +03:00
|
|
|
|
if (!IpcClient::init()) {
|
|
|
|
|
|
qWarning() << "Error occured when init IPC client";
|
2021-02-18 15:00:41 +03:00
|
|
|
|
emit serviceIsNotReady();
|
2021-02-03 15:42:36 +03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2021-02-18 15:00:41 +03:00
|
|
|
|
}
|
2021-02-03 15:42:36 +03:00
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
VpnConnection::~VpnConnection()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_vpnProtocol.clear();
|
2020-12-26 15:03:51 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VpnConnection::onBytesChanged(quint64 receivedBytes, quint64 sentBytes)
|
|
|
|
|
|
{
|
|
|
|
|
|
emit bytesChanged(receivedBytes, sentBytes);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VpnConnection::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
|
|
|
|
|
{
|
2021-02-18 15:00:41 +03:00
|
|
|
|
if (IpcClient::Interface()) {
|
2021-06-01 18:18:09 +03:00
|
|
|
|
if (state == VpnProtocol::Connected){
|
2021-02-18 15:00:41 +03:00
|
|
|
|
IpcClient::Interface()->flushDns();
|
|
|
|
|
|
|
2021-06-12 11:59:36 +03:00
|
|
|
|
if (m_settings.routeMode() != Settings::VpnAllSites) {
|
2021-06-01 18:18:09 +03:00
|
|
|
|
IpcClient::Interface()->routeDeleteList(m_vpnProtocol->vpnGateway(), QStringList() << "0.0.0.0");
|
|
|
|
|
|
//qDebug() << "VpnConnection::onConnectionStateChanged :: adding custom routes, count:" << forwardIps.size();
|
|
|
|
|
|
}
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(),
|
|
|
|
|
|
QStringList() << m_settings.primaryDns() << m_settings.secondaryDns());
|
2021-01-26 15:01:15 +03:00
|
|
|
|
|
|
|
|
|
|
|
2021-06-01 18:18:09 +03:00
|
|
|
|
if (m_settings.routeMode() == Settings::VpnOnlyForwardSites) {
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(), m_settings.getVpnIps(Settings::VpnOnlyForwardSites));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (m_settings.routeMode() == Settings::VpnAllExceptSites) {
|
2021-06-12 11:59:36 +03:00
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(), QStringList() << "0.0.0.0/1");
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(), QStringList() << "128.0.0.0/1");
|
|
|
|
|
|
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->routeGateway(), QStringList() << remoteAddress());
|
2021-06-01 18:18:09 +03:00
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->routeGateway(), m_settings.getVpnIps(Settings::VpnAllExceptSites));
|
2021-02-18 15:00:41 +03:00
|
|
|
|
}
|
2021-06-01 18:18:09 +03:00
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
}
|
2021-06-01 18:18:09 +03:00
|
|
|
|
else if (state == VpnProtocol::Error) {
|
2021-02-18 15:00:41 +03:00
|
|
|
|
IpcClient::Interface()->flushDns();
|
2021-01-26 15:01:15 +03:00
|
|
|
|
|
2021-05-27 22:18:36 +03:00
|
|
|
|
if (m_settings.routeMode() == Settings::VpnOnlyForwardSites) {
|
2021-02-18 15:00:41 +03:00
|
|
|
|
IpcClient::Interface()->clearSavedRoutes();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-01-26 15:01:15 +03:00
|
|
|
|
|
2020-12-26 15:03:51 +03:00
|
|
|
|
emit connectionStateChanged(state);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-12 11:59:36 +03:00
|
|
|
|
const QString &VpnConnection::remoteAddress() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_remoteAddress;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
QSharedPointer<VpnProtocol> VpnConnection::vpnProtocol() const
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_vpnProtocol;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-01 18:18:09 +03:00
|
|
|
|
void VpnConnection::addRoutes(const QStringList &ips)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (connectionState() == VpnProtocol::Connected && IpcClient::Interface()) {
|
|
|
|
|
|
if (m_settings.routeMode() == Settings::VpnOnlyForwardSites) {
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->vpnGateway(), ips);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (m_settings.routeMode() == Settings::VpnAllExceptSites) {
|
|
|
|
|
|
IpcClient::Interface()->routeAddList(m_vpnProtocol->routeGateway(), ips);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VpnConnection::deleteRoutes(const QStringList &ips)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (connectionState() == VpnProtocol::Connected && IpcClient::Interface()) {
|
|
|
|
|
|
if (m_settings.routeMode() == Settings::VpnOnlyForwardSites) {
|
|
|
|
|
|
IpcClient::Interface()->routeDeleteList(vpnProtocol()->vpnGateway(), ips);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (m_settings.routeMode() == Settings::VpnAllExceptSites) {
|
|
|
|
|
|
IpcClient::Interface()->routeDeleteList(m_vpnProtocol->routeGateway(), ips);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VpnConnection::flushDns()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (IpcClient::Interface()) IpcClient::Interface()->flushDns();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-01-06 17:12:24 +03:00
|
|
|
|
ErrorCode VpnConnection::lastError() const
|
2020-12-26 23:17:20 +03:00
|
|
|
|
{
|
|
|
|
|
|
if (!m_vpnProtocol.data()) {
|
2021-01-06 17:12:24 +03:00
|
|
|
|
return ErrorCode::InternalError;
|
2020-12-26 23:17:20 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return m_vpnProtocol.data()->lastError();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-07 23:28:37 +03:00
|
|
|
|
QMap<Protocol, QString> VpnConnection::getLastVpnConfig(const QJsonObject &containerConfig)
|
|
|
|
|
|
{
|
|
|
|
|
|
QMap<Protocol, QString> configs;
|
2021-10-04 19:07:49 +03:00
|
|
|
|
for (Protocol proto: ProtocolProps::allProtocols()) {
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
2021-09-20 21:51:28 +03:00
|
|
|
|
QString cfg = containerConfig.value(ProtocolProps::protoToString(proto)).toObject().value(config_key::last_config).toString();
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
|
|
|
|
|
if (!cfg.isEmpty()) configs.insert(proto, cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
return configs;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString VpnConnection::createVpnConfigurationForProto(int serverIndex,
|
|
|
|
|
|
const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig, Protocol proto,
|
|
|
|
|
|
ErrorCode *errorCode)
|
|
|
|
|
|
{
|
|
|
|
|
|
ErrorCode e = ErrorCode::NoError;
|
|
|
|
|
|
auto lastVpnConfig = getLastVpnConfig(containerConfig);
|
|
|
|
|
|
|
|
|
|
|
|
QString configData;
|
|
|
|
|
|
if (lastVpnConfig.contains(proto)) {
|
2021-05-14 04:27:30 -07:00
|
|
|
|
configData = lastVpnConfig.value(proto);
|
2021-10-02 21:56:47 +03:00
|
|
|
|
configData = VpnConfigurator::processConfigWithLocalSettings(container, proto, configData);
|
|
|
|
|
|
|
2021-09-20 21:51:28 +03:00
|
|
|
|
qDebug() << "VpnConnection::createVpnConfiguration: using saved config for" << ProtocolProps::protoToString(proto);
|
2021-05-07 23:28:37 +03:00
|
|
|
|
}
|
|
|
|
|
|
else {
|
2021-09-20 21:51:28 +03:00
|
|
|
|
qDebug() << "VpnConnection::createVpnConfiguration: gen new config for" << ProtocolProps::protoToString(proto);
|
2021-10-02 21:56:47 +03:00
|
|
|
|
configData = VpnConfigurator::genVpnProtocolConfig(credentials,
|
2021-10-05 12:22:13 +03:00
|
|
|
|
container, containerConfig, proto, &e);
|
2021-10-02 21:56:47 +03:00
|
|
|
|
|
|
|
|
|
|
QString configDataBeforeLocalProcessing = configData;
|
|
|
|
|
|
|
|
|
|
|
|
configData = VpnConfigurator::processConfigWithLocalSettings(container, proto, configData);
|
|
|
|
|
|
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
|
|
|
|
|
if (errorCode && e) {
|
|
|
|
|
|
*errorCode = e;
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (serverIndex >= 0) {
|
2021-05-10 02:33:31 +03:00
|
|
|
|
qDebug() << "VpnConnection::createVpnConfiguration: saving config for server #" << serverIndex << container << proto;
|
2021-05-07 23:28:37 +03:00
|
|
|
|
QJsonObject protoObject = m_settings.protocolConfig(serverIndex, container, proto);
|
2021-10-02 21:56:47 +03:00
|
|
|
|
protoObject.insert(config_key::last_config, configDataBeforeLocalProcessing);
|
2021-05-07 23:28:37 +03:00
|
|
|
|
m_settings.setProtocolConfig(serverIndex, container, proto, protoObject);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (errorCode) *errorCode = e;
|
|
|
|
|
|
return configData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-04 21:13:07 +03:00
|
|
|
|
QJsonObject VpnConnection::createVpnConfiguration(int serverIndex,
|
|
|
|
|
|
const ServerCredentials &credentials, DockerContainer container,
|
|
|
|
|
|
const QJsonObject &containerConfig, ErrorCode *errorCode)
|
2020-12-26 15:03:51 +03:00
|
|
|
|
{
|
2021-10-04 21:13:07 +03:00
|
|
|
|
ErrorCode e = ErrorCode::NoError;
|
|
|
|
|
|
QJsonObject vpnConfiguration;
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
2021-10-05 12:22:13 +03:00
|
|
|
|
for (ProtocolEnumNS::Protocol proto : ContainerProps::protocolsForContainer(container)) {
|
|
|
|
|
|
// QString vpnConfigData =
|
|
|
|
|
|
// createVpnConfigurationForProto(
|
|
|
|
|
|
// serverIndex, credentials, container, containerConfig, proto, &e);
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
2021-10-05 12:22:13 +03:00
|
|
|
|
QJsonObject vpnConfigData = QJsonDocument::fromJson(
|
|
|
|
|
|
createVpnConfigurationForProto(
|
|
|
|
|
|
serverIndex, credentials, container, containerConfig, proto, &e).toUtf8()).
|
|
|
|
|
|
object();
|
2021-05-07 23:28:37 +03:00
|
|
|
|
|
2021-10-04 21:13:07 +03:00
|
|
|
|
if (e) {
|
|
|
|
|
|
if (errorCode) *errorCode = e;
|
|
|
|
|
|
return {};
|
2021-01-06 17:12:24 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-05 12:22:13 +03:00
|
|
|
|
vpnConfiguration.insert(ProtocolProps::key_proto_config_data(proto), vpnConfigData);
|
2021-10-04 19:07:49 +03:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-08 00:50:26 +03:00
|
|
|
|
Protocol proto = ContainerProps::defaultProtocol(container);
|
|
|
|
|
|
vpnConfiguration[config_key::protocol] = ProtocolProps::protoToString(proto);
|
|
|
|
|
|
|
2021-10-04 21:13:07 +03:00
|
|
|
|
return vpnConfiguration;
|
2021-01-06 17:12:24 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-01 18:18:09 +03:00
|
|
|
|
ErrorCode VpnConnection::connectToVpn(int serverIndex,
|
|
|
|
|
|
const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig)
|
2021-01-06 17:12:24 +03:00
|
|
|
|
{
|
2021-06-12 11:59:36 +03:00
|
|
|
|
qDebug() << QString("СonnectToVpn, Server index is %1, container is %2, route mode is")
|
2021-09-20 21:51:28 +03:00
|
|
|
|
.arg(serverIndex).arg(ContainerProps::containerToString(container)) << m_settings.routeMode();
|
2021-06-12 11:59:36 +03:00
|
|
|
|
m_remoteAddress = credentials.hostName;
|
2020-12-26 15:03:51 +03:00
|
|
|
|
|
2021-06-01 18:18:09 +03:00
|
|
|
|
emit connectionStateChanged(VpnProtocol::Connecting);
|
2021-02-18 15:00:41 +03:00
|
|
|
|
|
|
|
|
|
|
if (m_vpnProtocol) {
|
|
|
|
|
|
disconnect(m_vpnProtocol.data(), &VpnProtocol::protocolError, this, &VpnConnection::vpnProtocolError);
|
|
|
|
|
|
m_vpnProtocol->stop();
|
2021-02-25 18:05:42 +03:00
|
|
|
|
m_vpnProtocol.reset();
|
2021-02-18 15:00:41 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-04 21:13:07 +03:00
|
|
|
|
ErrorCode e = ErrorCode::NoError;
|
|
|
|
|
|
m_vpnConfiguration = createVpnConfiguration(serverIndex, credentials, container, containerConfig);
|
2021-10-04 19:07:49 +03:00
|
|
|
|
if (e) {
|
|
|
|
|
|
emit connectionStateChanged(VpnProtocol::Error);
|
|
|
|
|
|
return e;
|
2021-01-06 17:12:24 +03:00
|
|
|
|
}
|
2021-01-15 23:36:35 +03:00
|
|
|
|
|
2021-04-04 23:12:36 +03:00
|
|
|
|
|
2021-10-04 19:07:49 +03:00
|
|
|
|
#ifndef Q_OS_ANDROID
|
|
|
|
|
|
|
2021-10-04 21:13:07 +03:00
|
|
|
|
m_vpnProtocol.reset(VpnProtocol::factory(container, m_vpnConfiguration));
|
2021-10-04 19:07:49 +03:00
|
|
|
|
if (!m_vpnProtocol) {
|
|
|
|
|
|
return ErrorCode::InternalError;
|
2021-04-04 23:12:36 +03:00
|
|
|
|
}
|
2021-06-12 11:59:36 +03:00
|
|
|
|
|
2021-10-04 19:07:49 +03:00
|
|
|
|
m_vpnProtocol->prepare();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
2021-10-07 22:52:13 +03:00
|
|
|
|
AndroidVpnProtocol *androidVpnProtocol = new AndroidVpnProtocol(proto, m_vpnConfiguration);
|
|
|
|
|
|
androidVpnProtocol->initialize();
|
|
|
|
|
|
m_vpnProtocol.reset(androidVpnProtocol);
|
2021-09-30 18:16:41 +03:00
|
|
|
|
#endif
|
2021-10-04 19:07:49 +03:00
|
|
|
|
|
2020-12-26 15:03:51 +03:00
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
connect(m_vpnProtocol.data(), &VpnProtocol::protocolError, this, &VpnConnection::vpnProtocolError);
|
2020-12-26 15:03:51 +03:00
|
|
|
|
connect(m_vpnProtocol.data(), SIGNAL(connectionStateChanged(VpnProtocol::ConnectionState)), this, SLOT(onConnectionStateChanged(VpnProtocol::ConnectionState)));
|
|
|
|
|
|
connect(m_vpnProtocol.data(), SIGNAL(bytesChanged(quint64, quint64)), this, SLOT(onBytesChanged(quint64, quint64)));
|
|
|
|
|
|
|
2021-04-26 22:54:31 +03:00
|
|
|
|
ServerController::disconnectFromHost(credentials);
|
|
|
|
|
|
|
2020-12-26 23:17:20 +03:00
|
|
|
|
return m_vpnProtocol.data()->start();
|
2020-12-26 15:03:51 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-01-09 19:55:16 +03:00
|
|
|
|
QString VpnConnection::bytesPerSecToText(quint64 bytes)
|
2020-12-26 15:03:51 +03:00
|
|
|
|
{
|
2021-01-09 19:55:16 +03:00
|
|
|
|
double mbps = bytes * 8 / 1e6;
|
|
|
|
|
|
return QString("%1 %2").arg(QString::number(mbps, 'f', 2)).arg(tr("Mbps")); // Mbit/s
|
2020-12-26 15:03:51 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VpnConnection::disconnectFromVpn()
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug() << "Disconnect from VPN";
|
|
|
|
|
|
|
2021-05-20 15:59:58 +03:00
|
|
|
|
if (IpcClient::Interface()) {
|
|
|
|
|
|
IpcClient::Interface()->flushDns();
|
2021-02-24 21:58:32 +03:00
|
|
|
|
|
2021-06-01 18:18:09 +03:00
|
|
|
|
// delete cached routes
|
2021-06-19 16:38:35 +03:00
|
|
|
|
QRemoteObjectPendingReply<bool> response = IpcClient::Interface()->clearSavedRoutes();
|
|
|
|
|
|
response.waitForFinished(1000);
|
2021-02-24 21:58:32 +03:00
|
|
|
|
}
|
2021-01-26 15:01:15 +03:00
|
|
|
|
|
2020-12-26 15:03:51 +03:00
|
|
|
|
if (!m_vpnProtocol.data()) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_vpnProtocol.data()->stop();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-01-15 23:36:35 +03:00
|
|
|
|
VpnProtocol::ConnectionState VpnConnection::connectionState()
|
|
|
|
|
|
{
|
2021-06-01 18:18:09 +03:00
|
|
|
|
if (!m_vpnProtocol) return VpnProtocol::Disconnected;
|
2021-01-15 23:36:35 +03:00
|
|
|
|
return m_vpnProtocol->connectionState();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
bool VpnConnection::isConnected() const
|
2020-12-26 15:03:51 +03:00
|
|
|
|
{
|
|
|
|
|
|
if (!m_vpnProtocol.data()) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
return m_vpnProtocol.data()->isConnected();
|
2020-12-26 15:03:51 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
bool VpnConnection::isDisconnected() const
|
2020-12-26 15:03:51 +03:00
|
|
|
|
{
|
|
|
|
|
|
if (!m_vpnProtocol.data()) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 15:00:41 +03:00
|
|
|
|
return m_vpnProtocol.data()->isDisconnected();
|
2020-12-26 15:03:51 +03:00
|
|
|
|
}
|