Commit Graph

52 Commits

Author SHA1 Message Date
markj
e40a4ef6b8 Adjust .Dd, missed in r363084.
MFC with:	r363084
2020-07-10 19:58:07 +00:00
markj
593aee73ad 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
trasz
b2fad95038 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
ae
0fb6ad528e Merge projects/ipsec into head/.
Small summary
 -------------

o Almost all IPsec releated code was moved into sys/netipsec.
o New kernel modules added: ipsec.ko and tcpmd5.ko. New kernel
  option IPSEC_SUPPORT added. It enables support for loading
  and unloading of ipsec.ko and tcpmd5.ko kernel modules.
o IPSEC_NAT_T option was removed. Now NAT-T support is enabled by
  default. The UDP_ENCAP_ESPINUDP_NON_IKE encapsulation type
  support was removed. Added TCP/UDP checksum handling for
  inbound packets that were decapsulated by transport mode SAs.
  setkey(8) modified to show run-time NAT-T configuration of SA.
o New network pseudo interface if_ipsec(4) added. For now it is
  build as part of ipsec.ko module (or with IPSEC kernel).
  It implements IPsec virtual tunnels to create route-based VPNs.
o The network stack now invokes IPsec functions using special
  methods. The only one header file <netipsec/ipsec_support.h>
  should be included to declare all the needed things to work
  with IPsec.
o All IPsec protocols handlers (ESP/AH/IPCOMP protosw) were removed.
  Now these protocols are handled directly via IPsec methods.
o TCP_SIGNATURE support was reworked to be more close to RFC.
o PF_KEY SADB was reworked:
  - now all security associations stored in the single SPI namespace,
    and all SAs MUST have unique SPI.
  - several hash tables added to speed up lookups in SADB.
  - SADB now uses rmlock to protect access, and concurrent threads
    can do SA lookups in the same time.
  - many PF_KEY message handlers were reworked to reflect changes
    in SADB.
  - SADB_UPDATE message was extended to support new PF_KEY headers:
    SADB_X_EXT_NEW_ADDRESS_SRC and SADB_X_EXT_NEW_ADDRESS_DST. They
    can be used by IKE daemon to change SA addresses.
o ipsecrequest and secpolicy structures were cardinally changed to
  avoid locking protection for ipsecrequest. Now we support
  only limited number (4) of bundled SAs, but they are supported
  for both INET and INET6.
o INPCB security policy cache was introduced. Each PCB now caches
  used security policies to avoid SP lookup for each packet.
o For inbound security policies added the mode, when the kernel does
  check for full history of applied IPsec transforms.
o References counting rules for security policies and security
  associations were changed. The proper SA locking added into xform
  code.
o xform code was also changed. Now it is possible to unregister xforms.
  tdb_xxx structures were changed and renamed to reflect changes in
  SADB/SPDB, and changed rules for locking and refcounting.

Reviewed by:	gnn, wblock
Obtained from:	Yandex LLC
Relnotes:	yes
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D9352
2017-02-06 08:49:57 +00:00
delphij
79a228359e MFV r288243: nc from OpenBSD 5.8. 2015-09-27 07:04:16 +00:00
delphij
2a9a342fe4 MFV r282611: netcat from OpenBSD 5.7.
MFC after:	2 weeks
2015-05-07 22:54:31 +00:00
delphij
3c5ed8a35e MFV r273617: netcat from OpenBSD 5.6.
MFC after:	2 weeks
2014-10-25 00:37:35 +00:00
delphij
1ec50e967b MFV r258194-264360: nc(1) from OpenBSD 5.5.
MFC after:	2 weeks
2014-04-11 22:12:31 +00:00
delphij
733062d51e MFV: netcat from OpenBSD 5.4.
No functional change.
2013-11-15 22:45:14 +00:00
delphij
8d6ff63e33 Reflect version update.
MFC after:	13 days
2013-04-15 18:35:09 +00:00
delphij
f60aecd8cc 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
delphij
79f289a888 MFV: netcat from OpenBSD 5.2.
MFC after:	1 month
2012-10-22 18:56:31 +00:00
delphij
755816685a Update FREEBSD-vendor to reflect the current version. 2012-05-04 21:06:53 +00:00
delphij
b8e45134f9 Merge from OpenBSD 5.1.
MFC after:	3 weeks
2012-05-04 21:03:39 +00:00
bz
dcdb23291f Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:
Extend the so far IPv4-only support for multiple routing tables (FIBs)
introduced in r178888 to IPv6 providing feature parity.

