defines.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * ngIRCd -- The Next Generation IRC Daemon
  3. * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * Please read the file COPYING, README and AUTHORS for more information.
  10. */
  11. #ifndef __defines_h__
  12. #define __defines_h__
  13. /**
  14. * @file
  15. * Global constants ("#defines") used by the ngIRCd.
  16. */
  17. /* Internal flags */
  18. /** Flag: there is no connection. */
  19. #define NONE -1
  20. /** Flag: connection is (still) established. */
  21. #define CONNECTED true
  22. /** Flag: connection isn't established (any more). */
  23. #define DISCONNECTED false
  24. /** Tag for outbound server links. */
  25. #define TOKEN_OUTBOUND -2
  26. /* Generic buffer sizes */
  27. /** Max. length of a line in the configuration file. */
  28. #define LINE_LEN 256
  29. /** Max. length of a log message. */
  30. #define MAX_LOG_MSG_LEN 256
  31. /** Max. length of file name. */
  32. #define FNAME_LEN 256
  33. /** Max. lenght of fully qualified host names (e. g. "abc.domain.tld"). */
  34. #define HOST_LEN 256
  35. /* Size of structures */
  36. /** Max. count of configurable servers. */
  37. #define MAX_SERVERS 16
  38. /** Max. number of WHOWAS list items that can be stored. */
  39. #define MAX_WHOWAS 64
  40. /** Size of default connection pool. */
  41. #define CONNECTION_POOL 100
  42. /* Hard-coded (default) options */
  43. /** Delay after startup before outgoing connections are initiated in seconds. */
  44. #define STARTUP_DELAY 1
  45. /** Time to delay re-connect attempts in seconds. */
  46. #define RECONNECT_DELAY 3
  47. /** Configuration file name. */
  48. #define CONFIG_FILE "/ngircd.conf"
  49. /** Name of the MOTD file. */
  50. #define MOTD_FILE "/ngircd.motd"
  51. /** Default chroot() directory. */
  52. #define CHROOT_DIR ""
  53. /** Default file for the process ID. */
  54. #define PID_FILE ""
  55. /* Sizes of "IRC elements": nicks, users, ... */
  56. /** Max. length of an IRC ID (incl. NULL); see RFC 2812 section 1.1 and 1.2.1. */
  57. #define CLIENT_ID_LEN 64
  58. /** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
  59. #define CLIENT_NICK_LEN_DEFAULT 10
  60. /** Maximum nick name length (including NULL). */
  61. #define CLIENT_NICK_LEN 32
  62. /** Max. password length (including NULL). */
  63. #define CLIENT_PASS_LEN 21
  64. /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */
  65. #define CLIENT_USER_LEN 10
  66. /** Max. length of "real names" (including NULL). */
  67. #define CLIENT_NAME_LEN 32
  68. /** Max. host name length (including NULL). */
  69. #define CLIENT_HOST_LEN 64
  70. /** Max. length of all client modes (including NULL). */
  71. #define CLIENT_MODE_LEN 16
  72. /** Max. length of server info texts (including NULL). */
  73. #define CLIENT_INFO_LEN 64
  74. /** Max. length of away messages (including NULL). */
  75. #define CLIENT_AWAY_LEN 128
  76. /** Max. length of client flags (including NULL). */
  77. #define CLIENT_FLAGS_LEN 16
  78. /** Max. length of a channel name (including NULL), see RFC 2812 section 1.3. */
  79. #define CHANNEL_NAME_LEN 51
  80. /** Max. length of channel modes (including NULL). */
  81. #define CHANNEL_MODE_LEN 9
  82. /** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
  83. #define COMMAND_LEN 513
  84. /* Read and write buffer sizes */
  85. /** Size of the read buffer of a connection in bytes. */
  86. #define READBUFFER_LEN 2048
  87. /** Size that triggers write buffer flushing if more space is needed. */
  88. #define WRITEBUFFER_FLUSH_LEN 4096
  89. /** Maximum size of the write buffer of a connection in bytes. */
  90. #define WRITEBUFFER_MAX_LEN 32768
  91. /** Maximum size of the write buffer of a server link connection in bytes. */
  92. #define WRITEBUFFER_SLINK_LEN 65536
  93. /* IRC/IRC+ protocol */
  94. /** Implemented IRC protocol version, see RFC 2813 section 4.1.1. */
  95. #define PROTOVER "0210"
  96. /** Protocol suffix, see RFC 2813 section 4.1.1. */
  97. #define PROTOIRC "-IRC"
  98. /** Protocol suffix used by the IRC+ protocol, see <doc/Protocol.txt>. */
  99. #define PROTOIRCPLUS "-IRC+"
  100. #ifdef IRCPLUS
  101. /** Standard IRC+ flags. */
  102. # define IRCPLUSFLAGS "CHLS"
  103. #endif
  104. /** Supported user modes. */
  105. #define USERMODES "acCiorRswx"
  106. /** Supported channel modes. */
  107. #define CHANMODES "beiIklmnoOPrRstvz"
  108. /** Away message for users connected to linked servers. */
  109. #define DEFAULT_AWAY_MSG "Away"
  110. /** Default ID for "topic owner". */
  111. #define DEFAULT_TOPIC_ID "-Server-"
  112. /** Prefix for NOTICEs from the server to users. Some servers use '*'. */
  113. #define NOTICE_TXTPREFIX ""
  114. /** Suffix for oversized messages that have been shortened and cut off. */
  115. #define CUT_TXTSUFFIX "[CUT]"
  116. /* Defaults and limits for IRC commands */
  117. /** Max. number of LIST replies. */
  118. #define MAX_RPL_LIST 100
  119. /** Max. number of elemets allowed in channel invite and ban lists. */
  120. #define MAX_HNDL_CHANNEL_LISTS 50
  121. /** Max. number of channel modes with arguments per MODE command. */
  122. #define MAX_HNDL_MODES_ARG 5
  123. /** Max. number of WHO replies. */
  124. #define MAX_RPL_WHO 25
  125. /** Max. number of WHOIS replies. */
  126. #define MAX_RPL_WHOIS 10
  127. /** Default count of WHOWAS command replies. */
  128. #define DEF_RPL_WHOWAS 5
  129. /** Max count of WHOWAS command replies. */
  130. #define MAX_RPL_WHOWAS 25
  131. #endif
  132. /* -eof- */