]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_api.c
GLINES: fix null pointer deref in trustgline / trustungline
[irc/quakenet/newserv.git] / trusts / trusts_api.c
index 23fe063511d6702d96e6fdea6e19496055bf1e94..a66ba6f043ab9751cceab2b5741eb956b51cb0ae 100644 (file)
@@ -1,6 +1,25 @@
+#include <stdio.h>
+#include "../lib/version.h"
 #include <../nick/nick.h>
+#include "../irc/irc.h"
 #include "trusts.h"
 
+MODULE_VERSION("");
+
 int istrusted(nick *np) {
   return gettrusthost(np) != NULL;
 }
+
+unsigned char getnodebits(struct irc_in_addr *ip) {
+  trusthost *th;
+
+  th = th_getbyhost(ip);
+
+  if(th)
+    return th->nodebits;
+
+  if(irc_in_addr_is_ipv4(ip))
+    return 128;
+  else
+    return 64;
+}