Files
amnezia-client/service/server/router.cpp
T

46 lines
938 B
C++
Raw Normal View History

2020-12-03 23:27:56 +03:00
#include "router.h"
2021-02-21 09:44:53 -08:00
#ifdef Q_OS_WIN
#include "router_win.h"
#elif defined (Q_OS_MAC)
#include "router_mac.h"
#endif
2020-12-03 23:27:56 +03:00
int Router::routeAddList(const QString &gw, const QStringList &ips)
{
2020-12-04 00:45:21 +03:00
#ifdef Q_OS_WIN
2021-02-21 09:44:53 -08:00
return RouterWin::Instance().routeAddList(gw, ips);
#elif defined (Q_OS_MAC)
return RouterMac::Instance().routeAddList(gw, ips);
2020-12-04 00:45:21 +03:00
#endif
2020-12-03 23:27:56 +03:00
}
bool Router::clearSavedRoutes()
{
2020-12-04 00:45:21 +03:00
#ifdef Q_OS_WIN
2021-02-21 09:44:53 -08:00
return RouterWin::Instance().clearSavedRoutes();
#elif defined (Q_OS_MAC)
return RouterMac::Instance().clearSavedRoutes();
2020-12-04 00:45:21 +03:00
#endif
2020-12-03 23:27:56 +03:00
}
2021-06-01 18:18:09 +03:00
int Router::routeDeleteList(const QString &gw, const QStringList &ips)
2020-12-03 23:27:56 +03:00
{
#ifdef Q_OS_WIN
2021-06-01 18:18:09 +03:00
return RouterWin::Instance().routeDeleteList(gw, ips);
2021-02-21 09:44:53 -08:00
#elif defined (Q_OS_MAC)
2021-06-01 18:18:09 +03:00
return RouterMac::Instance().routeDeleteList(gw, ips);
2021-02-21 09:44:53 -08:00
#endif
2020-12-03 23:27:56 +03:00
}
void Router::flushDns()
{
#ifdef Q_OS_WIN
2021-02-21 09:44:53 -08:00
RouterWin::Instance().flushDns();
#elif defined (Q_OS_MAC)
RouterMac::Instance().flushDns();
2020-12-03 23:27:56 +03:00
#endif
}
2021-02-21 09:44:53 -08:00