attack.h (444B)
1 #ifndef _ATTACK_H 2 #define _ATTACK_H 3 4 #include <time.h> 5 6 #include "queue.h" 7 8 extern int fd_black; 9 extern int fd_white; 10 11 enum list { 12 BLACK, 13 WHITE, 14 GREY, 15 }; 16 17 struct attacker { 18 char ip[16]; 19 int nban; /* [-1,8] */ 20 time_t last; 21 enum list list; 22 SLIST_ENTRY(attacker) attackers; 23 }; 24 25 int blacklist(struct attacker *); 26 int whitelist(struct attacker *); 27 int isattack(char *, char *); 28 int isexpire(struct attacker *); 29 int islogin(char *); 30 31 #endif