mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
* fix: app freeze on quit
* fix: typo in VpnConnection destructor
* add trace info
* add more trace info
* set timelimit for flushDns
* Refactor IpcClient::Interface access logic
* cleanup unused variable
* cleanup trace info
* fix: remove second disconnect from VPN on app close
* this object will be deleted at app close
* Don't terminate VPN thread on Linux
* Revert "Don't terminate VPN thread on Linux"
This reverts commit 20e4ea2d4a.
* disconnect all signals from vpnconnection on exit
* add interruption request on vpnConnectionThread
* use checktimer only for iOS
* disconnect all signals from vpnconnection on exit
* disconnect signals on exit before VPN disconnect
* add disconnectSlots method
* fix: add allow traffic rules on killswitch disable
* wait for response from service before object destroy
* change disconnect from vpn order
* add delay for connection close
* change disconnect method order
* use stop method for protocol disconnecect
* change disconnect method order
* allow dns traffic after app close
* delete tun on disconnect
---------
Co-authored-by: vkamn <vk@amnezia.org>
70 lines
1.6 KiB
C++
70 lines
1.6 KiB
C++
#ifndef ROUTERWIN_H
|
|
#define ROUTERWIN_H
|
|
|
|
#include <QTimer>
|
|
#include <QString>
|
|
#include <QSettings>
|
|
#include <QHash>
|
|
#include <QDebug>
|
|
#include <QObject>
|
|
|
|
#include "../client/platforms/windows/daemon/dnsutilswindows.h"
|
|
|
|
#include <WinSock2.h> //includes Windows.h
|
|
#include <WS2tcpip.h>
|
|
|
|
|
|
#include <iphlpapi.h>
|
|
#include <IcmpAPI.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
|
|
#include <stdint.h>
|
|
//typedef uint8_t u8_t ;
|
|
|
|
//#ifndef WIN32_LEAN_AND_MEAN
|
|
//#define WIN32_LEAN_AND_MEAN
|
|
//#endif
|
|
|
|
/**
|
|
* @brief The Router class - General class for handling ip routing
|
|
*/
|
|
class RouterWin : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static RouterWin& Instance();
|
|
|
|
int routeAddList(const QString &gw, const QStringList &ips);
|
|
bool clearSavedRoutes();
|
|
int routeDeleteList(const QString &gw, const QStringList &ips);
|
|
bool flushDns();
|
|
void resetIpStack();
|
|
|
|
bool StartRoutingIpv6();
|
|
bool StopRoutingIpv6();
|
|
|
|
void suspendWcmSvc(bool suspend);
|
|
bool updateResolvers(const QString& ifname, const QList<QHostAddress>& resolvers);
|
|
bool restoreResolvers();
|
|
|
|
private:
|
|
RouterWin(RouterWin const &) = delete;
|
|
RouterWin& operator= (RouterWin const&) = delete;
|
|
|
|
DWORD GetServicePid(LPCWSTR serviceName);
|
|
BOOL ListProcessThreads(DWORD dwOwnerPID);
|
|
BOOL EnableDebugPrivilege();
|
|
BOOL InitNtFunctions();
|
|
BOOL SuspendProcess(BOOL fSuspend, DWORD dwProcessId);
|
|
|
|
private:
|
|
RouterWin() {m_dnsUtil = new DnsUtilsWindows(this);}
|
|
QMultiMap<QString, MIB_IPFORWARDROW> m_ipForwardRows;
|
|
bool m_suspended = false;
|
|
DnsUtilsWindows *m_dnsUtil;
|
|
};
|
|
|
|
#endif // ROUTERWIN_H
|