Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Cedar/Listener.h')
-rw-r--r--src/Cedar/Listener.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Cedar/Listener.h b/src/Cedar/Listener.h
index c5dafddb..7730d340 100644
--- a/src/Cedar/Listener.h
+++ b/src/Cedar/Listener.h
@@ -109,6 +109,16 @@
// Function to call when receiving a new connection
typedef void (NEW_CONNECTION_PROC)(CONNECTION *c);
+// DOS attack list
+struct DOS
+{
+ IP IpAddress; // IP address
+ UINT64 FirstConnectedTick; // Time which a client connects at the first time
+ UINT64 LastConnectedTick; // Time which a client connected at the last time
+ UINT64 CurrentExpireSpan; // Current time-out period of this record
+ UINT64 DeleteEntryTick; // Time planned to delete this entry
+ UINT AccessCount; // The number of accesses
+};
// Listener structure
@@ -125,6 +135,8 @@ struct LISTENER
volatile bool Halt; // Halting flag
UINT Status; // State
+ LIST *DosList; // DOS attack list
+ UINT64 DosListLastRefreshTime; // Time that the DOS list is refreshed at the last
THREAD_PROC *ThreadProc; // Thread procedure
void *ThreadParam; // Thread parameters
@@ -199,6 +211,11 @@ void FreeDynamicListener(DYNAMIC_LISTENER *d);
bool ListenerRUDPRpcRecvProc(RUDP_STACK *r, UDPPACKET *p);
void ListenerSetProcRecvRpcEnable(bool b);
+int CompareDos(void *p1, void *p2);
+DOS *SearchDosList(LISTENER *r, IP *ip);
+void RefreshDosList(LISTENER *r);
+bool CheckDosAttack(LISTENER *r, SOCK *s);
+bool RemoveDosEntry(LISTENER *r, SOCK *s);
#endif // LISTENER_H