This includes an extended rtalloc(9) KPI for IPv6, the necessary
adjustments to the network stack, and user land support as in netstat.

Sponsored by:	Cisco Systems, Inc.
Reviewed by:	melifaro (basically)
MFC after:	10 days
2012-02-17 02:39:58 +00:00
delphij
5701d8b9ba Merge from OpenBSD 5.0 (this is a dummy change, the vendor change does not
apply to us).
2011-12-26 09:07:08 +00:00
delphij
8387350bb5 MFV: nc(1) from OpenBSD 4.9.
MFC after:	1 month
Obtained from:	OpenBSD
2011-05-11 21:52:26 +00:00
delphij
4393b7cb7e 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
brucec
ca3202b6c7 Remove extra word, which looks like a left-over from a deleted sentence. 2010-10-18 14:35:21 +00:00
bcr
488a727a00 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
delphij
78fcb82b98 Utilize IP_BINDANY which provided the same semantics of OpenBSD's
SO_BINDANY.
2010-04-15 23:21:24 +00:00
delphij
90101e00e6 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
delphij
2cf63c604b Update metadata information as well as upgrade instructions. 2010-03-23 23:56:22 +00:00
delphij
7f20b83b68 MFV: Update nc to the version from OpenBSD 4.7.
MFC after:	1 month
2010-03-23 23:00:35 +00:00
delphij
9cf63ca8dd Update the version number. 2010-02-02 00:30:44 +00:00
delphij
6852acc871 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
delphij
942205b726 What we have in base system is actually OpenBSD 4.5's netcat,
update this file to reflect the fact.
2009-12-08 19:12:38 +00:00
des
32589bd8e2 Update and remove CVS-specific items
Approved by:	re (kib)
2009-08-13 06:07:38 +00:00
cperciva
b79a5aa131 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
delphij
a62a3b6e1f 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
delphij
7515df23bd Update netcat to the version carried with OpenBSD 4.5. 2009-05-28 23:23:49 +00:00
delphij
2d9e1680b9 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
antoine
840e3ca1b5 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
delphij
ec8ec4bca9 Update instructions to match recent practices 2008-04-21 18:37:08 +00:00
delphij
3afec1f731 Add vendor metadata 2008-04-21 18:36:52 +00:00
delphij
a2049366d7 Resolve conflicts. 2008-04-21 18:31:50 +00:00
delphij
25a943c6df This commit was generated by cvs2svn to compensate for changes in r178382,
which included commits to RCS files with non-trunk default branches.
2008-04-21 18:30:26 +00:00
delphij
7283819616 Import netcat as of today's OPENBSD_4_3 snapshot. 2008-04-21 18:30:26 +00:00
bms
b6386e8a8a 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
gnn
f5875f045c Commit IPv6 support for FAST_IPSEC to the tree.
This commit includes all remaining changes for the time being including
user space updates.

Submitted by:    bz
Approved by:    re
2007-07-01 12:08:08 +00:00
delphij
71a2bc9dd5 Resolve conflicts. 2007-03-28 01:57:03 +00:00
delphij
2b70bf3587 Import netcat as of today's OPENBSD_4_1 snapshot. 2007-03-28 01:55:49 +00:00
delphij
36c02922c8 This commit was generated by cvs2svn to compensate for changes in r167961,
which included commits to RCS files with non-trunk default branches.
2007-03-28 01:55:49 +00:00
delphij
11228d528e Resolve conflicts. 2006-05-21 15:52:24 +00:00
delphij
ae5f19e683 Import netcat from OpenBSD 3.9-RELEASE. 2006-05-21 15:49:27 +00:00
delphij
71f517bebd This commit was generated by cvs2svn to compensate for changes in r158795,
which included commits to RCS files with non-trunk default branches.
2006-05-21 15:49:27 +00:00
hrs
2c3115e88f 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
ru
49d602bcb1 Fix markup in local FreeBSD additions.
Approved by:	re (blanket manpages)
2005-06-27 07:07:55 +00:00
delphij
dbc0713b05 Undo the VCS tag move to reduce diff hunks.
Pointed out by:	ru
2005-02-07 05:34:35 +00:00
delphij
909fc0148b Add instructions about upgrading netcat(1). 2005-02-06 15:26:44 +00:00