2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
17 * Global constants ("#defines") used by the ngIRCd.
23 /** Flag: there is no connection. */
26 /** Flag: connection is (still) established. */
27 #define CONNECTED true
29 /** Flag: connection isn't established (any more). */
30 #define DISCONNECTED false
32 /** Tag for outbound server links. */
33 #define TOKEN_OUTBOUND -2
36 /* Generic buffer sizes */
38 /** Max. length of a line in the configuration file. */
41 /** Max. length of a log message. */
42 #define MAX_LOG_MSG_LEN 256
44 /** Max. length of file name. */
47 /** Max. length of fully qualified host names (e. g. "abc.domain.tld"). */
50 /** Max. length of random salt */
51 #define RANDOM_SALT_LEN 32
53 /* Size of structures */
55 /** Max. count of configurable servers. */
56 #define MAX_SERVERS 64
58 /** Max. number of WHOWAS list items that can be stored. */
61 /** Size of default connection pool. */
62 #define CONNECTION_POOL 100
65 /* Hard-coded (default) options */
67 /** Delay after startup before outgoing connections are initiated in seconds. */
68 #define STARTUP_DELAY 1
70 /** Time to delay re-connect attempts in seconds. */
71 #define RECONNECT_DELAY 3
73 /** Configuration file name. */
74 #define CONFIG_FILE "/ngircd.conf"
76 /** Directory containing optional configuration snippets. */
77 #define CONFIG_DIR "/ngircd.conf.d"
79 /** Name of the MOTD file. */
80 #define MOTD_FILE "/ngircd.motd"
82 /** Name of the help file. */
83 #define HELP_FILE "/Commands.txt"
85 /** Default chroot() directory. */
88 /** Default file for the process ID. */
92 /* Sizes of "IRC elements": nicks, users, ... */
94 /** Max. length of an IRC ID (incl. NULL); see RFC 2812 section 1.1 and 1.2.1. */
95 #define CLIENT_ID_LEN 64
97 /** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
98 #define CLIENT_NICK_LEN_DEFAULT 10
100 /** Maximum nickname length (including NULL). */
101 #define CLIENT_NICK_LEN 32
103 /** Max. password length (including NULL). */
104 #define CLIENT_PASS_LEN 65
106 /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
108 # define CLIENT_USER_LEN 20
110 # define CLIENT_USER_LEN 10
112 /** Max. length of user names saved for authentication (used by PAM) */
114 # define CLIENT_AUTHUSER_LEN 64
117 /** Max. length of "real names" (including NULL). */
118 #define CLIENT_NAME_LEN 32
120 /** Max. host name length (including NULL). */
121 #define CLIENT_HOST_LEN 64
123 /** Max. mask lenght (including NULL). */
124 #define MASK_LEN (2 * CLIENT_HOST_LEN)
126 /** Max. length of all client modes (including NULL). */
127 #define CLIENT_MODE_LEN 21
129 /** Max. length of server info texts (including NULL). */
130 #define CLIENT_INFO_LEN 64
132 /** Max. length of away messages (including NULL). */
133 #define CLIENT_AWAY_LEN 128
135 /** Max. length of client flags (including NULL). */
136 #define CLIENT_FLAGS_LEN 16
138 /** Max. length of a channel name (including NULL), see RFC 2812 section 1.3. */
139 #define CHANNEL_NAME_LEN 51
141 /** Max. length of channel modes (including NULL). */
142 #define CHANNEL_MODE_LEN 21
144 /** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
145 #define COMMAND_LEN 513
148 /* Read and write buffer sizes */
150 /** Size of the read buffer of a connection in bytes. */
151 #define READBUFFER_LEN 2048
153 /** Size that triggers write buffer flushing if more space is needed. */
154 #define WRITEBUFFER_FLUSH_LEN 4096
156 /** Maximum size of the write buffer of a connection in bytes. */
157 #define WRITEBUFFER_MAX_LEN 32768
159 /** Maximum size of the write buffer of a server link connection in bytes. */
160 #define WRITEBUFFER_SLINK_LEN 65536
163 /* IRC/IRC+ protocol */
165 /** Implemented IRC protocol version, see RFC 2813 section 4.1.1. */
166 #define PROTOVER "0210"
168 /** Protocol suffix, see RFC 2813 section 4.1.1. */
169 #define PROTOIRC "-IRC"
171 /** Protocol suffix used by the IRC+ protocol, see <doc/Protocol.txt>. */
172 #define PROTOIRCPLUS "-IRC+"
175 /** Standard IRC+ flags. */
176 # define IRCPLUSFLAGS "CHLMSX"
179 /** Supported user modes. */
180 #define USERMODES "abBcCFiIoqrRswx"
182 /** Supported channel modes. */
183 #define CHANMODES "abehiIklmMnoOPqQrRstvVz"
185 /** Supported channel types. */
186 #define CHANTYPES "#&+"
188 /** Away message for users connected to linked servers. */
189 #define DEFAULT_AWAY_MSG "Away"
191 /** Default ID for "topic owner". */
192 #define DEFAULT_TOPIC_ID "-Server-"
194 /** Prefix for NOTICEs from the server to users. Some servers use '*'. */
195 #define NOTICE_TXTPREFIX ""
197 /** Suffix for oversized messages that have been shortened and cut off. */
198 #define CUT_TXTSUFFIX "[CUT]"
201 /* Defaults and limits for IRC commands */
203 /** Max. number of elemets allowed in channel invite and ban lists. */
204 #define MAX_HNDL_CHANNEL_LISTS 50
206 /** Max. number of channel modes with arguments per MODE command. */
207 #define MAX_HNDL_MODES_ARG 5
209 /** Max. number of WHO replies. */
210 #define MAX_RPL_WHO 25
212 /** Max. number of WHOIS replies. */
213 #define MAX_RPL_WHOIS 10
215 /** Default count of WHOWAS command replies. */
216 #define DEF_RPL_WHOWAS 5
218 /** Max count of WHOWAS command replies. */
219 #define MAX_RPL_WHOWAS 25