2 * ircd-ratbox: A slightly useful ircd.
3 * ircd_defs.h: A header for ircd global definitions.
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
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 * $Id: ircd_defs.h 20583 2005-07-17 18:55:27Z leeh $
28 * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
29 * Otherwise there are no user servicable part here.
32 /* ircd_defs.h - Global size definitions for record entries used
33 * througout ircd. Please think 3 times before adding anything to this
36 #ifndef INCLUDED_ircd_defs_h
37 #define INCLUDED_ircd_defs_h
41 /* For those unfamiliar with GNU format attributes, a is the 1 based
42 * argument number of the format string, and b is the 1 based argument
43 * number of the variadic ... */
45 #define AFP(a,b) __attribute__((format (printf, a, b)))
56 #define s_assert(expr) do \
59 "file: %s line: %d (%s): Assertion failed: (%s)", \
60 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
61 sendto_realops_flags(UMODE_ALL, L_ALL, \
62 "file: %s line: %d (%s): Assertion failed: (%s)", \
63 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
67 #define s_assert(expr) do \
70 "file: %s line: %d: Assertion failed: (%s)", \
71 __FILE__, __LINE__, #expr); \
72 sendto_realops_flags(UMODE_ALL, L_ALL, \
73 "file: %s line: %d: Assertion failed: (%s)" \
74 __FILE__, __LINE__, #expr); \
79 #define s_assert(expr) assert(expr)
82 #if !defined(CONFIG_RATBOX_LEVEL_1)
83 # error Incorrect config.h for this revision of ircd.
86 #define HOSTLEN 63 /* Length of hostname. Updated to */
87 /* comply with RFC1123 */
92 #define CHANNELLEN 200
93 #define LOC_CHANNELLEN 50
95 /* reason length of klines, parts, quits etc */
102 #define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */
103 #define MAXRECIPIENTS 20
104 #define MAXBANLENGTH 1024
105 #define OPERNICKLEN NICKLEN*2 /* Length of OPERNICKs. */
107 #define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5)
108 #define MAX_DATE_STRING 32 /* maximum string length for a date string */
113 * message return values
115 #define CLIENT_EXITED -2
116 #define CLIENT_PARSE_ERROR -1
121 #error "AF_INET6 not defined"
125 #else /* #ifdef IPV6 */
128 #define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
130 #endif /* #ifdef IPV6 */
134 #define irc_sockaddr_storage sockaddr_storage
136 #define irc_sockaddr_storage sockaddr
137 #define ss_family sa_family
138 #ifdef SOCKADDR_IN_HAS_LEN
139 #define ss_len sa_len
144 #define PATRICIA_BITS 128
146 #define PATRICIA_BITS 32
149 #ifdef SOCKADDR_IN_HAS_LEN
150 #define SET_SS_LEN(x, y) (x).ss_len = (y)
151 #define GET_SS_LEN(x) x.ss_len
153 #define SET_SS_LEN(x, y)
155 #define GET_SS_LEN(x) x.ss_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)
157 #define GET_SS_LEN(x) sizeof(struct sockaddr_in)
162 #endif /* INCLUDED_ircd_defs_h */