ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/hostmask.h
Revision: 1644
Committed: Tue Nov 6 22:20:16 2012 UTC (12 years, 9 months ago) by michael
Content type: text/x-chdr
File size: 2684 byte(s)
Log Message:
- More config subsystem cleanups

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 michael 1644 /* type: CONF_CLIENT, CONF_DLINE, CONF_KLINE etc... -A1kmm */
43     enum maskitem_type type;
44 adx 30
45     union
46     {
47     struct
48     {
49 michael 1632 /* Pointer into MaskItem... -A1kmm */
50 adx 30 struct irc_ssaddr addr;
51     int bits;
52     } ipa;
53    
54 michael 1632 /* Pointer into MaskItem... -A1kmm */
55 adx 30 const char *hostname;
56     } Mask;
57    
58     /* Higher precedences overrule lower ones... */
59 michael 1343 unsigned int precedence;
60 adx 30
61     /* Only checked if !(type & 1)... */
62     const char *username;
63 michael 1632 struct MaskItem *conf;
64 adx 30
65 michael 1367 dlink_node node;
66 adx 30 };
67 michael 1372
68     extern dlink_list atable[ATABLE_SIZE];
69     extern int parse_netmask(const char *, struct irc_ssaddr *, int *);
70 michael 1455 extern int match_ipv6(const struct irc_ssaddr *, const struct irc_ssaddr *, int);
71     extern int match_ipv4(const struct irc_ssaddr *, const struct irc_ssaddr *, int);
72 michael 1372
73     extern void mask_addr(struct irc_ssaddr *, int);
74     extern void init_host_hash(void);
75 michael 1632 extern void add_conf_by_address(const unsigned int, struct MaskItem *);
76     extern void delete_one_address_conf(const char *, struct MaskItem *);
77 michael 1372 extern void clear_out_address_conf(void);
78     extern void hostmask_expire_temporary(void);
79    
80 michael 1632 extern struct MaskItem *find_address_conf(const char *, const char *,
81 michael 1372 struct irc_ssaddr *, int, char *);
82 michael 1632 extern struct MaskItem *find_dline_conf(struct irc_ssaddr *, int);
83     extern struct MaskItem *find_conf_by_address(const char *, struct irc_ssaddr *,
84     unsigned int, int, const char *, const char *, int);
85 adx 30 #endif /* INCLUDE_hostmask_h */

Properties

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