declare proper return types for funcs and move helpme() up before its first usage

This commit is contained in:
Mike Frysinger 2009-03-06 01:46:51 +00:00
parent b7c6c3c10e
commit e89203975b
1 changed files with 44 additions and 41 deletions

View File

@ -952,6 +952,7 @@ dol_err:
Use the time delay between writes if given, otherwise use the "tcp ping"
trick for getting the RTT. [I got that idea from pluvius, and warped it.]
Return either the original fd, or clean up and return -1. */
int
udptest (fd, where)
int fd;
IA * where;
@ -1298,8 +1299,51 @@ Debug (("wrote %d to net, errno %d", rr, errno))
return (0);
} /* readwrite */
#ifdef HAVE_HELP /* unless we wanna be *really* cryptic */
/* helpme :
the obvious */
void
helpme()
{
o_verbose = 1;
holler ("[v1.10]\n\
connect to somewhere: nc [-options] hostname port[s] [ports] ... \n\
listen for inbound: nc -l -p port [-options] [hostname] [port]\n\
options:");
/* sigh, this necessarily gets messy. And the trailing \ characters may be
interpreted oddly by some compilers, generating or not generating extra
newlines as they bloody please. u-fix... */
#ifdef GAPING_SECURITY_HOLE /* needs to be separate holler() */
holler ("\
-e prog program to exec after connect [dangerous!!]");
#endif
holler ("\
-g gateway source-routing hop point[s], up to 8\n\
-G num source-routing pointer: 4, 8, 12, ...\n\
-h this cruft\n\
-i secs delay interval for lines sent, ports scanned\n\
-l listen mode, for inbound connects\n\
-n numeric-only IP addresses, no DNS\n\
-o file hex dump of traffic\n\
-p port local port number\n\
-r randomize local and remote ports\n\
-s addr local source address");
#ifdef TELNET
holler ("\
-t answer TELNET negotiation");
#endif
holler ("\
-u UDP mode\n\
-v verbose [use twice to be more verbose]\n\
-w secs timeout for connects and final net reads\n\
-z zero-I/O mode [used for scanning]");
bail ("port numbers can be individual or ranges: lo-hi [inclusive]");
} /* helpme */
#endif /* HAVE_HELP */
/* main :
now we pull it all together... */
int
main (argc, argv)
int argc;
char ** argv;
@ -1632,45 +1676,4 @@ Debug (("netfd %d from port %d to port %d", netfd, ourport, curport))
exit (0); /* otherwise, we're just done */
} /* main */
#ifdef HAVE_HELP /* unless we wanna be *really* cryptic */
/* helpme :
the obvious */
helpme()
{
o_verbose = 1;
holler ("[v1.10]\n\
connect to somewhere: nc [-options] hostname port[s] [ports] ... \n\
listen for inbound: nc -l -p port [-options] [hostname] [port]\n\
options:");
/* sigh, this necessarily gets messy. And the trailing \ characters may be
interpreted oddly by some compilers, generating or not generating extra
newlines as they bloody please. u-fix... */
#ifdef GAPING_SECURITY_HOLE /* needs to be separate holler() */
holler ("\
-e prog program to exec after connect [dangerous!!]");
#endif
holler ("\
-g gateway source-routing hop point[s], up to 8\n\
-G num source-routing pointer: 4, 8, 12, ...\n\
-h this cruft\n\
-i secs delay interval for lines sent, ports scanned\n\
-l listen mode, for inbound connects\n\
-n numeric-only IP addresses, no DNS\n\
-o file hex dump of traffic\n\
-p port local port number\n\
-r randomize local and remote ports\n\
-s addr local source address");
#ifdef TELNET
holler ("\
-t answer TELNET negotiation");
#endif
holler ("\
-u UDP mode\n\
-v verbose [use twice to be more verbose]\n\
-w secs timeout for connects and final net reads\n\
-z zero-I/O mode [used for scanning]");
bail ("port numbers can be individual or ranges: lo-hi [inclusive]");
} /* helpme */
#endif /* HAVE_HELP */
/* None genuine without this seal! _H*/