1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Remove some unused function parameters.

This commit is contained in:
david
2011-06-14 02:29:39 +00:00
parent 36af9da175
commit 87d9c4ba69
3 changed files with 14 additions and 20 deletions

14
nmap.cc
View File

@@ -220,7 +220,7 @@ static int parse_bounce_argument(struct ftpinfo *ftp, char *url) {
return 1; return 1;
} }
static void printusage(char *name, int rc) { static void printusage(int rc) {
printf("%s %s ( %s )\n" printf("%s %s ( %s )\n"
"Usage: nmap [Scan Type(s)] [Options] {target specification}\n" "Usage: nmap [Scan Type(s)] [Options] {target specification}\n"
@@ -645,7 +645,7 @@ int nmap_main(int argc, char *argv[]) {
} }
fakeargv[argc] = NULL; fakeargv[argc] = NULL;
if (argc < 2 ) printusage(argv[0], -1); if (argc < 2 ) printusage(-1);
Targets.reserve(100); Targets.reserve(100);
#ifdef WIN32 #ifdef WIN32
@@ -1040,8 +1040,8 @@ int nmap_main(int argc, char *argv[]) {
o.magic_port_set = 1; o.magic_port_set = 1;
if (o.magic_port == 0) error("WARNING: a source port of zero may not work on all systems."); if (o.magic_port == 0) error("WARNING: a source port of zero may not work on all systems.");
break; break;
case 'h': printusage(argv[0], 0); break; case 'h': printusage(0); break;
case '?': printusage(argv[0], -1); break; case '?': printusage(-1); break;
case 'I': case 'I':
error("WARNING: identscan (-I) no longer supported. Ignoring -I"); error("WARNING: identscan (-I) no longer supported. Ignoring -I");
break; break;
@@ -1196,7 +1196,7 @@ int nmap_main(int argc, char *argv[]) {
case 's': case 's':
if (!*optarg) { 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)"); 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; p = optarg;
while(*p) { while(*p) {
@@ -1228,7 +1228,7 @@ int nmap_main(int argc, char *argv[]) {
case 'X': o.xmasscan++; break; case 'X': o.xmasscan++; break;
case 'Y': o.sctpinitscan = 1; break; case 'Y': o.sctpinitscan = 1; break;
case 'Z': o.sctpcookieechoscan = 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++; p++;
} }
@@ -1573,7 +1573,7 @@ int nmap_main(int argc, char *argv[]) {
/* Before we randomize the ports scanned, lets output them to machine /* Before we randomize the ports scanned, lets output them to machine
parseable output */ parseable output */
if (o.verbose) 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 */ /* more fakeargv junk, BTW malloc'ing extra space in argv[0] doesn't work */
if (quashargv) { if (quashargv) {

View File

@@ -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 /* Output the list of ports scanned to the top of machine parseable
logs (in a comment, unfortunately). The items in ports should be logs (in a comment, unfortunately). The items in ports should be
in sequential order for space savings and easier to read output */ in sequential order for space savings and easier to read output */
void output_ports_to_machine_parseable_output(struct scan_lists *ports, void output_ports_to_machine_parseable_output(struct scan_lists *ports) {
int tcpscan, int udpscan,
int sctpscan, int protscan) {
int tcpportsscanned = ports->tcp_count; int tcpportsscanned = ports->tcp_count;
int udpportsscanned = ports->udp_count; int udpportsscanned = ports->udp_count;
int sctpportsscanned = ports->sctp_count; int sctpportsscanned = ports->sctp_count;
@@ -1338,7 +1336,7 @@ void write_host_header(Target *currenths) {
log_write(LOG_PLAIN, "]\n"); log_write(LOG_PLAIN, "]\n");
} }
} }
write_host_status(currenths, o.resolve_all); write_host_status(currenths);
if (currenths->TargetName() != NULL if (currenths->TargetName() != NULL
&& currenths->resolved_addrs.size() > 1) { && currenths->resolved_addrs.size() > 1) {
std::list<struct sockaddr_storage>::iterator it; std::list<struct sockaddr_storage>::iterator it;
@@ -1362,9 +1360,8 @@ void write_host_header(Target *currenths) {
/* Writes host status info to the log streams (including STDOUT). An /* 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 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 machine log. */
for all hosts (even down ones) to be resolved */ void write_host_status(Target *currenths) {
void write_host_status(Target *currenths, int resolve_all) {
if (o.listscan) { if (o.listscan) {
/* write "unknown" to machine and xml */ /* write "unknown" to machine and xml */
log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Unknown\n", log_write(LOG_MACHINE, "Host: %s (%s)\tStatus: Unknown\n",

View File

@@ -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 /* Output the list of ports scanned to the top of machine parseable
logs (in a comment, unfortunately). The items in ports should be logs (in a comment, unfortunately). The items in ports should be
in sequential order for space savings and easier to read output */ in sequential order for space savings and easier to read output */
void output_ports_to_machine_parseable_output(struct scan_lists *ports, void output_ports_to_machine_parseable_output(struct scan_lists *ports);
int tcpscan, int udpscan,
int sctpscan, int protscan);
/* Return a std::string containing all n strings separated by whitespace, and /* Return a std::string containing all n strings separated by whitespace, and
individually quoted if needed. */ 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 /* 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 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 machine log. */
for all hosts (even down ones) to be resolved */ void write_host_status(Target *currenths);
void write_host_status(Target *currenths, int resolve_all);
/* Prints the formatted OS Scan output to stdout, logfiles, etc (but only /* Prints the formatted OS Scan output to stdout, logfiles, etc (but only
if an OS Scan was performed */ if an OS Scan was performed */