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);
|
|
|
|
|
2017-11-24 08:53:11 +00:00
|
|
|
static quint32 logProcNewHeaderSize();
|
|
|
|
static quint32 logProcNewSize(quint32 pathLen);
|
|
|
|
|
2017-11-29 10:12:34 +00:00
|
|
|
static quint32 logStatHeaderSize();
|
|
|
|
static quint32 logStatProcSize(quint16 procCount);
|
2017-11-27 07:04:10 +00:00
|
|
|
static quint32 logStatTrafSize(quint16 procCount);
|
2017-11-29 10:12:34 +00:00
|
|
|
static quint32 logStatSize(quint16 procCount);
|
2017-11-27 07:04:10 +00:00
|
|
|
|
2017-11-07 12:15:58 +00:00
|
|
|
static quint32 logType(const char *input);
|
|
|
|
|
2017-11-01 13:49:11 +00:00
|
|
|
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-11-24 08:53:11 +00:00
|
|
|
static void logProcNewHeaderWrite(char *output,
|
|
|
|
quint32 pid, quint32 pathLen);
|
|
|
|
static void logProcNewHeaderRead(const char *input,
|
|
|
|
quint32 *pid, quint32 *pathLen);
|
|
|
|
|
2017-11-27 07:04:10 +00:00
|
|
|
static void logStatTrafHeaderRead(const char *input,
|
|
|
|
quint16 *procCount);
|
|
|
|
|
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-05 04:40:11 +00:00
|
|
|
const QString &kernelPath);
|
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
|