--- ircd-hybrid/trunk/include/ipcache.h 2018/10/21 16:02:02 8592 +++ ircd-hybrid/trunk/include/ipcache.h 2018/10/21 18:11:04 8593 @@ -26,27 +26,18 @@ #ifndef 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 }; struct ip_entry { - dlink_node node; /**< Doubly linked list node */ - struct irc_ssaddr ip; /**< Holds an IPv6 or IPv4 address */ + dlink_node node; /**< List node; linked into ipcache_list */ unsigned int count_local; /**< Number of local users using this IP */ unsigned int count_remote; /**< Number of remote users using this IP */ unsigned int connection_count; /**< Number of connections from this IP in the last throttle_time duration */ uintmax_t last_attempt; /**< The last time someone connected from this IP */ }; -extern struct ip_entry *ipcache_find_or_add_address(const struct irc_ssaddr *); -extern void ipcache_remove_address(const struct irc_ssaddr *, int); +extern struct ip_entry *ipcache_record_find_or_add(void *); +extern void ipcache_record_remove(void *, int); extern void ipcache_get_stats(unsigned int *const, size_t *const); extern void ipcache_init(void); #endif