31 |
|
#include "channel.h" |
32 |
|
#include "channel_mode.h" |
33 |
|
#include "client.h" |
34 |
– |
#include "common.h" |
34 |
|
#include "dbuf.h" |
35 |
|
#include "event.h" |
36 |
|
#include "fdlist.h" |
50 |
|
#include "send.h" |
51 |
|
#include "memory.h" |
52 |
|
#include "channel.h" /* chcap_usage_counts stuff...*/ |
53 |
+ |
#include "parse.h" |
54 |
|
|
55 |
|
#define MIN_CONN_FREQ 300 |
56 |
|
|
367 |
|
* non-matching lookups. |
368 |
|
*/ |
369 |
|
if (MyClient(source_p)) |
370 |
< |
target_p = find_client(parv[server]); |
370 |
> |
target_p = hash_find_client(parv[server]); |
371 |
|
else |
372 |
|
target_p = find_person(client_p, parv[server]); |
373 |
|
|
375 |
|
if (target_p->from == source_p->from && !MyConnect(target_p)) |
376 |
|
target_p = NULL; |
377 |
|
|
378 |
< |
if (target_p == NULL && (target_p = find_server(parv[server]))) |
378 |
> |
if (target_p == NULL && (target_p = hash_find_server(parv[server]))) |
379 |
|
if (target_p->from == source_p->from && !MyConnect(target_p)) |
380 |
|
target_p = NULL; |
381 |
|
|
389 |
|
{ |
390 |
|
if (!wilds) |
391 |
|
{ |
392 |
< |
if (!(target_p = find_server(parv[server]))) |
392 |
> |
if (!(target_p = hash_find_server(parv[server]))) |
393 |
|
{ |
394 |
|
sendto_one(source_p, form_str(ERR_NOSUCHSERVER), |
395 |
< |
me.name, parv[0], parv[server]); |
395 |
> |
me.name, source_p->name, parv[server]); |
396 |
|
return(HUNTED_NOSUCH); |
397 |
|
} |
398 |
|
} |
420 |
|
if(!IsRegistered(target_p)) |
421 |
|
{ |
422 |
|
sendto_one(source_p, form_str(ERR_NOSUCHSERVER), |
423 |
< |
me.name, parv[0], parv[server]); |
423 |
> |
me.name, source_p->name, parv[server]); |
424 |
|
return HUNTED_NOSUCH; |
425 |
|
} |
426 |
|
|
443 |
|
} |
444 |
|
|
445 |
|
sendto_one(source_p, form_str(ERR_NOSUCHSERVER), |
446 |
< |
me.name, parv[0], parv[server]); |
446 |
> |
me.name, source_p->name, parv[server]); |
447 |
|
return(HUNTED_NOSUCH); |
448 |
|
} |
449 |
|
|
506 |
|
/* Found a CONNECT config with port specified, scan clients |
507 |
|
* and see if this server is already connected? |
508 |
|
*/ |
509 |
< |
if (find_server(conf->name) != NULL) |
509 |
> |
if (hash_find_server(conf->name) != NULL) |
510 |
|
continue; |
511 |
|
|
512 |
|
if (CurrUserCount(cltmp) < MaxTotal(cltmp)) |
857 |
|
if (!IsClient(target_p)) |
858 |
|
return; |
859 |
|
|
860 |
< |
send_umode(NULL, target_p, 0, IsOperHiddenAdmin(target_p) ? |
860 |
> |
send_umode(NULL, target_p, 0, HasOFlag(target_p, OPER_FLAG_HIDDEN_ADMIN) ? |
861 |
|
SEND_UMODES & ~UMODE_ADMIN : SEND_UMODES, ubuf); |
862 |
|
|
863 |
|
if (ubuf[0] == '\0') |
867 |
|
} |
868 |
|
|
869 |
|
/* XXX Both of these need to have a :me.name or :mySID!?!?! */ |
870 |
< |
if (HasID(target_p) && IsCapable(client_p, CAP_TS6)) |
871 |
< |
sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
872 |
< |
target_p->servptr->id, |
873 |
< |
target_p->name, target_p->hopcount + 1, |
874 |
< |
(unsigned long) target_p->tsinfo, |
875 |
< |
ubuf, target_p->username, target_p->host, |
876 |
< |
(MyClient(target_p) && IsIPSpoof(target_p)) ? |
877 |
< |
"0" : target_p->sockhost, target_p->id, target_p->info); |
870 |
> |
if (IsCapable(client_p, CAP_SVS)) |
871 |
> |
{ |
872 |
> |
if (HasID(target_p) && IsCapable(client_p, CAP_TS6)) |
873 |
> |
sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s %lu :%s", |
874 |
> |
target_p->servptr->id, |
875 |
> |
target_p->name, target_p->hopcount + 1, |
876 |
> |
(unsigned long) target_p->tsinfo, |
877 |
> |
ubuf, target_p->username, target_p->host, |
878 |
> |
(MyClient(target_p) && IsIPSpoof(target_p)) ? |
879 |
> |
"0" : target_p->sockhost, target_p->id, |
880 |
> |
(unsigned long)target_p->servicestamp, target_p->info); |
881 |
> |
else |
882 |
> |
sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %lu :%s", |
883 |
> |
target_p->name, target_p->hopcount + 1, |
884 |
> |
(unsigned long) target_p->tsinfo, |
885 |
> |
ubuf, target_p->username, target_p->host, |
886 |
> |
target_p->servptr->name, (unsigned long)target_p->servicestamp, |
887 |
> |
target_p->info); |
888 |
> |
} |
889 |
|
else |
890 |
< |
sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s", |
891 |
< |
target_p->name, target_p->hopcount + 1, |
892 |
< |
(unsigned long) target_p->tsinfo, |
893 |
< |
ubuf, target_p->username, target_p->host, |
894 |
< |
target_p->servptr->name, target_p->info); |
890 |
> |
{ |
891 |
> |
if (HasID(target_p) && IsCapable(client_p, CAP_TS6)) |
892 |
> |
sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s", |
893 |
> |
target_p->servptr->id, |
894 |
> |
target_p->name, target_p->hopcount + 1, |
895 |
> |
(unsigned long) target_p->tsinfo, |
896 |
> |
ubuf, target_p->username, target_p->host, |
897 |
> |
(MyClient(target_p) && IsIPSpoof(target_p)) ? |
898 |
> |
"0" : target_p->sockhost, target_p->id, target_p->info); |
899 |
> |
else |
900 |
> |
sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s", |
901 |
> |
target_p->name, target_p->hopcount + 1, |
902 |
> |
(unsigned long) target_p->tsinfo, |
903 |
> |
ubuf, target_p->username, target_p->host, |
904 |
> |
target_p->servptr->name, target_p->info); |
905 |
> |
} |
906 |
|
|
907 |
|
if (IsConfAwayBurst((struct AccessItem *)map_to_conf(client_p->serv->sconf))) |
908 |
|
if (!EmptyString(target_p->away)) |
1121 |
|
make_server(client_p); |
1122 |
|
|
1123 |
|
/* fixing eob timings.. -gnp */ |
1124 |
< |
client_p->firsttime = CurrentTime; |
1124 |
> |
client_p->localClient->firsttime = CurrentTime; |
1125 |
> |
|
1126 |
> |
|
1127 |
> |
if (find_matching_name_conf(SERVICE_TYPE, client_p->name, NULL, NULL, 0)) |
1128 |
> |
AddFlag(client_p, FLAGS_SERVICE); |
1129 |
|
|
1130 |
|
/* Show the real host/IP to admins */ |
1131 |
|
sendto_realops_flags(UMODE_ALL, L_ADMIN, |
1135 |
|
sendto_realops_flags(UMODE_ALL, L_OPER, |
1136 |
|
"Link with %s established: (%s) link", |
1137 |
|
inpath,show_capabilities(client_p)); |
1138 |
< |
ilog(L_NOTICE, "Link with %s established: (%s) link", |
1138 |
> |
ilog(LOG_TYPE_IRCD, "Link with %s established: (%s) link", |
1139 |
|
inpath_ip, show_capabilities(client_p)); |
1140 |
|
|
1141 |
|
client_p->serv->sconf = conf; |
1454 |
|
{ |
1455 |
|
struct Client *target_p = ptr->data; |
1456 |
|
|
1457 |
< |
if (!IsBursted(target_p) && target_p->from != client_p) |
1457 |
> |
if (!HasFlag(target_p, FLAGS_BURSTED) && target_p->from != client_p) |
1458 |
|
sendnick_TS(client_p, target_p); |
1459 |
|
|
1460 |
< |
ClearBursted(target_p); |
1460 |
> |
DelFlag(target_p, FLAGS_BURSTED); |
1461 |
|
} |
1462 |
|
|
1463 |
|
/* We send the time we started the burst, and let the remote host determine an EOB time, |
1499 |
|
sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s", |
1500 |
|
me.name, (unsigned long)chptr->channelts, chptr->chname, |
1501 |
|
(unsigned long)chptr->topic_time, |
1502 |
< |
chptr->topic_info ? chptr->topic_info : "", |
1503 |
< |
chptr->topic ? chptr->topic : ""); |
1502 |
> |
chptr->topic_info, |
1503 |
> |
chptr->topic); |
1504 |
|
else if (IsCapable(client_p, CAP_TB)) |
1505 |
|
{ |
1506 |
|
if (ConfigChannel.burst_topicwho) |
1508 |
|
sendto_one(client_p, ":%s TB %s %lu %s :%s", |
1509 |
|
me.name, chptr->chname, |
1510 |
|
(unsigned long)chptr->topic_time, |
1511 |
< |
chptr->topic_info, chptr->topic ? chptr->topic : ""); |
1511 |
> |
chptr->topic_info, chptr->topic); |
1512 |
|
} |
1513 |
|
else |
1514 |
|
{ |
1515 |
|
sendto_one(client_p, ":%s TB %s %lu :%s", |
1516 |
|
me.name, chptr->chname, |
1517 |
|
(unsigned long)chptr->topic_time, |
1518 |
< |
chptr->topic ? chptr->topic : ""); |
1518 |
> |
chptr->topic); |
1519 |
|
} |
1520 |
|
} |
1521 |
|
} |
1540 |
|
ms = ptr->data; |
1541 |
|
target_p = ms->client_p; |
1542 |
|
|
1543 |
< |
if (!IsBursted(target_p)) |
1543 |
> |
if (!HasFlag(target_p, FLAGS_BURSTED)) |
1544 |
|
{ |
1545 |
< |
SetBursted(target_p); |
1545 |
> |
AddFlag(target_p, FLAGS_BURSTED); |
1546 |
|
|
1547 |
|
if (target_p->from != client_p) |
1548 |
|
sendnick_TS(client_p, target_p); |
1592 |
|
/* log */ |
1593 |
|
getnameinfo((struct sockaddr *)&aconf->ipnum, aconf->ipnum.ss_len, |
1594 |
|
buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); |
1595 |
< |
ilog(L_NOTICE, "Connect to %s[%s] @%s", aconf->user, aconf->host, |
1595 |
> |
ilog(LOG_TYPE_IRCD, "Connect to %s[%s] @%s", aconf->user, aconf->host, |
1596 |
|
buf); |
1597 |
|
|
1598 |
|
/* Still processing a DNS lookup? -> exit */ |
1615 |
|
/* Make sure this server isn't already connected |
1616 |
|
* Note: aconf should ALWAYS be a valid C: line |
1617 |
|
*/ |
1618 |
< |
if ((client_p = find_server(conf->name)) != NULL) |
1618 |
> |
if ((client_p = hash_find_server(conf->name)) != NULL) |
1619 |
|
{ |
1620 |
|
sendto_realops_flags(UMODE_ALL, L_ADMIN, |
1621 |
|
"Server %s already present from %s", |
1999 |
|
get_client_name(client_p, SHOW_IP), type, reason); |
2000 |
|
sendto_realops_flags(UMODE_ALL, L_OPER, "%s: CRYPTLINK %s error - %s", |
2001 |
|
get_client_name(client_p, MASK_IP), type, reason); |
2002 |
< |
ilog(L_ERROR, "%s: CRYPTLINK %s error - %s", |
2002 |
> |
ilog(LOG_TYPE_IRCD, "%s: CRYPTLINK %s error - %s", |
2003 |
|
get_client_name(client_p, SHOW_IP), type, reason); |
2004 |
|
|
2005 |
|
/* If client_reason isn't NULL, then exit the client with the message |