1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00
Commit Graph

63 Commits

Author SHA1 Message Date
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
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.
2014-06-18 10:18:58 +00:00
dmiller
c9714990c7 Remove trailing whitespace from C/C++ files
https://secwiki.org/w/Nmap/Code_Standards
2014-02-12 20:25:51 +00:00
d33tah
4816358475 Replace all tab characters at the beginnings of lines with 8 spaces.
Mixed indentation annoyed my vim.
2014-01-05 19:14:26 +00:00
dmiller
866db7eea3 Revert r32528, was not tested on Windows 2013-11-27 13:32:05 +00:00
dmiller
9c36367eea header file cleanup
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
2013-11-26 20:55:29 +00:00
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
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
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
fd9260276c Don't set max parallelism when only --min-paralellism is given.
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.
2012-04-07 08:07:38 +00:00
david
937d6bebef Use a separate variable for srtt - delta.
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.
2012-03-18 05:41:23 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
david
8ba1cf6b15 Factor out timing ack and drop code. 2011-12-31 21:59:57 +00:00
david
e962f1c5fe Centralize initialization of scan_performance_vars. 2011-12-31 21:59:52 +00:00
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
859ef5ecaf Merge r17202:17298 from /nmap-exp/david/nmap-xml. This brings in
structured XML output, automatic closing of XML elements on error, and
inclusion of error messages in XML output.
2010-04-14 01:05:51 +00:00
fyodor
d0e21e1d03 Suggest that people send patches to nmap-dev rather than to me directly 2009-04-15 00:37:03 +00:00
fyodor
eccc235d5a Increase copyright year to 2009, simplify/reword some derivative works text, and remove a confusing clause about selling proprietary front-ends to Nmap 2009-03-31 04:16:12 +00:00
bmenrigh
f74f2f05d7 Cast a double seconds into time_t to eliminate a compiler warning that was showing up for my x86_64 box. 2009-02-25 01:27:35 +00:00
david
e0250c1b66 Change the conditions for printing a timing status update to what I think they
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.
2009-02-11 18:56:46 +00:00
david
898c2a41a0 Clean up some ScanProgressMeter code to reduce code duplication and avoid
overflows by doing math with doubles. Based on a patch by Henri Doreau.
2009-02-11 17:50:19 +00:00
david
c2bedcf99a Fix a test against a struct timeval in ScanProgressMeter::printStatsIfNecessary.
The test was (last_print.tv_sec < 0), which is never true. I changed it to
last_print.tv_sec == 0, which checks if the last_print structure has been given
a value yet. This little bug appears not to have mattered much, because in the
else branch of the if, other calculations with an uninitialized last_est struct
seem to have resulted in a true value anyway.
2009-02-11 17:36:11 +00:00
david
6ad92e7983 Fix a small harmless typo in timing.cc. 2009-02-11 16:27:26 +00:00
david
fda214ed63 Make sure now has a value before assigning it to last_print in
ScanProgressMeter::printStats. I messed this up in r11985. Brandon reported the
problem.
2009-02-06 04:49:45 +00:00
david
02869fd83a Reintroduce the time_t local in ScanProgressMeter::printStats; it's needed for
Windows compilation.
2009-02-05 01:32:26 +00:00
david
29460cd95d Simplify and shorten the ScanProgressMeter::printStats code. 2009-02-05 00:25:25 +00:00
david
b369fd3c5b Add a patch from Henri Doreau that fixes an integer overflow in
ScanProgressMeter.
2009-02-04 23:24:49 +00:00
david
90ba6b97d0 Merge from /nmap-exp/david/nmap-perf. A summary of changes:
Don't make a host the global ping host until it moves to the completed
hosts list, and only change the global ping probe if the new probe is no
worse than the old (according to pingprobe_is_better).

Restore the ping magnifier for host congestion window updates.

Ignore the timing of certain ICMP errors that are likely to be rate
limited and don't change the port or host state. Avoid making timing
pings out of probes that elicit such errors. This used to be done only
for port scans and only at -T4 and above (and didn't prohibit the
creation of timing pings). Now it is done for host discovery too, and at
all timing levels.

