+ sendnoticetouser(proxyscannick,np,"Total %d scans actually found (%d active)",totalscansfound,activescansfound);
+ return CMD_OK;
+}
+
+void proxyscan_onconnect(int hooknum, void *arg) {
+ ps_ready = 1;
+
+ /* kick the queue.. */
+ startqueuedscans();
+}
+
+int proxyscandosave(void *sender, int cargc, char **cargv) {
+ nick *np = (nick *)sender;
+
+ sendnoticetouser(proxyscannick,np,"Saving cached hosts...");
+ dumpcachehosts(NULL);
+ sendnoticetouser(proxyscannick,np,"Done.");
+ return CMD_OK;
+}
+
+int proxyscandospew(void *sender, int cargc, char **cargv) {
+ nick *np = (nick *)sender;
+
+ /* check our database for the ip supplied */
+ unsigned long a,b,c,d;
+ if (4 != sscanf(cargv[0],"%lu.%lu.%lu.%lu",&a,&b,&c,&d)) {
+ sendnoticetouser(proxyscannick,np,"Usage: spew x.x.x.x");
+ } else {
+ /* check db */
+ proxyscanspewip(proxyscannick,np,a,b,c,d);
+ }
+ return CMD_OK;
+}
+
+int proxyscandoshowkill(void *sender, int cargc, char **cargv) {
+ nick *np = (nick *)sender;
+
+ /* check our database for the id supplied */
+ unsigned long a;
+ if (1 != sscanf(cargv[0],"%lu",&a)) {
+ sendnoticetouser(proxyscannick,np,"Usage: showkill <id>");
+ } else {
+ /* check db */
+ proxyscanshowkill(proxyscannick,np,a);
+ }
+ return CMD_OK;
+}
+
+int proxyscandoscan(void *sender, int cargc, char **cargv) {
+ nick *np = (nick *)sender;
+ patricia_node_t *node;
+ struct irc_in_addr sin;
+ unsigned char bits;
+ int i;
+
+ if (0 == ipmask_parse(cargv[0],&sin, &bits)) {
+ sendnoticetouser(proxyscannick,np,"Usage: scan <ip>");
+ } else {
+ if (bits != 128 || !irc_in_addr_is_ipv4(&sin) || irc_in_addr_is_loopback(&sin)) {
+ sendnoticetouser(proxyscannick,np,"You may only scan single IPv4 IP's");
+ return CMD_OK;