WireGuard for MacOS (#248)

* WireGuard for MacOS
* Fix openvpn block-outside-dns
This commit is contained in:
pokamest 2023-07-15 14:19:48 -07:00 committed by GitHub
parent ed5dc7cdfd
commit 35ecb8499d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 5150 additions and 3486 deletions

View file

@ -0,0 +1,29 @@
/* 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/. */
#include "dummyapplistprovider.h"
#include "leakdetector.h"
DummyAppListProvider::DummyAppListProvider(QObject* parent)
: AppListProvider(parent) {
MZ_COUNT_CTOR(DummyAppListProvider);
}
DummyAppListProvider::~DummyAppListProvider() {
MZ_COUNT_DTOR(DummyAppListProvider);
}
void DummyAppListProvider::getApplicationList() {
QMap<QString, QString> appList;
appList["com.example.one"] = "a Example App 1";
appList["com.example.two"] = "B Example App 2";
appList["org.example.one"] = "c Example App 3";
appList["org.example.two"] = "D Example App 4";
appList["com.example.a"] = "e Example App 5";
appList["com.example.b"] = "F Example App 6";
appList["org.example.c"] = "g Example App 7";
appList["org.example.d"] = "H Example App 8";
emit newAppList(appList);
}

View file

@ -0,0 +1,20 @@
/* 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 DUMMYAPPLISTPROVIDER_H
#define DUMMYAPPLISTPROVIDER_H
#include <QObject>
#include "applistprovider.h"
class DummyAppListProvider : public AppListProvider {
Q_OBJECT
public:
DummyAppListProvider(QObject* parent);
~DummyAppListProvider();
void getApplicationList() override;
};
#endif // DUMMYAPPLISTPROVIDER_H

View file

@ -0,0 +1,18 @@
/* 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/. */
#include "dummynetworkwatcher.h"
#include "leakdetector.h"
DummyNetworkWatcher::DummyNetworkWatcher(QObject* parent)
: NetworkWatcherImpl(parent) {
MZ_COUNT_CTOR(DummyNetworkWatcher);
}
DummyNetworkWatcher::~DummyNetworkWatcher() {
MZ_COUNT_DTOR(DummyNetworkWatcher);
}
void DummyNetworkWatcher::initialize() {}

View file

@ -0,0 +1,22 @@
/* 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 DUMMYNETWORKWATCHER_H
#define DUMMYNETWORKWATCHER_H
#include "networkwatcherimpl.h"
class DummyNetworkWatcher final : public NetworkWatcherImpl {
public:
DummyNetworkWatcher(QObject* parent);
~DummyNetworkWatcher();
void initialize() override;
NetworkWatcherImpl::TransportType getTransportType() override {
return TransportType_Other;
};
};
#endif // DUMMYNETWORKWATCHER_H

View file

@ -0,0 +1,25 @@
/* 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/. */
#include "dummypingsender.h"
#include "leakdetector.h"
#include "logger.h"
namespace {
Logger logger("DummyPingSender");
}
DummyPingSender::DummyPingSender(const QHostAddress& source, QObject* parent)
: PingSender(parent) {
MZ_COUNT_CTOR(DummyPingSender);
Q_UNUSED(source);
}
DummyPingSender::~DummyPingSender() { MZ_COUNT_DTOR(DummyPingSender); }
void DummyPingSender::sendPing(const QHostAddress& dest, quint16 sequence) {
logger.debug() << "Dummy ping to:" << dest.toString();
emit recvPing(sequence);
}

View file

@ -0,0 +1,21 @@
/* 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 DUMMYPINGSENDER_H
#define DUMMYPINGSENDER_H
#include "pingsender.h"
class DummyPingSender final : public PingSender {
Q_OBJECT
Q_DISABLE_COPY_MOVE(DummyPingSender)
public:
DummyPingSender(const QHostAddress& source, QObject* parent = nullptr);
~DummyPingSender();
void sendPing(const QHostAddress& dest, quint16 sequence) override;
};
#endif // DUMMYPINGSENDER_H