]>
Commit | Line | Data |
---|---|---|
212380e3 AC |
1 | /* |
2 | * charybdis: An advanced IRCd. | |
3 | * ircd_defs.h: A header for ircd global definitions. | |
4 | * | |
5 | * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center | |
6 | * Copyright (C) 1996-2002 Hybrid Development Team | |
7 | * Copyright (C) 2002-2004 ircd-ratbox development team | |
8 | * Copyright (C) 2005-2006 Charybdis development team | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; either version 2 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * This program is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with this program; if not, write to the Free Software | |
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
23 | * USA | |
24 | * | |
4a8fab1f | 25 | * $Id: ircd_defs.h 3512 2007-06-06 16:20:40Z nenolod $ |
212380e3 AC |
26 | */ |
27 | ||
28 | /* | |
29 | * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure | |
30 | * Otherwise there are no user servicable part here. | |
31 | * | |
32 | */ | |
4a8fab1f AC |
33 | |
34 | /* ircd_defs.h - Global size definitions for record entries used | |
35 | * througout ircd. Please think 3 times before adding anything to this | |
36 | * file. | |
37 | */ | |
212380e3 AC |
38 | #ifndef INCLUDED_ircd_defs_h |
39 | #define INCLUDED_ircd_defs_h | |
40 | ||
41 | #include "config.h" | |
42 | ||
43 | /* For those unfamiliar with GNU format attributes, a is the 1 based | |
44 | * argument number of the format string, and b is the 1 based argument | |
45 | * number of the variadic ... */ | |
46 | #ifdef __GNUC__ | |
47 | #define AFP(a,b) __attribute__((format (printf, a, b))) | |
48 | #else | |
49 | #define AFP(a,b) | |
50 | #endif | |
51 | ||
4a8fab1f AC |
52 | /* |
53 | * This ensures that __attribute__((deprecated)) is not used in for example | |
54 | * sun CC, since it's a GNU-specific extension. -nenolod | |
55 | */ | |
56 | #ifdef __GNUC__ | |
57 | #define IRC_DEPRECATED __attribute__((deprecated)) | |
58 | #else | |
59 | #define IRC_DEPRECATED | |
60 | #endif | |
212380e3 | 61 | |
4016731b | 62 | #include "logger.h" |
212380e3 AC |
63 | #include "send.h" |
64 | ||
65 | #ifdef SOFT_ASSERT | |
66 | #ifdef __GNUC__ | |
67 | #define s_assert(expr) do \ | |
68 | if(!(expr)) { \ | |
69 | ilog(L_MAIN, \ | |
70 | "file: %s line: %d (%s): Assertion failed: (%s)", \ | |
71 | __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ | |
72 | sendto_realops_snomask(SNO_GENERAL, L_ALL, \ | |
73 | "file: %s line: %d (%s): Assertion failed: (%s)", \ | |
74 | __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ | |
75 | } \ | |
76 | while(0) | |
77 | #else | |
78 | #define s_assert(expr) do \ | |
79 | if(!(expr)) { \ | |
80 | ilog(L_MAIN, \ | |
81 | "file: %s line: %d: Assertion failed: (%s)", \ | |
82 | __FILE__, __LINE__, #expr); \ | |
83 | sendto_realops_snomask(SNO_GENERAL, L_ALL, \ | |
84 | "file: %s line: %d: Assertion failed: (%s)" \ | |
85 | __FILE__, __LINE__, #expr); \ | |
86 | } \ | |
87 | while(0) | |
88 | #endif | |
89 | #else | |
90 | #define s_assert(expr) assert(expr) | |
91 | #endif | |
92 | ||
93 | #if !defined(CONFIG_RATBOX_LEVEL_1) | |
94 | # error Incorrect config.h for this revision of ircd. | |
95 | #endif | |
96 | ||
212380e3 AC |
97 | #define HOSTLEN 63 /* Length of hostname. Updated to */ |
98 | /* comply with RFC1123 */ | |
99 | ||
100 | #define USERLEN 10 | |
101 | #define REALLEN 50 | |
102 | #define CHANNELLEN 200 | |
103 | #define LOC_CHANNELLEN 50 | |
104 | ||
105 | /* reason length of klines, parts, quits etc */ | |
61569b65 JT |
106 | /* for quit messages, note that a client exit server notice |
107 | * :012345678901234567890123456789012345678901234567890123456789123 NOTICE * :*** Notice -- Client exiting: 012345678901234567 (0123456789@012345678901234567890123456789012345678901234567890123456789123) [] [1111:2222:3333:4444:5555:6666:7777:8888] | |
108 | * takes at most 246 bytes (including CRLF and '\0') and together with the | |
109 | * quit reason should fit in 512 */ | |
110 | #define REASONLEN 260 /* kick/part/quit */ | |
170703fe | 111 | #define BANREASONLEN 390 /* kline/dline */ |
61569b65 JT |
112 | #define AWAYLEN TOPICLEN |
113 | #define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */ | |
212380e3 AC |
114 | |
115 | /* 23+1 for \0 */ | |
116 | #define KEYLEN 24 | |
117 | #define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */ | |
118 | #define MAXRECIPIENTS 20 | |
119 | #define MAXBANLENGTH 1024 | |
120 | #define OPERNICKLEN NICKLEN*2 /* Length of OPERNICKs. */ | |
121 | ||
122 | #define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5) | |
123 | #define MAX_DATE_STRING 32 /* maximum string length for a date string */ | |
124 | ||
125 | #define HELPLEN 400 | |
126 | ||
127 | /* | |
128 | * message return values | |
129 | */ | |
130 | #define CLIENT_EXITED -2 | |
131 | #define CLIENT_PARSE_ERROR -1 | |
132 | #define CLIENT_OK 1 | |
133 | ||
ccda6e3f | 134 | #ifdef RB_IPV6 |
212380e3 AC |
135 | #ifndef AF_INET6 |
136 | #error "AF_INET6 not defined" | |
137 | #endif | |
138 | ||
139 | ||
ccda6e3f | 140 | #else /* #ifdef RB_IPV6 */ |
212380e3 AC |
141 | |
142 | #ifndef AF_INET6 | |
143 | #define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */ | |
144 | #endif | |
ccda6e3f | 145 | #endif /* #ifdef RB_IPV6 */ |
212380e3 | 146 | |
ccda6e3f | 147 | #ifdef RB_IPV6 |
212380e3 AC |
148 | #define PATRICIA_BITS 128 |
149 | #else | |
150 | #define PATRICIA_BITS 32 | |
151 | #endif | |
152 | ||
212380e3 | 153 | #endif /* INCLUDED_ircd_defs_h */ |