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.
24 /*=============================================================================
30 /*-----------------------------------------------------------------------------
36 * Each command must have a TOK_COMMAND and MSG_COMMAND definition.
37 * If you don't want one or the other, make them the same.
38 * Also each command has a "msgclass" used for debugging purposes.
43 #define MSG_PRIVATE "PRIVMSG" /* PRIV */
44 #define TOK_PRIVATE "P"
45 #define CLASS_PRIVATE LEVEL_PROPAGATE
47 #define MSG_WHO "WHO" /* WHO -> WHOC */
49 #define CLASS_WHO LEVEL_QUERY
51 #define MSG_WHOIS "WHOIS" /* WHOI */
53 #define CLASS_WHOIS LEVEL_QUERY
55 #define MSG_WHOWAS "WHOWAS" /* WHOW */
56 #define TOK_WHOWAS "X"
57 #define CLASS_WHOWAS LEVEL_QUERY
59 #define MSG_USER "USER" /* USER */
60 #define TOK_USER "USER"
61 #define CLASS_USER LEVEL_CLIENT
63 #define MSG_NICK "NICK" /* NICK */
65 #define CLASS_NICK LEVEL_CLIENT
67 #define MSG_SERVER "SERVER" /* SERV */
68 #define TOK_SERVER "S"
69 #define CLASS_SERVER LEVEL_MAP
71 #define MSG_LIST "LIST" /* LIST */
72 #define TOK_LIST "LIST"
73 #define CLASS_LIST LEVEL_QUERY
75 #define MSG_TOPIC "TOPIC" /* TOPI */
77 #define CLASS_TOPIC LEVEL_PROPAGATE
79 #define MSG_INVITE "INVITE" /* INVI */
80 #define TOK_INVITE "I"
81 #define CLASS_INVITE LEVEL_MODE
83 #define MSG_VERSION "VERSION" /* VERS */
84 #define TOK_VERSION "V"
85 #define CLASS_VERSION LEVEL_QUERY
87 #define MSG_QUIT "QUIT" /* QUIT */
89 #define CLASS_QUIT LEVEL_CLIENT
91 #define MSG_SQUIT "SQUIT" /* SQUI */
92 #define TOK_SQUIT "SQ"
93 #define CLASS_SQUIT LEVEL_MAP
95 #define MSG_KILL "KILL" /* KILL */
97 #define CLASS_KILL LEVEL_CLIENT
99 #define MSG_INFO "INFO" /* INFO */
101 #define CLASS_INFO LEVEL_QUERY
103 #define MSG_LINKS "LINKS" /* LINK */
104 #define TOK_LINKS "LI"
105 #define CLASS_LINKS LEVEL_QUERY
107 #define MSG_STATS "STATS" /* STAT */
108 #define TOK_STATS "R"
109 #define CLASS_STATS LEVEL_QUERY
111 #define MSG_HELP "HELP" /* HELP */
112 #define TOK_HELP "HELP"
113 #define CLASS_HELP LEVEL_QUERY
115 #define MSG_ERROR "ERROR" /* ERRO */
116 #define TOK_ERROR "Y"
117 #define CLASS_ERROR LEVEL_PROPAGATE
119 #define MSG_AWAY "AWAY" /* AWAY */
121 #define CLASS_AWAY LEVEL_PROPAGATE
123 #define MSG_CONNECT "CONNECT" /* CONN */
124 #define TOK_CONNECT "CO"
125 #define CLASS_CONNECT LEVEL_PROPAGATE
127 #define MSG_UPING "UPING" /* UPIN */
128 #define TOK_UPING "UP"
129 #define CLASS_UPING LEVEL_PROPAGATE
131 #define MSG_MAP "MAP" /* MAP */
132 #define TOK_MAP "MAP"
133 #define CLASS_MAP LEVEL_QUERY
135 #define MSG_PING "PING" /* PING */
137 #define CLASS_PING LEVEL_PROPAGATE
139 #define MSG_PONG "PONG" /* PONG */
141 #define CLASS_PONG LEVEL_CLIENT
143 #define MSG_OPER "OPER" /* OPER */
144 #define TOK_OPER "OPER"
145 #define CLASS_OPER LEVEL_PROPAGATE
147 #define MSG_PASS "PASS" /* PASS */
148 #define TOK_PASS "PA"
149 #define CLASS_PASS LEVEL_CLIENT
151 #define MSG_WALLOPS "WALLOPS" /* WALL */
152 #define TOK_WALLOPS "WA"
153 #define CLASS_WALLOPS LEVEL_PROPAGATE
155 #define MSG_DESYNCH "DESYNCH" /* DESY */
156 #define TOK_DESYNCH "DS"
157 #define CLASS_DESYNCH LEVEL_PROPAGATE
159 #define MSG_TIME "TIME" /* TIME */
160 #define TOK_TIME "TI"
161 #define CLASS_TIME LEVEL_QUERY
163 #define MSG_SETTIME "SETTIME" /* SETT */
164 #define TOK_SETTIME "SE"
165 #define CLASS_SETTIME LEVEL_PROPAGATE
167 #define MSG_RPING "RPING" /* RPIN */
168 #define TOK_RPING "RI"
169 #define CLASS_RPING LEVEL_PROPAGATE
171 #define MSG_RPONG "RPONG" /* RPON */
172 #define TOK_RPONG "RO"
173 #define CLASS_RPONG LEVEL_PROPAGATE
175 #define MSG_NAMES "NAMES" /* NAME */
176 #define TOK_NAMES "E"
177 #define CLASS_NAMES LEVEL_QUERY
179 #define MSG_ADMIN "ADMIN" /* ADMI */
180 #define TOK_ADMIN "AD"
181 #define CLASS_ADMIN LEVEL_QUERY
183 #define MSG_TRACE "TRACE" /* TRAC */
184 #define TOK_TRACE "TR"
185 #define CLASS_TRACE LEVEL_PROPAGATE
187 #define MSG_NOTICE "NOTICE" /* NOTI */
188 #define TOK_NOTICE "O"
189 #define CLASS_NOTICE LEVEL_PROPAGATE
191 #define MSG_WALLCHOPS "WALLCHOPS" /* WC */
192 #define TOK_WALLCHOPS "WC"
193 #define CLASS_WALLCHOPS LEVEL_PROPAGATE
195 #define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */
196 #define TOK_CPRIVMSG "CP"
197 #define CLASS_CPRIVMSG LEVEL_CLIENT
199 #define MSG_CNOTICE "CNOTICE" /* CNOT */
200 #define TOK_CNOTICE "CN"
201 #define CLASS_CNOTICE LEVEL_CLIENT
203 #define MSG_JOIN "JOIN" /* JOIN */
205 #define CLASS_JOIN LEVEL_CHANNEL
207 #define MSG_PART "PART" /* PART */
209 #define CLASS_PART LEVEL_CHANNEL
211 #define MSG_LUSERS "LUSERS" /* LUSE */
212 #define TOK_LUSERS "LU"
213 #define CLASS_LUSERS LEVEL_QUERY
215 #define MSG_MOTD "MOTD" /* MOTD */
216 #define TOK_MOTD "MO"
217 #define CLASS_MOTD LEVEL_QUERY
219 #define MSG_MODE "MODE" /* MODE */
221 #define CLASS_MODE LEVEL_MODE
223 #define MSG_KICK "KICK" /* KICK */
225 #define CLASS_KICK LEVEL_CHANNEL
227 #define MSG_USERHOST "USERHOST" /* USER -> USRH */
228 #define TOK_USERHOST "USERHOST"
229 #define CLASS_USERHOST LEVEL_QUERY
231 #define MSG_USERIP "USERIP" /* USER -> USIP */
232 #define TOK_USERIP "USERIP"
233 #define CLASS_USERIP LEVEL_QUERY
235 #define MSG_ISON "ISON" /* ISON */
236 #define TOK_ISON "ISON"
237 #define CLASS_ISON LEVEL_QUERY
239 #define MSG_SQUERY "SQUERY" /* SQUE */
240 #define TOK_SQUERY "SQUERY"
241 #define CLASS_SQUERY LEVEL_QUERY
243 #define MSG_SERVLIST "SERVLIST" /* SERV -> SLIS */
244 #define TOK_SERVLIST "SERVSET"
245 #define CLASS_SERVLIST LEVEL_QUERY
247 #define MSG_SERVSET "SERVSET" /* SERV -> SSET */
248 #define TOK_SERVSET "SERVSET"
249 #define CLASS_SERVSET LEVEL_CLIENT
251 #define MSG_REHASH "REHASH" /* REHA */
252 #define TOK_REHASH "REHASH"
253 #define CLASS_REHASH LEVEL_MAP
255 #define MSG_RESTART "RESTART" /* REST */
256 #define TOK_RESTART "RESTART"
257 #define CLASS_RESTART LEVEL_MAP
259 #define MSG_CLOSE "CLOSE" /* CLOS */
260 #define TOK_CLOSE "CLOSE"
261 #define CLASS_CLOSE LEVEL_CLIENT
263 #define MSG_DIE "DIE" /* DIE */
264 #define TOK_DIE "DIE"
265 #define CLASS_DIE LEVEL_MAP
267 #define MSG_HASH "HASH" /* HASH */
268 #define TOK_HASH "HASH"
269 #define CLASS_HASH LEVEL_QUERY
271 #define MSG_DNS "DNS" /* DNS -> DNSS */
272 #define TOK_DNS "DNS"
273 #define CLASS_DNS LEVEL_QUERY
275 #define MSG_SILENCE "SILENCE" /* SILE */
276 #define TOK_SILENCE "U"
277 #define CLASS_SILENCE LEVEL_PROPAGATE
279 #define MSG_GLINE "GLINE" /* GLIN */
280 #define TOK_GLINE "GL"
281 #define CLASS_GLINE LEVEL_CLIENT
283 #define MSG_BURST "BURST" /* BURS */
284 #define TOK_BURST "B"
285 #define CLASS_BURST LEVEL_CHANNEL
287 #define MSG_CREATE "CREATE" /* CREA */
288 #define TOK_CREATE "C"
289 #define CLASS_CREATE LEVEL_CHANNEL
291 #define MSG_DESTRUCT "DESTRUCT" /* DEST */
292 #define TOK_DESTRUCT "DE"
293 #define CLASS_DESTRUCT LEVEL_CHANNEL
295 #define MSG_END_OF_BURST "END_OF_BURST" /* END_ */
296 #define TOK_END_OF_BURST "EB"
297 #define CLASS_END_OF_BURST LEVEL_MAP
299 #define MSG_END_OF_BURST_ACK "EOB_ACK" /* EOB_ */
300 #define TOK_END_OF_BURST_ACK "EA"
301 #define CLASS_END_OF_BURST_ACK LEVEL_MAP
305 /*=============================================================================
308 #define MFLG_SLOW 0x01 /* Command can be executed roughly *
309 * once per 2 seconds. */
310 #define MFLG_UNREG 0x02 /* Command available to unregistered *
313 /*=============================================================================
318 unsigned int msgclass;
321 int (*func) (aClient *cptr, aClient *sptr, int parc, char *parv[]);
322 /* cptr = Connected client ptr
323 sptr = Source client ptr
324 parc = parameter count
325 parv = parameter variable array */
327 unsigned int parameters;
328 unsigned char flags; /* bit 0 set means that this command is allowed
329 to be used only on the average of once per 2
337 struct MessageTree *pointers[26];
340 /*=============================================================================
344 extern struct Message msgtab[];