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();
|
|
|
|
|
2017-12-06 13:41:26 +00:00
|
|
|
static int bufferSize();
|
2017-11-01 13:49:11 +00:00
|
|
|
|
2018-01-12 11:33:19 +00:00
|
|
|
static quint32 confIoConfOff();
|
|
|
|
|
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);
|
2017-12-25 15:23:26 +00:00
|
|
|
static int confAppIndex(const void *drvConf,
|
|
|
|
const QString &kernelPath);
|
|
|
|
static quint8 confAppGroupIndex(const void *drvConf, int appIndex);
|
|
|
|
static bool confAppBlocked(const void *drvConf, int appIndex);
|
2017-09-03 09:20:37 +00:00
|
|
|
|
|
|
|
static void provUnregister();
|
2017-08-25 16:04:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FORTCOMMON_H
|