]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/defines.h
Increase MAX_SERVERS from 16 to 64
[ngircd-alex.git] / src / ngircd / defines.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2014 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 256
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
65 /* Hard-coded (default) options */
66
67 /** Delay after startup before outgoing connections are initiated in seconds. */
68 #define STARTUP_DELAY 1
69
70 /** Time to delay re-connect attempts in seconds. */
71 #define RECONNECT_DELAY 3
72
73 /** Configuration file name. */
74 #define CONFIG_FILE "/ngircd.conf"
75
76 /** Directory containing optional configuration snippets. */
77 #define CONFIG_DIR "/ngircd.conf.d"
78
79 /** Name of the MOTD file. */
80 #define MOTD_FILE "/ngircd.motd"
81
82 /** Name of the help file. */
83 #define HELP_FILE "/Commands.txt"
84
85 /** Default chroot() directory. */
86 #define CHROOT_DIR ""
87
88 /** Default file for the process ID. */
89 #define PID_FILE ""
90
91
92 /* Sizes of "IRC elements": nicks, users, ... */
93
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
96
97 /** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
98 #define CLIENT_NICK_LEN_DEFAULT 10
99
100 /** Maximum nickname length (including NULL). */
101 #define CLIENT_NICK_LEN 32
102
103 /** Max. password length (including NULL). */
104 #define CLIENT_PASS_LEN 65
105
106 /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
107 #ifndef STRICT_RFC
108 # define CLIENT_USER_LEN 20
109 #else
110 # define CLIENT_USER_LEN 10
111 #endif
112
113 /** Max. length of "real names" (including NULL). */
114 #define CLIENT_NAME_LEN 32
115
116 /** Max. host name length (including NULL). */
117 #define CLIENT_HOST_LEN 64
118
119 /** Max. mask lenght (including NULL). */
120 #define MASK_LEN (2 * CLIENT_HOST_LEN)
121
122 /** Max. length of all client modes (including NULL). */
123 #define CLIENT_MODE_LEN 21
124
125 /** Max. length of server info texts (including NULL). */
126 #define CLIENT_INFO_LEN 64
127
128 /** Max. length of away messages (including NULL). */
129 #define CLIENT_AWAY_LEN 128
130
131 /** Max. length of client flags (including NULL). */
132 #define CLIENT_FLAGS_LEN 16
133
134 /** Max. length of a channel name (including NULL), see RFC 2812 section 1.3. */
135 #define CHANNEL_NAME_LEN 51
136
137 /** Max. length of channel modes (including NULL). */
138 #define CHANNEL_MODE_LEN 21
139
140 /** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
141 #define COMMAND_LEN 513
142
143
144 /* Read and write buffer sizes */
145
146 /** Size of the read buffer of a connection in bytes. */
147 #define READBUFFER_LEN 2048
148
149 /** Size that triggers write buffer flushing if more space is needed. */
150 #define WRITEBUFFER_FLUSH_LEN 4096
151
152 /** Maximum size of the write buffer of a connection in bytes. */
153 #define WRITEBUFFER_MAX_LEN 32768
154
155 /** Maximum size of the write buffer of a server link connection in bytes. */
156 #define WRITEBUFFER_SLINK_LEN 65536
157
158
159 /* IRC/IRC+ protocol */
160
161 /** Implemented IRC protocol version, see RFC 2813 section 4.1.1. */
162 #define PROTOVER "0210"
163
164 /** Protocol suffix, see RFC 2813 section 4.1.1. */
165 #define PROTOIRC "-IRC"
166
167 /** Protocol suffix used by the IRC+ protocol, see <doc/Protocol.txt>. */
168 #define PROTOIRCPLUS "-IRC+"
169
170 #ifdef IRCPLUS
171 /** Standard IRC+ flags. */
172 # define IRCPLUSFLAGS "CHLMSX"
173 #endif
174
175 /** Supported user modes. */
176 #define USERMODES "abBcCFioqrRswx"
177
178 /** Supported channel modes. */
179 #define CHANMODES "abehiIklmMnoOPqQrRstvVz"
180
181 /** Supported channel types. */
182 #define CHANTYPES "#&+"
183
184 /** Away message for users connected to linked servers. */
185 #define DEFAULT_AWAY_MSG "Away"
186
187 /** Default ID for "topic owner". */
188 #define DEFAULT_TOPIC_ID "-Server-"
189
190 /** Prefix for NOTICEs from the server to users. Some servers use '*'. */
191 #define NOTICE_TXTPREFIX ""
192
193 /** Suffix for oversized messages that have been shortened and cut off. */
194 #define CUT_TXTSUFFIX "[CUT]"
195
196
197 /* Defaults and limits for IRC commands */
198
199 /** Max. number of elemets allowed in channel invite and ban lists. */
200 #define MAX_HNDL_CHANNEL_LISTS 50
201
202 /** Max. number of channel modes with arguments per MODE command. */
203 #define MAX_HNDL_MODES_ARG 5
204
205 /** Max. number of WHO replies. */
206 #define MAX_RPL_WHO 25
207
208 /** Max. number of WHOIS replies. */
209 #define MAX_RPL_WHOIS 10
210
211 /** Default count of WHOWAS command replies. */
212 #define DEF_RPL_WHOWAS 5
213
214 /** Max count of WHOWAS command replies. */
215 #define MAX_RPL_WHOWAS 25
216
217
218 #endif
219
220 /* -eof- */