6 #ifndef _INC_cNetAddrTracker_H
7 #define _INC_cNetAddrTracker_H
36 static const int k_PINGS_PER_WINDOW = 5 * 10;
72 bool LookupHostName();
77 bool IsNeverDecay()
const;
81 bool IsBlocked()
const;
82 bool SetBlocked(
TIMESECD_t iTimeDecaySeconds,
const char* pszReason);
84 bool onTickAddr(
int iRefCount);
93 bool IncPingBlock(
bool bPreAccept =
false);
94 bool IncBadPassword(
const char* pszAttackedAccountName);
102 m_pAccount = pAccount;
137 return this->Add(pClientAddr);
142 return this->RemoveArgKey(pClientAddr);
149 void onTickAddrArray();
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define CHEAPOBJECT_IMPL
Definition: cHeapObject.h:32
Definition: cClientAddrObj.h:17
Definition: cNetAddrTracker.h:116
UNITTEST_FRIEND(cNetAddrTracker)
bool RemoveLogAddr(cNetAddrTracker *pClientAddr)
Definition: cNetAddrTracker.h:139
ITERATE_t AddLogAddr(cNetAddrTracker *pClientAddr)
Definition: cNetAddrTracker.h:134
Definition: cNetAddrTracker.h:25
cTimeInt m_timeCreated
When was this record created?
Definition: cNetAddrTracker.h:45
cTimeInt m_timeWindowStart
My ping check window started at this time.
Definition: cNetAddrTracker.h:48
int m_iPings
How many pings have we seen since m_timeWindowStart.
Definition: cNetAddrTracker.h:52
cStringA m_sIPHost
Look up this IP host name. reverse DNS lookup. (Maybe async lookup)
Definition: cNetAddrTracker.h:40
int m_iBadPasswords
How many bad passwords since m_timeWindowStart.
Definition: cNetAddrTracker.h:53
cRefBasePtr m_pAccount
associate this IP address with an account. (allow auto log in based on IP?)
Definition: cNetAddrTracker.h:56
cTimeInt m_timeBlockTil
Blocked until this time.
Definition: cNetAddrTracker.h:47
bool m_bTrusted
This is a trusted IP. (don't ever block it. e.g. localhost)
Definition: cNetAddrTracker.h:42
HASHCODE_t get_HashCode() const noexcept
Definition: cNetAddrTracker.h:66
void put_Account(cRefBase *pAccount)
Definition: cNetAddrTracker.h:96
cTimeInt m_timeDecay
Time this record should be gone. (may be set to NEVER)
Definition: cNetAddrTracker.h:46
int get_Pings() const
Transient Activity tracking info.
Definition: cNetAddrTracker.h:87
cStringA m_sDescription
Description of why this IP is blocked. or why we track it.
Definition: cNetAddrTracker.h:41
cNetAddress m_addr
The remote address we are tracking. IP4 OR IP6.
Definition: cNetAddrTracker.h:39
cTimeInt m_timeLastEvent
Last time we last interacted with this IP.
Definition: cNetAddrTracker.h:49
cString get_Name() const
Definition: cNetAddrTracker.h:62
Definition: cNetAddr.h:31
HASHCODE_t get_HashCode() const noexcept
Definition: cNetAddr.h:185
cStringA get_HostStr() const
Definition: cNetAddr.cpp:232
Definition: cSingleton.h:127
Definition: cThreadArray.h:240
Definition: cThreadLockRef.h:20
< similar to the MFC CTime and cTimeSpan, not as accurate or large ranged as COleDateTime
Definition: cTimeInt.h:101
cRefPtr< cNetAddrTracker > cNetAddrTrackPtr
cIUnkPtr
Definition: cNetAddrTracker.h:111
UNITTEST2_PREDEF(cQuadtree)
int ITERATE_t
like size_t but signed
Definition: Index.h:28
int TIMESECD_t
signed delta seconds. like TIMESEC_t. redefined in TimeUnits.h.
Definition: cTimeSys.h:19
__DECL_IMPORT cRefPtr cRefBasePtr
Definition: cRefPtr.h:376
UINT_PTR HASHCODE_t
could hold a pointer converted to a number? maybe 64 or 32 bit ? same as size_t.
Definition: GrayCore.h:116
cStringT< GChar_t > cString
Definition: cString.h:636