Fixed defined errors and refactor add_route for linux

This commit is contained in:
leetthewire 2021-06-27 01:53:08 +00:00
parent 148b1dacce
commit f852ff6dff
7 changed files with 219 additions and 5 deletions

View file

@ -4,6 +4,8 @@
#include "router_win.h"
#elif defined (Q_OS_MAC)
#include "router_mac.h"
#elif defined Q_OS_LINUX
#include "router_linux.h"
#endif
@ -13,6 +15,8 @@ int Router::routeAddList(const QString &gw, const QStringList &ips)
return RouterWin::Instance().routeAddList(gw, ips);
#elif defined (Q_OS_MAC)
return RouterMac::Instance().routeAddList(gw, ips);
#elif defined Q_OS_LINUX
return RouterLinux::Instance().routeAddList(gw, ips);
#endif
}
@ -22,6 +26,8 @@ bool Router::clearSavedRoutes()
return RouterWin::Instance().clearSavedRoutes();
#elif defined (Q_OS_MAC)
return RouterMac::Instance().clearSavedRoutes();
#elif defined Q_OS_LINUX
return RouterLinux::Instance().clearSavedRoutes();
#endif
}
@ -31,6 +37,8 @@ int Router::routeDeleteList(const QString &gw, const QStringList &ips)
return RouterWin::Instance().routeDeleteList(gw, ips);
#elif defined (Q_OS_MAC)
return RouterMac::Instance().routeDeleteList(gw, ips);
#elif defined Q_OS_LINUX
return RouterLinux::Instance().routeDeleteList(gw, ips);
#endif
}
@ -40,6 +48,8 @@ void Router::flushDns()
RouterWin::Instance().flushDns();
#elif defined (Q_OS_MAC)
RouterMac::Instance().flushDns();
#elif defined Q_OS_LINUX
RouterLinux::Instance().flushDns();
#endif
}