]>
jfr.im git - irc/quakenet/newserv.git/blob - trusts/trusts_api.c
2 #include <../nick/nick.h>
3 #include "../irc/irc.h"
6 int istrusted(nick
*np
) {
7 return gettrusthost(np
) != NULL
;
10 int trustgline(trustgroup
*tg
, const char *ident
, int duration
, const char *reason
) {
14 for(th
=tg
->hosts
;th
;th
=th
->next
) {
15 char *cidrstr
= trusts_cidr2str(&th
->ip
, th
->bits
);
16 irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric
->content
, ident
, cidrstr
, duration
, (intmax_t)getnettime(), reason
);
23 int trustungline(trustgroup
*tg
, const char *ident
, int duration
, const char *reason
) {
27 for(th
=tg
->hosts
;th
;th
=th
->next
) {
28 char *cidrstr
= trusts_cidr2str(&th
->ip
, th
->bits
);
29 irc_send("%s GL * +%s@%s %d %jd :%s", mynumeric
->content
, ident
, cidrstr
, duration
, (intmax_t)getnettime(), reason
);
36 unsigned char getnodebits(struct irc_in_addr
*ip
) {
39 th
= th_getbyhost(ip
);
44 if(irc_in_addr_is_ipv4(ip
))