+GLOBAL BOOLEAN IRC_VERSION( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target, *prefix;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ /* Falsche Anzahl Parameter? */
+ if(( Req->argc > 1 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* Ziel suchen */
+ if( Req->argc == 1 ) target = Client_GetFromID( Req->argv[0] );
+ else target = Client_ThisServer( );
+
+ /* Prefix ermitteln */
+ if( Client_Type( Client ) == CLIENT_SERVER ) prefix = Client_GetFromID( Req->prefix );
+ else prefix = Client;
+ if( ! prefix ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
+
+ /* An anderen Server weiterleiten? */
+ if( target != Client_ThisServer( ))
+ {
+ if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
+
+ /* forwarden */
+ IRC_WriteStrClientPrefix( Client_NextHop( target ), prefix, "VERSION %s", Req->argv[0] );
+ return CONNECTED;
+ }
+
+ /* mit Versionsinfo antworten */
+ return IRC_WriteStrClient( Client, RPL_VERSION_MSG, Client_ID( prefix ), NGIRCd_DebugLevel, Conf_ServerName, NGIRCd_VersionAddition( ));
+} /* IRC_VERSION */
+
+
+GLOBAL BOOLEAN IRC_KILL( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *prefix, *c;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if( Client_Type( Client ) != CLIENT_SERVER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ prefix = Client_GetFromID( Req->prefix );
+ if( ! prefix )
+ {
+ Log( LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!", Req->prefix );
+ prefix = Client_ThisServer( );
+ }
+
+ Log( LOG_NOTICE, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
+
+ /* andere Server benachrichtigen */
+ IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], Req->argv[1] );
+
+ /* haben wir selber einen solchen Client? */
+ c = Client_GetFromID( Req->argv[0] );
+ if( c && ( Client_Conn( c ) != NONE )) Conn_Close( Client_Conn( c ), NULL, Req->argv[1], TRUE );
+
+ return CONNECTED;
+} /* IRC_KILL */
+
+