Files
amnezia-client/service/server/killswitch.h
2026-04-10 23:06:16 +03:00

32 lines
791 B
C++

#ifndef KILLSWITCH_H
#define KILLSWITCH_H
#include <QJsonObject>
#include <QSharedPointer>
#include "secure_qsettings.h"
class KillSwitch : public QObject
{
Q_OBJECT
public:
static KillSwitch *instance();
bool init();
bool refresh(bool enabled);
bool disableKillSwitch();
bool disableAllTraffic();
bool enablePeerTraffic(const QJsonObject &configStr);
bool enableKillSwitch(const QJsonObject &configStr, int vpnAdapterIndex);
bool resetAllowedRange(const QStringList &ranges);
bool addAllowedRange(const QStringList &ranges);
bool isStrictKillSwitchEnabled();
private:
explicit KillSwitch(QObject* parent) : QObject(parent) {}
QStringList m_allowedRanges;
QSharedPointer<SecureQSettings> m_appSettigns;
};
#endif // KILLSWITCH_H