diff -r -u nmap-2.54BETA30/global_structures.h nmap-2.54BETA30IX/global_structures.h
--- nmap-2.54BETA30/global_structures.h	Fri Aug 10 07:53:07 2001
+++ nmap-2.54BETA30IX/global_structures.h	Tue Dec 18 10:28:33 2001
@@ -228,6 +228,7 @@
 struct ops /* someone took struct options, <grrr> */ {
   int debugging;
   int verbose;
+  int count;
   int randomize_hosts;
   int spoofsource; /* -S used */
   struct in_addr *source;
diff -r -u nmap-2.54BETA30/nmap.c nmap-2.54BETA30IX/nmap.c
--- nmap-2.54BETA30/nmap.c	Sun Oct 14 23:28:41 2001
+++ nmap-2.54BETA30IX/nmap.c	Tue Dec 18 10:40:56 2001
@@ -380,6 +380,7 @@
   {
     {"version", no_argument, 0, 'V'},
     {"verbose", no_argument, 0, 'v'},
+    {"count", no_argument, 0, 'c'},
     {"debug", optional_argument, 0, 'd'},
     {"help", no_argument, 0, 'h'},
     {"max_parallelism", required_argument, 0, 'M'},
@@ -770,6 +771,7 @@
       exit(0);
       break;
     case 'v': o.verbose++; break;
+    case 'c': o.count=1; break;
     }
   }
 
@@ -1563,6 +1565,7 @@
 	 "  -p <range> ports to scan.  Example range: '1-1024,1080,6666,31337'\n"
 	 "  -F Only scans ports listed in nmap-services\n"
 	 "  -v Verbose. Its use is recommended.  Use twice for greater effect.\n"
+         "  -c Counting stats\n"
 	 "  -P0 Don't ping hosts (needed to scan www.microsoft.com and others)\n"
 	 "* -Ddecoy_host1,decoy2[,...] Hide scan using many decoys\n"
 	 "  -T <Paranoid|Sneaky|Polite|Normal|Aggressive|Insane> General timing policy\n"
diff -r -u nmap-2.54BETA30/scan_engine.c nmap-2.54BETA30IX/scan_engine.c
--- nmap-2.54BETA30/scan_engine.c	Fri Aug 10 07:53:08 2001
+++ nmap-2.54BETA30IX/scan_engine.c	Tue Dec 18 10:37:27 2001
@@ -526,6 +526,8 @@
   int rawsd;
   char myname[513];
   int scanflags = 0;
+  int itimes = 0;
+  int iresends = 0;
   int victim;
   int senddelay = 0;
   pcap_t *pd = NULL;
@@ -536,6 +538,7 @@
   int  res;
   int connecterror = 0;
   int starttime;
+  int lastcheckedtime;
   struct hostent *myhostent = NULL;
   struct sockaddr_in sock;
   struct portinfo *scan = NULL,  *current, *next;
@@ -694,6 +697,7 @@
   }
 
   starttime = time(NULL);
+  lastcheckedtime = starttime;
 
   if (scantype != SYN_SCAN)
     ack_number = get_random_uint();
@@ -902,7 +906,15 @@
 	    current->state = PORT_TESTING;
 	    current->trynum = 0;
 	    /*	if (!testinglist) testinglist = current; */
-	    ss.numqueries_outstanding++;
+            if (o.count) {
+              itimes++;
+              if ( time(NULL) != lastcheckedtime ) {
+                lastcheckedtime = time(NULL);
+                log_write(LOG_STDOUT, "Tried: %5d (%d resends)      \nP/S: %8.2f ETS: %7.0f \e[28D\e[A", itimes , iresends ,  (double) ( itimes ) / ( 1 + lastcheckedtime - starttime ) , (double) ( numports - itimes + iresends ) / ( (double) itimes / ( 1 + lastcheckedtime - starttime ) ) );
+                log_flush(LOG_STDOUT);
+              }
+            }
+            ss.numqueries_outstanding++;
 	    gettimeofday(&current->sent[0], NULL);
 	    if ((scantype == SYN_SCAN) || (scantype == WINDOW_SCAN) || 
 		(scantype == ACK_SCAN)) {	  
@@ -1035,6 +1047,7 @@
 	  current->state = PORT_FRESH;
 	  current->trynum = 0;
 	  current->sd[0] = current->sd[1] = current->sd[2] = -1;
+          iresends++;
 	  if (o.debugging) { 
 	    log_write(LOG_STDOUT, "Preparing for retry, nonresponsive port %lu noted\n", current->portno); 
 	  }
@@ -1231,6 +1244,9 @@
   int tries = 0;
   int tmp = 0;
   int starttime;
+  int lastcheckedtime;
+  int itimes = 0;
+  int iresends = 0;
   u16 newport;
   int newstate = 999; /* This ought to break something if used illegally */
   struct hostent *myhostent = NULL;
@@ -1332,6 +1348,7 @@
     fatal("Unknown scan type for super_scan"); }
 
   starttime = time(NULL);
+  lastcheckedtime = starttime;
 
   if (o.debugging || o.verbose)
     log_write(LOG_STDOUT, "Initiating %s against %s (%s)\n", scantype2str(scantype), target->name, inet_ntoa(target->host));
@@ -1414,6 +1431,14 @@
 	    /* lets send a packet! */
 	    current->state = PORT_TESTING;
 	    /*	if (!testinglist) testinglist = current; */
+            if (o.count) {
+              itimes++;
+              if ( time(NULL) != lastcheckedtime ) {
+                lastcheckedtime = time(NULL);
+                log_write(LOG_STDOUT, "Tried: %5d (%d resends)      \nP/S: %8.2f ETS: %7.0f \e[28D\e[A", itimes , iresends ,  (double) itimes / ( 1 + lastcheckedtime - starttime ) , (double) ( numports - itimes + iresends ) / ( (double) ( itimes + iresends ) / ( 1 + lastcheckedtime - starttime ) ) );
+                log_flush(LOG_STDOUT);
+              }
+            }
 	    numqueries_outstanding++;
 	    gettimeofday(&current->sent[0], NULL);
 	    if (o.fragscan)
@@ -1636,6 +1661,7 @@
     for(current = openlist; current; current = (current->next >= 0)? &scan[current->next] : NULL) {
       current->state = PORT_FRESH;
       current->trynum = 0;
+      iresends++;
       if (o.debugging) { 
 	log_write(LOG_STDOUT, "Preparing for retry, open port %lu noted\n", current->portno); 
       }
