2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
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.
24 #include "conn-func.h"
34 #include "irc-write.h"
37 #include "irc-login.h"
39 static void Kill_Nick PARAMS(( char *Nick, char *Reason ));
42 * Handler for the IRC "PASS" command.
44 * See RFC 2813 section 4.1.1, and RFC 2812 section 3.1.1.
46 * @param Client The client from which this command has been received.
47 * @param Req Request structure with prefix and all parameters.
48 * @returns CONNECTED or DISCONNECTED.
51 IRC_PASS( CLIENT *Client, REQUEST *Req )
53 char *type, *orig_flags;
54 int protohigh, protolow;
56 assert( Client != NULL );
57 assert( Req != NULL );
59 /* Return an error if this is not a local client */
60 if (Client_Conn(Client) <= NONE)
61 return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG,
62 Client_ID(Client), Req->command);
64 if (Client_Type(Client) == CLIENT_UNKNOWN && Req->argc == 1) {
65 /* Not yet registered "unknown" connection, PASS with one
66 * argument: either a regular client, service, or server
67 * using the old RFC 1459 section 4.1.1 syntax. */
68 LogDebug("Connection %d: got PASS command (RFC 1459) ...",
70 } else if ((Client_Type(Client) == CLIENT_UNKNOWN ||
71 Client_Type(Client) == CLIENT_UNKNOWNSERVER) &&
72 (Req->argc == 3 || Req->argc == 4)) {
73 /* Not yet registered "unknown" connection or outgoing server
74 * link, PASS with three or four argument: server using the
75 * RFC 2813 section 4.1.1 syntax. */
76 LogDebug("Connection %d: got PASS command (RFC 2813, new server link) ...",
78 } else if (Client_Type(Client) == CLIENT_UNKNOWN ||
79 Client_Type(Client) == CLIENT_UNKNOWNSERVER) {
80 /* Unregistered connection, but wrong number of arguments: */
81 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
82 Client_ID(Client), Req->command);
84 /* Registered connection, PASS command is not allowed! */
85 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
89 Client_SetPassword(Client, Req->argv[0]);
91 /* Protocol version */
92 if (Req->argc >= 2 && strlen(Req->argv[1]) >= 4) {
98 Req->argv[1][4] = '\0';
99 protolow = atoi(&Req->argv[1][2]);
100 Req->argv[1][2] = '\0';
101 protohigh = atoi(Req->argv[1]);
103 Req->argv[1][2] = c2;
104 Req->argv[1][4] = c4;
106 Client_SetType(Client, CLIENT_GOTPASS_2813);
108 protohigh = protolow = 0;
109 Client_SetType(Client, CLIENT_GOTPASS);
112 /* Protocol type, see doc/Protocol.txt */
113 if (Req->argc >= 2 && strlen(Req->argv[1]) > 4)
114 type = &Req->argv[1][4];
118 /* Protocol flags/options */
120 orig_flags = Req->argv[3];
124 /* Implementation, version and IRC+ flags */
125 if (Req->argc >= 3) {
126 char *impl, *ptr, *serverver, *flags;
129 ptr = strchr(impl, '|');
133 if (type && strcmp(type, PROTOIRCPLUS) == 0) {
134 /* The peer seems to be a server which supports the
135 * IRC+ protocol (see doc/Protocol.txt). */
136 serverver = ptr ? ptr + 1 : "?";
137 flags = strchr(ptr ? serverver : impl, ':');
144 "Peer on conenction %d announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
145 Client_Conn(Client), impl, serverver,
146 protohigh, protolow, flags);
148 /* The peer seems to be a server supporting the
149 * "original" IRC protocol (RFC 2813). */
150 if (strchr(orig_flags, 'Z'))
155 "Peer on connection %d announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
156 Client_Conn(Client), impl,
157 protohigh, protolow, flags);
159 Client_SetFlags(Client, flags);
167 * Handler for the IRC "NICK" command.
169 * See RFC 2812, 3.1.2 "Nick message", and RFC 2813, 4.1.3 "Nick".
171 * This function implements the IRC command "NICK" which is used to register
172 * with the server, to change already registered nicknames and to introduce
173 * new users which are connected to other servers.
175 * @param Client The client from which this command has been received.
176 * @param Req Request structure with prefix and all parameters.
177 * @returns CONNECTED or DISCONNECTED.
180 IRC_NICK( CLIENT *Client, REQUEST *Req )
182 CLIENT *intr_c, *target, *c;
183 char *nick, *user, *hostname, *modes, *info;
186 assert( Client != NULL );
187 assert( Req != NULL );
189 /* Some IRC clients, for example BitchX, send the NICK and USER
190 * commands in the wrong order ... */
191 if(Client_Type(Client) == CLIENT_UNKNOWN
192 || Client_Type(Client) == CLIENT_GOTPASS
193 || Client_Type(Client) == CLIENT_GOTNICK
195 || Client_Type(Client) == CLIENT_GOTUSER
197 || Client_Type(Client) == CLIENT_USER
198 || Client_Type(Client) == CLIENT_SERVICE
199 || (Client_Type(Client) == CLIENT_SERVER && Req->argc == 1))
201 /* User registration or change of nickname */
203 /* Wrong number of arguments? */
205 return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG,
209 /* Search "target" client */
210 if( Client_Type( Client ) == CLIENT_SERVER )
212 target = Client_Search( Req->prefix );
214 return IRC_WriteStrClient( Client,
221 /* Is this a restricted client? */
222 if( Client_HasMode( Client, 'r' ))
223 return IRC_WriteStrClient( Client,
225 Client_ID( Client ));
231 /* If the clients tries to change to its own nickname we won't
232 * do anything. This is how the original ircd behaves and some
233 * clients (for example Snak) expect it to be like this.
234 * But I doubt that this is "really the right thing" ... */
235 if( strcmp( Client_ID( target ), Req->argv[0] ) == 0 )
239 /* Check that the new nickname is available. Special case:
240 * the client only changes from/to upper to lower case. */
241 if( strcasecmp( Client_ID( target ), Req->argv[0] ) != 0 )
243 if( ! Client_CheckNick( target, Req->argv[0] ))
247 if (Client_Type(target) != CLIENT_USER &&
248 Client_Type(target) != CLIENT_SERVICE &&
249 Client_Type(target) != CLIENT_SERVER) {
251 LogDebug("Connection %d: got valid NICK command ...",
252 Client_Conn( Client ));
254 /* Register new nickname of this client */
255 Client_SetID( target, Req->argv[0] );
259 Conn_SetAuthPing(Client_Conn(Client), rand());
260 IRC_WriteStrClient(Client, "PING :%ld",
261 Conn_GetAuthPing(Client_Conn(Client)));
262 LogDebug("Connection %d: sent AUTH PING %ld ...",
264 Conn_GetAuthPing(Client_Conn(Client)));
268 /* If we received a valid USER command already then
269 * register the new client! */
270 if( Client_Type( Client ) == CLIENT_GOTUSER )
271 return Login_User( Client );
273 Client_SetType( Client, CLIENT_GOTNICK );
275 /* Nickname change */
276 if (Client_Conn(target) > NONE) {
279 "%s \"%s\" changed nick (connection %d): \"%s\" -> \"%s\".",
280 Client_TypeText(target), Client_Mask(target),
281 Client_Conn(target), Client_ID(target),
283 Conn_UpdateIdle(Client_Conn(target));
286 LogDebug("%s \"%s\" changed nick: \"%s\" -> \"%s\".",
287 Client_TypeText(target),
288 Client_Mask(target), Client_ID(target),
292 /* Inform all users and servers (which have to know)
293 * of this nickname change */
294 if( Client_Type( Client ) == CLIENT_USER )
295 IRC_WriteStrClientPrefix( Client, Client,
298 IRC_WriteStrServersPrefix( Client, target,
299 "NICK :%s", Req->argv[0] );
300 IRC_WriteStrRelatedPrefix( target, target, false,
301 "NICK :%s", Req->argv[0] );
303 /* Register old nickname for WHOWAS queries */
304 Client_RegisterWhowas( target );
306 /* Save new nickname */
307 Client_SetID( target, Req->argv[0] );
309 IRC_SetPenalty( target, 2 );
313 } else if(Client_Type(Client) == CLIENT_SERVER ||
314 Client_Type(Client) == CLIENT_SERVICE) {
315 /* Server or service introduces new client */
317 /* Bad number of parameters? */
318 if (Req->argc != 2 && Req->argc != 7)
319 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
320 Client_ID(Client), Req->command);
322 if (Req->argc >= 7) {
323 /* RFC 2813 compatible syntax */
325 hops = atoi(Req->argv[1]);
327 hostname = Req->argv[3];
328 token = atoi(Req->argv[4]);
329 modes = Req->argv[5] + 1;
332 /* RFC 1459 compatible syntax */
336 hostname = Client_ID(Client);
337 token = atoi(Req->argv[1]);
342 c = Client_Search(nick);
345 * the new nick is already present on this server:
346 * the new and the old one have to be disconnected now.
348 Log( LOG_ERR, "Server %s introduces already registered nick \"%s\"!", Client_ID( Client ), Req->argv[0] );
349 Kill_Nick( Req->argv[0], "Nick collision" );
353 /* Find the Server this client is connected to */
354 intr_c = Client_GetFromToken(Client, token);
357 Log( LOG_ERR, "Server %s introduces nick \"%s\" on unknown server!?", Client_ID( Client ), Req->argv[0] );
358 Kill_Nick( Req->argv[0], "Unknown server" );
362 c = Client_NewRemoteUser(intr_c, nick, hops, user, hostname,
363 token, modes, info, true);
366 /* out of memory, need to disconnect client to keep network state consistent */
367 Log( LOG_ALERT, "Can't create client structure! (on connection %d)", Client_Conn( Client ));
368 Kill_Nick( Req->argv[0], "Server error" );
372 /* RFC 2813: client is now fully registered, inform all the
373 * other servers about the new user.
374 * RFC 1459: announce the new client only after receiving the
375 * USER command, first we need more information! */
377 LogDebug("Client \"%s\" is being registered (RFC 1459) ...",
379 Client_SetType(c, CLIENT_GOTNICK);
381 Client_Introduce(Client, c, CLIENT_USER);
385 else return IRC_WriteStrClient( Client, ERR_ALREADYREGISTRED_MSG, Client_ID( Client ));
390 * Handler for the IRC "USER" command.
392 * See RFC 2812, 3.1.3 "User message".
394 * @param Client The client from which this command has been received.
395 * @param Req Request structure with prefix and all parameters.
396 * @returns CONNECTED or DISCONNECTED.
399 IRC_USER(CLIENT * Client, REQUEST * Req)
406 assert(Client != NULL);
409 if (Client_Type(Client) == CLIENT_GOTNICK ||
411 Client_Type(Client) == CLIENT_UNKNOWN ||
413 Client_Type(Client) == CLIENT_GOTPASS)
417 return IRC_WriteStrClient(Client,
418 ERR_NEEDMOREPARAMS_MSG,
424 ptr = Client_User(Client);
425 if (!ptr || !*ptr || *ptr == '~')
426 Client_SetUser(Client, Req->argv[0], false);
428 Client_SetUser(Client, Req->argv[0], false);
430 Client_SetOrigUser(Client, Req->argv[0]);
432 /* "Real name" or user info text: Don't set it to the empty
433 * string, the original ircd can't deal with such "real names"
434 * (e. g. "USER user * * :") ... */
436 Client_SetInfo(Client, Req->argv[3]);
438 Client_SetInfo(Client, "-");
440 LogDebug("Connection %d: got valid USER command ...",
441 Client_Conn(Client));
442 if (Client_Type(Client) == CLIENT_GOTNICK)
443 return Login_User(Client);
445 Client_SetType(Client, CLIENT_GOTUSER);
448 } else if (Client_Type(Client) == CLIENT_SERVER ||
449 Client_Type(Client) == CLIENT_SERVICE) {
450 /* Server/service updating an user */
452 return IRC_WriteStrClient(Client,
453 ERR_NEEDMOREPARAMS_MSG,
456 c = Client_Search(Req->prefix);
458 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
462 Client_SetUser(c, Req->argv[0], true);
463 Client_SetOrigUser(c, Req->argv[0]);
464 Client_SetHostname(c, Req->argv[1]);
465 Client_SetInfo(c, Req->argv[3]);
467 LogDebug("Connection %d: got valid USER command for \"%s\".",
468 Client_Conn(Client), Client_Mask(c));
470 /* RFC 1459 style user registration?
471 * Introduce client to network: */
472 if (Client_Type(c) == CLIENT_GOTNICK)
473 Client_Introduce(Client, c, CLIENT_USER);
476 } else if (Client_Type(Client) == CLIENT_USER) {
477 /* Already registered connection */
478 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
481 /* Unexpected/invalid connection state? */
482 return IRC_WriteStrClient(Client, ERR_NOTREGISTERED_MSG,
489 * Handler for the IRC "SERVICE" command.
491 * This function implements IRC Services registration using the SERVICE command
492 * defined in RFC 2812 3.1.6 and RFC 2813 4.1.4.
494 * At the moment ngIRCd doesn't support directly linked services, so this
495 * function returns ERR_ERRONEUSNICKNAME when the SERVICE command has not been
496 * received from a peer server.
498 * @param Client The client from which this command has been received.
499 * @param Req Request structure with prefix and all parameters.
500 * @returns CONNECTED or DISCONNECTED..
503 IRC_SERVICE(CLIENT *Client, REQUEST *Req)
506 char *nick, *user, *host, *info, *modes, *ptr;
509 assert(Client != NULL);
512 if (Client_Type(Client) != CLIENT_GOTPASS &&
513 Client_Type(Client) != CLIENT_SERVER)
514 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
518 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
519 Client_ID(Client), Req->command);
521 if (Client_Type(Client) != CLIENT_SERVER)
522 return IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG,
523 Client_ID(Client), Req->argv[0]);
525 /* Bad number of parameters? */
527 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
528 Client_ID(Client), Req->command);
531 user = NULL; host = NULL;
532 token = atoi(Req->argv[1]);
533 hops = atoi(Req->argv[4]);
536 /* Validate service name ("nick name") */
537 c = Client_Search(nick);
539 /* Nick name collission: disconnect (KILL) both clients! */
540 Log(LOG_ERR, "Server %s introduces already registered service \"%s\"!",
541 Client_ID(Client), nick);
542 Kill_Nick(nick, "Nick collision");
546 /* Get the server to which the service is connected */
547 intr_c = Client_GetFromToken(Client, token);
549 Log(LOG_ERR, "Server %s introduces service \"%s\" on unknown server!?",
550 Client_ID(Client), nick);
551 Kill_Nick(nick, "Unknown server");
555 /* Get user and host name */
556 ptr = strchr(nick, '@');
562 host = Client_Hostname(intr_c);
563 ptr = strchr(nick, '!');
571 /* According to RFC 2812/2813 parameter 4 <type> "is currently reserved
572 * for future usage"; but we use it to transfer the modes and check
573 * that the first character is a '+' sign and ignore it otherwise. */
574 modes = (Req->argv[3][0] == '+') ? ++Req->argv[3] : "";
576 c = Client_NewRemoteUser(intr_c, nick, hops, user, host,
577 token, modes, info, true);
579 /* Couldn't create client structure, so KILL the service to
580 * keep network status consistent ... */
581 Log(LOG_ALERT, "Can't create client structure! (on connection %d)",
582 Client_Conn(Client));
583 Kill_Nick(nick, "Server error");
587 Client_Introduce(Client, c, CLIENT_SERVICE);
593 * Handler for the IRC "WEBIRC" command.
595 * See doc/Protocol.txt, section II.4:
596 * "Update webchat/proxy client information".
598 * @param Client The client from which this command has been received.
599 * @param Req Request structure with prefix and all parameters.
600 * @returns CONNECTED or DISCONNECTED.
603 IRC_WEBIRC(CLIENT *Client, REQUEST *Req)
605 /* Exactly 4 parameters are requited */
607 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
608 Client_ID(Client), Req->command);
610 if (!Conf_WebircPwd[0] || strcmp(Req->argv[0], Conf_WebircPwd) != 0)
611 return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG,
614 LogDebug("Connection %d: got valid WEBIRC command: user=%s, host=%s, ip=%s",
615 Client_Conn(Client), Req->argv[1], Req->argv[2], Req->argv[3]);
617 Client_SetUser(Client, Req->argv[1], true);
618 Client_SetOrigUser(Client, Req->argv[1]);
619 Client_SetHostname(Client, Req->argv[2]);
625 * Handler for the IRC "QUIT" command.
627 * See RFC 2812, 3.1.7 "Quit", and RFC 2813, 4.1.5 "Quit".
629 * @param Client The client from which this command has been received.
630 * @param Req Request structure with prefix and all parameters.
631 * @returns CONNECTED or DISCONNECTED.
634 IRC_QUIT( CLIENT *Client, REQUEST *Req )
637 char quitmsg[LINE_LEN];
639 assert(Client != NULL);
642 /* Wrong number of arguments? */
644 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
645 Client_ID(Client), Req->command);
648 strlcpy(quitmsg, Req->argv[0], sizeof quitmsg);
650 if (Client_Type(Client) == CLIENT_SERVER) {
652 target = Client_Search(Req->prefix);
655 "Got QUIT from %s for unknown client!?",
660 if (target != Client) {
661 Client_Destroy(target, "Got QUIT command.",
662 Req->argc == 1 ? quitmsg : NULL, true);
665 Conn_Close(Client_Conn(Client), "Got QUIT command.",
666 Req->argc == 1 ? quitmsg : NULL, true);
670 if (Req->argc == 1 && quitmsg[0] != '\"') {
671 /* " " to avoid confusion */
672 strlcpy(quitmsg, "\"", sizeof quitmsg);
673 strlcat(quitmsg, Req->argv[0], sizeof quitmsg-1);
674 strlcat(quitmsg, "\"", sizeof quitmsg );
677 /* User, Service, or not yet registered */
678 Conn_Close(Client_Conn(Client), "Got QUIT command.",
679 Req->argc == 1 ? quitmsg : NULL, true);
689 * Handler for HTTP command, e.g. GET and POST
691 * We handle these commands here to avoid the quite long timeout when
692 * some user tries to access this IRC daemon using an web browser ...
694 * @param Client The client from which this command has been received.
695 * @param Req Request structure with prefix and all parameters.
696 * @returns CONNECTED or DISCONNECTED.
699 IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req )
702 Req->argv[0] = "Oops, HTTP request received? This is IRC!";
703 return IRC_QUIT(Client, Req);
704 } /* IRC_QUIT_HTTP */
710 * Handler for the IRC "PING" command.
712 * See RFC 2812, 3.7.2 "Ping message".
714 * @param Client The client from which this command has been received.
715 * @param Req Request structure with prefix and all parameters.
716 * @returns CONNECTED or DISCONNECTED.
719 IRC_PING(CLIENT *Client, REQUEST *Req)
721 CLIENT *target, *from;
723 assert(Client != NULL);
727 return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
730 /* Don't ignore additional arguments when in "strict" mode */
732 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
733 Client_ID(Client), Req->command);
737 /* A target has been specified ... */
738 target = Client_Search(Req->argv[1]);
740 if (!target || Client_Type(target) != CLIENT_SERVER)
741 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
742 Client_ID(Client), Req->argv[1]);
744 if (target != Client_ThisServer()) {
745 /* Ok, we have to forward the PING */
746 if (Client_Type(Client) == CLIENT_SERVER)
747 from = Client_Search(Req->prefix);
751 return IRC_WriteStrClient(Client,
752 ERR_NOSUCHSERVER_MSG,
753 Client_ID(Client), Req->prefix);
755 return IRC_WriteStrClientPrefix(target, from,
756 "PING %s :%s", Req->argv[0],
761 if (Client_Type(Client) == CLIENT_SERVER) {
763 from = Client_Search(Req->prefix);
767 from = Client_ThisServer();
769 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
770 Client_ID(Client), Req->prefix);
772 Log(LOG_DEBUG, "Connection %d: got PING, sending PONG ...",
773 Client_Conn(Client));
776 return IRC_WriteStrClient(Client, "PONG %s :%s",
777 Client_ID(from), Client_ID(Client));
779 /* Some clients depend on the argument being returned in the PONG
780 * reply (not mentioned in any RFC, though) */
781 return IRC_WriteStrClient(Client, "PONG %s :%s",
782 Client_ID(from), Req->argv[0]);
788 * Handler for the IRC "PONG" command.
790 * See RFC 2812, 3.7.3 "Pong message".
792 * @param Client The client from which this command has been received.
793 * @param Req Request structure with prefix and all parameters.
794 * @returns CONNECTED or DISCONNECTED.
797 IRC_PONG(CLIENT *Client, REQUEST *Req)
799 CLIENT *target, *from;
806 assert(Client != NULL);
809 /* Wrong number of arguments? */
811 if (Client_Type(Client) == CLIENT_USER)
812 return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
818 if (Client_Type(Client) == CLIENT_USER)
819 return IRC_WriteStrClient(Client,
820 ERR_NEEDMOREPARAMS_MSG,
828 if (Req->argc == 2 && Client_Type(Client) == CLIENT_SERVER) {
829 target = Client_Search(Req->argv[0]);
831 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
832 Client_ID(Client), Req->argv[0]);
834 from = Client_Search(Req->prefix);
836 if (target != Client_ThisServer() && target != from) {
837 /* Ok, we have to forward the message. */
839 return IRC_WriteStrClient(Client,
840 ERR_NOSUCHSERVER_MSG,
841 Client_ID(Client), Req->prefix);
843 if (Client_Type(Client_NextHop(target)) != CLIENT_SERVER)
847 return IRC_WriteStrClientPrefix(target, from,
848 "PONG %s :%s", s, Req->argv[1]);
852 /* The connection timestamp has already been updated when the data has
853 * been read from so socket, so we don't need to update it here. */
855 conn = Client_Conn(Client);
858 /* Check authentication PING-PONG ... */
859 auth_ping = Conn_GetAuthPing(conn);
861 LogDebug("AUTH PONG: waiting for token \"%ld\", got \"%s\" ...",
862 auth_ping, Req->argv[0]);
863 if (auth_ping == atoi(Req->argv[0])) {
864 Conn_SetAuthPing(conn, 0);
865 if (Client_Type(Client) == CLIENT_WAITAUTHPING)
868 if (!IRC_WriteStrClient(Client,
869 "To connect, type /QUOTE PONG %ld",
875 if (Client_Type(Client) == CLIENT_SERVER && Conn_LastPing(conn) == 0) {
877 "Synchronization with \"%s\" done (connection %d): %ld seconds [%ld users, %ld channels]",
878 Client_ID(Client), conn, time(NULL) - Conn_GetSignon(conn),
879 Client_UserCount(), Channel_CountVisible(NULL));
880 Conn_UpdatePing(conn);
882 LogDebug("Connection %d: received PONG. Lag: %ld seconds.",
883 conn, time(NULL) - Conn_LastPing(conn));
890 * Kill all users with a specific nick name in the network.
892 * @param Nick Nick name.
893 * @param Reason Reason for the KILL.
896 Kill_Nick(char *Nick, char *Reason)
900 assert (Nick != NULL);
901 assert (Reason != NULL);
908 Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s",
911 IRC_KILL(Client_ThisServer(), &r);