Files
amnezia-client/service/server/router_linux.h
T

45 lines
978 B
C++
Raw Normal View History

2021-08-04 10:08:00 -07:00
#ifndef ROUTERLINUX_H
#define ROUTERLINUX_H
#include <QTimer>
#include <QString>
#include <QSettings>
#include <QHash>
#include <QDebug>
#include <QObject>
/**
* @brief The Router class - General class for handling ip routing
*/
class RouterLinux : public QObject
{
Q_OBJECT
public:
2023-08-08 16:41:00 -07:00
struct Route {
QString dst;
QString gw;
};
2021-08-04 10:08:00 -07:00
static RouterLinux& Instance();
bool routeAdd(const QString &ip, const QString &gw, const int &sock);
int routeAddList(const QString &gw, const QStringList &ips);
bool clearSavedRoutes();
bool routeDelete(const QString &ip, const QString &gw, const int &sock);
bool routeDeleteList(const QString &gw, const QStringList &ips);
2023-09-17 17:06:24 -04:00
QString getgatewayandiface();
2021-08-04 10:08:00 -07:00
void flushDns();
public slots:
private:
RouterLinux() {}
RouterLinux(RouterLinux const &) = delete;
RouterLinux& operator= (RouterLinux const&) = delete;
2023-08-08 16:41:00 -07:00
QList<Route> m_addedRoutes;
2021-08-04 10:08:00 -07:00
};
#endif // ROUTERLINUX_H