added bigrange option for network scan

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7721 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent c55787d07c
commit 5c981762c6

@ -46,6 +46,7 @@
<input type="text" name="scanhosts" value="#[scanhosts]#" size="60" maxlength="400" /><br/><br/> <input type="text" name="scanhosts" value="#[scanhosts]#" size="60" maxlength="400" /><br/><br/>
<input type="radio" name="source" id="sourcenet" value="intranet"#(intranet.checked)#:: checked="checked"#(/intranet.checked)# />Full Intranet Scan: #[intranethosts]#<br/> <input type="radio" name="source" id="sourcenet" value="intranet"#(intranet.checked)#:: checked="checked"#(/intranet.checked)# />Full Intranet Scan: #[intranethosts]#<br/>
<input type="checkbox" name="bigrange" />bigrange
#(intranetHint)#::<div class="info">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do not use intranet scan results, you are not in an intranet environment!</div>#(/intranetHint)# #(intranetHint)#::<div class="info">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do not use intranet scan results, you are not in an intranet environment!</div>#(/intranetHint)#
</dd> </dd>
<dt>Scan Cache</dt> <dt>Scan Cache</dt>

@ -94,6 +94,8 @@ public class CrawlStartScanner_p {
if (repeat_unit.equals("seldays")) validTime = repeat_time * 24 * 60 * 60 * 1000; if (repeat_unit.equals("seldays")) validTime = repeat_time * 24 * 60 * 60 * 1000;
} }
boolean bigrange = post.getBoolean("bigrange", false);
// case: an IP range was given; scan the range for services and display result // case: an IP range was given; scan the range for services and display result
if (post.containsKey("scan") && "hosts".equals(post.get("source", ""))) { if (post.containsKey("scan") && "hosts".equals(post.get("source", ""))) {
final Set<InetAddress> ia = new HashSet<InetAddress>(); final Set<InetAddress> ia = new HashSet<InetAddress>();
@ -107,10 +109,10 @@ public class CrawlStartScanner_p {
ia.add(Domains.dnsResolve(host)); ia.add(Domains.dnsResolve(host));
} }
final Scanner scanner = new Scanner(ia, CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000); final Scanner scanner = new Scanner(ia, CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000);
if (post.get("scanftp", "").equals("on")) scanner.addFTP(false); if (post.get("scanftp", "").equals("on")) scanner.addFTP(bigrange);
if (post.get("scanhttp", "").equals("on")) scanner.addHTTP(false); if (post.get("scanhttp", "").equals("on")) scanner.addHTTP(bigrange);
if (post.get("scanhttps", "").equals("on")) scanner.addHTTPS(false); if (post.get("scanhttps", "").equals("on")) scanner.addHTTPS(bigrange);
if (post.get("scansmb", "").equals("on")) scanner.addSMB(false); if (post.get("scansmb", "").equals("on")) scanner.addSMB(bigrange);
scanner.start(); scanner.start();
scanner.terminate(); scanner.terminate();
if ("on".equals(post.get("accumulatescancache", "")) && !"scheduler".equals(post.get("rescan", ""))) { if ("on".equals(post.get("accumulatescancache", "")) && !"scheduler".equals(post.get("rescan", ""))) {
@ -122,10 +124,10 @@ public class CrawlStartScanner_p {
if (post.containsKey("scan") && "intranet".equals(post.get("source", ""))) { if (post.containsKey("scan") && "intranet".equals(post.get("source", ""))) {
final Scanner scanner = new Scanner(Domains.myIntranetIPs(), CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000); final Scanner scanner = new Scanner(Domains.myIntranetIPs(), CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000);
if ("on".equals(post.get("scanftp", ""))) scanner.addFTP(false); if ("on".equals(post.get("scanftp", ""))) scanner.addFTP(bigrange);
if ("on".equals(post.get("scanhttp", ""))) scanner.addHTTP(false); if ("on".equals(post.get("scanhttp", ""))) scanner.addHTTP(bigrange);
if ("on".equals(post.get("scanhttps", ""))) scanner.addHTTPS(false); if ("on".equals(post.get("scanhttps", ""))) scanner.addHTTPS(bigrange);
if ("on".equals(post.get("scansmb", ""))) scanner.addSMB(false); if ("on".equals(post.get("scansmb", ""))) scanner.addSMB(bigrange);
scanner.start(); scanner.start();
scanner.terminate(); scanner.terminate();
if ("on".equals(post.get("accumulatescancache", "")) && !"scheduler".equals(post.get("rescan", ""))) { if ("on".equals(post.get("accumulatescancache", "")) && !"scheduler".equals(post.get("rescan", ""))) {

@ -202,7 +202,7 @@ public class Scanner extends Thread {
/*for (Runner r: runner.keySet()) { /*for (Runner r: runner.keySet()) {
if (r.age() > 3000) synchronized(r) { r.interrupt(); } if (r.age() > 3000) synchronized(r) { r.interrupt(); }
}*/ }*/
if (runner.size() >= this.runnerCount) Thread.sleep(30); if (runner.size() >= this.runnerCount) Thread.sleep(20);
} }
Runner runner = new Runner(uri); Runner runner = new Runner(uri);
this.runner.put(runner, PRESENT); this.runner.put(runner, PRESENT);

Loading…
Cancel
Save