1 /* {{{ irc-seven: Cows like it.
3 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center.
4 * Copyright (C) 1996-2002 Hybrid Development Team.
5 * Copyright (C) 2002-2004 ircd-ratbox development team.
6 * Copyright (C) 2005-2006 Charybdis development team.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
21 * Free Software Foundation, Inc.
22 * 51 Franklin St - Fifth Floor
23 * Boston, MA 02110-1301
29 * ircd_defs.h - Global size definitions for record entries used
30 * througout ircd-seven. Please think 3 times before adding anything
34 #ifndef _SEVEN_IRCD_DEFS_H
35 # define _SEVEN_IRCD_DEFS_H
40 # define AFP(a, b) __attribute__((format(printf, a, b)))
48 /* {{{ #define s_assert(expr) */
51 # define s_assert(expr) \
57 "file: %s line: %d (%s): Assertion failed: (%s)", \
58 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
59 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
60 "file: %s line: %d (%s): Assertion failed: (%s)", \
61 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
66 # define s_assert(expr) \
72 "file: %s line: %d (%s): Assertion failed: (%s)", \
73 __FILE__, __LINE__, __FUNCTION__, #expr); \
74 sendto_realops_snomask(SNO_GENERAL, L_ALL, \
75 "file: %s line: %d (%s): Assertion failed: (%s)", \
76 __FILE__, __LINE__, __FUNCTION__, #expr); \
82 # define s_assert(expr) assert(expr)
86 # if !defined(CONFIG_RATBOX_LEVEL_1)
87 # error Incorrect config.h for this revision of ircd.
91 * This defines the version of the data structures used in the ircd.
92 * In the event of a mismatch (i.e. this is incremented due to a major
93 * change that cannot be accomidated for in the ircd), then a hard
96 # define SEVEN_DV 0x00000900 /* 0.9.0 */
99 * Change the below definition of BUFSIZE and expect bad things to happen...
106 # define CHANNELLEN 200
107 # define LOC_CHANNELLEN 50
109 /* reason length of klines, parts, quits etc */
110 # define REASONLEN TOPICLEN
111 # define AWAYLEN TOPICLEN
112 # define KILLLEN TOPICLEN
115 # define MAXRECIPIENTS 20
116 # define MAXBANLENGTH 1024
117 # define OPERNICKLEN (NICKLEN * 2)
119 # define USERHOST_REPLYLEN (NICKLEN + HOSTLEN + USERLEN + 5)
120 # define MAX_DATE_STRING 32 /* maximum length for a date string. */
123 # define IDPREFIXLEN 3
126 * message return values
128 # define CLIENT_EXITED (-2)
129 # define CLIENT_PARSE_ERROR (-1)
130 # define CLIENT_OK (1)
134 # error "AF_INET6 not defined"
136 # else /* #ifdef IPV6 */
138 # define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
140 # endif /* #ifdef IPV6 */
143 # define PATRICIA_BITS 128
144 # define irc_sockaddr_storage sockaddr_storage
146 # define PATRICIA_BITS 32
147 # define irc_sockaddr_storage sockaddr
148 # define ss_family sa_family
149 # ifdef SOCKADDR_IN_HAS_LEN
150 # define ss_len sa_len
154 # ifdef SOCKADDR_IN_HAS_LEN
155 # define SET_SS_LEN(x, y) (x).ss_len = (y)
156 # define GET_SS_LEN(x) x.ss_len
158 # define SET_SS_LEN(x, y)
160 # define GET_SS_LEN(x) x.ss_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)
162 # define GET_SS_LEN(x) sizeof(struct sockaddr_in)
166 #endif /* ! _SEVEN_IRCD_DEFS_H */
169 * vim: ts=8 sw=8 noet fdm=marker tw=80