]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/defines.h
Clarify that "CAFile" is not set by default
[ngircd-alex.git] / src / ngircd / defines.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors.
4  *
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.
10  */
11
12 #ifndef __defines_h__
13 #define __defines_h__
14
15 /**
16  * @file
17  * Global constants ("#defines") used by the ngIRCd.
18  */
19
20
21 /* Internal flags */
22
23 /** Flag: there is no connection. */
24 #define NONE -1
25
26 /** Flag: connection is (still) established. */
27 #define CONNECTED true
28
29 /** Flag: connection isn't established (any more). */
30 #define DISCONNECTED false
31
32 /** Tag for outbound server links. */
33 #define TOKEN_OUTBOUND -2
34
35
36 /* Generic buffer sizes */
37
38 /** Max. length of a line in the configuration file. */
39 #define LINE_LEN 1024
40
41 /** Max. length of a log message. */
42 #define MAX_LOG_MSG_LEN 1024
43
44 /** Max. length of file name. */
45 #define FNAME_LEN 256
46
47 /** Max. length of fully qualified host names (e. g. "abc.domain.tld"). */
48 #define HOST_LEN 256
49
50 /** Max. length of random salt */
51 #define RANDOM_SALT_LEN 32
52
53 /* Size of structures */
54
55 /** Max. count of configurable servers. */
56 #define MAX_SERVERS 64
57
58 /** Max. number of WHOWAS list items that can be stored. */
59 #define MAX_WHOWAS 64
60
61 /** Size of default connection pool. */
62 #define CONNECTION_POOL 100
63
64 /** Size of buffer for PAM service name. */
65 #define MAX_PAM_SERVICE_NAME_LEN 64
66
67 /** Maximum number of file descriptors to request. */
68 #define MAX_FD_LIMIT 100000
69
70
71 /* Hard-coded (default) options */
72
73 /** Delay after startup before outgoing connections are initiated in seconds. */
74 #define STARTUP_DELAY 1
75
76 /** Time to delay re-connect attempts in seconds. */
77 #define RECONNECT_DELAY 3
78
79 /** Configuration file name. */
80 #define CONFIG_FILE "/ngircd.conf"
81
82 /** Directory containing optional configuration snippets. */
83 #define CONFIG_DIR "/ngircd.conf.d"
84
85 /** Name of the MOTD file. */
86 #define MOTD_FILE "/ngircd.motd"
87
88 /** Name of the help file. */
89 #define HELP_FILE "/Commands.txt"
90
91 /** Default chroot() directory. */
92 #define CHROOT_DIR ""
93
94 /** Default file for the process ID. */
95 #define PID_FILE ""
96
97
98 /* Sizes of "IRC elements": nicks, users, ... */
99
100 /** Max. length of an IRC ID (incl. NULL); see RFC 2812 section 1.1 and 1.2.1. */
101 #define CLIENT_ID_LEN 64
102
103 /** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
104 #define CLIENT_NICK_LEN_DEFAULT 10
105
106 /** Maximum nickname length (including NULL). */
107 #define CLIENT_NICK_LEN 32
108
109 /** Max. password length (including NULL). */
110 #define CLIENT_PASS_LEN 65
111
112 /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
113 #ifndef STRICT_RFC
114 # define CLIENT_USER_LEN 20
115 #else
116 # define CLIENT_USER_LEN 10
117 #endif
118 /** Max. length of user names saved for authentication (used by PAM) */
119 #ifdef PAM
120 # define CLIENT_AUTHUSER_LEN 64
121 #endif
122
123 /** Max. length of "real names" (including NULL). */
124 #define CLIENT_NAME_LEN 32
125
126 /** Max. host name length (including NULL). */
127 #define CLIENT_HOST_LEN 64
128
129 /** Max. mask length (including NULL). */
130 #define MASK_LEN (2 * CLIENT_HOST_LEN)
131
132 /** Max. length of all client modes (including NULL). */
133 #define CLIENT_MODE_LEN 21
134
135 /** Max. length of server info texts (including NULL). */
136 #define CLIENT_INFO_LEN 128
137
138 /** Max. length of away messages (including NULL). */
139 #define CLIENT_AWAY_LEN 128
140
141 /** Max. length of client flags (including NULL). */
142 #define CLIENT_FLAGS_LEN 16
143
144 /** Max. length of a channel name (including NULL), see RFC 2812 section 1.3. */
145 #define CHANNEL_NAME_LEN 51
146
147 /** Max. length of channel modes (including NULL). */
148 #define CHANNEL_MODE_LEN 21
149
150 /** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
151 #define COMMAND_LEN 513
152
153
154 /* Read and write buffer sizes */
155
156 /** Size of the read buffer of a connection in bytes. */
157 #define READBUFFER_LEN 2048
158
159 /** Size that triggers write buffer flushing if more space is needed. */
160 #define WRITEBUFFER_FLUSH_LEN 4096
161
162 /** Maximum size of the write buffer of a connection in bytes. */
163 #define WRITEBUFFER_MAX_LEN 32768
164
165 /** Maximum size of the write buffer of a server link connection in bytes. */
166 #define WRITEBUFFER_SLINK_LEN 65536
167
168
169 /* IRC/IRC+ protocol */
170
171 /** Implemented IRC protocol version, see RFC 2813 section 4.1.1. */
172 #define PROTOVER "0210"
173
174 /** Protocol suffix, see RFC 2813 section 4.1.1. */
175 #define PROTOIRC "-IRC"
176
177 /** Protocol suffix used by the IRC+ protocol, see <doc/Protocol.txt>. */
178 #define PROTOIRCPLUS "-IRC+"
179
180 #ifdef IRCPLUS
181 /** Standard IRC+ flags. */
182 # define IRCPLUSFLAGS "CHLMSX"
183 #endif
184
185 /** Supported user modes. */
186 #define USERMODES "abBcCFiIoqrRswx"
187
188 /** Supported channel modes. */
189 #define CHANMODES "abehiIklmMnoOPqQrRstvVz"
190
191 /** Supported channel types. */
192 #define CHANTYPES "#&+"
193
194 /** Away message for users connected to linked servers. */
195 #define DEFAULT_AWAY_MSG "Away"
196
197 /** Default ID for "topic owner". */
198 #define DEFAULT_TOPIC_ID "-Server-"
199
200 /** Prefix for NOTICEs from the server to users. Some servers use '*'. */
201 #define NOTICE_TXTPREFIX ""
202
203 /** Suffix for oversized messages that have been shortened and cut off. */
204 #define CUT_TXTSUFFIX "[CUT]"
205
206
207 /* Defaults and limits for IRC commands */
208
209 /** Max. number of elements allowed in channel invite and ban lists. */
210 #define MAX_HNDL_CHANNEL_LISTS 50
211
212 /** Max. number of channel modes with arguments per MODE command. */
213 #define MAX_HNDL_MODES_ARG 5
214
215 /** Max. number of targets per PRIVMSG/NOTICE/... command. */
216 #define MAX_HNDL_TARGETS 25
217
218 /** Max. number of WHO replies. */
219 #define MAX_RPL_WHO 25
220
221 /** Max. number of WHOIS replies. */
222 #define MAX_RPL_WHOIS 10
223
224 /** Default count of WHOWAS command replies. */
225 #define DEF_RPL_WHOWAS 5
226
227 /** Max count of WHOWAS command replies. */
228 #define MAX_RPL_WHOWAS 25
229
230
231 #endif
232
233 /* -eof- */