InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
numerics.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
5  * Copyright (C) 2008 Craig Edwards <craigedwards@brainbox.cc>
6  *
7  * This file is part of InspIRCd. InspIRCd is free software: you can
8  * redistribute it and/or modify it under the terms of the GNU General Public
9  * License as published by the Free Software Foundation, version 2.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 #ifndef NUMERICS_H
22 #define NUMERICS_H
23 
24 /*
25  * This file is aimed providing a string that is easier to use than using the numeric
26  * directly.
27  *
28  * Module authors, please note!
29  * While you are free to use any numerics on this list, like the rest of the core, you
30  * *should not* be editing it!
31  * You should just WriteNumeric(444, .. or whatever as you would before this file, OR:
32  * #define RPL_MYNUMERIC 444 & WriteNumeric(RPL_MYNUMERIC, ...
33  *
34  * If you *do* have a suggestion for a numeric you genuinely believe would be useful,
35  * please speak to us. :)
36  *
37  * Thanks to Darom, jackmcbarn and Brain for suggesting and discussing this.
38  *
39  * Please note that the list may not be exhaustive, it'll be done when I have
40  * nothing better to do with my time. -- w00t (jul 13, 2008)
41  */
42 enum Numerics
43 {
44  /*
45  * Reply range of numerics.
46  */
47  RPL_WELCOME = 1, // 2812, not 1459
48  RPL_YOURHOSTIS = 2, // 2812, not 1459
49  RPL_SERVERCREATED = 3, // 2812, not 1459
50  RPL_SERVERVERSION = 4, // 2812, not 1459
51  RPL_ISUPPORT = 5, // not RFC, extremely common though (defined as RPL_BOUNCE in 2812, widely ignored)
52 
53  RPL_MAP = 6, // unrealircd
54  RPL_ENDMAP = 7, // unrealircd
55  RPL_SNOMASKIS = 8, // unrealircd
56 
57  RPL_YOURUUID = 42, // taken from ircnet
58 
59  RPL_UMODEIS = 221,
60  RPL_RULES = 232, // unrealircd
61  RPL_ADMINME = 256,
62  RPL_ADMINLOC1 = 257,
63  RPL_ADMINLOC2 = 258,
64  RPL_ADMINEMAIL = 259,
65  RPL_MAPUSERS = 270, // insp-specific
66 
67  RPL_SYNTAX = 304, // insp-specific
68 
69  RPL_UNAWAY = 305,
70  RPL_NOWAWAY = 306,
71 
72  RPL_RULESTART = 308, // unrealircd
73  RPL_RULESEND = 309, // unrealircd
74  RPL_CHANNELMODEIS = 324,
75  RPL_CHANNELCREATED = 329, // ???
76  RPL_NOTOPICSET = 331,
77  RPL_TOPIC = 332,
78  RPL_TOPICTIME = 333, // not RFC, extremely common though
79 
80  RPL_INVITING = 341,
81  RPL_INVITELIST = 346, // insp-specific (stolen from ircu)
82  RPL_ENDOFINVITELIST = 347, // insp-specific (stolen from ircu)
83  RPL_VERSION = 351,
84  RPL_NAMREPLY = 353,
85  RPL_ENDOFNAMES = 366,
86 
87  RPL_INFO = 371,
88  RPL_ENDOFINFO = 374,
89  RPL_MOTD = 372,
90  RPL_MOTDSTART = 375,
91  RPL_ENDOFMOTD = 376,
92 
93  RPL_YOUAREOPER = 381,
94  RPL_REHASHING = 382,
95  RPL_TIME = 391,
96  RPL_YOURDISPLAYEDHOST = 396, // from charybdis/etc, common convention
97 
98  /*
99  * Error range of numerics.
100  */
101  ERR_NOSUCHNICK = 401,
102  ERR_NOSUCHSERVER = 402,
103  ERR_NOSUCHCHANNEL = 403, // used to indicate an invalid channel name also, so don't rely on RFC text (don't do that anyway!)
104  ERR_CANNOTSENDTOCHAN = 404,
105  ERR_TOOMANYCHANNELS = 405,
106  ERR_INVALIDCAPSUBCOMMAND = 410, // ratbox/charybdis(?)
107  ERR_UNKNOWNCOMMAND = 421,
108  ERR_NOMOTD = 422,
109  ERR_NORULES = 434, // unrealircd
110  ERR_USERNOTINCHANNEL = 441,
111  ERR_NOTONCHANNEL = 442,
112  ERR_USERONCHANNEL = 443,
113  ERR_CANTCHANGENICK = 447, // unrealircd, probably
114  ERR_NOTREGISTERED = 451,
115  ERR_NEEDMOREPARAMS = 461,
116  ERR_ALREADYREGISTERED = 462,
117 
118  /*
119  * A quick side-rant about the next group of numerics..
120  * There are clients out there that like to assume that just because they don't recieve a numeric
121  * they know, that they have joined the channel.
122  *
123  * If IRC was at all properly standardised, this may even be a semi-acceptable assumption to make,
124  * but that's not the case as we all know, so IT IS NOT ACCEPTABLE. Especially for Insp users, where
125  * differing modules MAY potentially choose to block joins and send NOTICEs or other text to the user
126  * instead!
127  *
128  * tl;dr version:
129  * DON'T MAKE YOUR CLIENT ASSUME YOU JOINED UNLESS YOU RECIEVE A JOIN WITH YOUR DAMN NICK ON IT.
130  * Thanks.
131  *
132  * -- A message from the IRC group for coder sanity, and w00t
133  */
134  ERR_BADCHANNELKEY = 475,
135  ERR_INVITEONLYCHAN = 473,
136  ERR_CHANNELISFULL = 471,
137  ERR_BANNEDFROMCHAN = 474,
138 
139  ERR_NOPRIVILEGES = 481, // rfc, beware though, we use this for other things opers may not do also
140  ERR_CHANOPRIVSNEEDED = 482, // rfc, beware though, we use this for other things like trying to kick a uline
141 
142  ERR_ALLMUSTSSL = 490, // unrealircd
143  ERR_NOCTCPALLOWED = 492, // XXX: bzzzz. 1459 defines this as ERR_NOSERVICEHOST, research it more and perhaps change this! (ERR_CANNOTSENDTOCHAN?)
144  // wtf, we also use this for m_noinvite. UGLY!
145  ERR_DELAYREJOIN = 495, // insp-specific, XXX: we should use 'resource temporarily unavailable' from ircnet/ratbox or whatever
146  ERR_UNKNOWNSNOMASK = 501, // insp-specific
147  ERR_USERSDONTMATCH = 502,
148  ERR_CANTJOINOPERSONLY = 520, // unrealircd, but crap to have so many numerics for cant join..
149  ERR_CANTSENDTOUSER = 531, // ???
150 
151  RPL_COMMANDS = 702, // insp-specific
152  RPL_COMMANDSEND = 703, // insp-specific
153 
154  ERR_WORDFILTERED = 936, // insp-specific, would be nice if we could get rid of this..
155  ERR_CANTUNLOADMODULE = 972, // insp-specific
156  RPL_UNLOADEDMODULE = 973, // insp-specific
157  ERR_CANTLOADMODULE = 974, // insp-specific
158  RPL_LOADEDMODULE = 975 // insp-specific
159 };
160 
161 #endif