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