]> jfr.im git - solanum.git/blame - include/ircd_defs.h
ircd/authproc.c: avoid crash on lack of any configured DNSBLs
[solanum.git] / include / ircd_defs.h
CommitLineData
212380e3 1/*
a6f63a82 2 * solanum: An advanced IRCd.
212380e3
AC
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
212380e3
AC
24 */
25
26/*
27 * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
55abcbb2 28 * Otherwise there are no user servicable part here.
212380e3 29 */
4a8fab1f
AC
30
31/* ircd_defs.h - Global size definitions for record entries used
32 * througout ircd. Please think 3 times before adding anything to this
33 * file.
34 */
212380e3
AC
35#ifndef INCLUDED_ircd_defs_h
36#define INCLUDED_ircd_defs_h
37
9b8e9eb3 38#include "defaults.h"
212380e3
AC
39
40/* For those unfamiliar with GNU format attributes, a is the 1 based
41 * argument number of the format string, and b is the 1 based argument
42 * number of the variadic ... */
43#ifdef __GNUC__
44#define AFP(a,b) __attribute__((format (printf, a, b)))
45#else
46#define AFP(a,b)
47#endif
48
4a8fab1f
AC
49/*
50 * This ensures that __attribute__((deprecated)) is not used in for example
51 * sun CC, since it's a GNU-specific extension. -nenolod
52 */
53#ifdef __GNUC__
54#define IRC_DEPRECATED __attribute__((deprecated))
55#else
56#define IRC_DEPRECATED
57#endif
212380e3 58
79435744
EM
59#ifndef MAX
60#define MAX(a, b) ((a) > (b) ? (a) : (b))
61#endif
62
63#ifndef MIN
64#define MIN(a, b) ((a) < (b) ? (a) : (b))
65#endif
66
c6ad9b0c
SA
67#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
68
212380e3
AC
69#define HOSTLEN 63 /* Length of hostname. Updated to */
70 /* comply with RFC1123 */
71
1eeb0469
AC
72/* Longest hostname we're willing to work with.
73 * Due to DNSBLs this is more than HOSTLEN.
74 */
75#define IRCD_RES_HOSTLEN 255
76
212380e3
AC
77#define USERLEN 10
78#define REALLEN 50
79#define CHANNELLEN 200
80#define LOC_CHANNELLEN 50
81
82/* reason length of klines, parts, quits etc */
61569b65
JT
83/* for quit messages, note that a client exit server notice
84 * :012345678901234567890123456789012345678901234567890123456789123 NOTICE * :*** Notice -- Client exiting: 012345678901234567 (0123456789@012345678901234567890123456789012345678901234567890123456789123) [] [1111:2222:3333:4444:5555:6666:7777:8888]
85 * takes at most 246 bytes (including CRLF and '\0') and together with the
86 * quit reason should fit in 512 */
87#define REASONLEN 260 /* kick/part/quit */
170703fe 88#define BANREASONLEN 390 /* kline/dline */
61569b65
JT
89#define AWAYLEN TOPICLEN
90#define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */
212380e3
AC
91
92/* 23+1 for \0 */
93#define KEYLEN 24
f3564f47
SA
94#define TAGSLEN 512 /* IRCv3 message tags */
95#define DATALEN 510 /* RFC1459 message data */
212380e3 96#define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */
f3564f47 97#define EXT_BUFSIZE (TAGSLEN + DATALEN + 1)
01a7f6d4 98#define OPERNICKLEN (NICKLEN*2) /* Length of OPERNICKs. */
212380e3 99
fe5fc851
SA
100#define NAMELEN (MAX(NICKLEN, HOSTLEN))
101
102#define USERHOST_REPLYLEN (NAMELEN+HOSTLEN+USERLEN+5)
212380e3
AC
103#define MAX_DATE_STRING 32 /* maximum string length for a date string */
104
105#define HELPLEN 400
106
55abcbb2
KB
107/*
108 * message return values
212380e3
AC
109 */
110#define CLIENT_EXITED -2
111#define CLIENT_PARSE_ERROR -1
112#define CLIENT_OK 1
113
212380e3
AC
114#ifndef AF_INET6
115#error "AF_INET6 not defined"
116#endif
117
212380e3 118#define PATRICIA_BITS 128
212380e3 119
79435744
EM
120/* Read buffer size */
121#define READBUF_SIZE 16384
122
212380e3 123#endif /* INCLUDED_ircd_defs_h */