X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/18f4cc5a2c53dd2ffe61a0f79f3dff098e064845..b2ee72e4487d9ec90ff64f63d8f8c3974d96bc5c:/include/ircd_defs.h diff --git a/include/ircd_defs.h b/include/ircd_defs.h index f5c359f6..cea850ce 100644 --- a/include/ircd_defs.h +++ b/include/ircd_defs.h @@ -21,14 +21,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id: ircd_defs.h 3512 2007-06-06 16:20:40Z nenolod $ */ /* * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure - * Otherwise there are no user servicable part here. - * + * Otherwise there are no user servicable part here. */ /* ircd_defs.h - Global size definitions for record entries used @@ -38,7 +35,7 @@ #ifndef INCLUDED_ircd_defs_h #define INCLUDED_ircd_defs_h -#include "config.h" +#include "defaults.h" /* 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 @@ -59,52 +56,24 @@ #define IRC_DEPRECATED #endif -#include "s_log.h" -#include "send.h" - -#ifdef SOFT_ASSERT -#ifdef __GNUC__ -#define s_assert(expr) do \ - if(!(expr)) { \ - ilog(L_MAIN, \ - "file: %s line: %d (%s): Assertion failed: (%s)", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ - sendto_realops_snomask(SNO_GENERAL, L_ALL, \ - "file: %s line: %d (%s): Assertion failed: (%s)", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \ - } \ - while(0) -#else -#define s_assert(expr) do \ - if(!(expr)) { \ - ilog(L_MAIN, \ - "file: %s line: %d: Assertion failed: (%s)", \ - __FILE__, __LINE__, #expr); \ - sendto_realops_snomask(SNO_GENERAL, L_ALL, \ - "file: %s line: %d: Assertion failed: (%s)" \ - __FILE__, __LINE__, #expr); \ - } \ - while(0) -#endif -#else -#define s_assert(expr) assert(expr) +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif -#if !defined(CONFIG_RATBOX_LEVEL_1) -# error Incorrect config.h for this revision of ircd. +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif -/* - * This defines the version of the data structures used in the ircd. - * In the event of a mismatch (i.e. this is incremented due to a major - * change that cannot be accomidated for in the ircd), then a hard - * restart occurs. - */ -#define CHARYBDIS_DV 0x00010200 /* 1.2.0 */ +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) #define HOSTLEN 63 /* Length of hostname. Updated to */ /* comply with RFC1123 */ +/* Longest hostname we're willing to work with. + * Due to DNSBLs this is more than HOSTLEN. + */ +#define IRCD_RES_HOSTLEN 255 + #define USERLEN 10 #define REALLEN 50 #define CHANNELLEN 200 @@ -116,46 +85,39 @@ * 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 */ -#define BANREASONLEN 390 /* kline/dline/gline */ +#define BANREASONLEN 390 /* kline/dline */ #define AWAYLEN TOPICLEN #define KILLLEN 200 /* with Killed (nick ()) added this should fit in quit */ /* 23+1 for \0 */ #define KEYLEN 24 +#define TAGSLEN 512 /* IRCv3 message tags */ +#define DATALEN 510 /* RFC1459 message data */ #define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */ -#define MAXRECIPIENTS 20 -#define MAXBANLENGTH 1024 -#define OPERNICKLEN NICKLEN*2 /* Length of OPERNICKs. */ +#define EXT_BUFSIZE (TAGSLEN + DATALEN + 1) +#define OPERNICKLEN (NICKLEN*2) /* Length of OPERNICKs. */ -#define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5) +#define NAMELEN (MAX(NICKLEN, HOSTLEN)) + +#define USERHOST_REPLYLEN (NAMELEN+HOSTLEN+USERLEN+5) #define MAX_DATE_STRING 32 /* maximum string length for a date string */ #define HELPLEN 400 -/* - * message return values +/* + * message return values */ #define CLIENT_EXITED -2 #define CLIENT_PARSE_ERROR -1 #define CLIENT_OK 1 -#ifdef IPV6 #ifndef AF_INET6 #error "AF_INET6 not defined" #endif - -#else /* #ifdef IPV6 */ - -#ifndef AF_INET6 -#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */ -#endif -#endif /* #ifdef IPV6 */ - -#ifdef IPV6 #define PATRICIA_BITS 128 -#else -#define PATRICIA_BITS 32 -#endif + +/* Read buffer size */ +#define READBUF_SIZE 16384 #endif /* INCLUDED_ircd_defs_h */