2 * IRC - Internet Relay Chat, include/msg.h
3 * Copyright (C) 1990 Jarkko Oikarinen and
4 * University of Oulu, Computing Center
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 1, or (at your option)
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef INCLUDED_msg_h
23 #define INCLUDED_msg_h
24 #ifndef INCLUDED_ircd_handler_h
25 #include "ircd_handler.h"
36 /*-----------------------------------------------------------------------------
42 * Each command must have a TOK_COMMAND and MSG_COMMAND definition.
43 * If you don't want one or the other, make them the same.
44 * Also each command has a "msgclass" used for debugging purposes.
49 #define MSG_PRIVATE "PRIVMSG" /* PRIV */
50 #define TOK_PRIVATE "P"
52 #define MSG_WHO "WHO" /* WHO -> WHOC */
55 #define MSG_WHOIS "WHOIS" /* WHOI */
58 #define MSG_WHOWAS "WHOWAS" /* WHOW */
59 #define TOK_WHOWAS "X"
61 #define MSG_USER "USER" /* USER */
62 #define TOK_USER "USER"
64 #define MSG_NICK "NICK" /* NICK */
67 #define MSG_SERVER "SERVER" /* SERV */
68 #define TOK_SERVER "S"
70 #define MSG_LIST "LIST" /* LIST */
71 #define TOK_LIST "LIST"
73 #define MSG_TOPIC "TOPIC" /* TOPI */
76 #define MSG_INVITE "INVITE" /* INVI */
77 #define TOK_INVITE "I"
79 #define MSG_VERSION "VERSION" /* VERS */
80 #define TOK_VERSION "V"
82 #define MSG_QUIT "QUIT" /* QUIT */
85 #define MSG_SQUIT "SQUIT" /* SQUI */
86 #define TOK_SQUIT "SQ"
88 #define MSG_KILL "KILL" /* KILL */
91 #define MSG_INFO "INFO" /* INFO */
94 #define MSG_LINKS "LINKS" /* LINK */
95 #define TOK_LINKS "LI"
97 #define MSG_STATS "STATS" /* STAT */
100 #define MSG_HELP "HELP" /* HELP */
101 #define TOK_HELP "HELP"
103 #define MSG_ERROR "ERROR" /* ERRO */
104 #define TOK_ERROR "Y"
106 #define MSG_AWAY "AWAY" /* AWAY */
109 #define MSG_CONNECT "CONNECT" /* CONN */
110 #define TOK_CONNECT "CO"
112 #define MSG_MAP "MAP" /* MAP */
113 #define TOK_MAP "MAP"
115 #define MSG_PING "PING" /* PING */
118 #define MSG_PONG "PONG" /* PONG */
121 #define MSG_OPER "OPER" /* OPER */
122 #define TOK_OPER "OPER"
124 #define MSG_PASS "PASS" /* PASS */
125 #define TOK_PASS "PA"
127 #define MSG_WALLOPS "WALLOPS" /* WALL */
128 #define TOK_WALLOPS "WA"
130 #define MSG_DESYNCH "DESYNCH" /* DESY */
131 #define TOK_DESYNCH "DS"
133 #define MSG_TIME "TIME" /* TIME */
134 #define TOK_TIME "TI"
136 #define MSG_SETTIME "SETTIME" /* SETT */
137 #define TOK_SETTIME "SE"
139 #define MSG_RPING "RPING" /* RPIN */
140 #define TOK_RPING "RI"
142 #define MSG_RPONG "RPONG" /* RPON */
143 #define TOK_RPONG "RO"
145 #define MSG_NAMES "NAMES" /* NAME */
146 #define TOK_NAMES "E"
148 #define MSG_ADMIN "ADMIN" /* ADMI */
149 #define TOK_ADMIN "AD"
151 #define MSG_TRACE "TRACE" /* TRAC */
152 #define TOK_TRACE "TR"
154 #define MSG_NOTICE "NOTICE" /* NOTI */
155 #define TOK_NOTICE "O"
157 #define MSG_WALLCHOPS "WALLCHOPS" /* WC */
158 #define TOK_WALLCHOPS "WC"
160 #define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */
161 #define TOK_CPRIVMSG "CP"
163 #define MSG_CNOTICE "CNOTICE" /* CNOT */
164 #define TOK_CNOTICE "CN"
166 #define MSG_JOIN "JOIN" /* JOIN */
169 #define MSG_PART "PART" /* PART */
172 #define MSG_LUSERS "LUSERS" /* LUSE */
173 #define TOK_LUSERS "LU"
175 #define MSG_MOTD "MOTD" /* MOTD */
176 #define TOK_MOTD "MO"
178 #define MSG_MODE "MODE" /* MODE */
181 #define MSG_KICK "KICK" /* KICK */
184 #define MSG_USERHOST "USERHOST" /* USER -> USRH */
185 #define TOK_USERHOST "USERHOST"
187 #define MSG_USERIP "USERIP" /* USER -> USIP */
188 #define TOK_USERIP "USERIP"
190 #define MSG_ISON "ISON" /* ISON */
191 #define TOK_ISON "ISON"
193 #define MSG_SQUERY "SQUERY" /* SQUE */
194 #define TOK_SQUERY "SQUERY"
196 #define MSG_SERVLIST "SERVLIST" /* SERV -> SLIS */
197 #define TOK_SERVLIST "SERVSET"
199 #define MSG_SERVSET "SERVSET" /* SERV -> SSET */
200 #define TOK_SERVSET "SERVSET"
202 #define MSG_REHASH "REHASH" /* REHA */
203 #define TOK_REHASH "REHASH"
205 #define MSG_RESTART "RESTART" /* REST */
206 #define TOK_RESTART "RESTART"
208 #define MSG_CLOSE "CLOSE" /* CLOS */
209 #define TOK_CLOSE "CLOSE"
211 #define MSG_DIE "DIE" /* DIE */
212 #define TOK_DIE "DIE"
214 #define MSG_HASH "HASH" /* HASH */
215 #define TOK_HASH "HASH"
217 #define MSG_DNS "DNS" /* DNS -> DNSS */
218 #define TOK_DNS "DNS"
220 #define MSG_SILENCE "SILENCE" /* SILE */
221 #define TOK_SILENCE "U"
223 #define MSG_GLINE "GLINE" /* GLIN */
224 #define TOK_GLINE "GL"
226 #define MSG_BURST "BURST" /* BURS */
227 #define TOK_BURST "B"
229 #define MSG_CREATE "CREATE" /* CREA */
230 #define TOK_CREATE "C"
232 #define MSG_DESTRUCT "DESTRUCT" /* DEST */
233 #define TOK_DESTRUCT "DE"
235 #define MSG_END_OF_BURST "END_OF_BURST" /* END_ */
236 #define TOK_END_OF_BURST "EB"
238 #define MSG_END_OF_BURST_ACK "EOB_ACK" /* EOB_ */
239 #define TOK_END_OF_BURST_ACK "EA"
241 #define MSG_PROTO "PROTO" /* PROTO */
242 #define TOK_PROTO "PROTO" /* PROTO */
248 #define MFLG_SLOW 0x01 /* Command can be executed roughly *
249 * once per 2 seconds. */
250 #define MFLG_UNREG 0x02 /* Command available to unregistered *
252 #define MFLG_IGNORE 0x04 /* silently ignore command from
253 * unregistered clients */
259 char *cmd; /* command string */
260 char *tok; /* token (shorter command string) */
261 unsigned int count; /* number of times message used */
262 unsigned int parameters;
263 unsigned int flags; /* bit 0 set means that this command is allowed
264 to be used only on the average of once per 2
266 unsigned int bytes; /* bytes received for this message */
268 * cptr = Connected client ptr
269 * sptr = Source client ptr
270 * parc = parameter count
271 * parv = parameter variable array
274 * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST
276 MessageHandler handlers[LAST_HANDLER_TYPE];
279 extern struct Message msgtab[];
281 #endif /* INCLUDED_msg_h */