1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 05:09:14 +00:00

Add --max-rate to go with --min-rate.

This commit is contained in:
david
2008-07-30 00:15:57 +00:00
parent c0e4374b0f
commit 25215ce9ba
6 changed files with 87 additions and 10 deletions

View File

@@ -192,6 +192,7 @@ void NmapOps::Initialize() {
debugging = 0;
verbose = 0;
min_packet_send_rate = 0.0; /* Unset. */
max_packet_send_rate = 0.0; /* Unset. */
randomize_hosts = 0;
sendpref = PACKET_SEND_NOPREF;
spoofsource = 0;
@@ -443,6 +444,10 @@ void NmapOps::ValidateOptions() {
if (max_parallelism && min_parallelism && (min_parallelism > max_parallelism)) {
fatal("--min-parallelism=%i must be less than or equal to --max-parallelism=%i",min_parallelism,max_parallelism);
}
if (min_packet_send_rate != 0.0 && max_packet_send_rate != 0.0 && min_packet_send_rate > max_packet_send_rate) {
fatal("--min-rate=%g must be less than or equal to --max-rate=%g", min_packet_send_rate, max_packet_send_rate);
}
if (af() == AF_INET6 && (numdecoys|osscan|bouncescan|fragscan|ackscan|finscan|idlescan|ipprotscan|maimonscan|nullscan|synscan|udpscan|windowscan|xmasscan)) {
fatal("Sorry -- IPv6 support is currently only available for connect() scan (-sT), ping scan (-sP), and list scan (-sL). OS detection and decoys are also not supported with IPv6. Further support is under consideration.");