proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
see http://seclists.org/nmap-dev/2013/q4/168
Move some includes out of nmap.h: nmap.h gets included lots of places,
and unconditionally included math.h, ctype.h, errno.h, stdio.h,
sys/stat.h, fcntl.h, sys/types.h, and stdarg.h. This commit moves those
includes into the .cc files where they are necessary and out of nmap.h
Remove redundant include global_structures.h, included from nmap.h
Removed redundant code included from nmap.h
Removing #include nbase.h when nmap.h is included (redundant)
Remove duplicate #include lines
Add ifndef guards to a few .h files
for file in `grep "* including the terms and conditions of this license text as well. \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well. \*/* including the terms and conditions of this license text as well. */g" -i $file; done
Setting --min-parallelism without also setting --max-parallelism would
force the max parallelism to the same value. So, for example,
--min-parallelism=1 would also limit the max parallelism to 1. This
patch, based on one by Chris Woodbury, allows the max parallelism to
rise above this minimum, up to the maximum defined by each scan phase.
Previously the "delta" variable, representing the measured rtt, was
cobbered in place to be srtt - delta in one branch. This was confusing
when a later output message printed "delta", which could have a
different meaning depending on which path was taken.
were intended to be. We are okay to print if
1. We don't have a completion time estimate yet; or
2. We have passed the last completion time estimate; or
3. The estimated time remaining differs from the last one printed by more
than 3 minutes, and the difference accounts for more than 5% of the
estimated total time.
The problem was that the last printed time remaining was calculated not as
difftime(last_est.tv_sec, last_print.tv_sec), but as
difftime(last_est.tv_sec, now->tv_sec). In other words it was constantly
changing, and at the same rate as the estimated time left (if the scan was
progressing at a constant rate). That means that as soon as a completion time
estimate was fairly accurate, you would not get any more estimates because the
difference in the two times would always be small.