ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/hostmask.h
Revision: 2865
Committed: Sun Jan 19 14:35:22 2014 UTC (11 years, 7 months ago) by michael
Content type: text/x-chdr
File size: 2719 byte(s)
Log Message:
- Clean up all files in include/ (fixed indentation, removed whitespaces/tabs)
- Fixed copyright years

File Contents

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

Properties

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