]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * solanum | |
3 | * authproc.h: A header with the authd functions. | |
4 | * | |
5 | * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center | |
6 | * Copyright (C) 1996-2002 Hybrid Development Team | |
7 | * Copyright (C) 2002-2012 ircd-ratbox development team | |
8 | * Copyright (C) 2016 William Pitcock <nenolod@dereferenced.org> | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; either version 2 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * This program is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with this program; if not, write to the Free Software | |
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | |
23 | * USA | |
24 | */ | |
25 | ||
26 | #ifndef SOLANUM_AUTHD_H | |
27 | #define SOLANUM_AUTHD_H | |
28 | ||
29 | #include "stdinc.h" | |
30 | #include "rb_dictionary.h" | |
31 | #include "client.h" | |
32 | ||
33 | struct DNSBLEntryStats | |
34 | { | |
35 | char *host; | |
36 | uint8_t iptype; | |
37 | unsigned int hits; | |
38 | }; | |
39 | ||
40 | struct OPMScanner | |
41 | { | |
42 | char type[16]; /* Type of proxy */ | |
43 | uint16_t port; /* Port */ | |
44 | ||
45 | rb_dlink_node node; | |
46 | }; | |
47 | ||
48 | struct OPMListener | |
49 | { | |
50 | char ipaddr[HOSTIPLEN]; /* Listener address */ | |
51 | uint16_t port; /* Listener port */ | |
52 | }; | |
53 | ||
54 | enum | |
55 | { | |
56 | LISTEN_IPV4, | |
57 | LISTEN_IPV6, | |
58 | LISTEN_LAST, | |
59 | }; | |
60 | ||
61 | extern rb_helper *authd_helper; | |
62 | ||
63 | extern rb_dictionary *dnsbl_stats; | |
64 | extern rb_dlink_list opm_list; | |
65 | extern struct OPMListener opm_listeners[LISTEN_LAST]; | |
66 | ||
67 | void init_authd(void); | |
68 | void configure_authd(void); | |
69 | void restart_authd(void); | |
70 | void rehash_authd(void); | |
71 | void check_authd(void); | |
72 | ||
73 | void authd_initiate_client(struct Client *, bool defer); | |
74 | void authd_deferred_client(struct Client *); | |
75 | void authd_accept_client(struct Client *client_p, const char *ident, const char *host); | |
76 | void authd_reject_client(struct Client *client_p, const char *ident, const char *host, char cause, const char *data, const char *reason); | |
77 | void authd_abort_client(struct Client *); | |
78 | ||
79 | void add_dnsbl_entry(const char *host, const char *reason, uint8_t iptype, rb_dlink_list *filters); | |
80 | void del_dnsbl_entry(const char *host); | |
81 | void del_dnsbl_entry_all(void); | |
82 | ||
83 | bool set_authd_timeout(const char *key, int timeout); | |
84 | void ident_check_enable(bool enabled); | |
85 | ||
86 | void conf_create_opm_listener(const char *ip, uint16_t port); | |
87 | void create_opm_listener(const char *ip, uint16_t port); | |
88 | void conf_create_opm_proxy_scanner(const char *type, uint16_t port); | |
89 | void create_opm_proxy_scanner(const char *type, uint16_t port); | |
90 | void delete_opm_proxy_scanner(const char *type, uint16_t port); | |
91 | void delete_opm_proxy_scanner_all(void); | |
92 | void delete_opm_listener_all(void); | |
93 | void opm_check_enable(bool enabled); | |
94 | ||
95 | #endif |