29 #ifndef CATEMPIPBLOCKLIST_HPP
30 #define CATEMPIPBLOCKLIST_HPP
32 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
struct _tempipblocklist_t * PTEMPIPBLOCKLIST
The purpose of this class is storing the IPs of JAP users who tried to hack/attack the payment system...
UINT64 m_validTimeMillis
the time that each blocked IP should stay in the List
CAMutex * m_pMutex
Used for locking the datastructure to make it threadsafe.
void setValidTimeMillis(UINT64 millis)
set the time (in Milliseconds) that each blocked IP should stay valid in the list
CAThread * m_pCleanupThread
this thread cleans up the hashtable and removes old entries
PTEMPIPBLOCKLIST * m_hashTable
the buffer where the entries are stored
SINT32 insertIP(const UINT8 ip[4])
inserts an IP into the blocklist
volatile bool m_bRunCleanupThread
as long as true the clenaupthread does his job.
CATempIPBlockList(UINT64 validTimeMillis)
static THREAD_RETURN cleanupThreadMainLoop(void *param)
the cleanup thread main loop
SINT32 checkIP(const UINT8 ip[4])
check whether an IP is blocked
struct _tempipblocklist_t * next
Next element, NULL if element is the last one.
UINT64 validTimeMillis
Entry is valid until getCurrentTimeMillis() > validTimeMillis.
UINT8 ip[2]
First two Bytes of the IP-Address.