version 1.110, 2013/03/12 02:57:37 |
version 1.111, 2013/03/20 09:27:56 |
|
|
unsigned int iflag; /* Interval Flag */ |
unsigned int iflag; /* Interval Flag */ |
int kflag; /* More than one connect */ |
int kflag; /* More than one connect */ |
int lflag; /* Bind to local port */ |
int lflag; /* Bind to local port */ |
|
int Nflag; /* shutdown() network socket */ |
int nflag; /* Don't do name look up */ |
int nflag; /* Don't do name look up */ |
char *Pflag; /* Proxy username */ |
char *Pflag; /* Proxy username */ |
char *pflag; /* Localport flag */ |
char *pflag; /* Localport flag */ |
|
|
sv = NULL; |
sv = NULL; |
|
|
while ((ch = getopt(argc, argv, |
while ((ch = getopt(argc, argv, |
"46DdhI:i:klnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { |
"46DdhI:i:klNnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { |
switch (ch) { |
switch (ch) { |
case '4': |
case '4': |
family = AF_INET; |
family = AF_INET; |
|
|
case 'l': |
case 'l': |
lflag = 1; |
lflag = 1; |
break; |
break; |
|
case 'N': |
|
Nflag = 1; |
|
break; |
case 'n': |
case 'n': |
nflag = 1; |
nflag = 1; |
break; |
break; |
|
|
if ((n = read(wfd, buf, plen)) < 0) |
if ((n = read(wfd, buf, plen)) < 0) |
return; |
return; |
else if (n == 0) { |
else if (n == 0) { |
shutdown(nfd, SHUT_WR); |
if (Nflag) |
|
shutdown(nfd, SHUT_WR); |
pfd[1].fd = -1; |
pfd[1].fd = -1; |
pfd[1].events = 0; |
pfd[1].events = 0; |
} else { |
} else { |
|
|
\t-i secs\t Delay interval for lines sent, ports scanned\n\ |
\t-i secs\t Delay interval for lines sent, ports scanned\n\ |
\t-k Keep inbound sockets open for multiple connects\n\ |
\t-k Keep inbound sockets open for multiple connects\n\ |
\t-l Listen mode, for inbound connects\n\ |
\t-l Listen mode, for inbound connects\n\ |
|
\t-N Shutdown the network socket after EOF on stdin\n\ |
\t-n Suppress name/port resolutions\n\ |
\t-n Suppress name/port resolutions\n\ |
\t-O length TCP send buffer length\n\ |
\t-O length TCP send buffer length\n\ |
\t-P proxyuser\tUsername for proxy authentication\n\ |
\t-P proxyuser\tUsername for proxy authentication\n\ |
|
|
usage(int ret) |
usage(int ret) |
{ |
{ |
fprintf(stderr, |
fprintf(stderr, |
"usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" |
"usage: nc [-46DdhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" |
"\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" |
"\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" |
"\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" |
"\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" |
"\t [-x proxy_address[:port]] [destination] [port]\n"); |
"\t [-x proxy_address[:port]] [destination] [port]\n"); |