unrealircd- supernets unrealircd source & configuration |
git clone git://git.acid.vegas/unrealircd.git |
Log | Files | Refs | Archive |
dynconf.h (12174B)
1 /************************************************************************ 2 * Unreal Internet Relay Chat Daemon, include/dynconf.h 3 * Copyright (C) 1999-2003 Carsten Munk 4 * Copyright (C) 2003-2021 Bram Matthys 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 1, or (at your option) 9 * 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., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * 20 * $Id$ 21 */ 22 23 24 #define DYNCONF_H 25 26 typedef struct FloodSettings FloodSettings; 27 28 struct FloodSettings { 29 FloodSettings *prev, *next; 30 char *name; 31 int limit[MAXFLOODOPTIONS]; 32 long period[MAXFLOODOPTIONS]; 33 }; 34 35 enum UHAllowed { UHALLOW_ALWAYS, UHALLOW_NOCHANS, UHALLOW_REJOIN, UHALLOW_NEVER }; 36 37 struct ChMode { 38 long mode; 39 long extmodes; 40 char *extparams[256]; 41 }; 42 43 typedef struct OperStat { 44 struct OperStat *prev, *next; 45 char *flag; 46 } OperStat; 47 48 typedef enum BroadcastChannelMessagesOption { BROADCAST_CHANNEL_MESSAGES_AUTO=1, BROADCAST_CHANNEL_MESSAGES_ALWAYS=2, BROADCAST_CHANNEL_MESSAGES_NEVER=3 } BroadcastChannelMessagesOption; 49 50 typedef enum AllowedChannelChars { ALLOWED_CHANNELCHARS_ANY=1, ALLOWED_CHANNELCHARS_ASCII=2, ALLOWED_CHANNELCHARS_UTF8=3 } AllowedChannelChars; 51 52 typedef enum BanTarget { BAN_TARGET_IP=1, BAN_TARGET_USERIP=2, BAN_TARGET_HOST=3, BAN_TARGET_USERHOST=4, BAN_TARGET_ACCOUNT=5, BAN_TARGET_CERTFP=6 } BanTarget; 53 54 typedef enum HideIdleTimePolicy { HIDE_IDLE_TIME_NEVER=1, HIDE_IDLE_TIME_ALWAYS=2, HIDE_IDLE_TIME_USERMODE=3, HIDE_IDLE_TIME_OPER_USERMODE=4 } HideIdleTimePolicy; 55 56 typedef enum LimitSVSCMDS { LIMIT_SVSCMDS_SERVERS=0, LIMIT_SVSCMDS_ULINES=1 } LimitSVSCMDS; 57 58 typedef enum HideBanReasonOption { HIDE_BAN_REASON_NO=0, HIDE_BAN_REASON_YES=1, HIDE_BAN_REASON_AUTO=2 } HideBanReasonOption; 59 60 /** The set { } block configuration */ 61 typedef struct Configuration Configuration; 62 struct Configuration { 63 unsigned show_opermotd:1; 64 unsigned hide_ulines:1; 65 unsigned flat_map:1; 66 unsigned ident_check:1; 67 unsigned fail_oper_warn:1; 68 unsigned show_connect_info:1; 69 unsigned no_connect_tls_info:1; 70 unsigned dont_resolve:1; 71 unsigned use_ban_version:1; 72 unsigned mkpasswd_for_everyone:1; 73 unsigned allow_insane_bans; 74 unsigned allow_part_if_shunned:1; 75 unsigned disable_cap:1; 76 unsigned check_target_nick_bans:1; 77 HideBanReasonOption hide_ban_reason; 78 int hide_killed_by; 79 char *link_bindip; 80 long throttle_period; 81 char throttle_count; 82 char *kline_address; 83 char *gline_address; 84 long oper_modes; 85 char *oper_snomask; 86 char *oper_auto_join_chans; 87 char *oper_vhost; 88 char *allow_user_stats; 89 OperStat *allow_user_stats_ext; 90 int ping_warning; 91 int maxdccallow; 92 int anti_spam_quit_message_time; 93 TLSOptions *tls_options; 94 Policy plaintext_policy_user; 95 MultiLine *plaintext_policy_user_message; 96 Policy plaintext_policy_oper; 97 MultiLine *plaintext_policy_oper_message; 98 Policy plaintext_policy_server; 99 Policy outdated_tls_policy_user; 100 char *outdated_tls_policy_user_message; 101 Policy outdated_tls_policy_oper; 102 char *outdated_tls_policy_oper_message; 103 Policy outdated_tls_policy_server; 104 enum UHAllowed userhost_allowed; 105 char *restrict_channelmodes; 106 char *restrict_extendedbans; 107 int named_extended_bans; 108 char *channel_command_prefix; 109 long handshake_data_flood_amount; 110 long handshake_data_flood_ban_time; 111 BanAction *handshake_data_flood_ban_action; 112 struct ChMode modes_on_join; 113 int modes_on_join_set; 114 char *level_on_join; 115 FloodSettings *floodsettings; 116 int ident_connect_timeout; 117 int ident_read_timeout; 118 long default_bantime; 119 int who_limit; 120 int silence_limit; 121 long ban_version_tkl_time; 122 long spamfilter_ban_time; 123 char *spamfilter_ban_reason; 124 char *spamfilter_virus_help_channel; 125 char spamfilter_vchan_deny; 126 SecurityGroup *spamfilter_except; 127 char *spamexcept_line; 128 long spamfilter_detectslow_warn; 129 long spamfilter_detectslow_fatal; 130 int spamfilter_stop_on_first_match; 131 int spamfilter_utf8; 132 SpamfilterShowMessageContentOnHit spamfilter_show_message_content_on_hit; 133 char *central_spamfilter_url; 134 char *central_spamfilter_feed; 135 long central_spamfilter_refresh_time; 136 int central_spamfilter_verbose; 137 int central_spamfilter_enabled; 138 SecurityGroup *central_spamfilter_except; 139 BanActionValue central_spamfilter_limit_ban_action; 140 long central_spamfilter_limit_ban_time; 141 int maxbans; 142 int watch_away_notification; 143 int uhnames; 144 unsigned short default_ipv6_clone_mask; 145 int ping_cookie; 146 int min_nick_length; 147 int nick_length; 148 int topic_length; 149 int kick_length; 150 int quit_length; 151 int away_length; 152 int hide_list; 153 int max_unknown_connections_per_ip; 154 long handshake_timeout; 155 long sasl_timeout; 156 long handshake_delay; 157 long handshake_boot_delay; 158 BanTarget automatic_ban_target; 159 BanTarget manual_ban_target; 160 char *reject_message_too_many_connections; 161 char *reject_message_server_full; 162 char *reject_message_unauthorized; 163 char *reject_message_kline; 164 char *reject_message_gline; 165 int topic_setter; 166 int ban_setter; 167 int ban_setter_sync; 168 int part_instead_of_quit_on_comment_change; 169 BroadcastChannelMessagesOption broadcast_channel_messages; 170 AllowedChannelChars allowed_channelchars; 171 HideIdleTimePolicy hide_idle_time; 172 unsigned inah:1; 173 char *network_name; 174 char *network_name_005; 175 char *default_server; 176 char *services_name; 177 char *cloak_prefix; 178 char *prefix_quit; 179 char *helpchan; 180 char *stats_server; 181 char *sasl_server; 182 int server_notice_colors; 183 int server_notice_show_event; 184 LimitSVSCMDS limit_svscmds; 185 int high_connection_rate; 186 int dns_client_timeout; 187 int dns_client_retry; 188 int dns_dnsbl_timeout; 189 int dns_dnsbl_retry; 190 }; 191 192 extern MODVAR Configuration iConf; 193 extern MODVAR Configuration tempiConf; 194 extern MODVAR int ipv6_disabled; 195 196 typedef struct BestPractices BestPractices; 197 struct BestPractices { 198 int hashed_passwords; /**< Use hashed passwords */ 199 int hashed_passwords_hits; /**< How many times advice has been given (like 'warnings' but it is advice) */ 200 }; 201 extern MODVAR BestPractices bestpractices; 202 203 #define KLINE_ADDRESS iConf.kline_address 204 #define GLINE_ADDRESS iConf.gline_address 205 #define OPER_MODES iConf.oper_modes 206 #define OPER_SNOMASK iConf.oper_snomask 207 #define SHOWOPERMOTD iConf.show_opermotd 208 #define HIDE_ULINES iConf.hide_ulines 209 #define FLAT_MAP iConf.flat_map 210 #define ALLOW_CHATOPS iConf.allow_chatops 211 #define PINGWARNING iConf.ping_warning 212 #define MAXDCCALLOW iConf.maxdccallow 213 #define DONT_RESOLVE iConf.dont_resolve 214 #define OPER_AUTO_JOIN_CHANS iConf.oper_auto_join_chans 215 #define LINK_BINDIP iConf.link_bindip 216 #define IDENT_CHECK iConf.ident_check 217 #define FAILOPER_WARN iConf.fail_oper_warn 218 #define SHOWCONNECTINFO iConf.show_connect_info 219 #define NOCONNECTTLSLINFO iConf.no_connect_tls_info 220 #define ALLOW_USER_STATS iConf.allow_user_stats 221 #define ANTI_SPAM_QUIT_MSG_TIME iConf.anti_spam_quit_message_time 222 223 #define NETWORK_NAME iConf.network_name 224 #define NETWORK_NAME_005 iConf.network_name_005 225 #define DEFAULT_SERVER iConf.default_server 226 #define SERVICES_NAME iConf.services_name 227 #define CLOAK_PREFIX iConf.cloak_prefix 228 #define HELP_CHANNEL iConf.helpchan 229 #define STATS_SERVER iConf.stats_server 230 #define SASL_SERVER iConf.sasl_server 231 #define iNAH iConf.inah 232 #define PREFIX_QUIT iConf.prefix_quit 233 234 #define UHOST_ALLOWED iConf.userhost_allowed 235 #define RESTRICT_CHANNELMODES iConf.restrict_channelmodes 236 #define RESTRICT_EXTENDEDBANS iConf.restrict_extendedbans 237 #define THROTTLING_PERIOD iConf.throttle_period 238 #define THROTTLING_COUNT iConf.throttle_count 239 #define USE_BAN_VERSION iConf.use_ban_version 240 #define MODES_ON_JOIN iConf.modes_on_join.extmodes 241 #define LEVEL_ON_JOIN iConf.level_on_join 242 243 #define IDENT_CONNECT_TIMEOUT iConf.ident_connect_timeout 244 #define IDENT_READ_TIMEOUT iConf.ident_read_timeout 245 246 #define MKPASSWD_FOR_EVERYONE iConf.mkpasswd_for_everyone 247 #define HIDE_BAN_REASON iConf.hide_ban_reason 248 #define ALLOW_INSANE_BANS iConf.allow_insane_bans 249 #define CHANCMDPFX iConf.channel_command_prefix 250 251 #define DEFAULT_BANTIME iConf.default_bantime 252 #define WHOLIMIT iConf.who_limit 253 254 #define ALLOW_PART_IF_SHUNNED iConf.allow_part_if_shunned 255 256 #define DISABLE_CAP iConf.disable_cap 257 258 #define DISABLE_IPV6 ipv6_disabled 259 260 #define BAN_VERSION_TKL_TIME iConf.ban_version_tkl_time 261 #define SILENCE_LIMIT (iConf.silence_limit ? iConf.silence_limit : 15) 262 263 #define SPAMFILTER_BAN_TIME iConf.spamfilter_ban_time 264 #define SPAMFILTER_BAN_REASON iConf.spamfilter_ban_reason 265 #define SPAMFILTER_VIRUSCHAN iConf.spamfilter_virus_help_channel 266 #define SPAMFILTER_VIRUSCHANDENY iConf.spamfilter_vchan_deny 267 #define SPAMFILTER_EXCEPT iConf.spamexcept_line 268 #define SPAMFILTER_DETECTSLOW_WARN iConf.spamfilter_detectslow_warn 269 #define SPAMFILTER_DETECTSLOW_FATAL iConf.spamfilter_detectslow_fatal 270 #define SPAMFILTER_STOP_ON_FIRST_MATCH iConf.spamfilter_stop_on_first_match 271 272 #define CHECK_TARGET_NICK_BANS iConf.check_target_nick_bans 273 274 #define MAXBANS iConf.maxbans 275 276 #define WATCH_AWAY_NOTIFICATION iConf.watch_away_notification 277 278 #define UHNAMES_ENABLED iConf.uhnames 279 280 /** Used for testing the set { } block configuration. 281 * It tests if a setting is present and is also used for duplicate checking. 282 */ 283 struct SetCheck { 284 unsigned has_show_opermotd:1; 285 unsigned has_hide_ulines:1; 286 unsigned has_flat_map:1; 287 unsigned has_allow_chatops:1; 288 unsigned has_ident_check:1; 289 unsigned has_fail_oper_warn:1; 290 unsigned has_show_connect_info:1; 291 unsigned has_dont_resolve:1; 292 unsigned has_mkpasswd_for_everyone:1; 293 unsigned has_allow_part_if_shunned:1; 294 unsigned has_tls_server_cipher_list :1; 295 unsigned has_tls_protocols :1; 296 unsigned has_dns_bind_ip:1; 297 unsigned has_link_bind_ip:1; 298 unsigned has_throttle_period:1; 299 unsigned has_throttle_connections:1; 300 unsigned has_kline_address:1; 301 unsigned has_gline_address:1; 302 unsigned has_modes_on_oper:1; 303 unsigned has_snomask_on_connect:1; 304 unsigned has_snomask_on_oper:1; 305 unsigned has_oper_auto_join:1; 306 unsigned has_check_target_nick_bans:1; 307 unsigned has_watch_away_notification:1; 308 unsigned has_uhnames:1; 309 unsigned has_allow_user_stats:1; 310 unsigned has_ping_warning:1; 311 unsigned has_maxdccallow:1; 312 unsigned has_anti_spam_quit_message_time:1; 313 unsigned has_allow_userhost_change:1; 314 unsigned has_restrict_channelmodes:1; 315 unsigned has_restrict_extendedbans:1; 316 unsigned has_channel_command_prefix:1; 317 unsigned has_modes_on_join:1; 318 unsigned has_level_on_join:1; 319 unsigned has_ident_connect_timeout:1; 320 unsigned has_ident_read_timeout:1; 321 unsigned has_default_bantime:1; 322 unsigned has_who_limit:1; 323 unsigned has_maxbans:1; 324 unsigned has_silence_limit:1; 325 unsigned has_ban_version_tkl_time:1; 326 unsigned has_spamfilter_ban_time:1; 327 unsigned has_spamfilter_ban_reason:1; 328 unsigned has_spamfilter_virus_help_channel:1; 329 unsigned has_spamfilter_virus_help_channel_deny:1; 330 unsigned has_spamfilter_except:1; 331 unsigned has_network_name:1; 332 unsigned has_default_server:1; 333 unsigned has_services_server:1; 334 unsigned has_sasl_server:1; 335 unsigned has_hiddenhost_prefix:1; 336 unsigned has_prefix_quit:1; 337 unsigned has_help_channel:1; 338 unsigned has_stats_server:1; 339 unsigned has_cloak_keys:1; 340 unsigned has_options_hide_ulines:1; 341 unsigned has_options_flat_map:1; 342 unsigned has_options_show_opermotd:1; 343 unsigned has_options_identd_check:1; 344 unsigned has_options_fail_oper_warn:1; 345 unsigned has_options_dont_resolve:1; 346 unsigned has_options_show_connect_info:1; 347 unsigned has_options_no_connect_tls_info:1; 348 unsigned has_options_mkpasswd_for_everyone:1; 349 unsigned has_options_allow_insane_bans:1; 350 unsigned has_options_allow_part_if_shunned:1; 351 unsigned has_options_disable_cap:1; 352 unsigned has_options_disable_ipv6:1; 353 unsigned has_ping_cookie:1; 354 unsigned has_min_nick_length:1; 355 unsigned has_nick_length:1; 356 unsigned has_hide_ban_reason:1; 357 unsigned has_hide_killed_by:1; 358 };