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"
51 #define CMD_PRIVATE MSG_PRIVATE, TOK_PRIVATE
53 #define MSG_WHO "WHO" /* WHO -> WHOC */
55 #define CMD_WHO MSG_WHO, TOK_WHO
57 #define MSG_WHOIS "WHOIS" /* WHOI */
59 #define CMD_WHOIS MSG_WHOIS, TOK_WHOIS
61 #define MSG_WHOWAS "WHOWAS" /* WHOW */
62 #define TOK_WHOWAS "X"
63 #define CMD_WHOWAS MSG_WHOWAS, TOK_WHOWAS
65 #define MSG_USER "USER" /* USER */
66 #define TOK_USER "USER"
67 #define CMD_USER MSG_USER, TOK_USER
69 #define MSG_NICK "NICK" /* NICK */
71 #define CMD_NICK MSG_NICK, TOK_NICK
73 #define MSG_SERVER "SERVER" /* SERV */
74 #define TOK_SERVER "S"
75 #define CMD_SERVER MSG_SERVER, TOK_SERVER
77 #define MSG_LIST "LIST" /* LIST */
78 #define TOK_LIST "LIST"
79 #define CMD_LIST MSG_LIST, TOK_LIST
81 #define MSG_TOPIC "TOPIC" /* TOPI */
83 #define CMD_TOPIC MSG_TOPIC, TOK_TOPIC
85 #define MSG_INVITE "INVITE" /* INVI */
86 #define TOK_INVITE "I"
87 #define CMD_INVITE MSG_INVITE, TOK_INVITE
89 #define MSG_VERSION "VERSION" /* VERS */
90 #define TOK_VERSION "V"
91 #define CMD_VERSION MSG_VERSION, TOK_VERSION
93 #define MSG_QUIT "QUIT" /* QUIT */
95 #define CMD_QUIT MSG_QUIT, TOK_QUIT
97 #define MSG_SQUIT "SQUIT" /* SQUI */
98 #define TOK_SQUIT "SQ"
99 #define CMD_SQUIT MSG_SQUIT, TOK_SQUIT
101 #define MSG_KILL "KILL" /* KILL */
103 #define CMD_KILL MSG_KILL, TOK_KILL
105 #define MSG_INFO "INFO" /* INFO */
107 #define CMD_INFO MSG_INFO, TOK_INFO
109 #define MSG_LINKS "LINKS" /* LINK */
110 #define TOK_LINKS "LI"
111 #define CMD_LINKS MSG_LINKS, TOK_LINKS
113 #define MSG_STATS "STATS" /* STAT */
114 #define TOK_STATS "R"
115 #define CMD_STATS MSG_STATS, TOK_STATS
117 #define MSG_HELP "HELP" /* HELP */
118 #define TOK_HELP "HELP"
119 #define CMD_HELP MSG_HELP, TOK_HELP
121 #define MSG_ERROR "ERROR" /* ERRO */
122 #define TOK_ERROR "Y"
123 #define CMD_ERROR MSG_ERROR, TOK_ERROR
125 #define MSG_AWAY "AWAY" /* AWAY */
127 #define CMD_AWAY MSG_AWAY, TOK_AWAY
129 #define MSG_CONNECT "CONNECT" /* CONN */
130 #define TOK_CONNECT "CO"
131 #define CMD_CONNECT MSG_CONNECT, TOK_CONNECT
133 #define MSG_MAP "MAP" /* MAP */
134 #define TOK_MAP "MAP"
135 #define CMD_MAP MSG_MAP, TOK_MAP
137 #define MSG_PING "PING" /* PING */
139 #define CMD_PING MSG_PING, TOK_PING
141 #define MSG_PONG "PONG" /* PONG */
143 #define CMD_PONG MSG_PONG, TOK_PONG
145 #define MSG_OPER "OPER" /* OPER */
146 #define TOK_OPER "OPER"
147 #define CMD_OPER MSG_OPER, TOK_OPER
149 #define MSG_PASS "PASS" /* PASS */
150 #define TOK_PASS "PA"
151 #define CMD_PASS MSG_PASS, TOK_PASS
153 #define MSG_WALLOPS "WALLOPS" /* WALL */
154 #define TOK_WALLOPS "WA"
155 #define CMD_WALLOPS MSG_WALLOPS, TOK_WALLOPS
157 #define MSG_WALLUSERS "WALLUSERS" /* WALL */
158 #define TOK_WALLUSERS "WU"
159 #define CMD_WALLUSERS MSG_WALLUSERS, TOK_WALLUSERS
161 #define MSG_DESYNCH "DESYNCH" /* DESY */
162 #define TOK_DESYNCH "DS"
163 #define CMD_DESYNCH MSG_DESYNCH, TOK_DESYNCH
165 #define MSG_TIME "TIME" /* TIME */
166 #define TOK_TIME "TI"
167 #define CMD_TIME MSG_TIME, TOK_TIME
169 #define MSG_SETTIME "SETTIME" /* SETT */
170 #define TOK_SETTIME "SE"
171 #define CMD_SETTIME MSG_SETTIME, TOK_SETTIME
173 #define MSG_RPING "RPING" /* RPIN */
174 #define TOK_RPING "RI"
175 #define CMD_RPING MSG_RPING, TOK_RPING
177 #define MSG_RPONG "RPONG" /* RPON */
178 #define TOK_RPONG "RO"
179 #define CMD_RPONG MSG_RPONG, TOK_RPONG
181 #define MSG_NAMES "NAMES" /* NAME */
182 #define TOK_NAMES "E"
183 #define CMD_NAMES MSG_NAMES, TOK_NAMES
185 #define MSG_ADMIN "ADMIN" /* ADMI */
186 #define TOK_ADMIN "AD"
187 #define CMD_ADMIN MSG_ADMIN, TOK_ADMIN
189 #define MSG_TRACE "TRACE" /* TRAC */
190 #define TOK_TRACE "TR"
191 #define CMD_TRACE MSG_TRACE, TOK_TRACE
193 #define MSG_NOTICE "NOTICE" /* NOTI */
194 #define TOK_NOTICE "O"
195 #define CMD_NOTICE MSG_NOTICE, TOK_NOTICE
197 #define MSG_WALLCHOPS "WALLCHOPS" /* WC */
198 #define TOK_WALLCHOPS "WC"
199 #define CMD_WALLCHOPS MSG_WALLCHOPS, TOK_WALLCHOPS
201 #define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */
202 #define TOK_CPRIVMSG "CP"
203 #define CMD_CPRIVMSG MSG_CPRIVMSG, TOK_CPRIVMSG
205 #define MSG_CNOTICE "CNOTICE" /* CNOT */
206 #define TOK_CNOTICE "CN"
207 #define CMD_CNOTICE MSG_CNOTICE, TOK_CNOTICE
209 #define MSG_JOIN "JOIN" /* JOIN */
211 #define CMD_JOIN MSG_JOIN, TOK_JOIN
213 #define MSG_PART "PART" /* PART */
215 #define CMD_PART MSG_PART, TOK_PART
217 #define MSG_LUSERS "LUSERS" /* LUSE */
218 #define TOK_LUSERS "LU"
219 #define CMD_LUSERS MSG_LUSERS, TOK_LUSERS
221 #define MSG_MOTD "MOTD" /* MOTD */
222 #define TOK_MOTD "MO"
223 #define CMD_MOTD MSG_MOTD, TOK_MOTD
225 #define MSG_MODE "MODE" /* MODE */
227 #define CMD_MODE MSG_MODE, TOK_MODE
229 #define MSG_KICK "KICK" /* KICK */
231 #define CMD_KICK MSG_KICK, TOK_KICK
233 #define MSG_USERHOST "USERHOST" /* USER -> USRH */
234 #define TOK_USERHOST "USERHOST"
235 #define CMD_USERHOST MSG_USERHOST, TOK_USERHOST
237 #define MSG_USERIP "USERIP" /* USER -> USIP */
238 #define TOK_USERIP "USERIP"
239 #define CMD_USERIP MSG_USERIP, TOK_USERIP
241 #define MSG_ISON "ISON" /* ISON */
242 #define TOK_ISON "ISON"
243 #define CMD_ISON MSG_ISON, TOK_ISON
245 #define MSG_SQUERY "SQUERY" /* SQUE */
246 #define TOK_SQUERY "SQUERY"
247 #define CMD_SQUERY MSG_SQUERY, TOK_SQUERY
249 #define MSG_SERVLIST "SERVLIST" /* SERV -> SLIS */
250 #define TOK_SERVLIST "SERVSET"
251 #define CMD_SERVLIST MSG_SERVLIST, TOK_SERVLIST
253 #define MSG_SERVSET "SERVSET" /* SERV -> SSET */
254 #define TOK_SERVSET "SERVSET"
255 #define CMD_SERVSET MSG_SERVSET, TOK_SERVSET
257 #define MSG_REHASH "REHASH" /* REHA */
258 #define TOK_REHASH "REHASH"
259 #define CMD_REHASH MSG_REHASH, TOK_REHASH
261 #define MSG_RESTART "RESTART" /* REST */
262 #define TOK_RESTART "RESTART"
263 #define CMD_RESTART MSG_RESTART, TOK_RESTART
265 #define MSG_CLOSE "CLOSE" /* CLOS */
266 #define TOK_CLOSE "CLOSE"
267 #define CMD_CLOSE MSG_CLOSE, TOK_CLOSE
269 #define MSG_DIE "DIE" /* DIE */
270 #define TOK_DIE "DIE"
271 #define CMD_DIE MSG_DIE, TOK_DIE
273 #define MSG_HASH "HASH" /* HASH */
274 #define TOK_HASH "HASH"
275 #define CMD_HASH MSG_HASH, TOK_HASH
277 #define MSG_DNS "DNS" /* DNS -> DNSS */
278 #define TOK_DNS "DNS"
279 #define CMD_DNS MSG_DNS, TOK_DNS
281 #define MSG_SILENCE "SILENCE" /* SILE */
282 #define TOK_SILENCE "U"
283 #define CMD_SILENCE MSG_SILENCE, TOK_SILENCE
285 #define MSG_GLINE "GLINE" /* GLIN */
286 #define TOK_GLINE "GL"
287 #define CMD_GLINE MSG_GLINE, TOK_GLINE
289 #define MSG_BURST "BURST" /* BURS */
290 #define TOK_BURST "B"
291 #define CMD_BURST MSG_BURST, TOK_BURST
293 #define MSG_UPING "UPING" /* UPIN */
294 #define TOK_UPING "UP"
295 #define CMD_UPING MSG_UPING, TOK_UPING
297 #define MSG_CREATE "CREATE" /* CREA */
298 #define TOK_CREATE "C"
299 #define CMD_CREATE MSG_CREATE, TOK_CREATE
301 #define MSG_DESTRUCT "DESTRUCT" /* DEST */
302 #define TOK_DESTRUCT "DE"
303 #define CMD_DESTRUCT MSG_DESTRUCT, TOK_DESTRUCT
305 #define MSG_END_OF_BURST "END_OF_BURST" /* END_ */
306 #define TOK_END_OF_BURST "EB"
307 #define CMD_END_OF_BURST MSG_END_OF_BURST, TOK_END_OF_BURST
309 #define MSG_END_OF_BURST_ACK "EOB_ACK" /* EOB_ */
310 #define TOK_END_OF_BURST_ACK "EA"
311 #define CMD_END_OF_BURST_ACK MSG_END_OF_BURST_ACK, TOK_END_OF_BURST_ACK
313 #define MSG_PROTO "PROTO" /* PROTO */
314 #define TOK_PROTO "PROTO" /* PROTO */
315 #define CMD_PROTO MSG_PROTO, TOK_PROTO
317 #define MSG_JUPE "JUPE" /* JUPE */
318 #define TOK_JUPE "JU"
319 #define CMD_JUPE MSG_JUPE, TOK_JUPE
321 #define MSG_OPMODE "OPMODE" /* OPMO */
322 #define TOK_OPMODE "OM"
323 #define CMD_OPMODE MSG_OPMODE, TOK_OPMODE
325 #define MSG_CLEARMODE "CLEARMODE" /* CLMO */
326 #define TOK_CLEARMODE "CM"
327 #define CMD_CLEARMODE MSG_CLEARMODE, TOK_CLEARMODE
329 #define MSG_POST "POST" /* POST */
330 #define TOK_POST "POST"
332 #define MSG_SET "SET" /* SET */
333 #define TOK_SET "SET"
335 #define MSG_RESET "RESET" /* RESE */
336 #define TOK_RESET "RESET"
338 #define MSG_GET "GET" /* GET */
339 #define TOK_GET "GET"
341 #define MSG_PRIVS "PRIVS" /* PRIV */
342 #define TOK_PRIVS "PRIVS"
347 #define MFLG_SLOW 0x01 /* Command can be executed roughly *
348 * once per 2 seconds. */
349 #define MFLG_UNREG 0x02 /* Command available to unregistered *
351 #define MFLG_IGNORE 0x04 /* silently ignore command from
352 * unregistered clients */
358 char *cmd; /* command string */
359 char *tok; /* token (shorter command string) */
360 unsigned int count; /* number of times message used */
361 unsigned int parameters;
362 unsigned int flags; /* bit 0 set means that this command is allowed
363 to be used only on the average of once per 2
365 unsigned int bytes; /* bytes received for this message */
367 * cptr = Connected client ptr
368 * sptr = Source client ptr
369 * parc = parameter count
370 * parv = parameter variable array
373 * UNREGISTERED, CLIENT, SERVER, OPER, SERVICE, LAST
375 MessageHandler handlers[LAST_HANDLER_TYPE];
378 extern struct Message msgtab[];
380 #endif /* INCLUDED_msg_h */