X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c9803e4ca6534ffb9ff9f5c892e3e9705b327245..3e32eb8e48a56bca543faa522909d3d83538c55d:/projects/stargazer/plugins/authorization/inetaccess/antiflood.h diff --git a/projects/stargazer/plugins/authorization/inetaccess/antiflood.h b/projects/stargazer/plugins/authorization/inetaccess/antiflood.h deleted file mode 100644 index 2c0f5965..00000000 --- a/projects/stargazer/plugins/authorization/inetaccess/antiflood.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 27.10.2002 - */ - -/* - * Author : Boris Mikhailenko - */ - - -#ifndef ANTIFLOOD_H -#define ANTIFLOOD_H - - -#include - -#include "bsp.h" -#include "os_int.h" - -#define FLOOD_LBL_MAX (10) - -//----------------------------------------------------------------------------- -struct FLOOD_NODE -{ -uint32_t ip; -uint64_t timeIP[FLOOD_LBL_MAX]; -int pos; -bool logged; -}; - -//----------------------------------------------------------------------------- -class ANTIFLOOD -{ -public: - ANTIFLOOD(); - bool AllowIP(uint32_t ip, bool * logged); - void Clean(); - void SetAvrgTime(uint64_t); - -private: - uint64_t CalcAvrgNodeTime(FLOOD_NODE * fn); - void AddNode(uint32_t ip); - void UpdateNodeTime(FLOOD_NODE * node); - - TREE floodTree; - struct timeval tv; - uint64_t avrgTime; - uint64_t currentTime; -}; -//----------------------------------------------------------------------------- - -#endif - - - -