Blame


1 6e07fb41 2001-12-21 alex /*
2 6e07fb41 2001-12-21 alex * ngIRCd -- The Next Generation IRC Daemon
3 b6254bbb 2002-01-02 alex * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 6e07fb41 2001-12-21 alex *
5 6e07fb41 2001-12-21 alex * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
6 6e07fb41 2001-12-21 alex * der GNU General Public License (GPL), wie von der Free Software Foundation
7 6e07fb41 2001-12-21 alex * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
8 6e07fb41 2001-12-21 alex * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
9 6e07fb41 2001-12-21 alex * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
10 804b1ec4 2001-12-31 alex * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
11 6e07fb41 2001-12-21 alex *
12 ec474a4b 2002-10-04 alex * $Id: parse.c,v 1.42 2002/10/04 11:21:46 alex Exp $
13 6e07fb41 2001-12-21 alex *
14 6e07fb41 2001-12-21 alex * parse.c: Parsen der Client-Anfragen
15 6e07fb41 2001-12-21 alex */
16 6e07fb41 2001-12-21 alex
17 6e07fb41 2001-12-21 alex
18 ca33cbda 2002-03-12 alex #include "portab.h"
19 6e07fb41 2001-12-21 alex
20 ca33cbda 2002-03-12 alex #include "imp.h"
21 6e07fb41 2001-12-21 alex #include <assert.h>
22 1c8c92af 2002-01-05 alex #include <stdlib.h>
23 6e07fb41 2001-12-21 alex #include <stdio.h>
24 6e07fb41 2001-12-21 alex #include <string.h>
25 6e07fb41 2001-12-21 alex
26 d79a7d28 2002-01-18 alex #include "ngircd.h"
27 ca33cbda 2002-03-12 alex #include "defines.h"
28 c2f60abe 2002-05-27 alex #include "conn.h"
29 c2f60abe 2002-05-27 alex #include "client.h"
30 c2f60abe 2002-05-27 alex #include "channel.h"
31 c2f60abe 2002-05-27 alex #include "log.h"
32 c2f60abe 2002-05-27 alex #include "messages.h"
33 c2f60abe 2002-05-27 alex #include "tool.h"
34 c2f60abe 2002-05-27 alex
35 c2f60abe 2002-05-27 alex #include "exp.h"
36 c2f60abe 2002-05-27 alex #include "parse.h"
37 c2f60abe 2002-05-27 alex
38 c2f60abe 2002-05-27 alex #include "imp.h"
39 76c4f066 2001-12-23 alex #include "irc.h"
40 14aba7c1 2002-03-03 alex #include "irc-channel.h"
41 b56eb4d8 2002-02-27 alex #include "irc-login.h"
42 b56eb4d8 2002-02-27 alex #include "irc-mode.h"
43 c2f60abe 2002-05-27 alex #include "irc-op.h"
44 14aba7c1 2002-03-03 alex #include "irc-oper.h"
45 14aba7c1 2002-03-03 alex #include "irc-server.h"
46 b56eb4d8 2002-02-27 alex #include "irc-write.h"
47 6e07fb41 2001-12-21 alex
48 ca33cbda 2002-03-12 alex #include "exp.h"
49 6e07fb41 2001-12-21 alex
50 6e07fb41 2001-12-21 alex
51 c2f60abe 2002-05-27 alex LOCAL VOID Init_Request PARAMS(( REQUEST *Req ));
52 6e07fb41 2001-12-21 alex
53 e0ed3aa1 2002-07-26 alex LOCAL BOOLEAN Validate_Prefix PARAMS(( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed ));
54 e0ed3aa1 2002-07-26 alex LOCAL BOOLEAN Validate_Command PARAMS(( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed ));
55 e0ed3aa1 2002-07-26 alex LOCAL BOOLEAN Validate_Args PARAMS(( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed ));
56 6e07fb41 2001-12-21 alex
57 c2f60abe 2002-05-27 alex LOCAL BOOLEAN Handle_Request PARAMS(( CONN_ID Idx, REQUEST *Req ));
58 6e07fb41 2001-12-21 alex
59 6e07fb41 2001-12-21 alex
60 c2f60abe 2002-05-27 alex GLOBAL BOOLEAN
61 c2f60abe 2002-05-27 alex Parse_Request( CONN_ID Idx, CHAR *Request )
62 6e07fb41 2001-12-21 alex {
63 76c4f066 2001-12-23 alex /* Client-Request parsen. Bei einem schwerwiegenden Fehler wird
64 76c4f066 2001-12-23 alex * die Verbindung geschlossen und FALSE geliefert.
65 6e07fb41 2001-12-21 alex * Der Aufbau gueltiger Requests ist in RFC 2812, 2.3 definiert. */
66 6e07fb41 2001-12-21 alex
67 6e07fb41 2001-12-21 alex REQUEST req;
68 6e07fb41 2001-12-21 alex CHAR *start, *ptr;
69 e0ed3aa1 2002-07-26 alex BOOLEAN closed;
70 6e07fb41 2001-12-21 alex
71 6e07fb41 2001-12-21 alex assert( Idx >= 0 );
72 6e07fb41 2001-12-21 alex assert( Request != NULL );
73 76c4f066 2001-12-23 alex
74 d4a60bd4 2001-12-25 alex #ifdef SNIFFER
75 d79a7d28 2002-01-18 alex if( NGIRCd_Sniffer ) Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
76 76c4f066 2001-12-23 alex #endif
77 e0ed3aa1 2002-07-26 alex
78 6e07fb41 2001-12-21 alex Init_Request( &req );
79 6e07fb41 2001-12-21 alex
80 363a03b8 2001-12-29 alex /* Fuehrendes und folgendes "Geraffel" verwerfen */
81 363a03b8 2001-12-29 alex ngt_TrimStr( Request );
82 363a03b8 2001-12-29 alex
83 6e07fb41 2001-12-21 alex /* gibt es ein Prefix? */
84 6e07fb41 2001-12-21 alex if( Request[0] == ':' )
85 6e07fb41 2001-12-21 alex {
86 6e07fb41 2001-12-21 alex /* Prefix vorhanden */
87 6e07fb41 2001-12-21 alex req.prefix = Request + 1;
88 6e07fb41 2001-12-21 alex ptr = strchr( Request, ' ' );
89 e0ed3aa1 2002-07-26 alex if( ! ptr )
90 e0ed3aa1 2002-07-26 alex {
91 e0ed3aa1 2002-07-26 alex Log( LOG_DEBUG, "Connection %d: Parse error: prefix without command!?", Idx );
92 e0ed3aa1 2002-07-26 alex return Conn_WriteStr( Idx, "ERROR :Prefix without command!?" );
93 e0ed3aa1 2002-07-26 alex }
94 6e07fb41 2001-12-21 alex *ptr = '\0';
95 3543c222 2002-01-09 alex #ifndef STRICT_RFC
96 3543c222 2002-01-09 alex /* multiple Leerzeichen als Trenner zwischen
97 3543c222 2002-01-09 alex * Prefix und Befehl ignorieren */
98 3543c222 2002-01-09 alex while( *(ptr + 1) == ' ' ) ptr++;
99 3543c222 2002-01-09 alex #endif
100 6e07fb41 2001-12-21 alex start = ptr + 1;
101 6e07fb41 2001-12-21 alex }
102 6e07fb41 2001-12-21 alex else start = Request;
103 6e07fb41 2001-12-21 alex
104 e0ed3aa1 2002-07-26 alex if( ! Validate_Prefix( Idx, &req, &closed )) return ! closed;
105 6e07fb41 2001-12-21 alex
106 6e07fb41 2001-12-21 alex /* Befehl */
107 6e07fb41 2001-12-21 alex ptr = strchr( start, ' ' );
108 3543c222 2002-01-09 alex if( ptr )
109 3543c222 2002-01-09 alex {
110 3543c222 2002-01-09 alex *ptr = '\0';
111 3543c222 2002-01-09 alex #ifndef STRICT_RFC
112 3543c222 2002-01-09 alex /* multiple Leerzeichen als Trenner vor
113 3543c222 2002-01-09 alex *Parametertrennern ignorieren */
114 3543c222 2002-01-09 alex while( *(ptr + 1) == ' ' ) ptr++;
115 3543c222 2002-01-09 alex #endif
116 3543c222 2002-01-09 alex }
117 6e07fb41 2001-12-21 alex req.command = start;
118 6e07fb41 2001-12-21 alex
119 e0ed3aa1 2002-07-26 alex if( ! Validate_Command( Idx, &req, &closed )) return ! closed;
120 6e07fb41 2001-12-21 alex
121 6e07fb41 2001-12-21 alex /* Argumente, Parameter */
122 6e07fb41 2001-12-21 alex if( ptr )
123 6e07fb41 2001-12-21 alex {
124 6e07fb41 2001-12-21 alex /* Prinzipiell gibt es welche :-) */
125 6e07fb41 2001-12-21 alex start = ptr + 1;
126 6e07fb41 2001-12-21 alex while( start )
127 6e07fb41 2001-12-21 alex {
128 6e07fb41 2001-12-21 alex /* Parameter-String "zerlegen" */
129 76c4f066 2001-12-23 alex if( start[0] == ':' )
130 76c4f066 2001-12-23 alex {
131 76c4f066 2001-12-23 alex req.argv[req.argc] = start + 1;
132 76c4f066 2001-12-23 alex ptr = NULL;
133 76c4f066 2001-12-23 alex }
134 76c4f066 2001-12-23 alex else
135 76c4f066 2001-12-23 alex {
136 76c4f066 2001-12-23 alex req.argv[req.argc] = start;
137 76c4f066 2001-12-23 alex ptr = strchr( start, ' ' );
138 3543c222 2002-01-09 alex if( ptr )
139 3543c222 2002-01-09 alex {
140 3543c222 2002-01-09 alex *ptr = '\0';
141 3543c222 2002-01-09 alex #ifndef STRICT_RFC
142 3543c222 2002-01-09 alex /* multiple Leerzeichen als
143 3543c222 2002-01-09 alex * Parametertrenner ignorieren */
144 3543c222 2002-01-09 alex while( *(ptr + 1) == ' ' ) ptr++;
145 3543c222 2002-01-09 alex #endif
146 3543c222 2002-01-09 alex }
147 76c4f066 2001-12-23 alex }
148 e0ed3aa1 2002-07-26 alex
149 6e07fb41 2001-12-21 alex req.argc++;
150 6e07fb41 2001-12-21 alex
151 6e07fb41 2001-12-21 alex if( start[0] == ':' ) break;
152 6e07fb41 2001-12-21 alex if( req.argc > 14 ) break;
153 e0ed3aa1 2002-07-26 alex
154 6e07fb41 2001-12-21 alex if( ptr ) start = ptr + 1;
155 6e07fb41 2001-12-21 alex else start = NULL;
156 6e07fb41 2001-12-21 alex }
157 6e07fb41 2001-12-21 alex }
158 93aa0dbf 2002-01-03 alex
159 e0ed3aa1 2002-07-26 alex if( ! Validate_Args( Idx, &req, &closed )) return ! closed;
160 e0ed3aa1 2002-07-26 alex
161 6e07fb41 2001-12-21 alex return Handle_Request( Idx, &req );
162 6e07fb41 2001-12-21 alex } /* Parse_Request */
163 6e07fb41 2001-12-21 alex
164 6e07fb41 2001-12-21 alex
165 c2f60abe 2002-05-27 alex LOCAL VOID
166 c2f60abe 2002-05-27 alex Init_Request( REQUEST *Req )
167 6e07fb41 2001-12-21 alex {
168 6e07fb41 2001-12-21 alex /* Neue Request-Struktur initialisieren */
169 6e07fb41 2001-12-21 alex
170 6e07fb41 2001-12-21 alex INT i;
171 e0ed3aa1 2002-07-26 alex
172 6e07fb41 2001-12-21 alex assert( Req != NULL );
173 6e07fb41 2001-12-21 alex
174 6e07fb41 2001-12-21 alex Req->prefix = NULL;
175 6e07fb41 2001-12-21 alex Req->command = NULL;
176 6e07fb41 2001-12-21 alex for( i = 0; i < 15; Req->argv[i++] = NULL );
177 6e07fb41 2001-12-21 alex Req->argc = 0;
178 6e07fb41 2001-12-21 alex } /* Init_Request */
179 6e07fb41 2001-12-21 alex
180 6e07fb41 2001-12-21 alex
181 c2f60abe 2002-05-27 alex LOCAL BOOLEAN
182 e0ed3aa1 2002-07-26 alex Validate_Prefix( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed )
183 6e07fb41 2001-12-21 alex {
184 5063de59 2002-07-29 alex CLIENT *client, *c;
185 6e07fb41 2001-12-21 alex
186 e0ed3aa1 2002-07-26 alex assert( Idx >= 0 );
187 e0ed3aa1 2002-07-26 alex assert( Req != NULL );
188 6e07fb41 2001-12-21 alex
189 e0ed3aa1 2002-07-26 alex *Closed = FALSE;
190 5063de59 2002-07-29 alex
191 e0ed3aa1 2002-07-26 alex /* ist ueberhaupt ein Prefix vorhanden? */
192 e0ed3aa1 2002-07-26 alex if( ! Req->prefix ) return TRUE;
193 6e07fb41 2001-12-21 alex
194 5063de59 2002-07-29 alex /* Client-Struktur der Connection ermitteln */
195 5063de59 2002-07-29 alex client = Client_GetFromConn( Idx );
196 5063de59 2002-07-29 alex assert( client != NULL );
197 5063de59 2002-07-29 alex
198 5063de59 2002-07-29 alex /* nur validieren, wenn bereits registrierte Verbindung */
199 5063de59 2002-07-29 alex if(( Client_Type( client ) != CLIENT_USER ) && ( Client_Type( client ) != CLIENT_SERVER ) && ( Client_Type( client ) != CLIENT_SERVICE ))
200 5063de59 2002-07-29 alex {
201 5063de59 2002-07-29 alex /* noch nicht registrierte Verbindung.
202 5063de59 2002-07-29 alex * Das Prefix wird ignoriert. */
203 5063de59 2002-07-29 alex Req->prefix = NULL;
204 5063de59 2002-07-29 alex return TRUE;
205 5063de59 2002-07-29 alex }
206 5063de59 2002-07-29 alex
207 e0ed3aa1 2002-07-26 alex /* pruefen, ob der im Prefix angegebene Client bekannt ist */
208 e0ed3aa1 2002-07-26 alex c = Client_Search( Req->prefix );
209 e0ed3aa1 2002-07-26 alex if( ! c )
210 e0ed3aa1 2002-07-26 alex {
211 e0ed3aa1 2002-07-26 alex /* im Prefix angegebener Client ist nicht bekannt */
212 e0ed3aa1 2002-07-26 alex Log( LOG_ERR, "Invalid prefix, client not known (connection %d)!?", Idx );
213 e0ed3aa1 2002-07-26 alex if( ! Conn_WriteStr( Idx, "ERROR :Invalid prefix, client not known!?" )) *Closed = TRUE;
214 e0ed3aa1 2002-07-26 alex return FALSE;
215 e0ed3aa1 2002-07-26 alex }
216 5063de59 2002-07-29 alex
217 e0ed3aa1 2002-07-26 alex /* pruefen, ob der Client mit dem angegebenen Prefix in Richtung
218 e0ed3aa1 2002-07-26 alex * des Senders liegt, d.h. sicherstellen, dass das Prefix nicht
219 e0ed3aa1 2002-07-26 alex * gefaelscht ist */
220 5063de59 2002-07-29 alex if( Client_NextHop( c ) != client )
221 e0ed3aa1 2002-07-26 alex {
222 e0ed3aa1 2002-07-26 alex /* das angegebene Prefix ist aus dieser Richtung, also
223 e0ed3aa1 2002-07-26 alex * aus der gegebenen Connection, ungueltig! */
224 e0ed3aa1 2002-07-26 alex Log( LOG_ERR, "Spoofed prefix \"%s\" from \"%s\" (connection %d)!", Req->prefix, Client_Mask( Client_GetFromConn( Idx )), Idx );
225 e0ed3aa1 2002-07-26 alex Conn_Close( Idx, NULL, "Spoofed prefix", TRUE );
226 e0ed3aa1 2002-07-26 alex *Closed = TRUE;
227 e0ed3aa1 2002-07-26 alex return FALSE;
228 e0ed3aa1 2002-07-26 alex }
229 e0ed3aa1 2002-07-26 alex
230 6e07fb41 2001-12-21 alex return TRUE;
231 6e07fb41 2001-12-21 alex } /* Validate_Prefix */
232 6e07fb41 2001-12-21 alex
233 6e07fb41 2001-12-21 alex
234 c2f60abe 2002-05-27 alex LOCAL BOOLEAN
235 e0ed3aa1 2002-07-26 alex Validate_Command( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed )
236 6e07fb41 2001-12-21 alex {
237 e0ed3aa1 2002-07-26 alex assert( Idx >= 0 );
238 6e07fb41 2001-12-21 alex assert( Req != NULL );
239 e0ed3aa1 2002-07-26 alex *Closed = FALSE;
240 e0ed3aa1 2002-07-26 alex
241 6e07fb41 2001-12-21 alex return TRUE;
242 6e07fb41 2001-12-21 alex } /* Validate_Comman */
243 6e07fb41 2001-12-21 alex
244 6e07fb41 2001-12-21 alex
245 c2f60abe 2002-05-27 alex LOCAL BOOLEAN
246 e0ed3aa1 2002-07-26 alex Validate_Args( CONN_ID Idx, REQUEST *Req, BOOLEAN *Closed )
247 6e07fb41 2001-12-21 alex {
248 e0ed3aa1 2002-07-26 alex assert( Idx >= 0 );
249 6e07fb41 2001-12-21 alex assert( Req != NULL );
250 e0ed3aa1 2002-07-26 alex *Closed = FALSE;
251 e0ed3aa1 2002-07-26 alex
252 6e07fb41 2001-12-21 alex return TRUE;
253 6e07fb41 2001-12-21 alex } /* Validate_Args */
254 6e07fb41 2001-12-21 alex
255 6e07fb41 2001-12-21 alex
256 c2f60abe 2002-05-27 alex LOCAL BOOLEAN
257 c2f60abe 2002-05-27 alex Handle_Request( CONN_ID Idx, REQUEST *Req )
258 6e07fb41 2001-12-21 alex {
259 76c4f066 2001-12-23 alex /* Client-Request verarbeiten. Bei einem schwerwiegenden Fehler
260 76c4f066 2001-12-23 alex * wird die Verbindung geschlossen und FALSE geliefert. */
261 76c4f066 2001-12-23 alex
262 1c8c92af 2002-01-05 alex CLIENT *client, *target, *prefix;
263 1c8c92af 2002-01-05 alex CHAR str[LINE_LEN];
264 1c8c92af 2002-01-05 alex INT i;
265 76c4f066 2001-12-23 alex
266 6e07fb41 2001-12-21 alex assert( Idx >= 0 );
267 6e07fb41 2001-12-21 alex assert( Req != NULL );
268 6e07fb41 2001-12-21 alex assert( Req->command != NULL );
269 6e07fb41 2001-12-21 alex
270 76c4f066 2001-12-23 alex client = Client_GetFromConn( Idx );
271 76c4f066 2001-12-23 alex assert( client != NULL );
272 1c8c92af 2002-01-05 alex
273 1c8c92af 2002-01-05 alex /* Statuscode, der geforwarded werden muss? */
274 1c8c92af 2002-01-05 alex if(( strlen( Req->command ) == 3 ) && ( atoi( Req->command ) > 100 ))
275 1c8c92af 2002-01-05 alex {
276 1c8c92af 2002-01-05 alex /* Befehl ist ein Statuscode */
277 1c8c92af 2002-01-05 alex
278 1c8c92af 2002-01-05 alex /* Zielserver ermitteln */
279 bc4ed226 2002-03-25 alex if(( Client_Type( client ) == CLIENT_SERVER ) && ( Req->argc > 0 )) target = Client_Search( Req->argv[0] );
280 1c8c92af 2002-01-05 alex else target = NULL;
281 9e18ec30 2002-01-07 alex if( ! target )
282 9e18ec30 2002-01-07 alex {
283 1ff2fceb 2002-02-26 alex if( Req->argc > 0 ) Log( LOG_WARNING, "Unknown target for status code: \"%s\"", Req->argv[0] );
284 9e18ec30 2002-01-07 alex else Log( LOG_WARNING, "Unknown target for status code!" );
285 9e18ec30 2002-01-07 alex return TRUE;
286 9e18ec30 2002-01-07 alex }
287 9e18ec30 2002-01-07 alex if( target == Client_ThisServer( ))
288 9e18ec30 2002-01-07 alex {
289 9e18ec30 2002-01-07 alex Log( LOG_DEBUG, "Ignored status code %s from \"%s\".", Req->command, Client_ID( client ));
290 9e18ec30 2002-01-07 alex return TRUE;
291 9e18ec30 2002-01-07 alex }
292 76c4f066 2001-12-23 alex
293 1c8c92af 2002-01-05 alex /* Quell-Client ermitteln */
294 9e18ec30 2002-01-07 alex if( ! Req->prefix[0] )
295 9e18ec30 2002-01-07 alex {
296 9e18ec30 2002-01-07 alex Log( LOG_WARNING, "Got status code without prefix!?" );
297 9e18ec30 2002-01-07 alex return TRUE;
298 9e18ec30 2002-01-07 alex }
299 bc4ed226 2002-03-25 alex else prefix = Client_Search( Req->prefix );
300 9e18ec30 2002-01-07 alex if( ! prefix )
301 9e18ec30 2002-01-07 alex {
302 9e18ec30 2002-01-07 alex Log( LOG_WARNING, "Got status code from unknown source: \"%s\"", Req->prefix );
303 9e18ec30 2002-01-07 alex return TRUE;
304 9e18ec30 2002-01-07 alex }
305 1c8c92af 2002-01-05 alex
306 1c8c92af 2002-01-05 alex /* Statuscode weiterleiten */
307 1c8c92af 2002-01-05 alex strcpy( str, Req->command );
308 1c8c92af 2002-01-05 alex for( i = 0; i < Req->argc; i++ )
309 1c8c92af 2002-01-05 alex {
310 1c8c92af 2002-01-05 alex if( i < Req->argc - 1 ) strcat( str, " " );
311 1c8c92af 2002-01-05 alex else strcat( str, " :" );
312 1c8c92af 2002-01-05 alex strcat( str, Req->argv[i] );
313 1c8c92af 2002-01-05 alex }
314 ec474a4b 2002-10-04 alex return IRC_WriteStrClientPrefix( target, prefix, "%s", str );
315 1c8c92af 2002-01-05 alex }
316 1c8c92af 2002-01-05 alex
317 cfd78b90 2001-12-25 alex if( strcasecmp( Req->command, "PASS" ) == 0 ) return IRC_PASS( client, Req );
318 cfd78b90 2001-12-25 alex else if( strcasecmp( Req->command, "NICK" ) == 0 ) return IRC_NICK( client, Req );
319 cfd78b90 2001-12-25 alex else if( strcasecmp( Req->command, "USER" ) == 0 ) return IRC_USER( client, Req );
320 93aa0dbf 2002-01-03 alex else if( strcasecmp( Req->command, "SERVER" ) == 0 ) return IRC_SERVER( client, Req );
321 93aa0dbf 2002-01-03 alex else if( strcasecmp( Req->command, "NJOIN" ) == 0 ) return IRC_NJOIN( client, Req );
322 d4a60bd4 2001-12-25 alex else if( strcasecmp( Req->command, "QUIT" ) == 0 ) return IRC_QUIT( client, Req );
323 5ff42762 2002-01-04 alex else if( strcasecmp( Req->command, "SQUIT" ) == 0 ) return IRC_SQUIT( client, Req );
324 c9067fb7 2001-12-26 alex else if( strcasecmp( Req->command, "PING" ) == 0 ) return IRC_PING( client, Req );
325 c9067fb7 2001-12-26 alex else if( strcasecmp( Req->command, "PONG" ) == 0 ) return IRC_PONG( client, Req );
326 cfd78b90 2001-12-25 alex else if( strcasecmp( Req->command, "MOTD" ) == 0 ) return IRC_MOTD( client, Req );
327 4c6a99cf 2001-12-27 alex else if( strcasecmp( Req->command, "PRIVMSG" ) == 0 ) return IRC_PRIVMSG( client, Req );
328 4c6a99cf 2001-12-27 alex else if( strcasecmp( Req->command, "NOTICE" ) == 0 ) return IRC_NOTICE( client, Req );
329 363a03b8 2001-12-29 alex else if( strcasecmp( Req->command, "MODE" ) == 0 ) return IRC_MODE( client, Req );
330 fb9d6ce1 2001-12-31 alex else if( strcasecmp( Req->command, "NAMES" ) == 0 ) return IRC_NAMES( client, Req );
331 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "ISON" ) == 0 ) return IRC_ISON( client, Req );
332 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "WHOIS" ) == 0 ) return IRC_WHOIS( client, Req );
333 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "USERHOST" ) == 0 ) return IRC_USERHOST( client, Req );
334 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "OPER" ) == 0 ) return IRC_OPER( client, Req );
335 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "DIE" ) == 0 ) return IRC_DIE( client, Req );
336 804b1ec4 2001-12-31 alex else if( strcasecmp( Req->command, "RESTART" ) == 0 ) return IRC_RESTART( client, Req );
337 b6254bbb 2002-01-02 alex else if( strcasecmp( Req->command, "ERROR" ) == 0 ) return IRC_ERROR( client, Req );
338 c2ee5437 2002-01-11 alex else if( strcasecmp( Req->command, "LUSERS" ) == 0 ) return IRC_LUSERS( client, Req );
339 c2ee5437 2002-01-11 alex else if( strcasecmp( Req->command, "LINKS" ) == 0 ) return IRC_LINKS( client, Req );
340 d3e0d78d 2002-01-21 alex else if( strcasecmp( Req->command, "JOIN" ) == 0 ) return IRC_JOIN( client, Req );
341 d3e0d78d 2002-01-21 alex else if( strcasecmp( Req->command, "PART" ) == 0 ) return IRC_PART( client, Req );
342 458174ff 2002-02-17 alex else if( strcasecmp( Req->command, "VERSION" ) == 0 ) return IRC_VERSION( client, Req );
343 aaa682fb 2002-02-23 alex else if( strcasecmp( Req->command, "KILL" ) == 0 ) return IRC_KILL( client, Req );
344 949977e8 2002-02-27 alex else if( strcasecmp( Req->command, "AWAY" ) == 0 ) return IRC_AWAY( client, Req );
345 d59f0290 2002-02-27 alex else if( strcasecmp( Req->command, "TOPIC" ) == 0 ) return IRC_TOPIC( client, Req );
346 14aba7c1 2002-03-03 alex else if( strcasecmp( Req->command, "WHO" ) == 0 ) return IRC_WHO( client, Req );
347 9d2407db 2002-04-23 alex else if( strcasecmp( Req->command, "LIST" ) == 0 ) return IRC_LIST( client, Req );
348 c2f60abe 2002-05-27 alex else if( strcasecmp( Req->command, "INVITE" ) == 0 ) return IRC_INVITE( client, Req );
349 c2f60abe 2002-05-27 alex else if( strcasecmp( Req->command, "KICK" ) == 0 ) return IRC_KICK( client, Req );
350 d1ac4039 2002-09-03 alex else if( strcasecmp( Req->command, "CONNECT" ) == 0 ) return IRC_CONNECT( client, Req );
351 5502fb27 2002-09-16 alex else if( strcasecmp( Req->command, "ADMIN" ) == 0 ) return IRC_ADMIN( client, Req );
352 3dc16212 2002-09-07 alex #ifdef IRCPLUS
353 d1ac4039 2002-09-03 alex else if( strcasecmp( Req->command, "CHANINFO" ) == 0 ) return IRC_CHANINFO( client, Req );
354 3dc16212 2002-09-07 alex #endif
355 d1ac4039 2002-09-03 alex
356 76c4f066 2001-12-23 alex /* Unbekannter Befehl */
357 a5677689 2002-01-06 alex if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );
358 3d2e9448 2002-01-05 alex Log( LOG_DEBUG, "Connection %d: Unknown command \"%s\", %d %s,%s prefix.", Client_Conn( client ), Req->command, Req->argc, Req->argc == 1 ? "parameter" : "parameters", Req->prefix ? "" : " no" );
359 76c4f066 2001-12-23 alex
360 6e07fb41 2001-12-21 alex return TRUE;
361 6e07fb41 2001-12-21 alex } /* Handle_Request */
362 6e07fb41 2001-12-21 alex
363 6e07fb41 2001-12-21 alex
364 6e07fb41 2001-12-21 alex /* -eof- */