2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2008 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.
26 #include "conn-func.h"
35 #include "irc-write.h"
38 #include "irc-login.h"
41 static bool Hello_User PARAMS(( CLIENT *Client ));
42 static void Kill_Nick PARAMS(( char *Nick, char *Reason ));
43 static void Introduce_Client PARAMS((CLIENT *To, CLIENT *Client, int Type));
44 static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix,
49 * Handler for the IRC command "PASS".
50 * See RFC 2813 section 4.1.1, and RFC 2812 section 3.1.1.
53 IRC_PASS( CLIENT *Client, REQUEST *Req )
55 char *type, *orig_flags;
56 int protohigh, protolow;
58 assert( Client != NULL );
59 assert( Req != NULL );
61 /* Return an error if this is not a local client */
62 if (Client_Conn(Client) <= NONE)
63 return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG,
64 Client_ID(Client), Req->command);
66 if (Client_Type(Client) == CLIENT_UNKNOWN && Req->argc == 1) {
67 /* Not yet registered "unknown" connection, PASS with one
68 * argument: either a regular client, service, or server
69 * using the old RFC 1459 section 4.1.1 syntax. */
70 LogDebug("Connection %d: got PASS command (RFC 1459) ...",
72 } else if ((Client_Type(Client) == CLIENT_UNKNOWN ||
73 Client_Type(Client) == CLIENT_UNKNOWNSERVER) &&
74 (Req->argc == 3 || Req->argc == 4)) {
75 /* Not yet registered "unknown" connection or outgoing server
76 * link, PASS with three or four argument: server using the
77 * RFC 2813 section 4.1.1 syntax. */
78 LogDebug("Connection %d: got PASS command (RFC 2813, new server link) ...",
80 } else if (Client_Type(Client) == CLIENT_UNKNOWN ||
81 Client_Type(Client) == CLIENT_UNKNOWNSERVER) {
82 /* Unregistered connection, but wrong number of arguments: */
83 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
84 Client_ID(Client), Req->command);
86 /* Registered connection, PASS command is not allowed! */
87 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
91 Client_SetPassword(Client, Req->argv[0]);
93 /* Protocol version */
94 if (Req->argc >= 2 && strlen(Req->argv[1]) >= 4) {
100 Req->argv[1][4] = '\0';
101 protolow = atoi(&Req->argv[1][2]);
102 Req->argv[1][2] = '\0';
103 protohigh = atoi(Req->argv[1]);
105 Req->argv[1][2] = c2;
106 Req->argv[1][4] = c4;
108 Client_SetType(Client, CLIENT_GOTPASS_2813);
110 protohigh = protolow = 0;
111 Client_SetType(Client, CLIENT_GOTPASS);
114 /* Protocol type, see doc/Protocol.txt */
115 if (Req->argc >= 2 && strlen(Req->argv[1]) > 4)
116 type = &Req->argv[1][4];
120 /* Protocol flags/options */
122 orig_flags = Req->argv[3];
126 /* Implementation, version and IRC+ flags */
127 if (Req->argc >= 3) {
128 char *impl, *ptr, *serverver, *flags;
131 ptr = strchr(impl, '|');
135 if (type && strcmp(type, PROTOIRCPLUS) == 0) {
136 /* The peer seems to be a server which supports the
137 * IRC+ protocol (see doc/Protocol.txt). */
139 flags = strchr(serverver, ':');
146 "Peer announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
147 impl, serverver, protohigh, protolow, flags);
149 /* The peer seems to be a server supporting the
150 * "original" IRC protocol (RFC 2813). */
152 if (strchr(orig_flags, 'Z'))
157 "Peer announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
158 impl, protohigh, protolow, flags);
160 Client_SetFlags(Client, flags);
168 * IRC "NICK" command.
169 * This function implements the IRC command "NICK" which is used to register
170 * with the server, to change already registered nicknames and to introduce
171 * new users which are connected to other servers.
174 IRC_NICK( CLIENT *Client, REQUEST *Req )
176 CLIENT *intr_c, *target, *c;
177 char *nick, *user, *hostname, *modes, *info;
180 assert( Client != NULL );
181 assert( Req != NULL );
183 /* Some IRC clients, for example BitchX, send the NICK and USER
184 * commands in the wrong order ... */
185 if(Client_Type(Client) == CLIENT_UNKNOWN
186 || Client_Type(Client) == CLIENT_GOTPASS
187 || Client_Type(Client) == CLIENT_GOTNICK
189 || Client_Type(Client) == CLIENT_GOTUSER
191 || Client_Type(Client) == CLIENT_USER
192 || Client_Type(Client) == CLIENT_SERVICE
193 || (Client_Type(Client) == CLIENT_SERVER && Req->argc == 1))
195 /* User registration or change of nickname */
197 /* Wrong number of arguments? */
199 return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG,
203 /* Search "target" client */
204 if( Client_Type( Client ) == CLIENT_SERVER )
206 target = Client_Search( Req->prefix );
208 return IRC_WriteStrClient( Client,
215 /* Is this a restricted client? */
216 if( Client_HasMode( Client, 'r' ))
217 return IRC_WriteStrClient( Client,
219 Client_ID( Client ));
225 /* If the clients tries to change to its own nickname we won't
226 * do anything. This is how the original ircd behaves and some
227 * clients (for example Snak) expect it to be like this.
228 * But I doubt that this is "really the right thing" ... */
229 if( strcmp( Client_ID( target ), Req->argv[0] ) == 0 )
233 /* Check that the new nickname is available. Special case:
234 * the client only changes from/to upper to lower case. */
235 if( strcasecmp( Client_ID( target ), Req->argv[0] ) != 0 )
237 if( ! Client_CheckNick( target, Req->argv[0] ))
241 if (Client_Type(target) != CLIENT_USER &&
242 Client_Type(target) != CLIENT_SERVICE &&
243 Client_Type(target) != CLIENT_SERVER) {
245 Log( LOG_DEBUG, "Connection %d: got valid NICK command ...",
246 Client_Conn( Client ));
248 /* Register new nickname of this client */
249 Client_SetID( target, Req->argv[0] );
251 /* If we received a valid USER command already then
252 * register the new client! */
253 if( Client_Type( Client ) == CLIENT_GOTUSER )
254 return Hello_User( Client );
256 Client_SetType( Client, CLIENT_GOTNICK );
258 /* Nickname change */
259 if (Client_Conn(target) > NONE) {
262 "%s \"%s\" changed nick (connection %d): \"%s\" -> \"%s\".",
263 Client_TypeText(target), Client_Mask(target),
264 Client_Conn(target), Client_ID(target),
266 Conn_UpdateIdle(Client_Conn(target));
269 LogDebug("%s \"%s\" changed nick: \"%s\" -> \"%s\".",
270 Client_TypeText(target),
271 Client_Mask(target), Client_ID(target),
275 /* Inform all users and servers (which have to know)
276 * of this nickname change */
277 if( Client_Type( Client ) == CLIENT_USER )
278 IRC_WriteStrClientPrefix( Client, Client,
281 IRC_WriteStrServersPrefix( Client, target,
282 "NICK :%s", Req->argv[0] );
283 IRC_WriteStrRelatedPrefix( target, target, false,
284 "NICK :%s", Req->argv[0] );
286 /* Register old nickname for WHOWAS queries */
287 Client_RegisterWhowas( target );
289 /* Save new nickname */
290 Client_SetID( target, Req->argv[0] );
292 IRC_SetPenalty( target, 2 );
296 } else if(Client_Type(Client) == CLIENT_SERVER ||
297 Client_Type(Client) == CLIENT_SERVICE) {
298 /* Server or service introduces new client */
300 /* Bad number of parameters? */
301 if (Req->argc != 2 && Req->argc != 7)
302 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
303 Client_ID(Client), Req->command);
305 if (Req->argc >= 7) {
306 /* RFC 2813 compatible syntax */
308 hops = atoi(Req->argv[1]);
310 hostname = Req->argv[3];
311 token = atoi(Req->argv[4]);
312 modes = Req->argv[5] + 1;
315 /* RFC 1459 compatible syntax */
319 hostname = Client_ID(Client);
320 token = atoi(Req->argv[1]);
325 /* Nick ueberpruefen */
326 c = Client_Search(nick);
328 /* Der neue Nick ist auf diesem Server bereits registriert:
329 * sowohl der neue, als auch der alte Client muessen nun
330 * disconnectiert werden. */
331 Log( LOG_ERR, "Server %s introduces already registered nick \"%s\"!", Client_ID( Client ), Req->argv[0] );
332 Kill_Nick( Req->argv[0], "Nick collision" );
336 /* Server, zu dem der Client connectiert ist, suchen */
337 intr_c = Client_GetFromToken(Client, token);
340 Log( LOG_ERR, "Server %s introduces nick \"%s\" on unknown server!?", Client_ID( Client ), Req->argv[0] );
341 Kill_Nick( Req->argv[0], "Unknown server" );
345 /* Neue Client-Struktur anlegen */
346 c = Client_NewRemoteUser(intr_c, nick, hops, user, hostname,
347 token, modes, info, true);
350 /* Eine neue Client-Struktur konnte nicht angelegt werden.
351 * Der Client muss disconnectiert werden, damit der Netz-
352 * status konsistent bleibt. */
353 Log( LOG_ALERT, "Can't create client structure! (on connection %d)", Client_Conn( Client ));
354 Kill_Nick( Req->argv[0], "Server error" );
358 /* RFC 2813: client is now fully registered, inform all the
359 * other servers about the new user.
360 * RFC 1459: announce the new client only after receiving the
361 * USER command, first we need more information! */
363 LogDebug("Client \"%s\" is beeing registered (RFC 1459) ...",
365 Client_SetType(c, CLIENT_GOTNICK);
367 Introduce_Client(Client, c, CLIENT_USER);
371 else return IRC_WriteStrClient( Client, ERR_ALREADYREGISTRED_MSG, Client_ID( Client ));
376 * Handler for the IRC command "USER".
379 IRC_USER(CLIENT * Client, REQUEST * Req)
386 assert(Client != NULL);
389 if (Client_Type(Client) == CLIENT_GOTNICK ||
391 Client_Type(Client) == CLIENT_UNKNOWN ||
393 Client_Type(Client) == CLIENT_GOTPASS)
397 return IRC_WriteStrClient(Client,
398 ERR_NEEDMOREPARAMS_MSG,
404 ptr = Client_User(Client);
405 if (!ptr || !*ptr || *ptr == '~')
406 Client_SetUser(Client, Req->argv[0], false);
408 Client_SetUser(Client, Req->argv[0], false);
411 /* "Real name" or user info text: Don't set it to the empty
412 * string, the original ircd can't deal with such "real names"
413 * (e. g. "USER user * * :") ... */
415 Client_SetInfo(Client, Req->argv[3]);
417 Client_SetInfo(Client, "-");
419 LogDebug("Connection %d: got valid USER command ...",
420 Client_Conn(Client));
421 if (Client_Type(Client) == CLIENT_GOTNICK)
422 return Hello_User(Client);
424 Client_SetType(Client, CLIENT_GOTUSER);
427 } else if (Client_Type(Client) == CLIENT_SERVER ||
428 Client_Type(Client) == CLIENT_SERVICE) {
429 /* Server/service updating an user */
431 return IRC_WriteStrClient(Client,
432 ERR_NEEDMOREPARAMS_MSG,
435 c = Client_Search(Req->prefix);
437 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
441 Client_SetUser(c, Req->argv[0], true);
442 Client_SetHostname(c, Req->argv[1]);
443 Client_SetInfo(c, Req->argv[3]);
445 LogDebug("Connection %d: got valid USER command for \"%s\".",
446 Client_Conn(Client), Client_Mask(c));
448 /* RFC 1459 style user registration?
449 * Introduce client to network: */
450 if (Client_Type(c) == CLIENT_GOTNICK)
451 Introduce_Client(Client, c, CLIENT_USER);
454 } else if (Client_Type(Client) == CLIENT_USER) {
455 /* Already registered connection */
456 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
459 /* Unexpected/invalid connection state? */
460 return IRC_WriteStrClient(Client, ERR_NOTREGISTERED_MSG,
467 * Handler for the IRC command "SERVICE".
468 * This function implements IRC Services registration using the SERVICE command
469 * defined in RFC 2812 3.1.6 and RFC 2813 4.1.4.
470 * At the moment ngIRCd doesn't support directly linked services, so this
471 * function returns ERR_ERRONEUSNICKNAME when the SERVICE command has not been
472 * received from a peer server.
475 IRC_SERVICE(CLIENT *Client, REQUEST *Req)
478 char *nick, *user, *host, *info, *modes, *ptr;
481 assert(Client != NULL);
484 if (Client_Type(Client) != CLIENT_GOTPASS &&
485 Client_Type(Client) != CLIENT_SERVER)
486 return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG,
490 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
491 Client_ID(Client), Req->command);
493 if (Client_Type(Client) != CLIENT_SERVER)
494 return IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG,
495 Client_ID(Client), Req->argv[0]);
497 /* Bad number of parameters? */
499 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
500 Client_ID(Client), Req->command);
503 user = NULL; host = NULL;
504 token = atoi(Req->argv[1]);
505 hops = atoi(Req->argv[4]);
508 /* Validate service name ("nick name") */
509 c = Client_Search(nick);
511 /* Nick name collission: disconnect (KILL) both clients! */
512 Log(LOG_ERR, "Server %s introduces already registered service \"%s\"!",
513 Client_ID(Client), nick);
514 Kill_Nick(nick, "Nick collision");
518 /* Get the server to which the service is connected */
519 intr_c = Client_GetFromToken(Client, token);
521 Log(LOG_ERR, "Server %s introduces service \"%s\" on unknown server!?",
522 Client_ID(Client), nick);
523 Kill_Nick(nick, "Unknown server");
527 /* Get user and host name */
528 ptr = strchr(nick, '@');
534 host = Client_Hostname(intr_c);
535 ptr = strchr(nick, '!');
543 /* According to RFC 2812/2813 parameter 4 <type> "is currently reserved
544 * for future usage"; but we use it to transfer the modes and check
545 * that the first character is a '+' sign and ignore it otherwise. */
546 modes = (Req->argv[3][0] == '+') ? ++Req->argv[3] : "";
548 c = Client_NewRemoteUser(intr_c, nick, hops, user, host,
549 token, modes, info, true);
551 /* Couldn't create client structure, so KILL the service to
552 * keep network status consistent ... */
553 Log(LOG_ALERT, "Can't create client structure! (on connection %d)",
554 Client_Conn(Client));
555 Kill_Nick(nick, "Server error");
559 Introduce_Client(Client, c, CLIENT_SERVICE);
565 IRC_QUIT( CLIENT *Client, REQUEST *Req )
568 char quitmsg[LINE_LEN];
570 assert( Client != NULL );
571 assert( Req != NULL );
573 /* Wrong number of arguments? */
575 return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
578 strlcpy(quitmsg, Req->argv[0], sizeof quitmsg);
580 if ( Client_Type( Client ) == CLIENT_SERVER )
583 target = Client_Search( Req->prefix );
586 /* Den Client kennen wir nicht (mehr), also nichts zu tun. */
587 Log( LOG_WARNING, "Got QUIT from %s for unknown client!?", Client_ID( Client ));
591 Client_Destroy( target, "Got QUIT command.", Req->argc == 1 ? quitmsg : NULL, true);
597 if (Req->argc == 1 && quitmsg[0] != '\"') {
598 /* " " to avoid confusion */
599 strlcpy(quitmsg, "\"", sizeof quitmsg);
600 strlcat(quitmsg, Req->argv[0], sizeof quitmsg-1);
601 strlcat(quitmsg, "\"", sizeof quitmsg );
604 /* User, Service, oder noch nicht registriert */
605 Conn_Close( Client_Conn( Client ), "Got QUIT command.", Req->argc == 1 ? quitmsg : NULL, true);
613 IRC_PING(CLIENT *Client, REQUEST *Req)
615 CLIENT *target, *from;
617 assert(Client != NULL);
620 /* Wrong number of arguments? */
622 return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
625 /* Don't ignore additional arguments when in "strict" mode */
627 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
628 Client_ID(Client), Req->command);
632 /* A target has been specified ... */
633 target = Client_Search(Req->argv[1]);
635 if (!target || Client_Type(target) != CLIENT_SERVER)
636 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
637 Client_ID(Client), Req->argv[1]);
639 if (target != Client_ThisServer()) {
640 /* Ok, we have to forward the PING */
641 if (Client_Type(Client) == CLIENT_SERVER)
642 from = Client_Search(Req->prefix);
646 return IRC_WriteStrClient(Client,
647 ERR_NOSUCHSERVER_MSG,
648 Client_ID(Client), Req->prefix);
650 return IRC_WriteStrClientPrefix(target, from,
651 "PING %s :%s", Req->argv[0],
656 if (Client_Type(Client) == CLIENT_SERVER) {
658 from = Client_Search(Req->prefix);
662 from = Client_ThisServer();
664 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
665 Client_ID(Client), Req->prefix);
667 Log(LOG_DEBUG, "Connection %d: got PING, sending PONG ...",
668 Client_Conn(Client));
671 return IRC_WriteStrClient(Client, "PONG %s :%s",
672 Client_ID(from), Client_ID(Client));
674 /* Some clients depend on the argument being returned in the PONG
675 * reply (not mentioned in any RFC, though) */
676 return IRC_WriteStrClient(Client, "PONG %s :%s",
677 Client_ID(from), Req->argv[0]);
683 IRC_PONG(CLIENT *Client, REQUEST *Req)
685 CLIENT *target, *from;
688 assert(Client != NULL);
691 /* Wrong number of arguments? */
693 return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG,
696 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
697 Client_ID(Client), Req->command);
700 if (Req->argc == 2 && Client_Type(Client) == CLIENT_SERVER) {
701 target = Client_Search(Req->argv[0]);
703 return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG,
704 Client_ID(Client), Req->argv[0]);
706 from = Client_Search(Req->prefix);
708 if (target != Client_ThisServer() && target != from) {
709 /* Ok, we have to forward the message. */
711 return IRC_WriteStrClient(Client,
712 ERR_NOSUCHSERVER_MSG,
713 Client_ID(Client), Req->prefix);
715 if (Client_Type(Client_NextHop(target)) != CLIENT_SERVER)
719 return IRC_WriteStrClientPrefix(target, from,
720 "PONG %s :%s", s, Req->argv[1]);
724 /* The connection timestamp has already been updated when the data has
725 * been read from so socket, so we don't need to update it here. */
727 if (Client_Conn(Client) > NONE)
729 "Connection %d: received PONG. Lag: %ld seconds.",
731 time(NULL) - Conn_LastPing(Client_Conn(Client)));
734 "Connection %d: received PONG.", Client_Conn(Client));
741 Hello_User(CLIENT * Client)
743 assert(Client != NULL);
745 /* Check password ... */
746 if (strcmp(Client_Password(Client), Conf_ServerPwd) != 0) {
749 "Client \"%s\" rejected (connection %d): Bad password!",
750 Client_Mask(Client), Client_Conn(Client));
751 Conn_Close(Client_Conn(Client), NULL, "Bad password", true);
755 Introduce_Client(NULL, Client, CLIENT_USER);
757 if (!IRC_WriteStrClient
758 (Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
760 if (!IRC_WriteStrClient
761 (Client, RPL_YOURHOST_MSG, Client_ID(Client),
762 Client_ID(Client_ThisServer()), PACKAGE_VERSION, TARGET_CPU,
763 TARGET_VENDOR, TARGET_OS))
765 if (!IRC_WriteStrClient
766 (Client, RPL_CREATED_MSG, Client_ID(Client), NGIRCd_StartStr))
768 if (!IRC_WriteStrClient
769 (Client, RPL_MYINFO_MSG, Client_ID(Client),
770 Client_ID(Client_ThisServer()), PACKAGE_VERSION, USERMODES,
774 /* Features supported by this server (005 numeric, ISUPPORT),
775 * see <http://www.irc.org/tech_docs/005.html> for details. */
776 if (!IRC_Send_ISUPPORT(Client))
779 if (!IRC_Send_LUSERS(Client))
781 if (!IRC_Show_MOTD(Client))
784 /* Suspend the client for a second ... */
785 IRC_SetPenalty(Client, 1);
792 Kill_Nick( char *Nick, char *Reason )
796 assert( Nick != NULL );
797 assert( Reason != NULL );
799 r.prefix = (char *)Client_ThisServer( );
804 Log( LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s", Nick, Reason );
805 IRC_KILL( Client_ThisServer( ), &r );
810 Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
812 /* Set client type (user or service) */
813 Client_SetType(Client, Type);
816 if (Conf_IsService(Conf_GetServer(Client_Conn(From)),
818 Client_SetType(Client, CLIENT_SERVICE);
819 LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
820 Client_TypeText(Client), Client_Mask(Client),
821 Client_Modes(Client), Client_ID(From),
822 Client_ID(Client_Introducer(Client)),
823 Client_Hops(Client), Client_Hops(Client) > 1 ? "s": "");
825 Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).",
826 Client_TypeText(Client), Client_Mask(Client),
827 Client_Conn(Client));
829 /* Inform other servers */
830 IRC_WriteStrServersPrefixFlag_CB(From,
831 From != NULL ? From : Client_ThisServer(),
832 '\0', cb_introduceClient, (void *)Client);
833 } /* Introduce_Client */
837 cb_introduceClient(CLIENT *To, CLIENT *Prefix, void *data)
839 CLIENT *c = (CLIENT *)data;
841 char *modes, *user, *host;
843 modes = Client_Modes(c);
844 user = Client_User(c) ? Client_User(c) : "-";
845 host = Client_Hostname(c) ? Client_Hostname(c) : "-";
847 conn = Client_Conn(To);
848 if (Conn_Options(conn) & CONN_RFC1459) {
849 /* RFC 1459 mode: separate NICK and USER commands */
850 Conn_WriteStr(conn, "NICK %s :%d", Client_ID(c),
852 Conn_WriteStr(conn, ":%s USER %s %s %s :%s",
853 Client_ID(c), user, host,
854 Client_ID(Client_Introducer(c)), Client_Info(c));
856 Conn_WriteStr(conn, ":%s MODE %s +%s",
857 Client_ID(c), Client_ID(c), modes);
859 /* RFC 2813 mode: one combined NICK or SERVICE command */
860 if (Client_Type(c) == CLIENT_SERVICE
861 && strchr(Client_Flags(To), 'S'))
862 IRC_WriteStrClientPrefix(To, Prefix,
863 "SERVICE %s %d * +%s %d :%s",
865 Client_MyToken(Client_Introducer(c)),
866 Client_Modes(c), Client_Hops(c) + 1,
869 IRC_WriteStrClientPrefix(To, Prefix,
870 "NICK %s %d %s %s %d +%s :%s",
871 Client_ID(c), Client_Hops(c) + 1,
873 Client_MyToken(Client_Introducer(c)),
874 modes, Client_Info(c));
876 } /* cb_introduceClient */