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
|
@ -2,10 +2,39 @@
|
|||
#include "localserver.h"
|
||||
#include "systemservice.h"
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "platforms/windows/daemon/windowsdaemontunnel.h"
|
||||
|
||||
namespace {
|
||||
int s_argc = 0;
|
||||
char** s_argv = nullptr;
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
SystemService::SystemService(int argc, char **argv)
|
||||
: QtService<QCoreApplication>(argc, argv, SERVICE_NAME)
|
||||
{
|
||||
setServiceDescription("Service for AmneziaVPN");
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if(argc > 2){
|
||||
s_argc = argc;
|
||||
s_argv = argv;
|
||||
QStringList tokens;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
tokens.append(QString(argv[i]));
|
||||
}
|
||||
|
||||
if (!tokens.empty() && tokens[0] == "tunneldaemon") {
|
||||
WindowsDaemonTunnel *daemon = new WindowsDaemonTunnel();
|
||||
daemon->run(tokens);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void SystemService::start()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue