2017-08-25 16:04:46 +00:00
|
|
|
#ifndef FORTCOMMON_H
|
|
|
|
#define FORTCOMMON_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2017-11-01 13:49:11 +00:00
|
|
|
#include <QString>
|
2017-08-25 16:04:46 +00:00
|
|
|
|
|
|
|
class FortCommon : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FortCommon(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
static QString deviceName();
|
|
|
|
|
|
|
|
static quint32 ioctlSetConf();
|
|
|
|
static quint32 ioctlSetFlags();
|
|
|
|
static quint32 ioctlGetLog();
|
|
|
|
|
|
|
|
static quint32 bufferSize();
|
2017-11-01 13:49:11 +00:00
|
|
|
|
|
|
|
static quint32 logBlockedHeaderSize();
|
|
|
|
static quint32 logBlockedSize(quint32 pathLen);
|
|
|
|
|
|
|
|
static void logBlockedHeaderWrite(char *output,
|
|
|
|
quint32 remoteIp, quint32 pid,
|
|
|
|
quint32 pathLen);
|
|
|
|
static void logBlockedHeaderRead(const char *input,
|
|
|
|
quint32 *remoteIp, quint32 *pid,
|
|
|
|
quint32 *pathLen);
|
2017-08-29 08:40:23 +00:00
|
|
|
|
2017-08-30 08:34:37 +00:00
|
|
|
static void confAppPermsMaskInit(void *drvConf);
|
2017-08-29 08:40:23 +00:00
|
|
|
static bool confIpInRange(const void *drvConf, quint32 ip,
|
|
|
|
bool included = false);
|
|
|
|
static bool confAppBlocked(const void *drvConf,
|
2017-11-01 14:06:47 +00:00
|
|
|
const QString &kernelPath, bool *notify = nullptr);
|
2017-09-03 09:20:37 +00:00
|
|
|
|
2017-10-27 10:59:09 +00:00
|
|
|
static uint provRegister(bool isBoot);
|
2017-09-03 09:20:37 +00:00
|
|
|
static void provUnregister();
|
2017-08-25 16:04:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FORTCOMMON_H
|