2007-01-25 06:40:21 +00:00
|
|
|
/*
|
|
|
|
* charybdis: An advanced IRCd.
|
|
|
|
* ircd_defs.h: A header for ircd global definitions.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
|
|
|
|
* Copyright (C) 1996-2002 Hybrid Development Team
|
|
|
|
* Copyright (C) 2002-2004 ircd-ratbox development team
|
|
|
|
* Copyright (C) 2005-2006 Charybdis development team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure
|
2014-03-03 04:25:47 +00:00
|
|
|
* Otherwise there are no user servicable part here.
|
2007-01-25 06:40:21 +00:00
|
|
|
*/
|
2007-06-06 16:20:40 +00:00
|
|
|
|
|
|
|
/* ircd_defs.h - Global size definitions for record entries used
|
|
|
|
* througout ircd. Please think 3 times before adding anything to this
|
|
|
|
* file.
|
|
|
|
*/
|
2007-01-25 06:40:21 +00:00
|
|
|
#ifndef INCLUDED_ircd_defs_h
|
|
|
|
#define INCLUDED_ircd_defs_h
|
|
|
|
|
2016-03-20 00:14:26 +00:00
|
|
|
#include "defaults.h"
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
/* For those unfamiliar with GNU format attributes, a is the 1 based
|
|
|
|
* argument number of the format string, and b is the 1 based argument
|
|
|
|
* number of the variadic ... */
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define AFP(a,b) __attribute__((format (printf, a, b)))
|
|
|
|
#else
|
|
|
|
#define AFP(a,b)
|
|
|
|
#endif
|
|
|
|
|
2007-06-06 16:20:40 +00:00
|
|
|
/*
|
|
|
|
* This ensures that __attribute__((deprecated)) is not used in for example
|
|
|
|
* sun CC, since it's a GNU-specific extension. -nenolod
|
|
|
|
*/
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define IRC_DEPRECATED __attribute__((deprecated))
|
|
|
|
#else
|
|
|
|
#define IRC_DEPRECATED
|
|
|
|
#endif
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2016-03-23 14:33:56 +00:00
|
|
|
#ifndef MAX
|
|
|
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MIN
|
|
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
#define HOSTLEN 63 /* Length of hostname. Updated to */
|
|
|
|
/* comply with RFC1123 */
|
|
|
|
|
2016-01-08 12:39:51 +00:00
|
|
|
/* Longest hostname we're willing to work with.
|
|
|
|
* Due to DNSBLs this is more than HOSTLEN.
|
|
|
|
*/
|
|
|
|
#define IRCD_RES_HOSTLEN 255
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
#define USERLEN 10
|
|
|
|
#define REALLEN 50
|
|
|
|
#define CHANNELLEN 200
|
|
|
|
#define LOC_CHANNELLEN 50
|
|
|
|
|
|
|
|
/* reason length of klines, parts, quits etc */
|
2007-03-04 23:42:55 +00:00
|
|
|
/* for quit messages, note that a client exit server notice
|
|
|
|
* :012345678901234567890123456789012345678901234567890123456789123 NOTICE * :*** Notice -- Client exiting: 012345678901234567 (0123456789@012345678901234567890123456789012345678901234567890123456789123) [] [1111:2222:3333:4444:5555:6666:7777:8888]
|
|
|
|
* takes at most 246 bytes (including CRLF and '\0') and together with the
|
|
|
|
* quit reason should fit in 512 */
|
|
|
|
#define REASONLEN 260 /* kick/part/quit */
|
2008-04-11 14:47:03 +00:00
|
|
|
#define BANREASONLEN 390 /* kline/dline */
|
2007-03-04 23:42:55 +00:00
|
|
|
#define AWAYLEN TOPICLEN
|
|
|
|
#define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
/* 23+1 for \0 */
|
|
|
|
#define KEYLEN 24
|
2017-06-28 20:24:10 +00:00
|
|
|
#define TAGSLEN 512 /* IRCv3 message tags */
|
|
|
|
#define DATALEN 510 /* RFC1459 message data */
|
2007-01-25 06:40:21 +00:00
|
|
|
#define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */
|
2017-06-28 20:24:10 +00:00
|
|
|
#define EXT_BUFSIZE (TAGSLEN + DATALEN + 1)
|
2009-06-03 21:18:07 +00:00
|
|
|
#define OPERNICKLEN (NICKLEN*2) /* Length of OPERNICKs. */
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
#define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5)
|
|
|
|
#define MAX_DATE_STRING 32 /* maximum string length for a date string */
|
|
|
|
|
|
|
|
#define HELPLEN 400
|
|
|
|
|
2014-03-03 04:25:47 +00:00
|
|
|
/*
|
|
|
|
* message return values
|
2007-01-25 06:40:21 +00:00
|
|
|
*/
|
|
|
|
#define CLIENT_EXITED -2
|
|
|
|
#define CLIENT_PARSE_ERROR -1
|
|
|
|
#define CLIENT_OK 1
|
|
|
|
|
2008-04-05 16:57:30 +00:00
|
|
|
#ifdef RB_IPV6
|
2007-01-25 06:40:21 +00:00
|
|
|
#ifndef AF_INET6
|
|
|
|
#error "AF_INET6 not defined"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-04-05 16:57:30 +00:00
|
|
|
#else /* #ifdef RB_IPV6 */
|
2007-01-25 06:40:21 +00:00
|
|
|
|
|
|
|
#ifndef AF_INET6
|
|
|
|
#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
|
|
|
|
#endif
|
2008-04-05 16:57:30 +00:00
|
|
|
#endif /* #ifdef RB_IPV6 */
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2008-04-05 16:57:30 +00:00
|
|
|
#ifdef RB_IPV6
|
2007-01-25 06:40:21 +00:00
|
|
|
#define PATRICIA_BITS 128
|
|
|
|
#else
|
|
|
|
#define PATRICIA_BITS 32
|
|
|
|
#endif
|
|
|
|
|
2016-03-23 14:33:56 +00:00
|
|
|
/* Read buffer size */
|
|
|
|
#define READBUF_SIZE 16384
|
|
|
|
|
2007-01-25 06:40:21 +00:00
|
|
|
#endif /* INCLUDED_ircd_defs_h */
|