mirror of
https://github.com/tnodir/fort
synced 2024-11-17 15:45:49 +00:00
81ee760f31
And fix tests.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#ifndef FORTCOMMON_H
|
|
#define FORTCOMMON_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
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();
|
|
|
|
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);
|
|
|
|
static void confAppPermsMaskInit(void *drvConf);
|
|
static bool confIpInRange(const void *drvConf, quint32 ip,
|
|
bool included = false);
|
|
static bool confAppBlocked(const void *drvConf,
|
|
const QString &kernelPath, bool *notify = 0);
|
|
|
|
static uint provRegister(bool isBoot);
|
|
static void provUnregister();
|
|
};
|
|
|
|
#endif // FORTCOMMON_H
|