mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
* feat: integrated xray as a library and added split-tunneling * fix: added copying amnezia_xray.dll to build dir * fix: changed path on darwin * chore: clean up getting default device * chore: removed WSAGetLastError from sockopt logging * fix: get rid of debug logs in xray handlers * fix: minor fixes and xray debugging capabilities * fix: macos default interface fix * fix: roll-back ipv6 sockopt for mac * fix: bind IPv6 on Windows * fix: (win) better IPv6 handling and router fixes * feat: prebuilts uploaded * fix: removed redundant cmake definitions * feat: moved xray to service process, reworked errors * fix: return values in networkUtilities * fix: macos build fixes * fix: (windows) cmake fixes * fix: (windows) compilation fix * fix: (windows) changed location of amnezia_xray.dll * feat: xray logs added to system service * chore: bump xray&tun2socks versions for android * chore: cleanup of XrayProtocol class * removed killswitch * removed redundant members and basic cleanup * feat: support split-tunneling in iOS and macOS NE * chore: update active interface index based on network path and available interfaces * refactor: update network path handling and logging in PacketTunnelProvider * chore: bump xray deps --------- Co-authored-by: Yaroslav Yashin <yaroslav.yashin@gmail.com>
74 lines
2.9 KiB
C++
74 lines
2.9 KiB
C++
#ifndef IPCSERVER_H
|
|
#define IPCSERVER_H
|
|
|
|
#include <QLocalServer>
|
|
#include <QObject>
|
|
#include <QRemoteObjectNode>
|
|
#include <QJsonObject>
|
|
#include "../client/daemon/interfaceconfig.h"
|
|
#include "../client/mozilla/pinghelper.h"
|
|
|
|
#include "ipc.h"
|
|
#include "ipcserverprocess.h"
|
|
#include "ipctun2socksprocess.h"
|
|
|
|
#include "rep_ipc_interface_source.h"
|
|
#include "rep_ipc_process_tun2socks_source.h"
|
|
|
|
class IpcServer : public IpcInterfaceSource
|
|
{
|
|
public:
|
|
explicit IpcServer(QObject *parent = nullptr);
|
|
virtual int createPrivilegedProcess() override;
|
|
|
|
virtual int routeAddList(const QString &gw, const QStringList &ips) override;
|
|
virtual bool clearSavedRoutes() override;
|
|
virtual bool routeDeleteList(const QString &gw, const QStringList &ips) override;
|
|
virtual bool flushDns() override;
|
|
virtual void resetIpStack() override;
|
|
virtual bool checkAndInstallDriver() override;
|
|
virtual QStringList getTapList() override;
|
|
virtual void cleanUp() override;
|
|
virtual void clearLogs() override;
|
|
virtual void setLogsEnabled(bool enabled) override;
|
|
virtual bool createTun(const QString &dev, const QString &subnet) override;
|
|
virtual bool deleteTun(const QString &dev) override;
|
|
virtual bool StartRoutingIpv6() override;
|
|
virtual bool StopRoutingIpv6() override;
|
|
virtual bool disableAllTraffic() override;
|
|
virtual bool addKillSwitchAllowedRange(QStringList ranges) override;
|
|
virtual bool resetKillSwitchAllowedRange(QStringList ranges) override;
|
|
virtual bool enablePeerTraffic(const QJsonObject &configStr) override;
|
|
virtual bool enableKillSwitch(const QJsonObject &excludeAddr, int vpnAdapterIndex) override;
|
|
virtual bool disableKillSwitch() override;
|
|
virtual bool refreshKillSwitch( bool enabled ) override;
|
|
virtual bool updateResolvers(const QString& ifname, const QList<QHostAddress>& resolvers) override;
|
|
virtual bool restoreResolvers() override;
|
|
virtual void xrayStart(const QString& cfg) override;
|
|
virtual void xrayStop() override;
|
|
virtual bool startNetworkCheck(const QString& serverIpv4Gateway, const QString& deviceIpv4Address) override;
|
|
virtual bool stopNetworkCheck() override;
|
|
|
|
private:
|
|
int m_localpid = 0;
|
|
|
|
struct ProcessDescriptor {
|
|
ProcessDescriptor (QObject *parent = nullptr) {
|
|
serverNode = QSharedPointer<QRemoteObjectHost>(new QRemoteObjectHost(parent));
|
|
ipcProcess = QSharedPointer<IpcServerProcess>(new IpcServerProcess(parent));
|
|
tun2socksProcess = QSharedPointer<IpcProcessTun2Socks>(new IpcProcessTun2Socks(parent));
|
|
localServer = QSharedPointer<QLocalServer>(new QLocalServer(parent));
|
|
}
|
|
|
|
QSharedPointer<IpcServerProcess> ipcProcess;
|
|
QSharedPointer<IpcProcessTun2Socks> tun2socksProcess;
|
|
QSharedPointer<QRemoteObjectHost> serverNode;
|
|
QSharedPointer<QLocalServer> localServer;
|
|
};
|
|
|
|
QMap<int, ProcessDescriptor> m_processes;
|
|
PingHelper m_pingHelper;
|
|
};
|
|
|
|
#endif // IPCSERVER_H
|