From 69595de83bf0429c67cc25a6e3651f3f1e0d1f04 Mon Sep 17 00:00:00 2001 From: katze Date: Wed, 11 Nov 2020 02:46:54 +0100 Subject: Upload files to 'tool/PGListUtil/src/common' --- tool/PGListUtil/src/common/CIpList.h | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tool/PGListUtil/src/common/CIpList.h (limited to 'tool/PGListUtil/src/common/CIpList.h') diff --git a/tool/PGListUtil/src/common/CIpList.h b/tool/PGListUtil/src/common/CIpList.h new file mode 100644 index 00000000..591c3877 --- /dev/null +++ b/tool/PGListUtil/src/common/CIpList.h @@ -0,0 +1,56 @@ +#ifndef CIPLIST_H +#define CIPLIST_H + +#include +#include +#include "common.h" +#include "CFilter.h" + +namespace pglu { +namespace ip { + +struct CIp { + char * caption; + union { + ulong ip64; + uint ip32[2]; + uchar ip8[8]; + }; + CIp * next; +}; + +class CIpList { +private: + boost::pool<> m_poolIp; + CIp m_ipHead; + CIp * m_ipFoot; + + filter::CFilter m_filter; + + int m_count; + int m_countDisabled; + + CIp * CreateIp(boost::xpressive::cmatch & match); + +public: + CIpList(); + ~CIpList(); + + void Clear(); + + void SetFilter(const char *filter, const filter::EFilterMode mode, const bool del); + void UnSetFilter(); + + bool LoadListFile(const char *path); + bool SaveListFile(const char *path, const bool append); + + void CheckAndSort(const bool sortCap, const bool sortIp, const bool delDupIp); + + int Count(); + int CountDisabled(); +}; + +} // namespace ip +} // namespace pglu + +#endif // CIPLIST_H -- cgit v1.2.3