Gracefully handle updates from the recent past in RateMeter. Doesn't
affect performance, but avoids a rare assertion failure.
2009-01-08 22:54:07 +00:00
david
9fe196bb0b o Fixed a division by zero error in the packet rate measuring code
that could cause a display of infinity packets per seconds near the
  start of a scan. [Jah]
2008-12-17 02:48:14 +00:00
david
c561222685 Fix spelling in some identifiers. wierd_responses -> weird_responses,
printStatsIfNeccessary -> printStatsIfNecessary.
2008-12-04 17:04:48 +00:00
david
4df1143f2b Fix a diagnostic format string. It was printing a signed long as if it were
unsigned. I got
adjust_timeouts2: packet supposedly had rtt of 18446744073707362535 microseconds.  Ignoring time.
on a 64-bit machine. (18446744073707362535 is 2 ** 64 - 2189081.)
2008-11-07 01:47:33 +00:00
fyodor
d16e94534f Removed a comment which simply declared /* WANKER ALERT! */ for no good reason. 2008-09-26 06:41:05 +00:00
david
debfc5f683 Change RateMeter to be more general, measuring just one quantity. Add a
PacketRateMeter specialized for measuring packet and byte rates, and use that
in scan_engine.cc.
2008-08-16 01:05:11 +00:00
fyodor
338a19ba4f updated to allow RateMeter::update to accept time decreases up to 5ms rather than a 1ms limit, as I just had a crash where now=1217210189.144224; last_update_tv=1217210189.148486. I still think this may be a bug in my SMP Linux kernel. But if it affects me, probably affects others. 2008-07-28 03:34:19 +00:00
david
625d88293e Avoid showing the sending rate in bytes per second if no sent bytes have been
recorded. This applies during a TCP connect scan, where we have a count of
packets sent but not of bytes (which we cannot measure, and will vary from
platform to platform).
2008-07-23 22:21:37 +00:00
fyodor
a1c363b84a RateMeter::update() used to abort if the new time was earlier than the old time. But on my SMP Linux 2.6.20 system, I've been doing large-scale scanning and I'm getting very occasional values like "now=1214173867.8027; last_update_tv=1214173867.8065". Unless I'm missing something, I think my gettimeofday may have decreased by 38 microseconds. Perhaps due to SMP and the old kernel. Anyway, I changed it so that decreases of up to 1 millisecond just give a warning (one-time) rather than abort Nmap. 2008-06-23 00:56:49 +00:00
fyodor
726febac7c add extra debugging information to an error case -- trying to track down a host discovery crash (abort) 2008-06-22 21:20:10 +00:00
fyodor
779b96a197 trivial copyright text tweak: filename nmap-os-fingerprints has changed to nmap-os-db 2008-05-22 20:45:32 +00:00
fyodor
10b54b773b minor license template updates from Kris--fix gnu.org link to GPLv2 (moved) and openssl license filename (COPYING.OpenSSL) 2008-05-05 04:10:00 +00:00
david
6982bacef5 Change a variable name and space out RateMeter::update to make it easier to understand. 2008-04-24 20:32:47 +00:00
david
5a8e417c0c Rewrite some RateMeter code to avoid an integer overflow reported by Kris. 2008-04-24 18:44:02 +00:00
fyodor
5551c5a311 o Fixed a bunch of code to avoid compilation warning messages (at
least on some Linux machines) [Andrew J. Bennieston]
2008-04-09 02:11:20 +00:00
david
feab94ebd3 Merge the minimum-rate scanning feature (--min-rate) from
/nmap-exp/david/nmap-fixed-rate.
2008-03-26 02:41:32 +00:00
fyodor
1accc12fb2 fix typo in legal header found by Leigh Zhao (missing word: of) 2008-02-28 18:52:06 +00:00
fyodor
29c912f394 URL change from http://insecure.org/nmap/* to http://nmap.org/* 2008-01-17 07:22:03 +00:00
fyodor
8220c8a42f update copyright line at the top of files from 1996-2006 to 1996-2008 2007-12-22 06:32:03 +00:00
fyodor
6c06f51bd7 merge soc07 r5100 - Changing fprintf(stderr, )'s to error()'s (or fatal() if followed by and exit()). Besides providing consistency, this also allows more errors to actually be logged with --log-errors. 2007-08-11 05:16:56 +00:00