2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2012 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
54 /* Size of structures */
56 /** Max. count of configurable servers. */
57 #define MAX_SERVERS 16
59 /** Max. number of WHOWAS list items that can be stored. */
62 /** Size of default connection pool. */
63 #define CONNECTION_POOL 100
66 /* Hard-coded (default) options */
68 /** Delay after startup before outgoing connections are initiated in seconds. */
69 #define STARTUP_DELAY 1
71 /** Time to delay re-connect attempts in seconds. */
72 #define RECONNECT_DELAY 3
74 /** Configuration file name. */
75 #define CONFIG_FILE "/ngircd.conf"
77 /** Name of the MOTD file. */
78 #define MOTD_FILE "/ngircd.motd"
80 /** Default chroot() directory. */
83 /** Default file for the process ID. */
87 /* Sizes of "IRC elements": nicks, users, ... */
89 /** Max. length of an IRC ID (incl. NULL); see RFC 2812 section 1.1 and 1.2.1. */
90 #define CLIENT_ID_LEN 64
92 /** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
93 #define CLIENT_NICK_LEN_DEFAULT 10
95 /** Maximum nickname length (including NULL). */
96 #define CLIENT_NICK_LEN 32
98 /** Max. password length (including NULL). */
99 #define CLIENT_PASS_LEN 21
101 /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
102 #define CLIENT_USER_LEN 10
104 /** Max. length of "real names" (including NULL). */
105 #define CLIENT_NAME_LEN 32
107 /** Max. host name length (including NULL). */
108 #define CLIENT_HOST_LEN 64
110 /** Max. length of all client modes (including NULL). */
111 #define CLIENT_MODE_LEN 21
113 /** Max. length of server info texts (including NULL). */
114 #define CLIENT_INFO_LEN 64
116 /** Max. length of away messages (including NULL). */
117 #define CLIENT_AWAY_LEN 128
119 /** Max. length of client flags (including NULL). */
120 #define CLIENT_FLAGS_LEN 16
122 /** Max. length of a channel name (including NULL), see RFC 2812 section 1.3. */
123 #define CHANNEL_NAME_LEN 51
125 /** Max. length of channel modes (including NULL). */
126 #define CHANNEL_MODE_LEN 21
128 /** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
129 #define COMMAND_LEN 513
132 /* Read and write buffer sizes */
134 /** Size of the read buffer of a connection in bytes. */
135 #define READBUFFER_LEN 2048
137 /** Size that triggers write buffer flushing if more space is needed. */
138 #define WRITEBUFFER_FLUSH_LEN 4096
140 /** Maximum size of the write buffer of a connection in bytes. */
141 #define WRITEBUFFER_MAX_LEN 32768
143 /** Maximum size of the write buffer of a server link connection in bytes. */
144 #define WRITEBUFFER_SLINK_LEN 65536
147 /* IRC/IRC+ protocol */
149 /** Implemented IRC protocol version, see RFC 2813 section 4.1.1. */
150 #define PROTOVER "0210"
152 /** Protocol suffix, see RFC 2813 section 4.1.1. */
153 #define PROTOIRC "-IRC"
155 /** Protocol suffix used by the IRC+ protocol, see <doc/Protocol.txt>. */
156 #define PROTOIRCPLUS "-IRC+"
159 /** Standard IRC+ flags. */
160 # define IRCPLUSFLAGS "CHLMS"
163 /** Supported user modes. */
164 #define USERMODES "abBcCioqrRswx"
166 /** Supported channel modes. */
167 #define CHANMODES "abehiIklmMnoOPqQrRstvVz"
169 /** Away message for users connected to linked servers. */
170 #define DEFAULT_AWAY_MSG "Away"
172 /** Default ID for "topic owner". */
173 #define DEFAULT_TOPIC_ID "-Server-"
175 /** Prefix for NOTICEs from the server to users. Some servers use '*'. */
176 #define NOTICE_TXTPREFIX ""
178 /** Suffix for oversized messages that have been shortened and cut off. */
179 #define CUT_TXTSUFFIX "[CUT]"
182 /* Defaults and limits for IRC commands */
184 /** Max. number of elemets allowed in channel invite and ban lists. */
185 #define MAX_HNDL_CHANNEL_LISTS 50
187 /** Max. number of channel modes with arguments per MODE command. */
188 #define MAX_HNDL_MODES_ARG 5
190 /** Max. number of WHO replies. */
191 #define MAX_RPL_WHO 25
193 /** Max. number of WHOIS replies. */
194 #define MAX_RPL_WHOIS 10
196 /** Default count of WHOWAS command replies. */
197 #define DEF_RPL_WHOWAS 5
199 /** Max count of WHOWAS command replies. */
200 #define MAX_RPL_WHOWAS 25