Custom routing done
ShadowSocks enabled by default
This commit is contained in:
parent
f91854594c
commit
a1cb4ac544
36 changed files with 482 additions and 780 deletions
|
@ -1,8 +1,14 @@
|
|||
#include "ipcserver.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QDateTime>
|
||||
#include <QLocalSocket>
|
||||
|
||||
#include "router.h"
|
||||
#ifdef Q_OS_WIN
|
||||
#include "tapcontroller_win.h"
|
||||
#endif
|
||||
|
||||
IpcServer::IpcServer(QObject *parent):
|
||||
IpcInterfaceSource(parent)
|
||||
{}
|
||||
|
@ -11,13 +17,13 @@ int IpcServer::createPrivilegedProcess()
|
|||
{
|
||||
m_localpid++;
|
||||
|
||||
ProcessDescriptor pd;
|
||||
ProcessDescriptor pd(this);
|
||||
// pd.serverNode->setHostUrl(QUrl(amnezia::getIpcProcessUrl(m_localpid)));
|
||||
// pd.serverNode->enableRemoting(pd.ipcProcess.data());
|
||||
|
||||
|
||||
|
||||
pd.localServer = QSharedPointer<QLocalServer>(new QLocalServer(this));
|
||||
//pd.localServer = QSharedPointer<QLocalServer>(new QLocalServer(this));
|
||||
pd.localServer->setSocketOptions(QLocalServer::WorldAccessOption);
|
||||
|
||||
if (!pd.localServer->listen(amnezia::getIpcProcessUrl(m_localpid))) {
|
||||
|
@ -46,3 +52,46 @@ int IpcServer::createPrivilegedProcess()
|
|||
|
||||
return m_localpid;
|
||||
}
|
||||
|
||||
bool IpcServer::routeAdd(const QString &ip, const QString &gw, const QString &mask)
|
||||
{
|
||||
return Router::Instance().routeAdd(ip, gw, mask);
|
||||
}
|
||||
|
||||
int IpcServer::routeAddList(const QString &gw, const QStringList &ips)
|
||||
{
|
||||
return Router::Instance().routeAddList(gw, ips);
|
||||
}
|
||||
|
||||
bool IpcServer::clearSavedRoutes()
|
||||
{
|
||||
return Router::Instance().clearSavedRoutes();
|
||||
}
|
||||
|
||||
bool IpcServer::routeDelete(const QString &ip)
|
||||
{
|
||||
return Router::Instance().routeDelete(ip);
|
||||
}
|
||||
|
||||
void IpcServer::flushDns()
|
||||
{
|
||||
return Router::Instance().flushDns();
|
||||
}
|
||||
|
||||
bool IpcServer::checkAndInstallDriver()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return TapController::checkAndSetup();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
QStringList IpcServer::getTapList()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return TapController::getTapList();
|
||||
#else
|
||||
return QStringList();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue