proxyscan_addscantype(STYPE_DIRECT_IRC, 6668);
proxyscan_addscantype(STYPE_DIRECT_IRC, 6669);
proxyscan_addscantype(STYPE_DIRECT_IRC, 6670);
+ proxyscan_addscantype(STYPE_ROUTER, 3128);
/* Schedule saves */
schedulerecurring(time(NULL)+3600,0,3600,&dumpcachehosts,NULL);
}
}
+ /* deref prefix (referenced in queuescan) */
+ derefnode(iptree,sp->node);
freescan(sp);
/* kick the queue.. */
return;
}
+ /* Do nothing */
+ break;
+
+ case STYPE_ROUTER:
+ sprintf(buf,"GET /nonexistent HTTP/1.0\r\n\r\n");
+ if ((write(fd,buf,strlen(buf)))<strlen(buf)) {
+ killsock(sp, SOUTCOME_CLOSED);
+ return;
+ }
+
/* Do nothing */
break;
}
char *magicstring;
int magicstringlength;
- if(sp->type != STYPE_DIRECT_IRC) {
- magicstring = MAGICSTRING;
- magicstringlength = MAGICSTRINGLENGTH;
- } else {
+ if(sp->type == STYPE_DIRECT_IRC) {
magicstring = MAGICIRCSTRING;
magicstringlength = MAGICIRCSTRINGLENGTH;
+ } else if(sp->type == STYPE_ROUTER) {
+ magicstring = MAGICROUTERSTRING;
+ magicstringlength = MAGICROUTERSTRINGLENGTH;
+ } else {
+ magicstring = MAGICSTRING;
+ magicstringlength = MAGICSTRINGLENGTH;
}
for (i=0;i<sp->bytesread - magicstringlength;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;
+ }
+
time_t t;
sendnoticetouser(proxyscannick,np,"Forcing scan of %s",IPtostr(sin));
// * Just queue the scans directly here.. plonk them on the priority queue * /