/[svn]/ircd-hybrid/trunk/include/ipcache.h
ViewVC logotype

Diff of /ircd-hybrid/trunk/include/ipcache.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8592 by michael, Thu Apr 5 12:46:00 2018 UTC revision 8593 by michael, Sun Oct 21 18:11:04 2018 UTC
# Line 26  Line 26 
26    
27  #ifndef INCLUDED_ipcache_h  #ifndef INCLUDED_ipcache_h
28  #define INCLUDED_ipcache_h  #define INCLUDED_ipcache_h
 #include "ircd_defs.h"  
   
 /*  
  * Usually, with hash tables, you use a prime number...  
  * but in this case I am dealing with ip addresses,  
  * not ascii strings.  
  */  
 enum { IP_HASH_SIZE = 0x1000 };  
29    
30  struct ip_entry  struct ip_entry
31  {  {
32    dlink_node node;                /**< Doubly linked list node */    dlink_node node;                /**< List node; linked into ipcache_list */
   struct irc_ssaddr ip;           /**< Holds an IPv6 or IPv4 address */  
33    unsigned int count_local;       /**< Number of local users using this IP */    unsigned int count_local;       /**< Number of local users using this IP */
34    unsigned int count_remote;      /**< Number of remote users using this IP */    unsigned int count_remote;      /**< Number of remote users using this IP */
35    unsigned int connection_count;  /**< Number of connections from this IP in the last throttle_time duration */    unsigned int connection_count;  /**< Number of connections from this IP in the last throttle_time duration */
36    uintmax_t last_attempt;         /**< The last time someone connected from this IP */    uintmax_t last_attempt;         /**< The last time someone connected from this IP */
37  };  };
38    
39  extern struct ip_entry *ipcache_find_or_add_address(const struct irc_ssaddr *);  extern struct ip_entry *ipcache_record_find_or_add(void *);
40  extern void ipcache_remove_address(const struct irc_ssaddr *, int);  extern void ipcache_record_remove(void *, int);
41  extern void ipcache_get_stats(unsigned int *const, size_t *const);  extern void ipcache_get_stats(unsigned int *const, size_t *const);
42  extern void ipcache_init(void);  extern void ipcache_init(void);
43  #endif  #endif

Legend:
Removed from v.8592  
changed lines
  Added in v.8593

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28