]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/parse.c
- Sourcen auf weitere Module fuer IRC-Befehle aufgesplitted.
[ngircd-alex.git] / src / ngircd / parse.c
index bab9c6c5ec96d18fff4374c455f2b6b67bb06eea..44b853e06f62a9dedd79d60c7b929a3a454e3cd9 100644 (file)
@@ -9,11 +9,42 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: parse.c,v 1.19 2002/01/09 01:08:42 alex Exp $
+ * $Id: parse.c,v 1.29 2002/03/03 17:17:38 alex Exp $
  *
  * parse.c: Parsen der Client-Anfragen
  *
  * $Log: parse.c,v $
+ * Revision 1.29  2002/03/03 17:17:38  alex
+ * - Sourcen auf weitere Module fuer IRC-Befehle aufgesplitted.
+ * - IRC-Befehl WHO implementiert.
+ *
+ * Revision 1.28  2002/02/27 23:25:31  alex
+ * - Anpassungen an Aufteilung von irc.d, Init- und Exit-Funktionen entfernt.
+ *
+ * Revision 1.27  2002/02/27 20:33:13  alex
+ * - Channel-Topics implementiert.
+ *
+ * Revision 1.26  2002/02/27 18:23:46  alex
+ * - IRC-Befehl "AWAY" implementert.
+ *
+ * Revision 1.25  2002/02/26 20:52:15  alex
+ * - Fehler bei Fehlermeldung wg. unbekanntem Prefix behoben.
+ *
+ * Revision 1.24  2002/02/23 21:39:48  alex
+ * - IRC-Befehl KILL sowie Kills bei Nick Collsisions implementiert.
+ *
+ * Revision 1.23  2002/02/17 23:38:58  alex
+ * - neuer IRC-Befehl VERSION implementiert: IRC_VERSION().
+ *
+ * Revision 1.22  2002/01/21 00:01:37  alex
+ * - neue Befehle JOIN und PART.
+ *
+ * Revision 1.21  2002/01/18 11:12:11  alex
+ * - der Sniffer wird nun nur noch aktiviert, wenn auf Kommandozeile angegeben.
+ *
+ * Revision 1.20  2002/01/11 23:50:55  alex
+ * - LINKS implementiert, LUSERS begonnen.
+ *
  * Revision 1.19  2002/01/09 01:08:42  alex
  * - Parses handhabt Leerzeichen zw. Parametern nun etwas "lockerer".
  *
 #include <stdio.h>
 #include <string.h>
 
+#include "ngircd.h"
 #include "client.h"
 #include "conn.h"
 #include "irc.h"
+#include "irc-channel.h"
+#include "irc-login.h"
+#include "irc-mode.h"
+#include "irc-oper.h"
+#include "irc-server.h"
+#include "irc-write.h"
 #include "log.h"
 #include "messages.h"
 #include "tool.h"
@@ -113,16 +151,6 @@ LOCAL BOOLEAN Validate_Args( REQUEST *Req );
 LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req );
 
 
-GLOBAL VOID Parse_Init( VOID )
-{
-} /* Parse_Init */
-
-
-GLOBAL VOID Parse_Exit( VOID )
-{
-} /* Parse_Exit */
-
-
 GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request )
 {
        /* Client-Request parsen. Bei einem schwerwiegenden Fehler wird
@@ -136,7 +164,7 @@ GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request )
        assert( Request != NULL );
 
 #ifdef SNIFFER
-       Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
+       if( NGIRCd_Sniffer ) Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
 #endif
        
        Init_Request( &req );
@@ -298,7 +326,7 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
                else target = NULL;
                if( ! target )
                {
-                       if( target ) Log( LOG_WARNING, "Unknown target for status code: \"%s\"", Req->argv[0] );
+                       if( Req->argc > 0 ) Log( LOG_WARNING, "Unknown target for status code: \"%s\"", Req->argv[0] );
                        else Log( LOG_WARNING, "Unknown target for status code!" );
                        return TRUE;
                }
@@ -353,6 +381,15 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
        else if( strcasecmp( Req->command, "DIE" ) == 0 ) return IRC_DIE( client, Req );
        else if( strcasecmp( Req->command, "RESTART" ) == 0 ) return IRC_RESTART( client, Req );
        else if( strcasecmp( Req->command, "ERROR" ) == 0 ) return IRC_ERROR( client, Req );
+       else if( strcasecmp( Req->command, "LUSERS" ) == 0 ) return IRC_LUSERS( client, Req );
+       else if( strcasecmp( Req->command, "LINKS" ) == 0 ) return IRC_LINKS( client, Req );
+       else if( strcasecmp( Req->command, "JOIN" ) == 0 ) return IRC_JOIN( client, Req );
+       else if( strcasecmp( Req->command, "PART" ) == 0 ) return IRC_PART( client, Req );
+       else if( strcasecmp( Req->command, "VERSION" ) == 0 ) return IRC_VERSION( client, Req );
+       else if( strcasecmp( Req->command, "KILL" ) == 0 ) return IRC_KILL( client, Req );
+       else if( strcasecmp( Req->command, "AWAY" ) == 0 ) return IRC_AWAY( client, Req );
+       else if( strcasecmp( Req->command, "TOPIC" ) == 0 ) return IRC_TOPIC( client, Req );
+       else if( strcasecmp( Req->command, "WHO" ) == 0 ) return IRC_WHO( client, Req );
        
        /* Unbekannter Befehl */
        if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );