Bug 206345 - [new port] net/sock: Richard Stevens' sock program + IPv6 capability
Summary: [new port] net/sock: Richard Stevens' sock program + IPv6 capability
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: feature, patch
Depends on:
Blocks:
 
Reported: 2016-01-17 22:09 UTC by Steve Jacobson
Modified: 2017-04-01 23:26 UTC (History)
3 users (show)

See Also:


Attachments
New port shar file: net/sock Richard Stevens' sock program + IPv6 capability (42.62 KB, text/plain)
2016-01-17 22:09 UTC, Steve Jacobson
rakuco: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Jacobson 2016-01-17 22:09:21 UTC
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.
Comment 1 Steve Jacobson 2016-01-17 22:17:33 UTC
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.
Comment 2 Steve Jacobson 2016-01-17 22:22:42 UTC
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.
Comment 3 Sean Bruno freebsd_committer freebsd_triage 2016-04-22 14:28:38 UTC
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.
Comment 4 Steve Jacobson 2016-05-01 04:52:54 UTC
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.
 */
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-05-24 17:00:38 UTC
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
Comment 6 Steve Wills freebsd_committer freebsd_triage 2016-05-24 17:01:14 UTC
Committed without LICENSE for now, since that's optional. Thanks!
Comment 7 Steve Jacobson 2017-04-01 23:26:41 UTC
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.