mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
resetIpStack added
This commit is contained in:
@@ -53,3 +53,14 @@ void Router::flushDns()
|
||||
#endif
|
||||
}
|
||||
|
||||
void Router::resetIpStack()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
RouterWin::Instance().resetIpStack();
|
||||
#elif defined (Q_OS_MAC)
|
||||
// todo fixme
|
||||
#elif defined Q_OS_LINUX
|
||||
// todo fixme
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
static bool clearSavedRoutes();
|
||||
static int routeDeleteList(const QString &gw, const QStringList &ips);
|
||||
static void flushDns();
|
||||
static void resetIpStack();
|
||||
};
|
||||
|
||||
#endif // ROUTER_H
|
||||
|
||||
@@ -289,6 +289,27 @@ void RouterWin::flushDns()
|
||||
//qDebug().noquote() << "OUTPUT ipconfig /flushdns: " + p.readAll();
|
||||
}
|
||||
|
||||
void RouterWin::resetIpStack()
|
||||
{
|
||||
// {
|
||||
// QProcess p;
|
||||
// QString command = QString("ipconfig /release");
|
||||
// p.start(command);
|
||||
// }
|
||||
{
|
||||
QProcess p;
|
||||
QString command = QString("netsh int ip reset");
|
||||
p.start(command);
|
||||
p.waitForFinished();
|
||||
}
|
||||
{
|
||||
QProcess p;
|
||||
QString command = QString("netsh winsock reset");
|
||||
p.start(command);
|
||||
p.waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void RouterWin::suspendWcmSvc(bool suspend)
|
||||
{
|
||||
if (suspend == m_suspended) return;
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
bool clearSavedRoutes();
|
||||
int routeDeleteList(const QString &gw, const QStringList &ips);
|
||||
void flushDns();
|
||||
void resetIpStack();
|
||||
|
||||
void suspendWcmSvc(bool suspend);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user