/usr/include/ircd-hybrid-8/ipcache.h is in hybrid-dev 1:8.2.22+dfsg.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | /*
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
*
* Copyright (c) 1997-2017 ircd-hybrid development team
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
/*! \file ipcache.h
* \brief Routines to count connections from particular IP addresses.
* \version $Id: ipcache.h 7925 2016-12-31 13:57:24Z michael $
*/
#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 */
unsigned int count; /**< Number of registered 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 *);
extern void ipcache_get_stats(unsigned int *const, size_t *const);
extern void ipcache_init(void);
#endif
|