summaryrefslogtreecommitdiff
path: root/usr.bin/nc
diff options
context:
space:
mode:
authorJeremy Evans <jeremy@cvs.openbsd.org>2011-01-09 22:16:47 +0000
committerJeremy Evans <jeremy@cvs.openbsd.org>2011-01-09 22:16:47 +0000
commit37bd8526a8031bf56e9dd935f5244dcca088c5cd (patch)
tree76656413ca13a38d0d7c9e1bb15334f2d97b2379 /usr.bin/nc
parentf7ce9c3a5652c25ce851a15a51bfb99ad5c2a7ff (diff)
Minor tweaks to nc(1) man page and usage.
OK jmc@, nicm@, tedu@
Diffstat (limited to 'usr.bin/nc')
-rw-r--r--usr.bin/nc/nc.133
-rw-r--r--usr.bin/nc/netcat.c6
2 files changed, 23 insertions, 16 deletions
diff --git a/usr.bin/nc/nc.1 b/usr.bin/nc/nc.1
index 8745528040b..f9bd5b153ea 100644
--- a/usr.bin/nc/nc.1
+++ b/usr.bin/nc/nc.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: nc.1,v 1.56 2011/01/08 00:44:19 jeremy Exp $
+.\" $OpenBSD: nc.1,v 1.57 2011/01/09 22:16:46 jeremy Exp $
.\"
.\" Copyright (c) 1996 David Sacerdote
.\" All rights reserved.
@@ -25,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 8 2011 $
+.Dd $Mdocdate: January 9 2011 $
.Dt NC 1
.Os
.Sh NAME
@@ -40,7 +40,7 @@
.Op Fl O Ar length
.Op Fl P Ar proxy_username
.Op Fl p Ar source_port
-.Op Fl s Ar source_ip_address
+.Op Fl s Ar source
.Op Fl T Ar ToS
.Op Fl V Ar rtable
.Op Fl w Ar timeout
@@ -49,7 +49,7 @@
.Fl x Ar proxy_address Ns Oo : Ns
.Ar port Oc
.Xc Oc
-.Op Ar hostname
+.Op Ar destination
.Op Ar port
.Ek
.Sh DESCRIPTION
@@ -57,8 +57,10 @@ The
.Nm
(or
.Nm netcat )
-utility is used for just about anything under the sun involving TCP
-or UDP.
+utility is used for just about anything under the sun involving TCP,
+UDP, or
+.Ux Ns -domain
+sockets.
It can open TCP connections, send UDP packets, listen on arbitrary
TCP and UDP ports, do port scanning, and deal with both IPv4 and
IPv6.
@@ -153,7 +155,7 @@ instead of sequentially within a range or in the order that the system
assigns them.
.It Fl S
Enables the RFC 2385 TCP MD5 signature option.
-.It Fl s Ar source_ip_address
+.It Fl s Ar source
Specifies the IP of the interface which is used to send the packets.
For
.Ux Ns -domain
@@ -234,7 +236,7 @@ If the protocol is not specified, SOCKS version 5 is used.
Requests that
.Nm
should connect to
-.Ar hostname
+.Ar destination
using a proxy at
.Ar proxy_address
and
@@ -252,16 +254,22 @@ It is an error to use this option in conjunction with the
option.
.El
.Pp
-.Ar hostname
+.Ar destination
can be a numerical IP address or a symbolic hostname
(unless the
.Fl n
option is given).
-In general, a hostname must be specified,
+In general, a destination must be specified,
unless the
.Fl l
option is given
(in which case the local host is used).
+For
+.Ux Ns -domain
+sockets, a destination is required and is the socket path to connect to
+(or listen on if the
+.Fl l
+option is given).
.Pp
.Ar port
can be a single integer or a range of ports.
@@ -270,8 +278,7 @@ In general,
a destination port must be specified,
unless the
.Fl U
-option is given
-(in which case a socket must be specified).
+option is given.
.Sh CLIENT/SERVER MODEL
It is quite simple to build a very basic client/server model using
.Nm .
@@ -404,7 +411,7 @@ IP for the local end of the connection:
.Pp
Create and listen on a
.Ux Ns -domain
-socket:
+stream socket:
.Pp
.Dl $ nc -lU /var/tmp/dsocket
.Pp
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index 7b9fe41ba46..5c81e43e859 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.99 2011/01/08 00:44:19 jeremy Exp $ */
+/* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -930,9 +930,9 @@ usage(int ret)
{
fprintf(stderr,
"usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n"
- "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-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 [-x proxy_address[:port]] [hostname] [port]\n");
+ "\t [-x proxy_address[:port]] [destination] [port]\n");
if (ret)
exit(1);
}