diff options
author | jeremy <> | 2011-01-09 22:16:46 +0000 |
---|---|---|
committer | jeremy <> | 2011-01-09 22:16:46 +0000 |
commit | d3c652ff017fa6f88b4f612912306f2529cfb213 (patch) | |
tree | 2f77324cb63f86865bf8a318c24675517bdec589 | |
parent | 4d7b7131e400dc1324f2daa39f007c5ac043b349 (diff) | |
download | openbsd-d3c652ff017fa6f88b4f612912306f2529cfb213.tar.gz openbsd-d3c652ff017fa6f88b4f612912306f2529cfb213.tar.bz2 openbsd-d3c652ff017fa6f88b4f612912306f2529cfb213.zip |
Minor tweaks to nc(1) man page and usage.
OK jmc@, nicm@, tedu@
-rw-r--r-- | src/usr.bin/nc/nc.1 | 33 | ||||
-rw-r--r-- | src/usr.bin/nc/netcat.c | 6 |
2 files changed, 23 insertions, 16 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1 index 8745528040..f9bd5b153e 100644 --- a/src/usr.bin/nc/nc.1 +++ b/src/usr.bin/nc/nc.1 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: nc.1,v 1.56 2011/01/08 00:44:19 jeremy Exp $ | 1 | .\" $OpenBSD: nc.1,v 1.57 2011/01/09 22:16:46 jeremy Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1996 David Sacerdote | 3 | .\" Copyright (c) 1996 David Sacerdote |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -25,7 +25,7 @@ | |||
25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | .\" | 27 | .\" |
28 | .Dd $Mdocdate: January 8 2011 $ | 28 | .Dd $Mdocdate: January 9 2011 $ |
29 | .Dt NC 1 | 29 | .Dt NC 1 |
30 | .Os | 30 | .Os |
31 | .Sh NAME | 31 | .Sh NAME |
@@ -40,7 +40,7 @@ | |||
40 | .Op Fl O Ar length | 40 | .Op Fl O Ar length |
41 | .Op Fl P Ar proxy_username | 41 | .Op Fl P Ar proxy_username |
42 | .Op Fl p Ar source_port | 42 | .Op Fl p Ar source_port |
43 | .Op Fl s Ar source_ip_address | 43 | .Op Fl s Ar source |
44 | .Op Fl T Ar ToS | 44 | .Op Fl T Ar ToS |
45 | .Op Fl V Ar rtable | 45 | .Op Fl V Ar rtable |
46 | .Op Fl w Ar timeout | 46 | .Op Fl w Ar timeout |
@@ -49,7 +49,7 @@ | |||
49 | .Fl x Ar proxy_address Ns Oo : Ns | 49 | .Fl x Ar proxy_address Ns Oo : Ns |
50 | .Ar port Oc | 50 | .Ar port Oc |
51 | .Xc Oc | 51 | .Xc Oc |
52 | .Op Ar hostname | 52 | .Op Ar destination |
53 | .Op Ar port | 53 | .Op Ar port |
54 | .Ek | 54 | .Ek |
55 | .Sh DESCRIPTION | 55 | .Sh DESCRIPTION |
@@ -57,8 +57,10 @@ The | |||
57 | .Nm | 57 | .Nm |
58 | (or | 58 | (or |
59 | .Nm netcat ) | 59 | .Nm netcat ) |
60 | utility is used for just about anything under the sun involving TCP | 60 | utility is used for just about anything under the sun involving TCP, |
61 | or UDP. | 61 | UDP, or |
62 | .Ux Ns -domain | ||
63 | sockets. | ||
62 | It can open TCP connections, send UDP packets, listen on arbitrary | 64 | It can open TCP connections, send UDP packets, listen on arbitrary |
63 | TCP and UDP ports, do port scanning, and deal with both IPv4 and | 65 | TCP and UDP ports, do port scanning, and deal with both IPv4 and |
64 | IPv6. | 66 | IPv6. |
@@ -153,7 +155,7 @@ instead of sequentially within a range or in the order that the system | |||
153 | assigns them. | 155 | assigns them. |
154 | .It Fl S | 156 | .It Fl S |
155 | Enables the RFC 2385 TCP MD5 signature option. | 157 | Enables the RFC 2385 TCP MD5 signature option. |
156 | .It Fl s Ar source_ip_address | 158 | .It Fl s Ar source |
157 | Specifies the IP of the interface which is used to send the packets. | 159 | Specifies the IP of the interface which is used to send the packets. |
158 | For | 160 | For |
159 | .Ux Ns -domain | 161 | .Ux Ns -domain |
@@ -234,7 +236,7 @@ If the protocol is not specified, SOCKS version 5 is used. | |||
234 | Requests that | 236 | Requests that |
235 | .Nm | 237 | .Nm |
236 | should connect to | 238 | should connect to |
237 | .Ar hostname | 239 | .Ar destination |
238 | using a proxy at | 240 | using a proxy at |
239 | .Ar proxy_address | 241 | .Ar proxy_address |
240 | and | 242 | and |
@@ -252,16 +254,22 @@ It is an error to use this option in conjunction with the | |||
252 | option. | 254 | option. |
253 | .El | 255 | .El |
254 | .Pp | 256 | .Pp |
255 | .Ar hostname | 257 | .Ar destination |
256 | can be a numerical IP address or a symbolic hostname | 258 | can be a numerical IP address or a symbolic hostname |
257 | (unless the | 259 | (unless the |
258 | .Fl n | 260 | .Fl n |
259 | option is given). | 261 | option is given). |
260 | In general, a hostname must be specified, | 262 | In general, a destination must be specified, |
261 | unless the | 263 | unless the |
262 | .Fl l | 264 | .Fl l |
263 | option is given | 265 | option is given |
264 | (in which case the local host is used). | 266 | (in which case the local host is used). |
267 | For | ||
268 | .Ux Ns -domain | ||
269 | sockets, a destination is required and is the socket path to connect to | ||
270 | (or listen on if the | ||
271 | .Fl l | ||
272 | option is given). | ||
265 | .Pp | 273 | .Pp |
266 | .Ar port | 274 | .Ar port |
267 | can be a single integer or a range of ports. | 275 | can be a single integer or a range of ports. |
@@ -270,8 +278,7 @@ In general, | |||
270 | a destination port must be specified, | 278 | a destination port must be specified, |
271 | unless the | 279 | unless the |
272 | .Fl U | 280 | .Fl U |
273 | option is given | 281 | option is given. |
274 | (in which case a socket must be specified). | ||
275 | .Sh CLIENT/SERVER MODEL | 282 | .Sh CLIENT/SERVER MODEL |
276 | It is quite simple to build a very basic client/server model using | 283 | It is quite simple to build a very basic client/server model using |
277 | .Nm . | 284 | .Nm . |
@@ -404,7 +411,7 @@ IP for the local end of the connection: | |||
404 | .Pp | 411 | .Pp |
405 | Create and listen on a | 412 | Create and listen on a |
406 | .Ux Ns -domain | 413 | .Ux Ns -domain |
407 | socket: | 414 | stream socket: |
408 | .Pp | 415 | .Pp |
409 | .Dl $ nc -lU /var/tmp/dsocket | 416 | .Dl $ nc -lU /var/tmp/dsocket |
410 | .Pp | 417 | .Pp |
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 7b9fe41ba4..5c81e43e85 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.99 2011/01/08 00:44:19 jeremy Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * | 4 | * |
@@ -930,9 +930,9 @@ usage(int ret) | |||
930 | { | 930 | { |
931 | fprintf(stderr, | 931 | fprintf(stderr, |
932 | "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" | 932 | "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" |
933 | "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" | 933 | "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" |
934 | "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" | 934 | "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" |
935 | "\t [-x proxy_address[:port]] [hostname] [port]\n"); | 935 | "\t [-x proxy_address[:port]] [destination] [port]\n"); |
936 | if (ret) | 936 | if (ret) |
937 | exit(1); | 937 | exit(1); |
938 | } | 938 | } |