amnezia-client/client/protocols/ios_vpnprotocol.h
pokamest 5510ff7dce
iOS connection fixes (#278)
iOS VPN connection fixes
2023-08-09 03:02:41 +01:00

66 lines
1.7 KiB
C++

#ifndef IOS_VPNPROTOCOL_H
#define IOS_VPNPROTOCOL_H
#include "vpnprotocol.h"
#include "protocols/protocols_defs.h"
using namespace amnezia;
class IOSVpnProtocol : public VpnProtocol
{
Q_OBJECT
public:
explicit IOSVpnProtocol(amnezia::Proto proto, const QJsonObject& configuration, QObject* parent = nullptr);
static IOSVpnProtocol* instance();
virtual ~IOSVpnProtocol() override;
bool initialize();
virtual ErrorCode start() override;
virtual void stop() override;
void resume_start();
void checkStatus();
void setNotificationText(const QString& title, const QString& message,
int timerSec);
void setFallbackConnectedNotification();
void getBackendLogs(std::function<void(const QString&)>&& callback);
void cleanupBackendLogs();
signals:
void newTransmittedDataCount(quint64 rxBytes, quint64 txBytes);
protected slots:
protected:
private:
Proto m_protocol;
bool m_serviceConnected = false;
bool m_checkingStatus = false;
std::function<void(const QString&)> m_logCallback;
bool m_isChangingState = false;
void setupWireguardProtocol(const QJsonObject& rawConfig);
void setupOpenVPNProtocol(const QJsonObject& rawConfig);
void setupCloakProtocol(const QJsonObject& rawConfig);
void setupShadowSocksProtocol(const QJsonObject& rawConfig);
void launchWireguardTunnel(const QJsonObject& rawConfig);
void launchOpenVPNTunnel(const QJsonObject& rawConfig);
void launchCloakTunnel(const QJsonObject& rawConfig);
void launchShadowSocksTunnel(const QJsonObject& rawConfig);
QString serializeSSConfig(const QJsonObject &ssConfig);
};
#endif // IOS_VPNPROTOCOL_H