2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
20 static char UNUSED id[] = "$Id: client.c,v 1.80 2005/05/16 12:23:48 alex Exp $";
43 #include "irc-write.h"
50 #define GETID_LEN (CLIENT_NICK_LEN-1) + 1 + (CLIENT_USER_LEN-1) + 1 + (CLIENT_HOST_LEN-1) + 1
53 LOCAL CLIENT *This_Server, *My_Clients;
54 LOCAL char GetID_Buffer[GETID_LEN];
56 LOCAL WHOWAS My_Whowas[MAX_WHOWAS];
57 LOCAL int Last_Whowas = -1;
60 LOCAL long Count PARAMS(( CLIENT_TYPE Type ));
61 LOCAL long MyCount PARAMS(( CLIENT_TYPE Type ));
63 LOCAL CLIENT *New_Client_Struct PARAMS(( void ));
64 LOCAL void Generate_MyToken PARAMS(( CLIENT *Client ));
65 LOCAL void Adjust_Counters PARAMS(( CLIENT *Client ));
66 LOCAL void Register_Whowas PARAMS(( CLIENT *Client ));
68 #ifndef Client_DestroyNow
69 GLOBAL void Client_DestroyNow PARAMS((CLIENT *Client ));
73 long Max_Users = 0, My_Max_Users = 0;
81 This_Server = New_Client_Struct( );
84 Log( LOG_EMERG, "Can't allocate client structure for server! Going down." );
85 Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
89 /* Client-Struktur dieses Servers */
90 This_Server->next = NULL;
91 This_Server->type = CLIENT_SERVER;
92 This_Server->conn_id = NONE;
93 This_Server->introducer = This_Server;
94 This_Server->mytoken = 1;
95 This_Server->hops = 0;
97 gethostname( This_Server->host, CLIENT_HOST_LEN );
98 h = gethostbyname( This_Server->host );
99 if( h ) strlcpy( This_Server->host, h->h_name, sizeof( This_Server->host ));
101 Client_SetID( This_Server, Conf_ServerName );
102 Client_SetInfo( This_Server, Conf_ServerInfo );
104 My_Clients = This_Server;
106 memset( &My_Whowas, 0, sizeof( My_Whowas ));
116 if( NGIRCd_SignalRestart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, false );
117 else Client_Destroy( This_Server, "Server going down.", NULL, false );
124 next = (CLIENT *)c->next;
128 if( cnt ) Log( LOG_INFO, "Freed %d client structure%s.", cnt, cnt == 1 ? "" : "s" );
133 Client_ThisServer( void )
136 } /* Client_ThisServer */
140 Client_NewLocal( CONN_ID Idx, char *Hostname, int Type, bool Idented )
142 /* Neuen lokalen Client erzeugen: Wrapper-Funktion fuer Client_New(). */
143 return Client_New( Idx, This_Server, NULL, Type, NULL, NULL, Hostname, NULL, 0, 0, NULL, Idented );
144 } /* Client_NewLocal */
148 Client_NewRemoteServer( CLIENT *Introducer, char *Hostname, CLIENT *TopServer, int Hops, int Token, char *Info, bool Idented )
150 /* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
151 return Client_New( NONE, Introducer, TopServer, CLIENT_SERVER, Hostname, NULL, Hostname, Info, Hops, Token, NULL, Idented );
152 } /* Client_NewRemoteServer */
156 Client_NewRemoteUser( CLIENT *Introducer, char *Nick, int Hops, char *User, char *Hostname, int Token, char *Modes, char *Info, bool Idented )
158 /* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
159 return Client_New( NONE, Introducer, NULL, CLIENT_USER, Nick, User, Hostname, Info, Hops, Token, Modes, Idented );
160 } /* Client_NewRemoteUser */
164 Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, int Type, char *ID, char *User, char *Hostname, char *Info, int Hops, int Token, char *Modes, bool Idented )
168 assert( Idx >= NONE );
169 assert( Introducer != NULL );
170 assert( Hostname != NULL );
172 client = New_Client_Struct( );
173 if( ! client ) return NULL;
176 client->conn_id = Idx;
177 client->introducer = Introducer;
178 client->topserver = TopServer;
180 if( ID ) Client_SetID( client, ID );
181 if( User ) Client_SetUser( client, User, Idented );
182 if( Hostname ) Client_SetHostname( client, Hostname );
183 if( Info ) Client_SetInfo( client, Info );
185 client->token = Token;
186 if( Modes ) Client_SetModes( client, Modes );
187 if( Type == CLIENT_SERVER ) Generate_MyToken( client );
189 /* ist der User away? */
190 if( strchr( client->modes, 'a' )) strlcpy( client->away, DEFAULT_AWAY_MSG, sizeof( client->away ));
193 client->next = (POINTER *)My_Clients;
196 /* Adjust counters */
197 Adjust_Counters( client );
204 Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
206 /* Client entfernen. */
209 char msg[LINE_LEN], *txt;
211 assert( Client != NULL );
213 if( LogMsg ) txt = LogMsg;
215 if( ! txt ) txt = "Reason unknown.";
217 /* Netz-Split-Nachricht vorbereiten (noch nicht optimal) */
218 if( Client->type == CLIENT_SERVER ) snprintf( msg, sizeof( msg ), "%s: lost server %s", This_Server->id, Client->id );
224 if(( Client->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c != Client ))
226 /* der Client, der geloescht wird ist ein Server. Der Client, den wir gerade
227 * pruefen, ist ein Child von diesem und muss daher auch entfernt werden */
228 Client_Destroy( c, NULL, msg, false );
235 /* Wir haben den Client gefunden: entfernen */
236 if( last ) last->next = c->next;
237 else My_Clients = (CLIENT *)c->next;
239 if( c->type == CLIENT_USER )
241 if( c->conn_id != NONE )
243 /* Ein lokaler User */
244 Log( LOG_NOTICE, "User \"%s\" unregistered (connection %d): %s", Client_Mask( c ), c->conn_id, txt );
248 /* Alle andere Server informieren! */
249 if( FwdMsg ) IRC_WriteStrServersPrefix( NULL, c, "QUIT :%s", FwdMsg );
250 else IRC_WriteStrServersPrefix( NULL, c, "QUIT :" );
256 Log( LOG_DEBUG, "User \"%s\" unregistered: %s", Client_Mask( c ), txt );
260 /* Andere Server informieren, ausser denen, die "in
261 * Richtung dem liegen", auf dem der User registriert
262 * ist. Von denen haben wir das QUIT ja wohl bekommen. */
263 if( FwdMsg ) IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "QUIT :%s", FwdMsg );
264 else IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "QUIT :" );
268 /* Unregister client from channels */
269 Channel_Quit( c, FwdMsg ? FwdMsg : c->id );
271 /* Register client in My_Whowas structure */
272 Register_Whowas( c );
274 else if( c->type == CLIENT_SERVER )
276 if( c != This_Server )
278 if( c->conn_id != NONE ) Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
279 else Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered: %s", c->id, txt );
282 /* andere Server informieren */
283 if( ! NGIRCd_SignalQuit )
285 if( FwdMsg ) IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "SQUIT %s :%s", c->id, FwdMsg );
286 else IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "SQUIT %s :", c->id );
291 if( c->conn_id != NONE )
293 if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
294 else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
298 if( c->id[0] ) Log( LOG_WARNING, "Unregistered unknown client \"%s\": %s", c->id, txt );
299 else Log( LOG_WARNING, "Unregistered unknown client: %s", c->id, txt );
307 c = (CLIENT *)c->next;
309 } /* Client_Destroy */
313 Client_DestroyNow( CLIENT *Client )
315 /* Destroy client structure immediately. This function is only
316 * intended for the connection layer to remove client structures
317 * of connections that can't be established! */
321 assert( Client != NULL );
329 /* Wir haben den Client gefunden: entfernen */
330 if( last ) last->next = c->next;
331 else My_Clients = (CLIENT *)c->next;
336 c = (CLIENT *)c->next;
338 } /* Client_DestroyNow */
342 Client_SetHostname( CLIENT *Client, char *Hostname )
344 /* Hostname eines Clients setzen */
346 assert( Client != NULL );
347 assert( Hostname != NULL );
349 strlcpy( Client->host, Hostname, sizeof( Client->host ));
350 } /* Client_SetHostname */
354 Client_SetID( CLIENT *Client, char *ID )
356 /* Hostname eines Clients setzen, Hash-Wert berechnen */
358 assert( Client != NULL );
359 assert( ID != NULL );
361 strlcpy( Client->id, ID, sizeof( Client->id ));
364 Client->hash = Hash( Client->id );
369 Client_SetUser( CLIENT *Client, char *User, bool Idented )
371 /* Username eines Clients setzen */
373 assert( Client != NULL );
374 assert( User != NULL );
376 if( Idented ) strlcpy( Client->user, User, sizeof( Client->user ));
379 Client->user[0] = '~';
380 strlcpy( Client->user + 1, User, sizeof( Client->user ) - 1 );
382 } /* Client_SetUser */
386 Client_SetInfo( CLIENT *Client, char *Info )
388 /* Hostname eines Clients setzen */
390 assert( Client != NULL );
391 assert( Info != NULL );
393 strlcpy( Client->info, Info, sizeof( Client->info ));
394 } /* Client_SetInfo */
398 Client_SetModes( CLIENT *Client, char *Modes )
400 /* Modes eines Clients setzen */
402 assert( Client != NULL );
403 assert( Modes != NULL );
405 strlcpy( Client->modes, Modes, sizeof( Client->modes ));
406 } /* Client_SetModes */
410 Client_SetFlags( CLIENT *Client, char *Flags )
412 /* Flags eines Clients setzen */
414 assert( Client != NULL );
415 assert( Flags != NULL );
417 strlcpy( Client->flags, Flags, sizeof( Client->flags ));
418 } /* Client_SetFlags */
422 Client_SetPassword( CLIENT *Client, char *Pwd )
424 /* Von einem Client geliefertes Passwort */
426 assert( Client != NULL );
427 assert( Pwd != NULL );
429 strlcpy( Client->pwd, Pwd, sizeof( Client->pwd ));
430 } /* Client_SetPassword */
434 Client_SetAway( CLIENT *Client, char *Txt )
436 /* Set AWAY reason of client */
438 assert( Client != NULL );
439 assert( Txt != NULL );
441 strlcpy( Client->away, Txt, sizeof( Client->away ));
442 Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
443 } /* Client_SetAway */
447 Client_SetType( CLIENT *Client, int Type )
449 assert( Client != NULL );
451 if( Type == CLIENT_SERVER ) Generate_MyToken( Client );
452 Adjust_Counters( Client );
453 } /* Client_SetType */
457 Client_SetHops( CLIENT *Client, int Hops )
459 assert( Client != NULL );
461 } /* Client_SetHops */
465 Client_SetToken( CLIENT *Client, int Token )
467 assert( Client != NULL );
468 Client->token = Token;
469 } /* Client_SetToken */
473 Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer )
475 assert( Client != NULL );
476 assert( Introducer != NULL );
477 Client->introducer = Introducer;
478 } /* Client_SetIntroducer */
482 Client_SetOperByMe( CLIENT *Client, bool OperByMe )
484 assert( Client != NULL );
485 Client->oper_by_me = OperByMe;
486 } /* Client_SetOperByMe */
490 Client_ModeAdd( CLIENT *Client, char Mode )
493 * If Client already alread had Mode, return false.
494 * If the Mode was newly set, return true.
499 assert( Client != NULL );
501 x[0] = Mode; x[1] = '\0';
502 if( ! strchr( Client->modes, x[0] ))
504 /* Client hat den Mode noch nicht -> setzen */
505 strlcat( Client->modes, x, sizeof( Client->modes ));
509 } /* Client_ModeAdd */
513 Client_ModeDel( CLIENT *Client, char Mode )
516 * If Mode was removed, return true.
517 * If Client did not have Mode, return false.
522 assert( Client != NULL );
524 x[0] = Mode; x[1] = '\0';
526 p = strchr( Client->modes, x[0] );
527 if( ! p ) return false;
529 /* Client has Mode -> delete */
536 } /* Client_ModeDel */
540 Client_GetFromConn( CONN_ID Idx )
542 /* return Client-Structure that belongs to the local Connection Idx gehoert.
543 * If none is found, return NULL.
553 if( c->conn_id == Idx ) return c;
554 c = (CLIENT *)c->next;
557 } /* Client_GetFromConn */
561 Client_Search( char *Nick )
563 /* return Client-Structure that has the corresponding Nick.
564 * If none is found, return NULL.
567 char search_id[CLIENT_ID_LEN], *ptr;
571 assert( Nick != NULL );
573 /* copy Nick and truncate hostmask if necessary */
574 strlcpy( search_id, Nick, sizeof( search_id ));
575 ptr = strchr( search_id, '!' );
576 if( ptr ) *ptr = '\0';
578 search_hash = Hash( search_id );
583 if( c->hash == search_hash )
585 /* lt. Hash-Wert: Treffer! */
586 if( strcasecmp( c->id, search_id ) == 0 ) return c;
588 c = (CLIENT *)c->next;
591 } /* Client_Search */
595 Client_GetFromToken( CLIENT *Client, int Token )
597 /* Client-Struktur, die den entsprechenden Introducer (=Client)
598 * und das gegebene Token hat, liefern. Wird keine gefunden,
599 * so wird NULL geliefert. */
603 assert( Client != NULL );
609 if(( c->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c->token == Token )) return c;
610 c = (CLIENT *)c->next;
613 } /* Client_GetFromToken */
617 Client_Type( CLIENT *Client )
619 assert( Client != NULL );
625 Client_Conn( CLIENT *Client )
627 assert( Client != NULL );
628 return Client->conn_id;
633 Client_ID( CLIENT *Client )
635 assert( Client != NULL );
638 if( Client->type == CLIENT_USER ) assert( strlen( Client->id ) < CLIENT_NICK_LEN );
641 if( Client->id[0] ) return Client->id;
647 Client_Info( CLIENT *Client )
649 assert( Client != NULL );
655 Client_User( CLIENT *Client )
657 assert( Client != NULL );
658 if( Client->user[0] ) return Client->user;
664 Client_Hostname( CLIENT *Client )
666 assert( Client != NULL );
668 } /* Client_Hostname */
672 Client_Password( CLIENT *Client )
674 assert( Client != NULL );
676 } /* Client_Password */
680 Client_Modes( CLIENT *Client )
682 assert( Client != NULL );
683 return Client->modes;
688 Client_Flags( CLIENT *Client )
690 assert( Client != NULL );
691 return Client->flags;
696 Client_OperByMe( CLIENT *Client )
698 assert( Client != NULL );
699 return Client->oper_by_me;
700 } /* Client_OperByMe */
704 Client_Hops( CLIENT *Client )
706 assert( Client != NULL );
712 Client_Token( CLIENT *Client )
714 assert( Client != NULL );
715 return Client->token;
720 Client_MyToken( CLIENT *Client )
722 assert( Client != NULL );
723 return Client->mytoken;
724 } /* Client_MyToken */
728 Client_NextHop( CLIENT *Client )
732 assert( Client != NULL );
735 while( c->introducer && ( c->introducer != c ) && ( c->introducer != This_Server )) c = c->introducer;
737 } /* Client_NextHop */
741 Client_Mask( CLIENT *Client )
743 /* Client-"ID" liefern, wie sie z.B. fuer
744 * Prefixe benoetigt wird. */
746 assert( Client != NULL );
748 if( Client->type == CLIENT_SERVER ) return Client->id;
750 snprintf( GetID_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user, Client->host );
756 Client_Introducer( CLIENT *Client )
758 assert( Client != NULL );
759 return Client->introducer;
760 } /* Client_Introducer */
764 Client_TopServer( CLIENT *Client )
766 assert( Client != NULL );
767 return Client->topserver;
768 } /* Client_TopServer */
772 Client_HasMode( CLIENT *Client, char Mode )
774 assert( Client != NULL );
775 return strchr( Client->modes, Mode ) != NULL;
776 } /* Client_HasMode */
780 Client_Away( CLIENT *Client )
782 /* AWAY-Text liefern */
784 assert( Client != NULL );
790 Client_CheckNick( CLIENT *Client, char *Nick )
792 /* Nick ueberpruefen */
794 assert( Client != NULL );
795 assert( Nick != NULL );
797 /* Nick ungueltig? */
798 if( ! Client_IsValidNick( Nick ))
800 IRC_WriteStrClient( Client, ERR_ERRONEUSNICKNAME_MSG, Client_ID( Client ), Nick );
804 /* Nick bereits vergeben? */
805 if( Client_Search( Nick ))
807 /* den Nick gibt es bereits */
808 IRC_WriteStrClient( Client, ERR_NICKNAMEINUSE_MSG, Client_ID( Client ), Nick );
813 } /* Client_CheckNick */
817 Client_CheckID( CLIENT *Client, char *ID )
819 /* Nick ueberpruefen */
821 char str[COMMAND_LEN];
824 assert( Client != NULL );
825 assert( Client->conn_id > NONE );
826 assert( ID != NULL );
829 if( strlen( ID ) > CLIENT_ID_LEN )
831 IRC_WriteStrClient( Client, ERR_ERRONEUSNICKNAME_MSG, Client_ID( Client ), ID );
835 /* ID bereits vergeben? */
839 if( strcasecmp( c->id, ID ) == 0 )
841 /* die Server-ID gibt es bereits */
842 snprintf( str, sizeof( str ), "ID \"%s\" already registered", ID );
843 if( Client->conn_id != c->conn_id ) Log( LOG_ERR, "%s (on connection %d)!", str, c->conn_id );
844 else Log( LOG_ERR, "%s (via network)!", str );
845 Conn_Close( Client->conn_id, str, str, true);
848 c = (CLIENT *)c->next;
852 } /* Client_CheckID */
858 /* Ersten Client liefern. */
865 Client_Next( CLIENT *c )
867 /* Naechsten Client liefern. Existiert keiner,
868 * so wird NULL geliefert. */
871 return (CLIENT *)c->next;
876 Client_UserCount( void )
878 return Count( CLIENT_USER );
879 } /* Client_UserCount */
883 Client_ServiceCount( void )
885 return Count( CLIENT_SERVICE );;
886 } /* Client_ServiceCount */
890 Client_ServerCount( void )
892 return Count( CLIENT_SERVER );
893 } /* Client_ServerCount */
897 Client_MyUserCount( void )
899 return MyCount( CLIENT_USER );
900 } /* Client_MyUserCount */
904 Client_MyServiceCount( void )
906 return MyCount( CLIENT_SERVICE );
907 } /* Client_MyServiceCount */
911 Client_MyServerCount( void )
920 if(( c->type == CLIENT_SERVER ) && ( c->hops == 1 )) cnt++;
921 c = (CLIENT *)c->next;
924 } /* Client_MyServerCount */
928 Client_OperCount( void )
937 if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++;
938 c = (CLIENT *)c->next;
941 } /* Client_OperCount */
945 Client_UnknownCount( void )
954 if( c && ( c->type != CLIENT_USER ) && ( c->type != CLIENT_SERVICE ) && ( c->type != CLIENT_SERVER )) cnt++;
955 c = (CLIENT *)c->next;
958 } /* Client_UnknownCount */
962 Client_MaxUserCount( void )
965 } /* Client_MaxUserCount */
969 Client_MyMaxUserCount( void )
972 } /* Client_MyMaxUserCount */
976 Client_IsValidNick( char *Nick )
978 /* Ist der Nick gueltig? */
980 char *ptr, goodchars[20];
982 assert( Nick != NULL );
984 strcpy( goodchars, ";0123456789-" );
986 if( Nick[0] == '#' ) return false;
987 if( strchr( goodchars, Nick[0] )) return false;
988 if( strlen( Nick ) >= CLIENT_NICK_LEN ) return false;
993 if(( *ptr < 'A' ) && ( ! strchr( goodchars, *ptr ))) return false;
994 if(( *ptr > '}' ) && ( ! strchr( goodchars, *ptr ))) return false;
999 } /* Client_IsValidNick */
1003 * Return pointer to "My_Whowas" structure.
1006 Client_GetWhowas( void )
1009 } /* Client_GetWhowas */
1012 * Return the index of the last used WHOWAS entry.
1015 Client_GetLastWhowasIndex( void )
1018 } /* Client_GetLastWhowasIndex */
1022 Count( CLIENT_TYPE Type )
1031 if( c->type == Type ) cnt++;
1032 c = (CLIENT *)c->next;
1039 MyCount( CLIENT_TYPE Type )
1048 if(( c->introducer == This_Server ) && ( c->type == Type )) cnt++;
1049 c = (CLIENT *)c->next;
1056 New_Client_Struct( void )
1058 /* Neue CLIENT-Struktur pre-initialisieren */
1062 c = (CLIENT *)malloc( sizeof( CLIENT ));
1065 Log( LOG_EMERG, "Can't allocate memory! [New_Client_Struct]" );
1069 memset( c, 0, sizeof ( CLIENT ));
1071 c->type = CLIENT_UNKNOWN;
1073 c->oper_by_me = false;
1083 Generate_MyToken( CLIENT *Client )
1092 if( c->mytoken == token )
1094 /* Das Token wurde bereits vergeben */
1099 else c = (CLIENT *)c->next;
1101 Client->mytoken = token;
1102 Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id );
1103 } /* Generate_MyToken */
1107 Adjust_Counters( CLIENT *Client )
1111 assert( Client != NULL );
1113 if( Client->type != CLIENT_USER ) return;
1115 if( Client->conn_id != NONE )
1117 /* Local connection */
1118 count = Client_MyUserCount( );
1119 if( count > My_Max_Users ) My_Max_Users = count;
1121 count = Client_UserCount( );
1122 if( count > Max_Users ) Max_Users = count;
1123 } /* Adjust_Counters */
1127 * Register client in My_Whowas structure for further recall by WHOWAS.
1130 Register_Whowas( CLIENT *Client )
1134 assert( Client != NULL );
1136 slot = Last_Whowas + 1;
1137 if( slot >= MAX_WHOWAS || slot < 0 ) slot = 0;
1140 Log( LOG_DEBUG, "Saving WHOWAS information to slot %d ...", slot );
1143 My_Whowas[slot].time = time( NULL );
1144 strlcpy( My_Whowas[slot].id, Client_ID( Client ),
1145 sizeof( My_Whowas[slot].id ));
1146 strlcpy( My_Whowas[slot].user, Client_User( Client ),
1147 sizeof( My_Whowas[slot].user ));
1148 strlcpy( My_Whowas[slot].host, Client_Hostname( Client ),
1149 sizeof( My_Whowas[slot].host ));
1150 strlcpy( My_Whowas[slot].info, Client_Info( Client ),
1151 sizeof( My_Whowas[slot].info ));
1152 strlcpy( My_Whowas[slot].server, Client_ID( Client_Introducer( Client )),
1153 sizeof( My_Whowas[slot].server ));
1156 } /* Register_Whowas */