mirror of
https://github.com/tnodir/fort
synced 2024-11-15 01:55:44 +00:00
UI: Rename ConfConstData to ConfRoData
This commit is contained in:
parent
53488c1b4f
commit
1492dd9b83
@ -191,8 +191,8 @@ SOURCES += \
|
|||||||
util/conf/addressrange.cpp \
|
util/conf/addressrange.cpp \
|
||||||
util/conf/appparseoptions.cpp \
|
util/conf/appparseoptions.cpp \
|
||||||
util/conf/confbuffer.cpp \
|
util/conf/confbuffer.cpp \
|
||||||
util/conf/confconstdata.cpp \
|
|
||||||
util/conf/confdata.cpp \
|
util/conf/confdata.cpp \
|
||||||
|
util/conf/confrodata.cpp \
|
||||||
util/conf/confutil.cpp \
|
util/conf/confutil.cpp \
|
||||||
util/conf/ruletextparser.cpp \
|
util/conf/ruletextparser.cpp \
|
||||||
util/dateutil.cpp \
|
util/dateutil.cpp \
|
||||||
@ -426,8 +426,8 @@ HEADERS += \
|
|||||||
util/conf/conf_types.h \
|
util/conf/conf_types.h \
|
||||||
util/conf/confappswalker.h \
|
util/conf/confappswalker.h \
|
||||||
util/conf/confbuffer.h \
|
util/conf/confbuffer.h \
|
||||||
util/conf/confconstdata.h \
|
|
||||||
util/conf/confdata.h \
|
util/conf/confdata.h \
|
||||||
|
util/conf/confrodata.h \
|
||||||
util/conf/confruleswalker.h \
|
util/conf/confruleswalker.h \
|
||||||
util/conf/confutil.h \
|
util/conf/confutil.h \
|
||||||
util/conf/ruletextparser.h \
|
util/conf/ruletextparser.h \
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <util/stringutil.h>
|
#include <util/stringutil.h>
|
||||||
|
|
||||||
#include "confappswalker.h"
|
#include "confappswalker.h"
|
||||||
#include "confconstdata.h"
|
#include "confrodata.h"
|
||||||
#include "confruleswalker.h"
|
#include "confruleswalker.h"
|
||||||
#include "confutil.h"
|
#include "confutil.h"
|
||||||
#include "ruletextparser.h"
|
#include "ruletextparser.h"
|
||||||
@ -349,7 +349,7 @@ bool ConfBuffer::loadZone(IpRange &ipRange)
|
|||||||
const char *data = buffer().data();
|
const char *data = buffer().data();
|
||||||
uint bufSize = buffer().size();
|
uint bufSize = buffer().size();
|
||||||
|
|
||||||
return ConfConstData(data).loadAddressList(ipRange, bufSize);
|
return ConfRoData(data).loadAddressList(ipRange, bufSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfBuffer::parseAddressGroups(const QList<AddressGroup *> &addressGroups,
|
bool ConfBuffer::parseAddressGroups(const QList<AddressGroup *> &addressGroups,
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#include "confconstdata.h"
|
#include "confrodata.h"
|
||||||
|
|
||||||
#include <common/fortconf.h>
|
#include <common/fortconf.h>
|
||||||
|
|
||||||
ConfConstData::ConfConstData(const void *data) : m_data((const char *) data) { }
|
ConfRoData::ConfRoData(const void *data) : m_data((const char *) data) { }
|
||||||
|
|
||||||
bool ConfConstData::loadAddressList(IpRange &ipRange, uint &bufSize)
|
bool ConfRoData::loadAddressList(IpRange &ipRange, uint &bufSize)
|
||||||
{
|
{
|
||||||
return loadIpRange(ipRange, bufSize)
|
return loadIpRange(ipRange, bufSize)
|
||||||
&& (bufSize == 0 || loadIpRange(ipRange, bufSize, /*isIPv6=*/true));
|
&& (bufSize == 0 || loadIpRange(ipRange, bufSize, /*isIPv6=*/true));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfConstData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6)
|
bool ConfRoData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6)
|
||||||
{
|
{
|
||||||
if (bufSize < FORT_CONF_ADDR_LIST_OFF)
|
if (bufSize < FORT_CONF_ADDR_LIST_OFF)
|
||||||
return false;
|
return false;
|
||||||
@ -48,17 +48,17 @@ bool ConfConstData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfConstData::loadLongs(longs_arr_t &array)
|
void ConfRoData::loadLongs(longs_arr_t &array)
|
||||||
{
|
{
|
||||||
loadData(array.data(), array.size(), sizeof(quint32));
|
loadData(array.data(), array.size(), sizeof(quint32));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfConstData::loadIp6Array(ip6_arr_t &array)
|
void ConfRoData::loadIp6Array(ip6_arr_t &array)
|
||||||
{
|
{
|
||||||
loadData(array.data(), array.size(), sizeof(ip6_addr_t));
|
loadData(array.data(), array.size(), sizeof(ip6_addr_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfConstData::loadData(void *dst, int elemCount, uint elemSize)
|
void ConfRoData::loadData(void *dst, int elemCount, uint elemSize)
|
||||||
{
|
{
|
||||||
const size_t arraySize = size_t(elemCount) * elemSize;
|
const size_t arraySize = size_t(elemCount) * elemSize;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFCONSTDATA_H
|
#ifndef CONFRODATA_H
|
||||||
#define CONFCONSTDATA_H
|
#define CONFRODATA_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
#include "conf_types.h"
|
#include "conf_types.h"
|
||||||
|
|
||||||
class ConfConstData
|
class ConfRoData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ConfConstData(const void *data);
|
explicit ConfRoData(const void *data);
|
||||||
|
|
||||||
bool loadAddressList(IpRange &ipRange, uint &bufSize);
|
bool loadAddressList(IpRange &ipRange, uint &bufSize);
|
||||||
bool loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6 = false);
|
bool loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6 = false);
|
||||||
@ -23,4 +23,4 @@ private:
|
|||||||
const char *m_data = nullptr;
|
const char *m_data = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFCONSTDATA_H
|
#endif // CONFRODATA_H
|
Loading…
Reference in New Issue
Block a user