/[svn]/ircd-hybrid/trunk/src/numeric.c
ViewVC logotype

Contents of /ircd-hybrid/trunk/src/numeric.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8255 - (show annotations)
Wed May 24 17:08:47 2017 UTC (3 years, 2 months ago) by michael
File MIME type: text/x-chdr
File size: 13265 byte(s)
- Change RPL_WELCOME to rfc2812 style now that we have the realhost information in Client::realhost

1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2017 ircd-hybrid development team
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 * USA
20 */
21
22 /*! \file numeric.c
23 * \brief Declarations of numeric replies.
24 * \version $Id$
25 */
26
27 #include "stdinc.h"
28 #include "numeric.h"
29
30
31 static const char *const replies[] =
32 {
33 /* 001 */ [RPL_WELCOME] = ":Welcome to the %s Internet Relay Chat Network %s!%s@%s",
34 /* 002 */ [RPL_YOURHOST] = ":Your host is %s, running version %s",
35 /* 003 */ [RPL_CREATED] = ":This server was created %s",
36 /* 004 */ [RPL_MYINFO] = "%s %s %s bchiklmnoprstuveCILMORST bkloveIh",
37 /* 005 */ [RPL_ISUPPORT] = "%s :are supported by this server",
38 /* 010 */ [RPL_REDIR] = "%s %u :Please use this Server/Port instead",
39 /* 015 */ [RPL_MAP] = ":%s%s",
40 /* 016 */ [RPL_MAPMORE] = ":%s%s --> *more*",
41 /* 017 */ [RPL_MAPEND] = ":End of /MAP",
42 /* 200 */ [RPL_TRACELINK] = "Link %s %s %s",
43 /* 201 */ [RPL_TRACECONNECTING] = "Try. %s %s",
44 /* 202 */ [RPL_TRACEHANDSHAKE] = "H.S. %s %s",
45 /* 203 */ [RPL_TRACEUNKNOWN] = "???? %s %s (%s) %ju",
46 /* 204 */ [RPL_TRACEOPERATOR] = "Oper %s %s (%s) %ju %u",
47 /* 205 */ [RPL_TRACEUSER] = "User %s %s (%s) %ju %u",
48 /* 206 */ [RPL_TRACESERVER] = "Serv %s %uS %uC %s %s!%s@%s %ju",
49 /* 208 */ [RPL_TRACENEWTYPE] = "<newtype> 0 %s",
50 /* 209 */ [RPL_TRACECLASS] = "Class %s %u",
51 /* 211 */ [RPL_STATSLINKINFO] = "%s %u %u %ju %u %ju :%u %u %s",
52 /* 212 */ [RPL_STATSCOMMANDS] = "%s %u %ju :%u",
53 /* 213 */ [RPL_STATSCLINE] = "%c %s %s %s %u %s",
54 /* 215 */ [RPL_STATSILINE] = "%c %s * %s@%s %u %s",
55 /* 216 */ [RPL_STATSKLINE] = "%c %s * %s :%s",
56 /* 217 */ [RPL_STATSQLINE] = "%c %s :%s",
57 /* 218 */ [RPL_STATSYLINE] = "%c %s %u %u %u %u %u %u %u/%u %u/%u %s",
58 /* 219 */ [RPL_ENDOFSTATS] = "%c :End of /STATS report",
59 /* 220 */ [RPL_STATSPLINE] = "%c %d %s %d %s :%s",
60 /* 221 */ [RPL_UMODEIS] = "%s",
61 /* 225 */ [RPL_STATSDLINE] = "%c %s :%s",
62 /* 226 */ [RPL_STATSALINE] = "%s",
63 /* 241 */ [RPL_STATSLLINE] = "%c %s * %s %u %s",
64 /* 242 */ [RPL_STATSUPTIME] = ":Server Up %s",
65 /* 243 */ [RPL_STATSOLINE] = "%c %s@%s * %s %s %s",
66 /* 244 */ [RPL_STATSHLINE] = "%c %s * %s %u %s",
67 /* 245 */ [RPL_STATSTLINE] = "T %s %s",
68 /* 246 */ [RPL_STATSSERVICE] = "%c %s * %s %u %u",
69 /* 247 */ [RPL_STATSXLINE] = "%c %s :%s",
70 /* 248 */ [RPL_STATSULINE] = "U %s %s@%s %s",
71 /* 250 */ [RPL_STATSCONN] = ":Highest connection count: %u (%u clients) (%ju connections received)",
72 /* 251 */ [RPL_LUSERCLIENT] = ":There are %u users and %u invisible on %u servers",
73 /* 252 */ [RPL_LUSEROP] = "%u :IRC Operators online",
74 /* 253 */ [RPL_LUSERUNKNOWN] = "%u :unknown connection(s)",
75 /* 254 */ [RPL_LUSERCHANNELS] = "%u :channels formed",
76 /* 255 */ [RPL_LUSERME] = ":I have %u clients and %u servers",
77 /* 256 */ [RPL_ADMINME] = ":Administrative info about %s",
78 /* 257 */ [RPL_ADMINLOC1] = ":%s",
79 /* 258 */ [RPL_ADMINLOC2] = ":%s",
80 /* 259 */ [RPL_ADMINEMAIL] = ":%s",
81 /* 262 */ [RPL_TRACEEND] = "%s :End of TRACE",
82 /* 263 */ [RPL_LOAD2HI] = "%s :Server load is temporarily too heavy. Please wait a while and try again.",
83 /* 265 */ [RPL_LOCALUSERS] = ":Current local users: %u Max: %u",
84 /* 266 */ [RPL_GLOBALUSERS] = ":Current global users: %u Max: %u",
85 /* 276 */ [RPL_WHOISCERTFP] = "%s :has client certificate fingerprint %s",
86 /* 281 */ [RPL_ACCEPTLIST] = ":%s",
87 /* 282 */ [RPL_ENDOFACCEPT] = ":End of /ACCEPT list.",
88 /* 301 */ [RPL_AWAY] = "%s :%s",
89 /* 302 */ [RPL_USERHOST] = ":%s 302 %s :%s",
90 /* 303 */ [RPL_ISON] = ":%s 303 %s :",
91 /* 305 */ [RPL_UNAWAY] = ":You are no longer marked as being away",
92 /* 306 */ [RPL_NOWAWAY] = ":You have been marked as being away",
93 /* 307 */ [RPL_WHOISREGNICK] = "%s :has identified for this nick",
94 /* 311 */ [RPL_WHOISUSER] = "%s %s %s * :%s",
95 /* 312 */ [RPL_WHOISSERVER] = "%s %s :%s",
96 /* 313 */ [RPL_WHOISOPERATOR] = "%s :%s",
97 /* 314 */ [RPL_WHOWASUSER] = "%s %s %s * :%s",
98 /* 315 */ [RPL_ENDOFWHO] = "%s :End of /WHO list.",
99 /* 317 */ [RPL_WHOISIDLE] = "%s %u %ju :seconds idle, signon time",
100 /* 318 */ [RPL_ENDOFWHOIS] = "%s :End of /WHOIS list.",
101 /* 319 */ [RPL_WHOISCHANNELS] = ":%s 319 %s %s :%s",
102 /* 321 */ [RPL_LISTSTART] = "Channel :Users Name",
103 /* 322 */ [RPL_LIST] = "%s %u :%s%s",
104 /* 323 */ [RPL_LISTEND] = ":End of /LIST",
105 /* 324 */ [RPL_CHANNELMODEIS] = "%s %s %s",
106 /* 329 */ [RPL_CREATIONTIME] = "%s %ju",
107 /* 330 */ [RPL_WHOISACCOUNT] = "%s %s :%s logged in as",
108 /* 331 */ [RPL_NOTOPIC] = "%s :No topic is set.",
109 /* 332 */ [RPL_TOPIC] = "%s :%s",
110 /* 333 */ [RPL_TOPICWHOTIME] = "%s %s %ju",
111 /* 335 */ [RPL_WHOISTEXT] = "%s :%s",
112 /* 336 */ [RPL_INVITELIST] = ":%s",
113 /* 337 */ [RPL_ENDOFINVITELIST] = ":End of /INVITE list.",
114 /* 338 */ [RPL_WHOISACTUALLY] = "%s %s@%s %s :Actual user@host, actual IP",
115 /* 341 */ [RPL_INVITING] = "%s %s",
116 /* 346 */ [RPL_INVEXLIST] = "%s %s!%s@%s %s %ju",
117 /* 347 */ [RPL_ENDOFINVEXLIST] = "%s :End of Channel Invite List",
118 /* 348 */ [RPL_EXCEPTLIST] = "%s %s!%s@%s %s %ju",
119 /* 349 */ [RPL_ENDOFEXCEPTLIST] = "%s :End of Channel Exception List",
120 /* 351 */ [RPL_VERSION] = "%s(%s). %s :%s",
121 /* 352 */ [RPL_WHOREPLY] = "%s %s %s %s %s %s :%u %s",
122 /* 353 */ [RPL_NAMREPLY] = ":%s 353 %s %s %s :",
123 /* 362 */ [RPL_CLOSING] = "%s :Closed. Status = %u",
124 /* 363 */ [RPL_CLOSEEND] = "%u: Connections closed",
125 /* 364 */ [RPL_LINKS] = "%s %s :%u %s",
126 /* 365 */ [RPL_ENDOFLINKS] = "%s :End of /LINKS list.",
127 /* 366 */ [RPL_ENDOFNAMES] = "%s :End of /NAMES list.",
128 /* 367 */ [RPL_BANLIST] = "%s %s!%s@%s %s %ju",
129 /* 368 */ [RPL_ENDOFBANLIST] = "%s :End of Channel Ban List",
130 /* 369 */ [RPL_ENDOFWHOWAS] = "%s :End of WHOWAS",
131 /* 371 */ [RPL_INFO] = ":%s",
132 /* 372 */ [RPL_MOTD] = ":- %s",
133 /* 373 */ [RPL_INFOSTART] = ":Server INFO",
134 /* 374 */ [RPL_ENDOFINFO] = ":End of /INFO list.",
135 /* 375 */ [RPL_MOTDSTART] = ":- %s Message of the Day - ",
136 /* 376 */ [RPL_ENDOFMOTD] = ":End of /MOTD command.",
137 /* 379 */ [RPL_WHOISMODES] = "%s :is using modes %s",
138 /* 381 */ [RPL_YOUREOPER] = ":You are now an IRC operator",
139 /* 382 */ [RPL_REHASHING] = "%s :Rehashing",
140 /* 391 */ [RPL_TIME] = "%s :%s",
141 /* 396 */ [RPL_VISIBLEHOST] = "%s :is now your visible host",
142 /* 401 */ [ERR_NOSUCHNICK] = "%s :No such nick/channel",
143 /* 402 */ [ERR_NOSUCHSERVER] = "%s :No such server",
144 /* 403 */ [ERR_NOSUCHCHANNEL] = "%s :No such channel",
145 /* 404 */ [ERR_CANNOTSENDTOCHAN] = "%s :Cannot send to channel",
146 /* 405 */ [ERR_TOOMANYCHANNELS] = "%s :You have joined too many channels",
147 /* 406 */ [ERR_WASNOSUCHNICK] = "%s :There was no such nickname",
148 /* 407 */ [ERR_TOOMANYTARGETS] = "%s :Too many recipients. Only %u processed",
149 /* 408 */ [ERR_NOCTRLSONCHAN] = "%s :You cannot use control codes on this channel. Not sent: %s",
150 /* 409 */ [ERR_NOORIGIN] = ":No origin specified",
151 /* 410 */ [ERR_INVALIDCAPCMD] = "%s :Invalid CAP subcommand",
152 /* 411 */ [ERR_NORECIPIENT] = ":No recipient given (%s)",
153 /* 412 */ [ERR_NOTEXTTOSEND] = ":No text to send",
154 /* 413 */ [ERR_NOTOPLEVEL] = "%s :No top-level domain specified",
155 /* 414 */ [ERR_WILDTOPLEVEL] = "%s :Wildcard in top-level domain",
156 /* 421 */ [ERR_UNKNOWNCOMMAND] = "%s :Unknown command",
157 /* 422 */ [ERR_NOMOTD] = ":MOTD File is missing",
158 /* 429 */ [ERR_TOOMANYAWAY] = ":Too many aways - Flood protection activated",
159 /* 431 */ [ERR_NONICKNAMEGIVEN] = ":No nickname given",
160 /* 432 */ [ERR_ERRONEUSNICKNAME] = "%s :%s",
161 /* 433 */ [ERR_NICKNAMEINUSE] = "%s :Nickname is already in use.",
162 /* 436 */ [ERR_NICKCOLLISION] = "%s :Nickname collision KILL",
163 /* 438 */ [ERR_NICKTOOFAST] = "%s :Nick change too fast. Please wait %u seconds.",
164 /* 440 */ [ERR_SERVICESDOWN] = "%s :Services are currently unavailable.",
165 /* 441 */ [ERR_USERNOTINCHANNEL] = "%s %s :They aren't on that channel",
166 /* 442 */ [ERR_NOTONCHANNEL] = "%s :You are not on that channel",
167 /* 443 */ [ERR_USERONCHANNEL] = "%s %s :is already on channel",
168 /* 451 */ [ERR_NOTREGISTERED] = ":You have not registered",
169 /* 456 */ [ERR_ACCEPTFULL] = ":Accept list is full",
170 /* 457 */ [ERR_ACCEPTEXIST] = "%s!%s@%s :is already on your accept list",
171 /* 458 */ [ERR_ACCEPTNOT] = "%s!%s@%s :is not on your accept list",
172 /* 461 */ [ERR_NEEDMOREPARAMS] = "%s :Not enough parameters",
173 /* 462 */ [ERR_ALREADYREGISTRED] = ":You may not reregister",
174 /* 464 */ [ERR_PASSWDMISMATCH] = ":Password incorrect",
175 /* 465 */ [ERR_YOUREBANNEDCREEP] = ":You are banned from this server- %s",
176 /* 468 */ [ERR_ONLYSERVERSCANCHANGE] = "%s :Only servers can change that mode",
177 /* 471 */ [ERR_CHANNELISFULL] = "%s :Cannot join channel (+l)",
178 /* 472 */ [ERR_UNKNOWNMODE] = "%c :is unknown mode char to me",
179 /* 473 */ [ERR_INVITEONLYCHAN] = "%s :Cannot join channel (+i)",
180 /* 474 */ [ERR_BANNEDFROMCHAN] = "%s :Cannot join channel (+b)",
181 /* 475 */ [ERR_BADCHANNELKEY] = "%s :Cannot join channel (+k)",
182 /* 477 */ [ERR_NEEDREGGEDNICK] = "%s :You need to identify to a registered nick to join or speak in that channel.",
183 /* 478 */ [ERR_BANLISTFULL] = "%s %s :Channel ban list is full",
184 /* 479 */ [ERR_BADCHANNAME] = "%s :Illegal channel name",
185 /* 481 */ [ERR_NOPRIVILEGES] = ":Permission denied - You are not an IRC operator",
186 /* 482 */ [ERR_CHANOPRIVSNEEDED] = "%s :You are not channel operator",
187 /* 483 */ [ERR_CANTKILLSERVER] = ":You cannot kill a server!",
188 /* 485 */ [ERR_CHANBANREASON] = "%s :Cannot join channel (%s)",
189 /* 486 */ [ERR_NONONREG] = "%s :You must identify to a registered nick to private message that person",
190 /* 489 */ [ERR_SSLONLYCHAN] = "%s :Cannot join channel (+S) - SSL/TLS required",
191 /* 491 */ [ERR_NOOPERHOST] = ":Only few of mere mortals may try to enter the twilight zone",
192 /* 492 */ [ERR_NOCTCP] = "%s :You cannot send CTCPs to this channel. Not sent: %s",
193 /* 501 */ [ERR_UMODEUNKNOWNFLAG] = ":Unknown MODE flag",
194 /* 502 */ [ERR_USERSDONTMATCH] = ":Cannot change mode for other users",
195 /* 504 */ [ERR_USERNOTONSERV] = "%s :User is not on this server",
196 /* 512 */ [ERR_TOOMANYWATCH] = "%s :Maximum size for WATCH-list is %u entries",
197 /* 513 */ [ERR_WRONGPONG] = ":To connect type /QUOTE PONG %u",
198 /* 520 */ [ERR_OPERONLYCHAN] = "%s :Cannot join channel (+O)",
199 /* 521 */ [ERR_LISTSYNTAX] = ":Bad list syntax, type /QUOTE HELP LIST",
200 /* 523 */ [ERR_WHOLIMEXCEED] = "%u :%s search limit exceeded.",
201 /* 524 */ [ERR_HELPNOTFOUND] = "%s :Help not found",
202 /* 600 */ [RPL_LOGON] = "%s %s %s %ju :logged online",
203 /* 601 */ [RPL_LOGOFF] = "%s %s %s %ju :logged offline",
204 /* 602 */ [RPL_WATCHOFF] = "%s %s %s %ju :stopped watching",
205 /* 603 */ [RPL_WATCHSTAT] = ":You have %u and are on %u WATCH entries",
206 /* 604 */ [RPL_NOWON] = "%s %s %s %ju :is online",
207 /* 605 */ [RPL_NOWOFF] = "%s %s %s %ju :is offline",
208 /* 606 */ [RPL_WATCHLIST] = ":%s",
209 /* 607 */ [RPL_ENDOFWATCHLIST] = ":End of WATCH %c",
210 /* 671 */ [RPL_WHOISSECURE] = "%s :is connected via SSL (secure link)",
211 /* 702 */ [RPL_MODLIST] = "%s %p %s %s",
212 /* 703 */ [RPL_ENDOFMODLIST] = ":End of /MODULE LIST.",
213 /* 704 */ [RPL_HELPSTART] = "%s :%s",
214 /* 705 */ [RPL_HELPTXT] = "%s :%s",
215 /* 706 */ [RPL_ENDOFHELP] = "%s :End of /HELP.",
216 /* 709 */ [RPL_ETRACE] = "%s %s %s %s %s %s :%s",
217 /* 710 */ [RPL_KNOCK] = "%s %s!%s@%s :has asked for an invite.",
218 /* 711 */ [RPL_KNOCKDLVR] = "%s :Your KNOCK has been delivered.",
219 /* 712 */ [ERR_TOOMANYKNOCK] = "%s :Too many KNOCKs (%s).",
220 /* 713 */ [ERR_CHANOPEN] = "%s :Channel is open.",
221 /* 714 */ [ERR_KNOCKONCHAN] = "%s :You are already on that channel.",
222 /* 715 */ [ERR_TOOMANYINVITE] = "%s :Too many INVITEs (%s).",
223 /* 716 */ [RPL_TARGUMODEG] = "%s :is in %s mode (%s)",
224 /* 717 */ [RPL_TARGNOTIFY] = "%s :has been informed that you messaged them.",
225 /* 718 */ [RPL_UMODEGMSG] = "%s %s@%s :is messaging you, and you are umode %s.",
226 /* 723 */ [ERR_NOPRIVS] = "%s :Insufficient oper privileges.",
227 /* 759 */ [RPL_ETRACEEND] = "%s :End of ETRACE",
228 /* 999 */ [ERR_LAST_ERR_MSG] = ":Last error message"
229 };
230
231 /*
232 * numeric_form
233 *
234 * inputs - numeric
235 * output - corresponding string
236 * side effects - NONE
237 */
238 const char *
239 numeric_form(enum irc_numerics numeric)
240 {
241 assert(numeric < ERR_LAST_ERR_MSG);
242
243 if (numeric > ERR_LAST_ERR_MSG)
244 numeric = ERR_LAST_ERR_MSG;
245
246 assert(replies[numeric]);
247
248 return replies[numeric];
249 }

Properties

Name Value
svn:eol-style native
svn:keywords Id

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28