50 |
|
#include "s_conf.h" |
51 |
|
#include "s_serv.h" |
52 |
|
#include "s_log.h" |
53 |
– |
#include "s_stats.h" |
53 |
|
#include "s_user.h" |
54 |
|
#include "send.h" |
55 |
|
#include "memory.h" |
753 |
|
} |
754 |
|
} |
755 |
|
|
756 |
< |
return(0); |
756 |
> |
return 0; |
757 |
|
} |
758 |
|
|
759 |
|
/* |
766 |
|
int |
767 |
|
find_capability(const char *capab) |
768 |
|
{ |
769 |
< |
dlink_node *ptr; |
771 |
< |
struct Capability *cap; |
769 |
> |
const dlink_node *ptr = NULL; |
770 |
|
|
771 |
|
DLINK_FOREACH(ptr, cap_list.head) |
772 |
|
{ |
773 |
< |
cap = ptr->data; |
773 |
> |
const struct Capability *cap = ptr->data; |
774 |
|
|
775 |
< |
if (cap->cap != 0) |
776 |
< |
{ |
779 |
< |
if (irccmp(cap->name, capab) == 0) |
780 |
< |
return(cap->cap); |
781 |
< |
} |
775 |
> |
if (cap->cap && !irccmp(cap->name, capab)) |
776 |
> |
return cap->cap; |
777 |
|
} |
778 |
< |
return(0); |
778 |
> |
|
779 |
> |
return 0; |
780 |
|
} |
781 |
|
|
782 |
|
/* send_capabilities() |
991 |
|
{ |
992 |
|
if (client_p != serv_list.head->data || serv_list.head->next) |
993 |
|
{ |
994 |
< |
ServerStats->is_ref++; |
994 |
> |
++ServerStats.is_ref; |
995 |
|
sendto_one(client_p, "ERROR :I'm a leaf not a hub"); |
996 |
|
exit_client(client_p, &me, "I'm a leaf"); |
997 |
|
return; |
1550 |
|
} |
1551 |
|
} |
1552 |
|
|
1557 |
– |
/* set_autoconn() |
1558 |
– |
* |
1559 |
– |
* inputs - struct Client pointer to oper requesting change |
1560 |
– |
* output - none |
1561 |
– |
* side effects - set autoconnect mode |
1562 |
– |
*/ |
1563 |
– |
void |
1564 |
– |
set_autoconn(struct Client *source_p, const char *name, int newval) |
1565 |
– |
{ |
1566 |
– |
struct ConfItem *conf; |
1567 |
– |
struct AccessItem *aconf; |
1568 |
– |
|
1569 |
– |
if (name != NULL) |
1570 |
– |
{ |
1571 |
– |
conf = find_exact_name_conf(SERVER_TYPE, name, NULL, NULL); |
1572 |
– |
if (conf != NULL) |
1573 |
– |
{ |
1574 |
– |
aconf = (struct AccessItem *)map_to_conf(conf); |
1575 |
– |
if (newval) |
1576 |
– |
SetConfAllowAutoConn(aconf); |
1577 |
– |
else |
1578 |
– |
ClearConfAllowAutoConn(aconf); |
1579 |
– |
|
1580 |
– |
sendto_realops_flags(UMODE_ALL, L_ALL, |
1581 |
– |
"%s has changed AUTOCONN for %s to %i", |
1582 |
– |
source_p->name, name, newval); |
1583 |
– |
sendto_one(source_p, |
1584 |
– |
":%s NOTICE %s :AUTOCONN for %s is now set to %i", |
1585 |
– |
me.name, source_p->name, name, newval); |
1586 |
– |
} |
1587 |
– |
else |
1588 |
– |
{ |
1589 |
– |
sendto_one(source_p, ":%s NOTICE %s :Can't find %s", |
1590 |
– |
me.name, source_p->name, name); |
1591 |
– |
} |
1592 |
– |
} |
1593 |
– |
else |
1594 |
– |
{ |
1595 |
– |
sendto_one(source_p, ":%s NOTICE %s :Please specify a server name!", |
1596 |
– |
me.name, source_p->name); |
1597 |
– |
} |
1598 |
– |
} |
1599 |
– |
|
1553 |
|
/* New server connection code |
1554 |
|
* Based upon the stuff floating about in s_bsd.c |
1555 |
|
* -- adrian |