2020-12-03 23:27:56 +03:00
|
|
|
#ifndef ROUTER_H
|
|
|
|
|
#define ROUTER_H
|
|
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QSettings>
|
|
|
|
|
#include <QHash>
|
|
|
|
|
#include <QDebug>
|
2021-02-21 09:44:53 -08:00
|
|
|
#include <QObject>
|
2024-03-27 11:02:34 +00:00
|
|
|
#include <QHostAddress>
|
2020-12-03 23:27:56 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The Router class - General class for handling ip routing
|
|
|
|
|
*/
|
|
|
|
|
class Router : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2021-02-21 09:44:53 -08:00
|
|
|
static int routeAddList(const QString &gw, const QStringList &ips);
|
|
|
|
|
static bool clearSavedRoutes();
|
2021-06-01 18:18:09 +03:00
|
|
|
static int routeDeleteList(const QString &gw, const QStringList &ips);
|
2025-11-30 18:49:16 -08:00
|
|
|
static bool flushDns();
|
2021-12-15 14:53:07 +03:00
|
|
|
static void resetIpStack();
|
2024-03-27 11:02:34 +00:00
|
|
|
static bool createTun(const QString &dev, const QString &subnet);
|
|
|
|
|
static bool deleteTun(const QString &dev);
|
2025-11-30 18:49:16 -08:00
|
|
|
static bool StartRoutingIpv6();
|
|
|
|
|
static bool StopRoutingIpv6();
|
2024-03-27 11:02:34 +00:00
|
|
|
static bool updateResolvers(const QString& ifname, const QList<QHostAddress>& resolvers);
|
2025-10-02 14:58:53 +02:00
|
|
|
static bool restoreResolvers();
|
2020-12-03 23:27:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // ROUTER_H
|
2021-02-21 09:44:53 -08:00
|
|
|
|