Created attachment 165725 [details] New port shar file: net/sock Richard Stevens' sock program + IPv6 capability A ported and reworked code of Richard Stevens' "sock" utility by Christian Kreibich. From the original author: In "TCP/IP Illustrated Vol. 1," Richard Stevens used a program called "sock" to demonstrate the many properties of TCP/IP. Steve Jacobson rewrote Christian Kreibich's version of "sock" to add an IPv6 option. TCP and UDP tests can now be run over IPv6 in addition to the original IPv4 capability. He converted the result into a FreeBSD port.
This references the original 0.3.2 tarball from 2010. It also contains patches for my IPv6 changes. I put myself down as maintainer. I tested the code on FreeBSD 8.4, i386, and FreeBSD 10.2, amd64. I built the sock.shar file on 10.2. The license is generic educational on all the source files. Only one file mentions "GPL", and that is sock.spec, the RPM spec file, which was added later by a Linux person. We should not need that file. Testing with this program shows that a number of socket options that are supported for IPv4 are not supported for IPv6. I don't know if anyone is concerned about this in practice.
This program can generate various UDP and TCP packets with various options. It can also be run as a client or as a server. In addition to various educational uses, this program can be used in many different networking contexts to generate test packets. In addition to the previously existing capabilities of "sock," this port also has an IPv6 option, that allows TCP or UDP to be run over IPv6 instead of the default IPv4. This port also fixes a couple of bugs in Christian Kreibich's version; these are documented in the source code.
Review nits: I had to adjust the MASTER_SITES to: MASTER_SITES= http://www.icir.org/christian/downloads/ I am unsure what to do about the LICENSE here. "educational" isn't a keyword, and the attribution is directly assigned to Stevens (its his code). I think I need to ask for help on this one.
Perhaps the licensing could be addressed by a "RESTRICTED= " entry in the Makefile? An example is net/ldapbrowser/Makefile. net/sniffit/Makefile has a "COMMENT= " entry referencing "For educational use." Unfortunately, W. Richard Stevens passed away in 1999, so we can't ask him for clarification. The original software, from which this is derived, can be freely downloaded from http://www.kohala.com/start/unpv12e.html The above is linked from Stevens' web page, http://www.kohala.com/start/ The block comment from main.c is reproduced here: /* * Copyright (c) 1993 W. Richard Stevens. All rights reserved. * Permission to use or modify this software and its documentation only for * educational purposes and without fee is hereby granted, provided that * the above copyright notice appear in all copies. The author makes no * representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. */
A commit references this bug: Author: swills Date: Tue May 24 16:59:55 UTC 2016 New revision: 415801 URL: https://svnweb.freebsd.org/changeset/ports/415801 Log: net/sock: create port This is a standalone version of W. Richard Stevens' "sock" program, based on the code available for the UNIX Network Programming book. Adapted and reworked code for W. Richard Stevens' "sock" utility by Christian Kreibich. From the author: In TCP/IP Illustrated Vol. 1, Richard Stevens used a program called "sock" to demonstrate the many properties of TCP/IP. Unfortunately, the book only speaks about how to use the program but does not point to a site for downloading its sources. While sock is contained in the code package accompanying UNIX Network Programming, this code is also getting dated. The program can be used to generate TCP or UDP packets for testing various network features. It runs as either client or server. WWW: http://www.icir.org/christian/sock.html PR: 206345 Submitted by: Steve Jacobson <sjac998@yahoo.com> (with slight modification) Changes: head/net/Makefile head/net/sock/ head/net/sock/Makefile head/net/sock/distinfo head/net/sock/files/ head/net/sock/files/patch-src__cliopen.c head/net/sock/files/patch-src__loopudp.c head/net/sock/files/patch-src__main.c head/net/sock/files/patch-src__multicast.c head/net/sock/files/patch-src__servopen.c head/net/sock/files/patch-src__sock.h head/net/sock/files/patch-src__sockopts.c head/net/sock/files/patch-src__sourceroute.c head/net/sock/files/patch-src__sourceudp.c head/net/sock/pkg-descr
Committed without LICENSE for now, since that's optional. Thanks!
There are now two follow-ons for this port. Bug 217909 updates net/sock to sock-0.4.1. It must be applied first. Bug 218298 updates net/sock to sock-0.4.2.