]> jfr.im git - irc/quakenet/newserv.git/blame - trusts/trusts_api.c
GLINES: fix null pointer deref in trustgline / trustungline
[irc/quakenet/newserv.git] / trusts / trusts_api.c
CommitLineData
6e6e98da 1#include <stdio.h>
c4610da5 2#include "../lib/version.h"
813c5b73 3#include <../nick/nick.h>
ac3af088 4#include "../irc/irc.h"
813c5b73
CP
5#include "trusts.h"
6
c4610da5
GB
7MODULE_VERSION("");
8
813c5b73
CP
9int istrusted(nick *np) {
10 return gettrusthost(np) != NULL;
11}
ac3af088 12
a473a1be
GB
13unsigned char getnodebits(struct irc_in_addr *ip) {
14 trusthost *th;
15
16 th = th_getbyhost(ip);
17
18 if(th)
19 return th->nodebits;
20
21 if(irc_in_addr_is_ipv4(ip))
22 return 128;
23 else
24 return 64;
25}