ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/hostmask.h
Revision: 1455
Committed: Fri Jun 29 14:16:12 2012 UTC (13 years, 2 months ago) by michael
Content type: text/x-chdr
Original Path: ircd-hybrid-8/include/hostmask.h
File size: 2698 byte(s)
Log Message:
- Minor constification changes

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * hostmask.h: A header for the hostmask code.
4     *
5     * Copyright (C) 2005 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #ifndef INCLUDE_hostmask_h
26     #define INCLUDE_hostmask_h 1
27    
28 michael 1372 #define ATABLE_SIZE 0x1000
29    
30    
31 michael 1367 enum hostmask_type
32 adx 30 {
33     HM_HOST,
34     HM_IPV4,
35     HM_IPV6
36     };
37    
38     struct AddressRec
39     {
40     /* masktype: HM_HOST, HM_IPV4, HM_IPV6 -A1kmm */
41 michael 1367 enum hostmask_type masktype;
42 adx 30
43     union
44     {
45     struct
46     {
47     /* Pointer into AccessItem... -A1kmm */
48     struct irc_ssaddr addr;
49     int bits;
50     } ipa;
51    
52     /* Pointer into AccessItem... -A1kmm */
53     const char *hostname;
54     } Mask;
55    
56 michael 1369 /* type: CONF_CLIENT, CONF_DLINE, CONF_KLINE etc... -A1kmm */
57 michael 1367 unsigned int type;
58 adx 30
59     /* Higher precedences overrule lower ones... */
60 michael 1343 unsigned int precedence;
61 adx 30
62     /* Only checked if !(type & 1)... */
63     const char *username;
64     struct AccessItem *aconf;
65    
66 michael 1367 dlink_node node;
67 adx 30 };
68 michael 1372
69     extern dlink_list atable[ATABLE_SIZE];
70     extern int parse_netmask(const char *, struct irc_ssaddr *, int *);
71 michael 1455 extern int match_ipv6(const struct irc_ssaddr *, const struct irc_ssaddr *, int);
72     extern int match_ipv4(const struct irc_ssaddr *, const struct irc_ssaddr *, int);
73 michael 1372
74     extern void mask_addr(struct irc_ssaddr *, int);
75     extern void init_host_hash(void);
76     extern void add_conf_by_address(const unsigned int, struct AccessItem *);
77     extern void delete_one_address_conf(const char *, struct AccessItem *);
78     extern void clear_out_address_conf(void);
79     extern void hostmask_expire_temporary(void);
80    
81     extern struct AccessItem *find_address_conf(const char *, const char *,
82     struct irc_ssaddr *, int, char *);
83     extern struct AccessItem *find_dline_conf(struct irc_ssaddr *, int);
84     extern struct AccessItem *find_conf_by_address(const char *, struct irc_ssaddr *,
85     unsigned int, int, const char *, const char *, int);
86 adx 30 #endif /* INCLUDE_hostmask_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision