Commit Graph

34 Commits

Author SHA1 Message Date
Mark Johnston
5c346ead18 Adjust .Dd, missed in r363084.
MFC with:	r363084
2020-07-10 19:58:07 +00:00
Mark Johnston
d041589227 Add a --sctp flag to nc.
The change adds an SCTP mode akin to UDP mode.  This is handy for doing
smoke testing of SCTP.

Use a long option to minimize the risk of option conflicts with OpenBSD.
For bonus points, this change unbreaks --no-tcpopt by adding a missing
case required by getopt_long().

Reviewed by:	delphij, tuexen
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25610
2020-07-10 19:54:04 +00:00
Edward Tomasz Napierala
1e62ecedf2 Add -M option to nc(1), which makes it print the TCP connection
statistics obtained with stats(3) in JSON format to standard error.

Reviewed by:	allanjude, thj, cem (earlier version)
Tested by:	thj
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D21324
2019-12-14 10:53:52 +00:00
Xin LI
100e2a06e2 MFV r288243: nc from OpenBSD 5.8. 2015-09-27 07:04:16 +00:00
Xin LI
3ae0125a99 MFV r258194-264360: nc(1) from OpenBSD 5.5.
MFC after:	2 weeks
2014-04-11 22:12:31 +00:00
Xin LI
5abd6fdcfa MFV: netcat from OpenBSD 5.4.
No functional change.
2013-11-15 22:45:14 +00:00
Xin LI
0772266e63 MFV r249496,249498. The most visible change is that we no longer shuts
down the connection when stdin closes, by default.  This matches Hobbit's
original netcat and GNU netcat.

Old behavior can be restored with the new -N flag.

MFC after:	2 weeks
2013-04-15 05:31:59 +00:00
Xin LI
52dba105d2 MFV: netcat from OpenBSD 5.2.
MFC after:	1 month
2012-10-22 18:56:31 +00:00
Xin LI
ac3ea9104e Merge from OpenBSD 5.1.
MFC after:	3 weeks
2012-05-04 21:03:39 +00:00
Xin LI
59c7ad52aa MFV: nc(1) from OpenBSD 4.9.
MFC after:	1 month
Obtained from:	OpenBSD
2011-05-11 21:52:26 +00:00
Xin LI
4f2bbc00f2 MFV: nc(1) from OpenBSD 4.8.
While I'm there, bump WARNS level to 2 as the vendor
have the right printf format string now.

MFC after:	1 month
Obtained from:	OpenBSD
2010-10-19 00:01:53 +00:00
Rebecca Cran
dadef94c7a Remove extra word, which looks like a left-over from a deleted sentence. 2010-10-18 14:35:21 +00:00
Benedict Reuschling
bc6940585f Use "printf" instead of "echo -n" in an example because it
should be more compatible for most shells that are out there.

I contacted Philip Guenther at OpenBSD about this PR and he
corrected the issue in their tree pretty fast.

PR:			docs/142243
Submitted by:		Yasir (yasir27 at mail dot ru)
Obtained from:		OpenBSD
Discussed with:		delphij
MFC after:		7 days
2010-07-26 18:33:33 +00:00
Xin LI
55e999851d Diff reduction with OpenBSD:
- Remove unused locally added variable;
 - Deprecate -o: it's the default behavior on OpenBSD.

X-MFC:	along with nc 4.7.
2010-04-15 19:15:05 +00:00
Xin LI
26bf9c3b54 MFV: Update nc to the version from OpenBSD 4.7.
MFC after:	1 month
2010-03-23 23:00:35 +00:00
Xin LI
2d5ea05a45 Update to 4.6.
Note: the -V option from OpenBSD is implemented using setfib(2) on FreeBSD.

MFC after:	2 weeks
2010-01-19 18:45:29 +00:00
Colin Percival
f15e71c26a Fix .Dd value -- our mdoc macros don't know how to parse the $Mdocdate$
tag, so the file was being treated as having no date (i.e., the current
date was being inserted).

Approved by:	re (kib)
2009-07-11 17:35:55 +00:00
Xin LI
c9b4549c3d Add an EXIT STATUS section to the manual page. Currently, nc(1)
does not follow sysexits(3), and returns 1 for all error cases.

PR:		docs/126451
2009-05-29 07:18:31 +00:00
Xin LI
1a9dc239f5 Update netcat to the version carried with OpenBSD 4.5. 2009-05-28 23:23:49 +00:00
Xin LI
7dcaa833c8 Merge nc(1) from OpenBSD 4.4. While there, rename our '-O' (no
tcp options) to '--no-tcpopt' in order to resolve a comflicit
with OpenBSD's -O semantics.
2008-12-19 23:00:23 +00:00
Xin LI
b3b9c2bbcb Flatten all tags of the dist tree of netcat. 2008-09-27 00:53:34 +00:00
Antoine Brodin
b6642dadae Document freebsd extensions to netcat a bit better:
- sort the options
- document -o and -O everywhere

Reviewed by:	delphij
Approved by:	rwatson (mentor)
2008-05-10 18:50:45 +00:00
Xin LI
2308b50e15 Resolve conflicts. 2008-04-21 18:31:50 +00:00
Xin LI
c7c53f7a03 Import netcat as of today's OPENBSD_4_3 snapshot. 2008-04-21 18:30:26 +00:00
Bruce M Simpson
bc38f653f1 Add an -O option to disable TCP options, for protocol testing purposes.
Do this for active and passive (-l switch) TCP sessions.

MFC after:	1 week
2008-04-01 13:54:24 +00:00
Xin LI
bdb0aaa123 Resolve conflicts. 2007-03-28 01:57:03 +00:00
Xin LI
b2f6436d8f Import netcat as of today's OPENBSD_4_1 snapshot. 2007-03-28 01:55:49 +00:00
Xin LI
2440a45859 Resolve conflicts. 2006-05-21 15:52:24 +00:00
Xin LI
7a997a696b Import netcat from OpenBSD 3.9-RELEASE. 2006-05-21 15:49:27 +00:00
Hiroki Sato
c0f0812202 Fix incorrect command line examples.
Submitted by:	Yoshihiko Sarumaru (mistral at imasy dot or dot jp)
PR:		docs/94158
MFC after:	2 days
2006-03-07 18:34:18 +00:00
Ruslan Ermilov
4bdc233895 Fix markup in local FreeBSD additions.
Approved by:	re (blanket manpages)
2005-06-27 07:07:55 +00:00
Xin LI
b0683dae2d Undo the VCS tag move to reduce diff hunks.
Pointed out by:	ru
2005-02-07 05:34:35 +00:00
Xin LI
04def62430 Finish the import of nc(1) from OpenBSD. This includes:
- Bring IPsec support from the ports collection [1].
	- Bring -o ("once only") option from the ports
	  collection [2].
	- Adopt the Makefile framework into
	  usr.bin/nc/Makefile.
	- Add a knob to control whether to build nc(1),
	  NO_NETCAT.
	- Bump __FreeBSD_version so ports collection can
	  detect this change.

Original patchset are contributed to the ports collection by:
[1] nectar, [2] joerg.

Note: WARNS?=6 patchset spined off in this commit, in order not
to take too many files off the vendor branch.
2005-02-06 14:44:27 +00:00
Xin LI
8c384020b3 Import a (stripped) snapshot of OpenBSD's nc(1) an excellent
reimplementation of the famous tool that can do arbitrary TCP
and UDP connections and listens.

This gaves sysadm the same tool the crackers have, so that
they may learn what the network is about and protect it better.
For developers, this is an invaluable debugging tool, and a
good build block of scripts.

Discussed on:	freebsd-hackers@
2005-02-04 08:41:44 +00:00