summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-01-17 18:05:11 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2014-01-17 18:05:11 +0000
commita8644e71c3fe50605180c186d4e2d408f2ca0cdd (patch)
treef804604962707a7dcb1e925c83aaa967c39834bb /include
parent15969d8cd46d4cd4239a6bbe31658e5318d14404 (diff)
- Made irc numeric use an enum
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2849 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'include')
-rw-r--r--include/numeric.h464
1 files changed, 229 insertions, 235 deletions
diff --git a/include/numeric.h b/include/numeric.h
index 84a7e78..c3a9375 100644
--- a/include/numeric.h
+++ b/include/numeric.h
@@ -1,8 +1,7 @@
/*
- * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
- * numeric.h: A header for the numeric functions.
+ * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
*
- * Copyright (C) 2002 by the past and present ircd coders, and others.
+ * Copyright (c) 1997-2014 ircd-hybrid 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
@@ -18,251 +17,246 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
- *
- * $Id$
+ */
+
+/*! \file numeric.h
+ * \brief Declarations of numeric replies.
+ * \version $Id$
*/
#ifndef INCLUDED_numeric_h
#define INCLUDED_numeric_h
-/* form_str - return a format string for a message number
- * messages are defined below
- */
-extern const char *form_str(unsigned int);
-
/*
* Reserve numerics 000-099 for server-client connections where the client
* is local to the server. If any server is passed a numeric in this range
* from another server then it is remapped to 100-199. -avalon
*/
-#define RPL_WELCOME 001
-#define RPL_YOURHOST 002
-#define RPL_CREATED 003
-#define RPL_MYINFO 004
-#define RPL_ISUPPORT 005
-#define RPL_REDIR 10
-#define RPL_MAP 15 /* Undernet extension */
-#define RPL_MAPMORE 16 /* Undernet extension */
-#define RPL_MAPEND 17 /* Undernet extension */
-
-#define RPL_YOURID 42 /* IRCnet extension */
-
-/*
- * Numeric replies from server commands.
- * These are currently in the range 200-399.
- */
-#define RPL_TRACELINK 200
-#define RPL_TRACECONNECTING 201
-#define RPL_TRACEHANDSHAKE 202
-#define RPL_TRACEUNKNOWN 203
-#define RPL_TRACEOPERATOR 204
-#define RPL_TRACEUSER 205
-#define RPL_TRACESERVER 206
-#define RPL_TRACENEWTYPE 208
-#define RPL_TRACECLASS 209
-#define RPL_STATSLINKINFO 211
-#define RPL_STATSCOMMANDS 212
-#define RPL_STATSCLINE 213
-#define RPL_STATSNLINE 214
-#define RPL_STATSILINE 215
-#define RPL_STATSKLINE 216
-#define RPL_STATSQLINE 217
-#define RPL_STATSYLINE 218
-#define RPL_ENDOFSTATS 219
-
-/*
- * note ircu uses 217 for STATSPLINE frip. conflict
- * as RPL_STATSQLINE was used in old 2.8 for Q line
- * I'm going to steal 220 for now *sigh*
- * -Dianora
- */
-#define RPL_STATSPLINE 220
-#define RPL_UMODEIS 221
-#define RPL_STATSFLINE 224
-#define RPL_STATSDLINE 225
-#define RPL_STATSALINE 226
-#define RPL_STATSLLINE 241
-#define RPL_STATSUPTIME 242
-#define RPL_STATSOLINE 243
-#define RPL_STATSHLINE 244
-#define RPL_STATSTLINE 245
-#define RPL_STATSSERVICE 246
-#define RPL_STATSXLINE 247
-#define RPL_STATSULINE 248
-#define RPL_STATSDEBUG 249
-#define RPL_STATSCONN 250
-#define RPL_LUSERCLIENT 251
-#define RPL_LUSEROP 252
-#define RPL_LUSERUNKNOWN 253
-#define RPL_LUSERCHANNELS 254
-#define RPL_LUSERME 255
-#define RPL_ADMINME 256
-#define RPL_ADMINLOC1 257
-#define RPL_ADMINLOC2 258
-#define RPL_ADMINEMAIL 259
-#define RPL_ENDOFTRACE 262
-#define RPL_LOAD2HI 263
-#define RPL_LOCALUSERS 265
-#define RPL_GLOBALUSERS 266
-#define RPL_WHOISCERTFP 276
-#define RPL_ACCEPTLIST 281
-#define RPL_ENDOFACCEPT 282
-#define RPL_NEWHOSTIS 285
+enum irc_numerics
+{
+ RPL_WELCOME = 1,
+ RPL_YOURHOST = 2,
+ RPL_CREATED = 3,
+ RPL_MYINFO = 4,
+ RPL_ISUPPORT = 5,
+ RPL_REDIR = 10,
+ RPL_MAP = 15,
+ RPL_MAPMORE = 16,
+ RPL_MAPEND = 17,
+ RPL_YOURID = 42,
-/* numeric_replies */
-#define RPL_AWAY 301
-#define RPL_USERHOST 302
-#define RPL_ISON 303
-#define RPL_UNAWAY 305
-#define RPL_NOWAWAY 306
-#define RPL_WHOISREGNICK 307
-#define RPL_WHOISUSER 311
-#define RPL_WHOISSERVER 312
-#define RPL_WHOISOPERATOR 313
-
-#define RPL_WHOWASUSER 314
-#define RPL_ENDOFWHO 315
-#define RPL_WHOISCHANOP 316 /* redundant and not needed but reserved */
-#define RPL_WHOISIDLE 317
-#define RPL_ENDOFWHOIS 318
-#define RPL_WHOISCHANNELS 319
-#define RPL_LISTSTART 321
-#define RPL_LIST 322
-#define RPL_LISTEND 323
-#define RPL_CHANNELMODEIS 324
-#define RPL_CREATIONTIME 329
-#define RPL_WHOISACCOUNT 330
-#define RPL_NOTOPIC 331
-#define RPL_TOPIC 332
-#define RPL_TOPICWHOTIME 333
-#define RPL_WHOISTEXT 337
-#define RPL_WHOISACTUALLY 338
-#define RPL_INVITING 341
-#define RPL_INVITELIST 346
-#define RPL_ENDOFINVITELIST 347
-#define RPL_EXCEPTLIST 348
-#define RPL_ENDOFEXCEPTLIST 349
-#define RPL_VERSION 351
-#define RPL_WHOREPLY 352
-#define RPL_NAMREPLY 353
-#define RPL_CLOSING 362
-#define RPL_CLOSEEND 363
-#define RPL_LINKS 364
-#define RPL_ENDOFLINKS 365
-#define RPL_ENDOFNAMES 366
-#define RPL_BANLIST 367
-#define RPL_ENDOFBANLIST 368
-#define RPL_ENDOFWHOWAS 369
-#define RPL_INFO 371
-#define RPL_MOTD 372
-#define RPL_INFOSTART 373
-#define RPL_ENDOFINFO 374
-#define RPL_MOTDSTART 375
-#define RPL_ENDOFMOTD 376
-#define RPL_WHOISMODES 379
-#define RPL_YOUREOPER 381
-#define RPL_REHASHING 382
-#define RPL_RSACHALLENGE 386
-#define RPL_TIME 391
-#define RPL_USERSSTART 392
-#define RPL_USERS 393
-#define RPL_ENDOFUSERS 394
-#define RPL_NOUSERS 395
-#define RPL_HOSTHIDDEN 396
-
-/*
- * Errors are in the range from 400-599 currently and are grouped by what
- * commands they come from.
- */
-#define ERR_NOSUCHNICK 401
-#define ERR_NOSUCHSERVER 402
-#define ERR_NOSUCHCHANNEL 403
-#define ERR_CANNOTSENDTOCHAN 404
-#define ERR_TOOMANYCHANNELS 405
-#define ERR_WASNOSUCHNICK 406
-#define ERR_TOOMANYTARGETS 407
-#define ERR_NOCTRLSONCHAN 408
-#define ERR_NOORIGIN 409
-#define ERR_INVALIDCAPCMD 410
+ /*
+ * Numeric replies from server commands.
+ * These are currently in the range 200-399.
+ */
+ RPL_TRACELINK = 200,
+ RPL_TRACECONNECTING = 201,
+ RPL_TRACEHANDSHAKE = 202,
+ RPL_TRACEUNKNOWN = 203,
+ RPL_TRACEOPERATOR = 204,
+ RPL_TRACEUSER = 205,
+ RPL_TRACESERVER = 206,
+ RPL_TRACENEWTYPE = 208,
+ RPL_TRACECLASS = 209,
+ RPL_STATSLINKINFO = 211,
+ RPL_STATSCOMMANDS = 212,
+ RPL_STATSCLINE = 213,
+ RPL_STATSNLINE = 214,
+ RPL_STATSILINE = 215,
+ RPL_STATSKLINE = 216,
+ RPL_STATSQLINE = 217,
+ RPL_STATSYLINE = 218,
+ RPL_ENDOFSTATS = 219,
-#define ERR_NORECIPIENT 411
-#define ERR_NOTEXTTOSEND 412
-#define ERR_NOTOPLEVEL 413
-#define ERR_WILDTOPLEVEL 414
-#define ERR_UNKNOWNCOMMAND 421
-#define ERR_NOMOTD 422
-#define ERR_NOADMININFO 423
-#define ERR_NONICKNAMEGIVEN 431
-#define ERR_ERRONEUSNICKNAME 432
-#define ERR_NICKNAMEINUSE 433
-#define ERR_NICKCOLLISION 436
-#define ERR_UNAVAILRESOURCE 437
-#define ERR_NICKTOOFAST 438 /* We did it first Undernet! ;) db */
-#define ERR_SERVICESDOWN 440
-#define ERR_USERNOTINCHANNEL 441
-#define ERR_NOTONCHANNEL 442
-#define ERR_USERONCHANNEL 443
-#define ERR_NOTREGISTERED 451
-#define ERR_ACCEPTFULL 456
-#define ERR_ACCEPTEXIST 457
-#define ERR_ACCEPTNOT 458
-#define ERR_NEEDMOREPARAMS 461
-#define ERR_ALREADYREGISTRED 462
-#define ERR_PASSWDMISMATCH 464
-#define ERR_YOUREBANNEDCREEP 465
-#define ERR_ONLYSERVERSCANCHANGE 468
-#define ERR_OPERONLYCHAN 470
-#define ERR_CHANNELISFULL 471
-#define ERR_UNKNOWNMODE 472
-#define ERR_INVITEONLYCHAN 473
-#define ERR_BANNEDFROMCHAN 474
-#define ERR_BADCHANNELKEY 475
-#define ERR_NEEDREGGEDNICK 477
-#define ERR_BANLISTFULL 478 /* I stole the numeric from ircu -db */
-#define ERR_BADCHANNAME 479
-#define ERR_SSLONLYCHAN 480
-#define ERR_NOPRIVILEGES 481
-#define ERR_CHANOPRIVSNEEDED 482
-#define ERR_CANTKILLSERVER 483
-#define ERR_RESTRICTED 484
-#define ERR_CHANBANREASON 485
-#define ERR_NONONREG 486
-#define ERR_NOOPERHOST 491
-#define ERR_UMODEUNKNOWNFLAG 501
-#define ERR_USERSDONTMATCH 502
-#define ERR_GHOSTEDCLIENT 503
-#define ERR_USERNOTONSERV 504
-#define ERR_TOOMANYWATCH 512
-#define ERR_WRONGPONG 513
-#define ERR_LONGMASK 518 /* Undernet extension -Kev */
-#define ERR_LISTSYNTAX 521
-#define ERR_HELPNOTFOUND 524
-#define RPL_LOGON 600
-#define RPL_LOGOFF 601
-#define RPL_WATCHOFF 602
-#define RPL_WATCHSTAT 603
-#define RPL_NOWON 604
-#define RPL_NOWOFF 605
-#define RPL_WATCHLIST 606
-#define RPL_ENDOFWATCHLIST 607
-#define RPL_WHOISSECURE 671
-#define RPL_MODLIST 702
-#define RPL_ENDOFMODLIST 703
-#define RPL_HELPSTART 704
-#define RPL_HELPTXT 705
-#define RPL_ENDOFHELP 706
-#define RPL_ETRACE 709
-#define RPL_KNOCK 710
-#define RPL_KNOCKDLVR 711
-#define ERR_TOOMANYKNOCK 712
-#define ERR_CHANOPEN 713
-#define ERR_KNOCKONCHAN 714
-#define RPL_TARGUMODEG 716
-#define RPL_TARGNOTIFY 717
-#define RPL_UMODEGMSG 718
-#define ERR_NOPRIVS 723
+ /*
+ * Note ircu uses 217 for STATSPLINE frip. conflict
+ * as RPL_STATSQLINE was used in old 2.8 for Q line
+ * I'm going to steal 220 for now *sigh* -Dianora
+ */
+ RPL_STATSPLINE = 220,
+ RPL_UMODEIS = 221,
+ RPL_STATSFLINE = 224,
+ RPL_STATSDLINE = 225,
+ RPL_STATSALINE = 226,
+ RPL_STATSLLINE = 241,
+ RPL_STATSUPTIME = 242,
+ RPL_STATSOLINE = 243,
+ RPL_STATSHLINE = 244,
+ RPL_STATSTLINE = 245,
+ RPL_STATSSERVICE = 246,
+ RPL_STATSXLINE = 247,
+ RPL_STATSULINE = 248,
+ RPL_STATSDEBUG = 249,
+ RPL_STATSCONN = 250,
+ RPL_LUSERCLIENT = 251,
+ RPL_LUSEROP = 252,
+ RPL_LUSERUNKNOWN = 253,
+ RPL_LUSERCHANNELS = 254,
+ RPL_LUSERME = 255,
+ RPL_ADMINME = 256,
+ RPL_ADMINLOC1 = 257,
+ RPL_ADMINLOC2 = 258,
+ RPL_ADMINEMAIL = 259,
+ RPL_ENDOFTRACE = 262,
+ RPL_LOAD2HI = 263,
+ RPL_LOCALUSERS = 265,
+ RPL_GLOBALUSERS = 266,
+ RPL_WHOISCERTFP = 276,
+ RPL_ACCEPTLIST = 281,
+ RPL_ENDOFACCEPT = 282,
+ RPL_NEWHOSTIS = 285,
+ RPL_AWAY = 301,
+ RPL_USERHOST = 302,
+ RPL_ISON = 303,
+ RPL_UNAWAY = 305,
+ RPL_NOWAWAY = 306,
+ RPL_WHOISREGNICK = 307,
+ RPL_WHOISUSER = 311,
+ RPL_WHOISSERVER = 312,
+ RPL_WHOISOPERATOR = 313,
+ RPL_WHOWASUSER = 314,
+ RPL_ENDOFWHO = 315,
+ RPL_WHOISCHANOP = 316, /* Redundant and not needed but reserved */
+ RPL_WHOISIDLE = 317,
+ RPL_ENDOFWHOIS = 318,
+ RPL_WHOISCHANNELS = 319,
+ RPL_LISTSTART = 321,
+ RPL_LIST = 322,
+ RPL_LISTEND = 323,
+ RPL_CHANNELMODEIS = 324,
+ RPL_CREATIONTIME = 329,
+ RPL_WHOISACCOUNT = 330,
+ RPL_NOTOPIC = 331,
+ RPL_TOPIC = 332,
+ RPL_TOPICWHOTIME = 333,
+ RPL_WHOISTEXT = 337,
+ RPL_WHOISACTUALLY = 338,
+ RPL_INVITING = 341,
+ RPL_INVITELIST = 346,
+ RPL_ENDOFINVITELIST = 347,
+ RPL_EXCEPTLIST = 348,
+ RPL_ENDOFEXCEPTLIST = 349,
+ RPL_VERSION = 351,
+ RPL_WHOREPLY = 352,
+ RPL_NAMREPLY = 353,
+ RPL_CLOSING = 362,
+ RPL_CLOSEEND = 363,
+ RPL_LINKS = 364,
+ RPL_ENDOFLINKS = 365,
+ RPL_ENDOFNAMES = 366,
+ RPL_BANLIST = 367,
+ RPL_ENDOFBANLIST = 368,
+ RPL_ENDOFWHOWAS = 369,
+ RPL_INFO = 371,
+ RPL_MOTD = 372,
+ RPL_INFOSTART = 373,
+ RPL_ENDOFINFO = 374,
+ RPL_MOTDSTART = 375,
+ RPL_ENDOFMOTD = 376,
+ RPL_WHOISMODES = 379,
+ RPL_YOUREOPER = 381,
+ RPL_REHASHING = 382,
+ RPL_RSACHALLENGE = 386,
+ RPL_TIME = 391,
+ RPL_USERSSTART = 392,
+ RPL_USERS = 393,
+ RPL_ENDOFUSERS = 394,
+ RPL_NOUSERS = 395,
+ RPL_HOSTHIDDEN = 396,
-#define ERR_LAST_ERR_MSG 999
+ /*
+ * Errors are in the range from 400-599 currently and are grouped by what
+ * commands they come from.
+ */
+ ERR_NOSUCHNICK = 401,
+ ERR_NOSUCHSERVER = 402,
+ ERR_NOSUCHCHANNEL = 403,
+ ERR_CANNOTSENDTOCHAN = 404,
+ ERR_TOOMANYCHANNELS = 405,
+ ERR_WASNOSUCHNICK = 406,
+ ERR_TOOMANYTARGETS = 407,
+ ERR_NOCTRLSONCHAN = 408,
+ ERR_NOORIGIN = 409,
+ ERR_INVALIDCAPCMD = 410,
+ ERR_NORECIPIENT = 411,
+ ERR_NOTEXTTOSEND = 412,
+ ERR_NOTOPLEVEL = 413,
+ ERR_WILDTOPLEVEL = 414,
+ ERR_UNKNOWNCOMMAND = 421,
+ ERR_NOMOTD = 422,
+ ERR_NOADMININFO = 423,
+ ERR_NONICKNAMEGIVEN = 431,
+ ERR_ERRONEUSNICKNAME = 432,
+ ERR_NICKNAMEINUSE = 433,
+ ERR_NICKCOLLISION = 436,
+ ERR_UNAVAILRESOURCE = 437,
+ ERR_NICKTOOFAST = 438,
+ ERR_SERVICESDOWN = 440,
+ ERR_USERNOTINCHANNEL = 441,
+ ERR_NOTONCHANNEL = 442,
+ ERR_USERONCHANNEL = 443,
+ ERR_NOTREGISTERED = 451,
+ ERR_ACCEPTFULL = 456,
+ ERR_ACCEPTEXIST = 457,
+ ERR_ACCEPTNOT = 458,
+ ERR_NEEDMOREPARAMS = 461,
+ ERR_ALREADYREGISTRED = 462,
+ ERR_PASSWDMISMATCH = 464,
+ ERR_YOUREBANNEDCREEP = 465,
+ ERR_ONLYSERVERSCANCHANGE = 468,
+ ERR_OPERONLYCHAN = 470,
+ ERR_CHANNELISFULL = 471,
+ ERR_UNKNOWNMODE = 472,
+ ERR_INVITEONLYCHAN = 473,
+ ERR_BANNEDFROMCHAN = 474,
+ ERR_BADCHANNELKEY = 475,
+ ERR_NEEDREGGEDNICK = 477,
+ ERR_BANLISTFULL = 478,
+ ERR_BADCHANNAME = 479,
+ ERR_SSLONLYCHAN = 480,
+ ERR_NOPRIVILEGES = 481,
+ ERR_CHANOPRIVSNEEDED = 482,
+ ERR_CANTKILLSERVER = 483,
+ ERR_RESTRICTED = 484,
+ ERR_CHANBANREASON = 485,
+ ERR_NONONREG = 486,
+ ERR_NOOPERHOST = 491,
+ ERR_UMODEUNKNOWNFLAG = 501,
+ ERR_USERSDONTMATCH = 502,
+ ERR_GHOSTEDCLIENT = 503,
+ ERR_USERNOTONSERV = 504,
+ ERR_TOOMANYWATCH = 512,
+ ERR_WRONGPONG = 513,
+ ERR_LONGMASK = 518,
+ ERR_LISTSYNTAX = 521,
+ ERR_HELPNOTFOUND = 524,
+ RPL_LOGON = 600,
+ RPL_LOGOFF = 601,
+ RPL_WATCHOFF = 602,
+ RPL_WATCHSTAT = 603,
+ RPL_NOWON = 604,
+ RPL_NOWOFF = 605,
+ RPL_WATCHLIST = 606,
+ RPL_ENDOFWATCHLIST = 607,
+ RPL_WHOISSECURE = 671,
+ RPL_MODLIST = 702,
+ RPL_ENDOFMODLIST = 703,
+ RPL_HELPSTART = 704,
+ RPL_HELPTXT = 705,
+ RPL_ENDOFHELP = 706,
+ RPL_ETRACE = 709,
+ RPL_KNOCK = 710,
+ RPL_KNOCKDLVR = 711,
+ ERR_TOOMANYKNOCK = 712,
+ ERR_CHANOPEN = 713,
+ ERR_KNOCKONCHAN = 714,
+ RPL_TARGUMODEG = 716,
+ RPL_TARGNOTIFY = 717,
+ RPL_UMODEGMSG = 718,
+ ERR_NOPRIVS = 723,
+ ERR_LAST_ERR_MSG = 999
+};
+extern const char *form_str(enum irc_numerics);
#endif /* INCLUDED_numeric_h */