2 * ircd-ratbox: A slightly useful ircd.
3 * m_server.c: Introduces a server.
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2005 ircd-ratbox development team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include "client.h" /* client struct */
27 #include "hash.h" /* add_to_client_hash */
29 #include "ircd.h" /* me */
30 #include "numeric.h" /* ERR_xxx */
31 #include "s_conf.h" /* struct ConfItem */
32 #include "s_newconf.h"
33 #include "logger.h" /* log level defines */
34 #include "s_serv.h" /* server_estab, check_server */
35 #include "s_stats.h" /* ServerStats */
37 #include "send.h" /* sendto_one */
42 static const char server_desc
[] =
43 "Provides the TS6 commands to introduce a new server to the network";
45 static void mr_server(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
46 static void ms_server(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
47 static void ms_sid(struct MsgBuf
*, struct Client
*, struct Client
*, int, const char **);
49 static bool bogus_host(const char *host
);
50 static void set_server_gecos(struct Client
*, const char *);
52 struct Message server_msgtab
= {
54 {{mr_server
, 4}, mg_reg
, mg_ignore
, {ms_server
, 4}, mg_ignore
, mg_reg
}
56 struct Message sid_msgtab
= {
58 {mg_ignore
, mg_reg
, mg_ignore
, {ms_sid
, 5}, mg_ignore
, mg_reg
}
61 mapi_clist_av1 server_clist
[] = { &server_msgtab
, &sid_msgtab
, NULL
};
63 DECLARE_MODULE_AV2(server
, NULL
, NULL
, server_clist
, NULL
, NULL
, NULL
, NULL
, server_desc
);
66 * mr_server - SERVER message handler
67 * parv[1] = servername
68 * parv[2] = serverinfo/hopcount
69 * parv[3] = serverinfo
72 mr_server(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
74 char info
[REALLEN
+ 1];
76 struct Client
*target_p
;
78 unsigned int required_mask
;
84 rb_strlcpy(info
, parv
[3], sizeof(info
));
86 if (IsHandshake(client_p
) && irccmp(client_p
->name
, name
))
88 sendto_realops_snomask(SNO_GENERAL
, is_remote_connect(client_p
) ? L_NETWIDE
: L_ALL
,
89 "Server %s has unexpected name %s",
90 client_p
->name
, name
);
91 ilog(L_SERVER
, "Server %s has unexpected name %s",
92 log_client_name(client_p
, SHOW_IP
), name
);
93 exit_client(client_p
, client_p
, client_p
, "Server name mismatch");
98 * Reject a direct nonTS server connection if we're TS_ONLY -orabidoo
100 if(!DoesTS(client_p
))
102 sendto_realops_snomask(SNO_GENERAL
, L_ALL
, "Link %s dropped, non-TS server",
104 exit_client(client_p
, client_p
, client_p
, "Non-TS server");
110 exit_client(client_p
, client_p
, client_p
, "Bogus server name");
114 /* Now we just have to call check_server and everything should be
115 * check for us... -A1kmm. */
116 ret
= check_server(name
, client_p
);
123 if(ConfigFileEntry
.warn_no_nline
)
125 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
126 "Unauthorised server connection attempt from %s: "
127 "No entry for servername %s",
128 "[@255.255.255.255]", name
);
130 ilog(L_SERVER
, "Access denied, no connect block for server %s%s",
131 EmptyString(client_p
->name
) ? name
: "",
132 log_client_name(client_p
, SHOW_IP
));
135 exit_client(client_p
, client_p
, client_p
, "Invalid servername.");
141 sendto_realops_snomask(SNO_GENERAL
, is_remote_connect(client_p
) ? L_NETWIDE
: L_ALL
,
142 "Unauthorised server connection attempt from %s: "
143 "Bad credentials for server %s",
144 "[@255.255.255.255]", name
);
146 ilog(L_SERVER
, "Access denied, invalid credentials for server %s%s",
147 EmptyString(client_p
->name
) ? name
: "",
148 log_client_name(client_p
, SHOW_IP
));
150 exit_client(client_p
, client_p
, client_p
, "Invalid credentials.");
156 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
157 "Unauthorised server connection attempt from %s: "
158 "Invalid host for server %s",
159 "[@255.255.255.255]", name
);
161 ilog(L_SERVER
, "Access denied, invalid host for server %s%s",
162 EmptyString(client_p
->name
) ? name
: "",
163 log_client_name(client_p
, SHOW_IP
));
165 exit_client(client_p
, client_p
, client_p
, "Invalid host.");
170 /* servername is > HOSTLEN */
172 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
173 "Invalid servername %s from %s",
174 name
, "[@255.255.255.255]");
175 ilog(L_SERVER
, "Access denied, invalid servername from %s",
176 log_client_name(client_p
, SHOW_IP
));
178 exit_client(client_p
, client_p
, client_p
, "Invalid servername.");
183 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
184 "Connection from servername %s requires SSL/TLS but is plaintext",
186 ilog(L_SERVER
, "Access denied, requires SSL/TLS but is plaintext from %s",
187 log_client_name(client_p
, SHOW_IP
));
189 exit_client(client_p
, client_p
, client_p
, "Access denied, requires SSL/TLS but is plaintext");
192 if (client_p
->certfp
)
194 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
195 "Connection from servername %s has invalid certificate fingerprint %s",
196 name
, client_p
->certfp
);
197 ilog(L_SERVER
, "Access denied, invalid certificate fingerprint %s from %s",
198 client_p
->certfp
, log_client_name(client_p
, SHOW_IP
));
199 exit_client(client_p
, client_p
, client_p
, "Invalid fingerprint.");
203 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
204 "Connection from servername %s failed certificate validation",
206 ilog(L_SERVER
, "Access denied; certificate validation failed for certificate from %s",
207 log_client_name(client_p
, SHOW_IP
));
208 exit_client(client_p
, client_p
, client_p
, "Invalid certificate.");
213 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
214 "Connection from servername %s rejected, no more connections allowed in class",
216 ilog(L_SERVER
, "Access denied, no more connections allowed in class for %s",
217 log_client_name(client_p
, SHOW_IP
));
219 exit_client(client_p
, client_p
, client_p
, "Access denied, no more connections allowed in class");
222 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
223 "Connection from servername %s rejected, unknown error %d",
225 ilog(L_SERVER
, "Access denied, unknown error %d for server %s%s", ret
,
226 EmptyString(client_p
->name
) ? name
: "",
227 log_client_name(client_p
, SHOW_IP
));
229 exit_client(client_p
, client_p
, client_p
, "Unknown error.");
233 /* require TS6 for direct links */
234 if(!IsCapable(client_p
, CAP_TS6
))
236 sendto_realops_snomask(SNO_GENERAL
, is_remote_connect(client_p
) ? L_NETWIDE
: L_ALL
,
237 "Link %s dropped, TS6 protocol is required", name
);
238 exit_client(client_p
, client_p
, client_p
, "Incompatible TS version");
242 /* check to ensure any "required" caps are set. --nenolod */
243 required_mask
= capability_index_get_required(serv_capindex
);
244 if (!IsCapable(client_p
, required_mask
))
246 missing
= capability_index_list(serv_capindex
, required_mask
&
247 ~client_p
->localClient
->caps
);
248 sendto_realops_snomask(SNO_GENERAL
, is_remote_connect(client_p
) ? L_NETWIDE
: L_ALL
,
249 "Link %s dropped, required CAPABs [%s] are missing",
251 ilog(L_SERVER
, "Link %s%s dropped, required CAPABs [%s] are missing",
252 EmptyString(client_p
->name
) ? name
: "",
253 log_client_name(client_p
, SHOW_IP
), missing
);
254 /* Do not use '[' in the below message because it would cause
255 * it to be considered potentially unsafe (might disclose IP
258 sendto_one(client_p
, "ERROR :Missing required CAPABs (%s)", missing
);
259 exit_client(client_p
, client_p
, client_p
, "Missing required CAPABs");
264 if((target_p
= find_server(NULL
, name
)))
267 * This link is trying feed me a server that I already have
268 * access through another path -- multiple paths not accepted
269 * currently, kill this link immediately!!
271 * Rather than KILL the link which introduced it, KILL the
272 * youngest of the two links. -avalon
274 * Definitely don't do that here. This is from an unregistered
277 if (target_p
->servptr
->flags
& FLAGS_SERVICE
)
279 /* Assume any servers introduced by services
283 sendto_one(client_p
, "ERROR :Server juped.");
287 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
288 "Attempt to re-introduce server %s from %s",
289 name
, "[@255.255.255.255]");
290 ilog(L_SERVER
, "Attempt to re-introduce server %s from %s",
291 name
, log_client_name(client_p
, SHOW_IP
));
293 sendto_one(client_p
, "ERROR :Server already exists.");
295 exit_client(client_p
, client_p
, client_p
, "Server Exists");
299 if (client_p
->preClient
&& !EmptyString(client_p
->preClient
->id
)) {
300 if ((target_p
= find_id(client_p
->preClient
->id
)) != NULL
) {
301 sendto_realops_snomask(SNO_GENERAL
, is_remote_connect(client_p
) ? L_NETWIDE
: L_ALL
,
302 "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
303 client_p
->preClient
->id
,
304 EmptyString(client_p
->name
) ? name
: "",
305 client_p
->name
, target_p
->name
);
306 ilog(L_SERVER
, "Attempt to re-introduce SID %s from %s%s (already in use by %s)",
307 client_p
->preClient
->id
,
308 EmptyString(client_p
->name
) ? name
: "",
309 log_client_name(client_p
, SHOW_IP
),
312 sendto_one(client_p
, "ERROR :SID already exists.");
313 exit_client(client_p
, client_p
, client_p
, "SID Exists");
316 rb_strlcpy(client_p
->id
, client_p
->preClient
->id
, sizeof(client_p
->id
));
321 * if we are connecting (Handshake), we already have the name from the
322 * C:line in client_p->name
325 rb_strlcpy(client_p
->name
, name
, sizeof(client_p
->name
));
326 set_server_gecos(client_p
, info
);
327 client_p
->hopcount
= hop
;
328 server_estab(client_p
);
332 * ms_server - SERVER message handler
333 * parv[1] = servername
334 * parv[2] = serverinfo/hopcount
335 * parv[3] = serverinfo
338 ms_server(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
340 char info
[REALLEN
+ 1];
341 /* same size as in s_misc.c */
343 struct Client
*target_p
;
344 struct remote_conf
*hub_p
;
345 hook_data_client hdata
;
350 char squitreason
[160];
354 rb_strlcpy(info
, parv
[3], sizeof(info
));
356 if(find_server(NULL
, name
))
359 * This link is trying feed me a server that I already have
360 * access through another path -- multiple paths not accepted
361 * currently, kill this link immediately!!
363 * Rather than KILL the link which introduced it, KILL the
364 * youngest of the two links. -avalon
366 * I think that we should exit the link itself, not the introducer,
367 * and we should always exit the most recently received(i.e. the
368 * one we are receiving this SERVER for. -A1kmm
370 * You *cant* do this, if you link somewhere, it bursts you a server
371 * that already exists, then sends you a client burst, you squit the
372 * server, but you keep getting the burst of clients on a server that
373 * doesnt exist, although ircd can handle it, its not a realistic
376 ilog(L_SERVER
, "Link %s cancelled, server %s already exists",
377 client_p
->name
, name
);
379 snprintf(squitreason
, sizeof squitreason
,
380 "Server %s already exists",
382 exit_client(client_p
, client_p
, &me
, squitreason
);
387 * User nicks never have '.' in them and server names
388 * must always have '.' in them.
390 if(strchr(name
, '.') == NULL
)
393 * Server trying to use the same name as a person. Would
394 * cause a fair bit of confusion. Enough to make it hellish
395 * for a while and servers to send stuff to the wrong place.
397 sendto_one(client_p
, "ERROR :Nickname %s already exists!", name
);
398 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
399 "Link %s cancelled: Server/nick collision on %s",
400 client_p
->name
, name
);
401 ilog(L_SERVER
, "Link %s cancelled: Server/nick collision on %s",
402 client_p
->name
, name
);
404 exit_client(client_p
, client_p
, client_p
, "Nick as Server");
409 * Server is informing about a new server behind
410 * this link. Create REMOTE server structure,
411 * add it to list and propagate word to my other
416 * See if the newly found server is behind a guaranteed
417 * leaf. If so, close the link.
420 RB_DLINK_FOREACH(ptr
, hubleaf_conf_list
.head
)
424 if(match(hub_p
->server
, client_p
->name
) && match(hub_p
->host
, name
))
426 if(hub_p
->flags
& CONF_HUB
)
433 /* Ok, this way this works is
435 * A server can have a CONF_HUB allowing it to introduce servers
439 * name = "irc.bighub.net";
443 * That would allow "irc.bighub.net" to introduce anything it wanted..
448 * name = "irc.somehub.fi";
452 * Would allow this server in finland to hub anything but
456 /* Ok, check client_p can hub the new server */
459 /* OOOPs nope can't HUB */
460 sendto_realops_snomask(SNO_GENERAL
, L_ALL
, "Non-Hub link %s introduced %s.",
461 client_p
->name
, name
);
462 ilog(L_SERVER
, "Non-Hub link %s introduced %s.",
463 client_p
->name
, name
);
465 snprintf(squitreason
, sizeof squitreason
,
466 "No matching hub_mask for %s",
468 exit_client(NULL
, client_p
, &me
, squitreason
);
472 /* Check for the new server being leafed behind this HUB */
475 /* OOOPs nope can't HUB this leaf */
476 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
477 "Link %s introduced leafed server %s.",
478 client_p
->name
, name
);
479 ilog(L_SERVER
, "Link %s introduced leafed server %s.",
480 client_p
->name
, name
);
482 snprintf(squitreason
, sizeof squitreason
,
483 "Matching leaf_mask for %s",
485 exit_client(NULL
, client_p
, &me
, squitreason
);
491 if(strlen(name
) > HOSTLEN
)
493 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
494 "Link %s introduced server with invalid servername %s",
495 client_p
->name
, name
);
496 ilog(L_SERVER
, "Link %s introduced server with invalid servername %s",
497 client_p
->name
, name
);
499 exit_client(NULL
, client_p
, &me
, "Invalid servername introduced.");
503 target_p
= make_client(client_p
);
504 make_server(target_p
);
505 target_p
->hopcount
= hop
;
507 rb_strlcpy(target_p
->name
, name
, sizeof(target_p
->name
));
509 set_server_gecos(target_p
, info
);
511 target_p
->servptr
= source_p
;
515 rb_dlinkAddTail(target_p
, &target_p
->node
, &global_client_list
);
516 rb_dlinkAddTailAlloc(target_p
, &global_serv_list
);
517 add_to_client_hash(target_p
->name
, target_p
);
518 rb_dlinkAdd(target_p
, &target_p
->lnode
, &target_p
->servptr
->serv
->servers
);
520 target_p
->serv
->nameinfo
= scache_connect(target_p
->name
, target_p
->info
, IsHidden(target_p
));
522 sendto_server(client_p
, NULL
, NOCAPS
, NOCAPS
,
523 ":%s SERVER %s %d :%s%s",
524 source_p
->name
, target_p
->name
, target_p
->hopcount
+ 1,
525 IsHidden(target_p
) ? "(H) " : "", target_p
->info
);
527 sendto_realops_snomask(SNO_EXTERNAL
, L_ALL
,
528 "Server %s being introduced by %s", target_p
->name
, source_p
->name
);
530 /* quick, dirty EOB. you know you love it. */
531 sendto_one(target_p
, ":%s PING %s %s", get_id(&me
, target_p
), me
.name
, target_p
->name
);
533 hdata
.client
= source_p
;
534 hdata
.target
= target_p
;
535 call_hook(h_server_introduced
, &hdata
);
539 ms_sid(struct MsgBuf
*msgbuf_p
, struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
541 struct Client
*target_p
;
542 struct remote_conf
*hub_p
;
543 hook_data_client hdata
;
547 char squitreason
[160];
549 /* collision on the name? */
550 if(find_server(NULL
, parv
[1]) != NULL
)
552 ilog(L_SERVER
, "Link %s cancelled, server %s already exists",
553 client_p
->name
, parv
[1]);
555 snprintf(squitreason
, sizeof squitreason
,
556 "Server %s already exists",
558 exit_client(NULL
, client_p
, &me
, squitreason
);
562 /* collision on the SID? */
563 if((target_p
= find_id(parv
[3])) != NULL
)
565 sendto_wallops_flags(UMODE_WALLOP
, &me
,
566 "Link %s cancelled, SID %s for server %s already in use by %s",
567 client_p
->name
, parv
[3], parv
[1], target_p
->name
);
568 sendto_server(NULL
, NULL
, CAP_TS6
, NOCAPS
,
569 ":%s WALLOPS :Link %s cancelled, SID %s for server %s already in use by %s",
570 me
.id
, client_p
->name
, parv
[3], parv
[1], target_p
->name
);
571 ilog(L_SERVER
, "Link %s cancelled, SID %s for server %s already in use by %s",
572 client_p
->name
, parv
[3], parv
[1], target_p
->name
);
574 snprintf(squitreason
, sizeof squitreason
,
575 "SID %s for %s already in use by %s",
576 parv
[3], parv
[1], target_p
->name
);
577 exit_client(NULL
, client_p
, &me
, squitreason
);
581 if(bogus_host(parv
[1]) || strlen(parv
[1]) > HOSTLEN
)
583 sendto_one(client_p
, "ERROR :Invalid servername");
584 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
585 "Link %s cancelled, servername %s invalid",
586 client_p
->name
, parv
[1]);
587 ilog(L_SERVER
, "Link %s cancelled, servername %s invalid",
588 client_p
->name
, parv
[1]);
590 exit_client(NULL
, client_p
, &me
, "Bogus server name");
594 if(!IsDigit(parv
[3][0]) || !IsIdChar(parv
[3][1]) ||
595 !IsIdChar(parv
[3][2]) || parv
[3][3] != '\0')
597 sendto_one(client_p
, "ERROR :Invalid SID");
598 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
599 "Link %s cancelled, SID %s invalid",
600 client_p
->name
, parv
[3]);
601 ilog(L_SERVER
, "Link %s cancelled, SID %s invalid",
602 client_p
->name
, parv
[3]);
604 exit_client(NULL
, client_p
, &me
, "Bogus SID");
608 /* for the directly connected server:
609 * H: allows it to introduce a server matching that mask
610 * L: disallows it introducing a server matching that mask
612 RB_DLINK_FOREACH(ptr
, hubleaf_conf_list
.head
)
616 if(match(hub_p
->server
, client_p
->name
) && match(hub_p
->host
, parv
[1]))
618 if(hub_p
->flags
& CONF_HUB
)
625 /* no matching hub_mask */
628 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
629 "Non-Hub link %s introduced %s.",
630 client_p
->name
, parv
[1]);
631 ilog(L_SERVER
, "Non-Hub link %s introduced %s.",
632 client_p
->name
, parv
[1]);
634 snprintf(squitreason
, sizeof squitreason
,
635 "No matching hub_mask for %s",
637 exit_client(NULL
, client_p
, &me
, squitreason
);
641 /* matching leaf_mask */
644 sendto_realops_snomask(SNO_GENERAL
, L_ALL
,
645 "Link %s introduced leafed server %s.",
646 client_p
->name
, parv
[1]);
647 ilog(L_SERVER
, "Link %s introduced leafed server %s.",
648 client_p
->name
, parv
[1]);
650 snprintf(squitreason
, sizeof squitreason
,
651 "Matching leaf_mask for %s",
653 exit_client(NULL
, client_p
, &me
, squitreason
);
658 target_p
= make_client(client_p
);
659 make_server(target_p
);
661 rb_strlcpy(target_p
->name
, parv
[1], sizeof(target_p
->name
));
662 target_p
->hopcount
= atoi(parv
[2]);
663 rb_strlcpy(target_p
->id
, parv
[3], sizeof(target_p
->id
));
664 set_server_gecos(target_p
, parv
[4]);
666 target_p
->servptr
= source_p
;
669 rb_dlinkAddTail(target_p
, &target_p
->node
, &global_client_list
);
670 rb_dlinkAddTailAlloc(target_p
, &global_serv_list
);
671 add_to_client_hash(target_p
->name
, target_p
);
672 add_to_id_hash(target_p
->id
, target_p
);
673 rb_dlinkAdd(target_p
, &target_p
->lnode
, &target_p
->servptr
->serv
->servers
);
675 target_p
->serv
->nameinfo
= scache_connect(target_p
->name
, target_p
->info
, IsHidden(target_p
));
677 sendto_server(client_p
, NULL
, CAP_TS6
, NOCAPS
,
678 ":%s SID %s %d %s :%s%s",
679 source_p
->id
, target_p
->name
, target_p
->hopcount
+ 1,
680 target_p
->id
, IsHidden(target_p
) ? "(H) " : "", target_p
->info
);
682 sendto_realops_snomask(SNO_EXTERNAL
, L_ALL
,
683 "Server %s being introduced by %s", target_p
->name
, source_p
->name
);
685 /* quick, dirty EOB. you know you love it. */
686 sendto_one(target_p
, ":%s PING %s %s",
687 get_id(&me
, target_p
), me
.name
, get_id(target_p
, target_p
));
689 hdata
.client
= source_p
;
690 hdata
.target
= target_p
;
691 call_hook(h_server_introduced
, &hdata
);
694 /* set_server_gecos()
696 * input - pointer to client
698 * side effects - servers gecos field is set
701 set_server_gecos(struct Client
*client_p
, const char *info
)
703 /* check the info for [IP] */
709 s
= LOCAL_COPY(info
);
711 /* we should only check the first word for an ip */
712 if((p
= strchr(s
, ' ')))
715 /* check for a ] which would symbolise an [IP] */
718 /* set s to after the first space */
724 /* no ], put the space back */
728 /* p may have been set to a trailing space, so check s exists and that
730 if(s
&& (*s
!= '\0'))
732 /* a space? if not (H) could be the last part of info.. */
733 if((p
= strchr(s
, ' ')))
736 /* check for (H) which is a hidden server */
737 if(!strcmp(s
, "(H)"))
741 /* if there was no space.. theres nothing to set info to */
750 /* if there was a trailing space, s could point to \0, so check */
751 if(s
&& (*s
!= '\0'))
753 rb_strlcpy(client_p
->info
, s
, sizeof(client_p
->info
));
759 rb_strlcpy(client_p
->info
, "(Unknown Location)", sizeof(client_p
->info
));
766 * output - true if a bogus hostname input, false if its valid
767 * side effects - none
770 bogus_host(const char *host
)
772 bool bogus_server
= false;
776 for(s
= host
; *s
; s
++)
787 if(!dots
|| bogus_server
)