diff --git a/nmap.cc b/nmap.cc index 2d449c8de..1d38e5f59 100644 --- a/nmap.cc +++ b/nmap.cc @@ -220,7 +220,7 @@ static int parse_bounce_argument(struct ftpinfo *ftp, char *url) { return 1; } -static void printusage(char *name, int rc) { +static void printusage(int rc) { printf("%s %s ( %s )\n" "Usage: nmap [Scan Type(s)] [Options] {target specification}\n" @@ -645,7 +645,7 @@ int nmap_main(int argc, char *argv[]) { } fakeargv[argc] = NULL; - if (argc < 2 ) printusage(argv[0], -1); + if (argc < 2 ) printusage(-1); Targets.reserve(100); #ifdef WIN32 @@ -1040,8 +1040,8 @@ int nmap_main(int argc, char *argv[]) { o.magic_port_set = 1; if (o.magic_port == 0) error("WARNING: a source port of zero may not work on all systems."); break; - case 'h': printusage(argv[0], 0); break; - case '?': printusage(argv[0], -1); break; + case 'h': printusage(0); break; + case '?': printusage(-1); break; case 'I': error("WARNING: identscan (-I) no longer supported. Ignoring -I"); break; @@ -1196,7 +1196,7 @@ int nmap_main(int argc, char *argv[]) { case 's': if (!*optarg) { error("An option is required for -s, most common are -sT (tcp scan), -sS (SYN scan), -sF (FIN scan), -sU (UDP scan) and -sn (Ping scan)"); - printusage(argv[0], -1); + printusage(-1); } p = optarg; while(*p) { @@ -1228,7 +1228,7 @@ int nmap_main(int argc, char *argv[]) { case 'X': o.xmasscan++; break; case 'Y': o.sctpinitscan = 1; break; case 'Z': o.sctpcookieechoscan = 1; break; - default: error("Scantype %c not supported\n",*p); printusage(argv[0], -1); break; + default: error("Scantype %c not supported\n",*p); printusage(-1); break; } p++; } @@ -1573,7 +1573,7 @@ int nmap_main(int argc, char *argv[]) { /* Before we randomize the ports scanned, lets output them to machine parseable output */ if (o.verbose) - output_ports_to_machine_parseable_output(&ports, o.TCPScan(), o.UDPScan(), o.SCTPScan(), o.ipprotscan); + output_ports_to_machine_parseable_output(&ports); /* more fakeargv junk, BTW malloc'ing extra space in argv[0] doesn't work */ if (quashargv) { diff --git a/output.cc b/output.cc index 1adbc8e8c..80e00891c 100644 --- a/output.cc +++ b/output.cc @@ -1109,9 +1109,7 @@ static void output_rangelist_given_ports(int logt, unsigned short *ports, /* Output the list of ports scanned to the top of machine parseable logs (in a comment, unfortunately). The items in ports should be in sequential order for space savings and easier to read output */ -void output_ports_to_machine_parseable_output(struct scan_lists *ports, - int tcpscan, int udpscan, - int sctpscan, int protscan) { +void output_ports_to_machine_parseable_output(struct scan_lists *ports) { int tcpportsscanned = ports->tcp_count; int udpportsscanned = ports->udp_count; int sctpportsscanned = ports->sctp_count; @@ -1338,7 +1336,7 @@ void write_host_header(Target *currenths) { log_write(LOG_PLAIN, "]\n"); } } - write_host_status(currenths, o.resolve_all); + write_host_status(currenths); if (currenths->TargetName() != NULL && currenths->resolved_addrs.size() > 1) { std::list::iterator it; @@ -1362,9 +1360,8 @@ void write_host_header(Target *currenths) { /* Writes host status info to the log streams (including STDOUT). An example is "Host: 10.11.12.13 (foo.bar.example.com)\tStatus: Up\n" to - machine log. resolve_all should be passed nonzero if the user asked - for all hosts (even down ones) to be resolved */ -void write_host_status(Target *currenths, int resolve_all) { + machine log. */ +void write_host_status(Target *currenths) { if (o.listscan) { /* write "unknown" to machine and xml */ log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Unknown\n", diff --git a/output.h b/output.h index a7d39854a..b2f9394c6 100644 --- a/output.h +++ b/output.h @@ -188,9 +188,7 @@ int log_open(int logt, int append, char *filename); /* Output the list of ports scanned to the top of machine parseable logs (in a comment, unfortunately). The items in ports should be in sequential order for space savings and easier to read output */ -void output_ports_to_machine_parseable_output(struct scan_lists *ports, - int tcpscan, int udpscan, - int sctpscan, int protscan); +void output_ports_to_machine_parseable_output(struct scan_lists *ports); /* Return a std::string containing all n strings separated by whitespace, and individually quoted if needed. */ @@ -207,9 +205,8 @@ void write_host_header(Target *currenths); /* Writes host status info to the log streams (including STDOUT). An example is "Host: 10.11.12.13 (foo.bar.example.com)\tStatus: Up\n" to - machine log. resolve_all should be passed nonzero if the user asked - for all hosts (even down ones) to be resolved */ -void write_host_status(Target *currenths, int resolve_all); + machine log. */ +void write_host_status(Target *currenths); /* Prints the formatted OS Scan output to stdout, logfiles, etc (but only if an OS Scan was performed */