WireGuard rework for MacOS and Windows (#314)
WireGuard rework for MacOS and Windows
This commit is contained in:
parent
421a27ceae
commit
07c38e9b6c
60 changed files with 4779 additions and 434 deletions
48
client/platforms/windows/daemon/windowsdaemon.h
Normal file
48
client/platforms/windows/daemon/windowsdaemon.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef WINDOWSDAEMON_H
|
||||
#define WINDOWSDAEMON_H
|
||||
|
||||
#include "daemon/daemon.h"
|
||||
#include "dnsutilswindows.h"
|
||||
#include "windowssplittunnel.h"
|
||||
#include "windowstunnelservice.h"
|
||||
#include "wireguardutilswindows.h"
|
||||
|
||||
#define TUNNEL_SERVICE_NAME L"WireGuardTunnel$AmneziaVPN"
|
||||
|
||||
class WindowsDaemon final : public Daemon {
|
||||
Q_DISABLE_COPY_MOVE(WindowsDaemon)
|
||||
|
||||
public:
|
||||
WindowsDaemon();
|
||||
~WindowsDaemon();
|
||||
|
||||
void prepareActivation(const InterfaceConfig& config) override;
|
||||
|
||||
protected:
|
||||
bool run(Op op, const InterfaceConfig& config) override;
|
||||
WireguardUtils* wgutils() const override { return m_wgutils; }
|
||||
bool supportDnsUtils() const override { return true; }
|
||||
DnsUtils* dnsutils() override { return m_dnsutils; }
|
||||
|
||||
private:
|
||||
void monitorBackendFailure();
|
||||
|
||||
private:
|
||||
enum State {
|
||||
Active,
|
||||
Inactive,
|
||||
};
|
||||
|
||||
State m_state = Inactive;
|
||||
int m_inetAdapterIndex = -1;
|
||||
|
||||
WireguardUtilsWindows* m_wgutils = nullptr;
|
||||
DnsUtilsWindows* m_dnsutils = nullptr;
|
||||
WindowsSplitTunnel m_splitTunnelManager;
|
||||
};
|
||||
|
||||
#endif // WINDOWSDAEMON_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue