#include "portab.h"
-static char UNUSED id[] = "$Id: client.c,v 1.65 2002/12/12 12:24:18 alex Exp $";
+static char UNUSED id[] = "$Id: client.c,v 1.65.2.1 2002/12/22 23:42:28 alex Exp $";
#include "imp.h"
#include <assert.h>
LOCAL CLIENT *New_Client_Struct PARAMS(( VOID ));
LOCAL VOID Generate_MyToken PARAMS(( CLIENT *Client ));
+LOCAL VOID Adjust_Counters PARAMS(( CLIENT *Client ));
+
+
+LONG Max_Users = 0, My_Max_Users = 0;
GLOBAL VOID
client->next = (POINTER *)My_Clients;
My_Clients = client;
+ /* Adjust counters */
+ Adjust_Counters( client );
+
return client;
} /* Client_New */
assert( Client != NULL );
Client->type = Type;
if( Type == CLIENT_SERVER ) Generate_MyToken( Client );
+ Adjust_Counters( Client );
} /* Client_SetType */
} /* Client_UnknownCount */
+GLOBAL LONG
+Client_MaxUserCount( VOID )
+{
+ return Max_Users;
+} /* Client_MaxUserCount */
+
+
+GLOBAL LONG
+Client_MyMaxUserCount( VOID )
+{
+ return My_Max_Users;
+} /* Client_MyMaxUserCount */
+
+
GLOBAL BOOLEAN
Client_IsValidNick( CHAR *Nick )
{
} /* Generate_MyToken */
+LOCAL VOID
+Adjust_Counters( CLIENT *Client )
+{
+ LONG count;
+
+ assert( Client != NULL );
+
+ if( Client->type != CLIENT_USER ) return;
+
+ if( Client->conn_id != NONE )
+ {
+ /* Local connection */
+ count = Client_MyUserCount( );
+ if( count > My_Max_Users ) My_Max_Users = count;
+ }
+ count = Client_UserCount( );
+ if( count > Max_Users ) Max_Users = count;
+} /* Adjust_Counters */
+
+
/* -eof- */
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
- * $Id: client.h,v 1.32 2002/12/12 12:23:43 alex Exp $
+ * $Id: client.h,v 1.32.2.1 2002/12/22 23:42:28 alex Exp $
*
* Client management (header)
*/
GLOBAL LONG Client_MyUserCount PARAMS((VOID ));
GLOBAL LONG Client_MyServiceCount PARAMS((VOID ));
GLOBAL LONG Client_MyServerCount PARAMS((VOID ));
+GLOBAL LONG Client_MaxUserCount PARAMS(( VOID ));
+GLOBAL LONG Client_MyMaxUserCount PARAMS(( VOID ));
GLOBAL BOOLEAN Client_IsValidNick PARAMS((CHAR *Nick ));
#include "portab.h"
-static char UNUSED id[] = "$Id: irc-info.c,v 1.8 2002/12/18 13:55:41 alex Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.8.2.1 2002/12/22 23:42:28 alex Exp $";
#include "imp.h"
#include <assert.h>
assert( Client != NULL );
- /* Users, Services und Serevr im Netz */
+ /* Users, services and serevers in the network */
if( ! IRC_WriteStrClient( Client, RPL_LUSERCLIENT_MSG, Client_ID( Client ), Client_UserCount( ), Client_ServiceCount( ), Client_ServerCount( ))) return DISCONNECTED;
- /* IRC-Operatoren im Netz */
+ /* Number of IRC operators */
cnt = Client_OperCount( );
if( cnt > 0 )
{
if( ! IRC_WriteStrClient( Client, RPL_LUSEROP_MSG, Client_ID( Client ), cnt )) return DISCONNECTED;
}
- /* Unbekannt Verbindungen */
+ /* Unknown connections */
cnt = Client_UnknownCount( );
if( cnt > 0 )
{
if( ! IRC_WriteStrClient( Client, RPL_LUSERUNKNOWN_MSG, Client_ID( Client ), cnt )) return DISCONNECTED;
}
- /* Channels im Netz */
+ /* Number of created channels */
if( ! IRC_WriteStrClient( Client, RPL_LUSERCHANNELS_MSG, Client_ID( Client ), Channel_Count( ))) return DISCONNECTED;
- /* Channels im Netz */
+ /* Number of local users, services and servers */
if( ! IRC_WriteStrClient( Client, RPL_LUSERME_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyServiceCount( ), Client_MyServerCount( ))) return DISCONNECTED;
+#ifndef STRICT_RFC
+ /* Maximum number of local users */
+ if( ! IRC_WriteStrClient( Client, RPL_LOCALUSERS_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyMaxUserCount( ))) return DISCONNECTED;
+ /* Maximum number of users in the network */
+ if( ! IRC_WriteStrClient( Client, RPL_NETUSERS_MSG, Client_ID( Client ), Client_UserCount( ), Client_MaxUserCount( ))) return DISCONNECTED;
+#endif
+
return CONNECTED;
} /* IRC_Send_LUSERS */
#include "portab.h"
-static char UNUSED id[] = "$Id: irc-login.c,v 1.27 2002/12/12 12:24:18 alex Exp $";
+static char UNUSED id[] = "$Id: irc-login.c,v 1.27.2.1 2002/12/22 23:42:28 alex Exp $";
#include "imp.h"
#include <assert.h>
if( ! IRC_WriteStrClient( Client, RPL_CREATED_MSG, Client_ID( Client ), NGIRCd_StartStr )) return FALSE;
if( ! IRC_WriteStrClient( Client, RPL_MYINFO_MSG, Client_ID( Client ), Client_ID( Client_ThisServer( )), VERSION, USERMODES, CHANMODES )) return FALSE;
+ /* Features */
+ if( ! IRC_WriteStrClient( Client, RPL_FEATURE_MSG, Client_ID( Client ), CLIENT_NICK_LEN - 1, CHANNEL_TOPIC_LEN - 1, CLIENT_AWAY_LEN - 1, Conf_MaxJoins )) return DISCONNECTED;
+
Client_SetType( Client, CLIENT_USER );
if( ! IRC_Send_LUSERS( Client )) return DISCONNECTED;
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
- * $Id: messages.h,v 1.59 2002/12/18 14:03:14 alex Exp $
+ * $Id: messages.h,v 1.59.2.1 2002/12/22 23:42:28 alex Exp $
*
* IRC numerics (Header)
*/
#define RPL_YOURHOST_MSG "002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)"
#define RPL_CREATED_MSG "003 %s :This server has been started %s"
#define RPL_MYINFO_MSG "004 %s %s ngircd-%s %s %s"
+#define RPL_FEATURE_MSG "005 %s NICKLEN=%d TOPICLEN=%d AWAYLEN=%d MAXCHANNELS=%d :are supported on this server"
#define RPL_STATSLINKINFO_MSG "211 %s %s %d %ld %ld %ld %ld :%ld"
#define RPL_STATSCOMMANDS_MSG "212 %s %s %ld %ld %ld"
#define RPL_ENDOFSTATS_MSG "219 %s %c :End of STATS report"
#define RPL_ADMINLOC1_MSG "257 %s :%s"
#define RPL_ADMINLOC2_MSG "258 %s :%s"
#define RPL_ADMINEMAIL_MSG "259 %s :%s"
+#define RPL_LOCALUSERS_MSG "265 %s :Current local users: %ld, Max: %ld"
+#define RPL_NETUSERS_MSG "266 %s :Current global users: %ld, Max: %ld"
#define RPL_AWAY_MSG "301 %s %s :%s"
#define RPL_USERHOST_MSG "302 %s :"