Minix 3/src ad920fcminix/tests test83.c common-socket.c

tests: adapt existing tests to new LWIP service

Change-Id: Id744e9d3fbe19733557011f8803593cf3768c35d
DeltaFile
+36-151minix/tests/test83.c
+91-54minix/tests/common-socket.c
+2-18minix/tests/test81.c
+8-6minix/tests/test80.c
+11-2minix/tests/test48.c
+0-10minix/tests/common-socket.h
+148-2416 files

Minix 3/src bb9622bsbin/ping ping.c, usr.sbin/traceroute traceroute.c

ping(8), traceroute(8): adapt to new LWIP service

Change-Id: I0aae7199dfd9075201975e133cdaeab6bc2bd24f
DeltaFile
+0-23usr.sbin/traceroute/traceroute.c
+0-8sbin/ping/ping.c
+0-312 files

Minix 3/src ef8d499minix/net/lwip tcpsock.c ifaddr.c

Add lwip: a new lwIP-based TCP/IP service

This commit adds a new TCP/IP service to MINIX 3.  As its core, the
service uses the lwIP TCP/IP stack for maintenance reasons.  The
service aims to be compatible with NetBSD userland, including its
low-level network management utilities.  It also aims to support
modern features such as IPv6.  In summary, the new LWIP service has
support for the following main features:

- TCP, UDP, RAW sockets with mostly standard BSD API semantics;
- IPv6 support: host mode (complete) and router mode (partial);
- most of the standard BSD API socket options (SO_);
- all of the standard BSD API message flags (MSG_);
- the most used protocol-specific socket and control options;
- a default loopback interface and the ability to create one more;
- configuration-free ethernet interfaces and driver tracking;
- queuing and multiple concurrent requests to each ethernet driver;
- standard ioctl(2)-based BSD interface management;
- radix tree backed, destination-based routing;

    [12 lines not shown]
DeltaFile
+2,793-0minix/net/lwip/tcpsock.c
+2,224-0minix/net/lwip/ifaddr.c
+1,912-0minix/net/lwip/rtsock.c
+1,718-0minix/net/lwip/ethif.c
+1,654-0minix/net/lwip/route.c
+1,365-0minix/net/lwip/bpfdev.c
+11,666-054 files not shown
+25,803-1160 files

Minix 3/src 0f03189minix/include/minix rmib.h, minix/lib/libsys rmib.c

RMIB: add indirection support for sparse subtrees

Normally, each RMIB subtree consists of an array of nodes, indexed
by node identifier.  In a sparsely filled subtree, most of the array
is empty and just wasting memory.  In that case, it may be beneficial
to have a level of indirection, with an intermediate array containing
pairs of node IDs and pointers to the actual nodes.  This patch adds
support for such indirection.

For the use cases that inspired this patch, net.inet and net.inet6,
the indirection shaves off a little under 16KB of memory from the
TCP/IP service.

Change-Id: Ic68ca3fee1a0f2032f77eef6df42728f9b9400e8
DeltaFile
+77-31minix/lib/libsys/rmib.c
+26-0minix/include/minix/rmib.h
+103-312 files

Minix 3/src 5edbea5minix/include/minix safecopies.h, minix/lib/libsys safecopies.c

libsys: allow for grant preallocation

Since the grant table is allocated dynamically, a system service always
runs the risk of running out of memory at run time when trying to
allocate a grant.  In order to allow services to mitigate that risk,
grants can now be preallocated, typically at system service startup,
using the new cpf_prealloc(3) libsys function.  The function takes a
'count' parameter that indicates the number of additional grants to
preallocate.  Thus, the function may be called from multiple submodules
within a service, each preallocating their own maximum of grants that
it may need at run time.

Change-Id: I6904726a722a8c27dfe2efa470e683718f310272
DeltaFile
+19-7minix/lib/libsys/safecopies.c
+7-3minix/include/minix/safecopies.h
+26-102 files

Minix 3/src 5d5fbe7minix/lib/liblwip/core/snmp mib2.c, minix/lib/liblwip/dist CHANGELOG

Import new lwIP version into liblwip

In order to match NetBSD-style imports of external code, the library
has been restructured.  The full lwIP source tree is imported, except
for a few .git* files in its root directory, into dist/.  The MINIX 3
Makefiles and other custom files are located in lib/.  Finally, since
we need to apply a number of small patches to lwIP, these patches are
stored in patches/, in addition to being applied to the lwIP tree.

The currently imported version of lwIP is taken from its master
branch sometime after the 2.0.1 release, specifically git-7ffe5bf.

Change-Id: Ie03c4fa36fa928870263c191205d6d93f652a3cc
DeltaFile
+4,253-0minix/lib/liblwip/dist/CHANGELOG
+0-4,146minix/lib/liblwip/core/snmp/mib2.c
+3,114-0minix/lib/liblwip/dist/src/api/sockets.c
+2,964-0minix/lib/liblwip/dist/src/include/lwip/opt.h
+2,790-0minix/lib/liblwip/dist/src/netif/ppp/lcp.c
+2,629-0minix/lib/liblwip/dist/src/apps/httpd/httpd.c
+15,750-4,146461 files not shown
+127,170-67,510467 files

Minix 3/src 47db417minix/drivers/net/lance lance.c

lance: perform full reinitialization for restarts

When performing a restart (CSR0 STOP, STRT), the behavior regarding
the NIC's current RX/TX descriptor ring counters varies between cards:
older LANCE cards do not reset the counters; newer PCnet cards do
reset them; VirtualBox's emulation is once again broken in that it
claims to emulate newer cards but implements the older behavior.

Changing the card's receive mode requires such a restart, and now that
the system can actually change receive modes dynamically as part of
normal network operation, this results in the lance driver breaking
all the time on at least VirtualBox.

Instead of trying to figure out exactly what is going on with the
counters during a restart, we now simply perform a full-blown
reinitialization every time the NIC is restarted.  That leaves no
ambiguity regarding the counters, and appears to be what drivers on
other OSes do as well.  As a bonus, this approach actually saves code.

Change-Id: I60fad2df6de4616d5de2cec39c09b60c15d854fb
DeltaFile
+32-85minix/drivers/net/lance/lance.c
+32-851 files

Minix 3/src f7df02eminix/drivers/net/3c90x 3c90x.c, minix/drivers/net/dp8390 dp8390.c

libnetdriver: rewrite

This is a driver-breaking update to the netdriver library, which is
used by all network drivers.  The aim of this change is to make the
library more compatible with NetBSD, and in particular with various
features that are expected to be supported by the NetBSD userland.
The main changes made by this patch are the following:

- each network driver now has a NetBSD-style short device name;
- drivers are not expected to receive packets right after startup;
- extended support for receipt modes, including multicast lists;
- support for multiple parallel send, receive requests;
- embedding of I/O vectors in send and receive requests;
- support for capabilities, including checksum offloading;
- support for reporting link status updates to the TCP/IP stack;
- support for setting and retrieving media status;
- support for changing the hardware (MAC) address;
- support for NetBSD interface flags IFF_DEBUG, IFF_LINK[0-2];
- support for NetBSD error statistics;

    [20 lines not shown]
DeltaFile
+584-210minix/lib/libnetdriver/netdriver.c
+146-139minix/drivers/net/rtl8139/rtl8139.c
+106-132minix/drivers/net/dp8390/dp8390.c
+122-110minix/drivers/net/rtl8169/rtl8169.c
+69-152minix/drivers/net/3c90x/3c90x.c
+123-97minix/drivers/net/fxp/fxp.c
+1,150-84057 files not shown
+1,994-1,70163 files

Minix 3/src 686761dusr.sbin/syslogd syslogd.c Makefile

syslogd(8): drop some MINIX-specific changes

Change-Id: Ic286b89975eeea1abf0d5086ee13dfb9ab57d8ba
DeltaFile
+0-12usr.sbin/syslogd/syslogd.c
+0-2usr.sbin/syslogd/Makefile
+0-2usr.sbin/syslogd/syslogd.h
+0-163 files

Minix 3/src 5bded7clibexec/ftpd ftpd.c

ftpd(8): drop some MINIX-specific changes

Also put in a crude way to clean up zombies when ftpd(8) is running
in daemon mode, because we do not yet support SA_NOCLDWAIT.

Change-Id: I8a7db1d665c432d736db833b0022d0340764db1f
DeltaFile
+9-4libexec/ftpd/ftpd.c
+9-41 files

Minix 3/src 340f5e5libexec/httpd bozohttpd.c bozohttpd.8

Import NetBSD httpd(8)

Also known as bozohttpd(8).

Change-Id: I40e955b5654674f2c708b10e5e403ca9cbc92534
DeltaFile
+2,321-0libexec/httpd/bozohttpd.c
+683-0libexec/httpd/bozohttpd.8
+523-0libexec/httpd/cgi-bozo.c
+452-0libexec/httpd/lua-bozo.c
+356-0libexec/httpd/main.c
+350-0libexec/httpd/bozohttpd.h
+4,685-054 files not shown
+8,166-260 files

Minix 3/src 8f95729usr.sbin/rtadvd rtadvd.c config.c

Import NetBSD rtadvd(8)

Change-Id: I22626843d85c78f0fadefd58d61d7a85d285b2b8
DeltaFile
+1,820-0usr.sbin/rtadvd/rtadvd.c
+1,324-0usr.sbin/rtadvd/config.c
+497-0usr.sbin/rtadvd/rtadvd.conf.5
+488-0usr.sbin/rtadvd/rrenum.c
+444-0usr.sbin/rtadvd/advcap.c
+418-0usr.sbin/rtadvd/if.c
+4,991-020 files not shown
+6,247-226 files

Minix 3/src 5de448eusr.sbin/ndp ndp.c ndp.8

Import NetBSD ndp(8)

Like arp(8), this utility already uses the NetBSD 8 protocol for
talking to the operating system through routing sockets.

Like arp(8), this utility is not fully functional, due to limitations
of lwIP.  While ndp(8) should provide a proper (read-only) view of the
contents of the Neighbor Discovery table, any attempts to modify the
table will fail.  In addition, various other ndp(8) features are not
supported.  On MINIX 3, the prefix and default router lists are not
managed by the operating system however, but rather by dhcpcd(8);
therefore, an implementation of the features related to those lists
would not provide any actual functionality.

Change-Id: I479bfc8141ba69fe50c1b2f7091933267ce6fa3e
DeltaFile
+1,556-0usr.sbin/ndp/ndp.c
+280-0usr.sbin/ndp/ndp.8
+74-0usr.sbin/ndp/prog_ops.h
+59-0usr.sbin/ndp/ndp_rumpops.c
+55-0usr.sbin/ndp/ndp_hostops.c
+23-0usr.sbin/ndp/Makefile
+2,047-04 files not shown
+2,051-110 files

Minix 3/src b636d99external/bsd/tcpdump/dist configure print-isoclns.c

Import NetBSD tcpdump(8)

For now, printing of Sun RPC requests is disabled because we do not
yet have the RPC header files.  This should affect basically noone,
as we do not have any RPC-based programs yet, for the same reason.

Change-Id: Ie7818faaaacdc104d8b2c37a68866b4ce18247d6
DeltaFile
+9,731-0external/bsd/tcpdump/dist/configure
+3,119-0external/bsd/tcpdump/dist/print-isoclns.c
+3,016-0external/bsd/tcpdump/dist/print-802_11.c
+3,001-0external/bsd/tcpdump/dist/print-isakmp.c
+2,889-0external/bsd/tcpdump/dist/print-rx.c
+2,788-0external/bsd/tcpdump/dist/print-bgp.c
+24,544-0577 files not shown
+148,736-1583 files

Minix 3/src d56f51eexternal/bsd/libpcap/dist configure gencode.c

Import NetBSD libpcap

As part of this, we import bpf_filter.c from NetBSD.  Even though that
file is part of the NetBSD kernel, it is also used by userland (as is
clear here).  Our LWIP service has its own bpf_filter.c implementation
but that implementation has certain limits (e.g. on program size) that
are fine for a system service but should not apply to userland.

The libpcap code has a number of blocks guarded by __NetBSD__, but
none of those blocks apply to MINIX 3.  In particular, some of the
alignment logic used for NetBSD may in fact not work in our case.

Change-Id: Ib187e22d627c929e111d5d4a991c3bee3c0154cb
DeltaFile
+9,892-0external/bsd/libpcap/dist/configure
+8,910-0external/bsd/libpcap/dist/gencode.c
+6,556-0external/bsd/libpcap/dist/pcap-linux.c
+2,760-0external/bsd/libpcap/dist/pcap-bpf.c
+2,360-0external/bsd/libpcap/dist/optimize.c
+2,034-0external/bsd/libpcap/dist/pcap.c
+32,512-0242 files not shown
+90,572-2248 files

Minix 3/src 83ee113external/bsd/dhcp/dist configure, external/bsd/dhcp/dist/client dhc6.c

Import NetBSD dhclient(8), dhcpd(8), dhcrelay(8)

dhcrelay(8) and omshell(1) have not been tested.

Change-Id: I0cad89f65666af4e366a86e130ce8df0894c3bb4
DeltaFile
+8,245-0external/bsd/dhcp/dist/configure
+6,644-0external/bsd/dhcp/dist/server/dhcpv6.c
+6,415-0external/bsd/dhcp/dist/server/failover.c
+6,085-0external/bsd/dhcp/dist/server/confpars.c
+5,673-0external/bsd/dhcp/dist/common/parse.c
+5,108-0external/bsd/dhcp/dist/client/dhc6.c
+38,170-0283 files not shown
+182,445-3289 files

Minix 3/src 00b67f0external/bsd/bind/dist configure, external/bsd/bind/dist/bin/pkcs11 openssl-0.9.8zc-patch

Import NetBSD named(8)

Also known as ISC bind.  This import adds utilities such as host(1),
dig(1), and nslookup(1), as well as many other tools and libraries.

Change-Id: I035ca46e64f1965d57019e773f4ff0ef035e4aa3
DeltaFile
+24,398-0external/bsd/bind/dist/configure
+19,324-0external/bsd/bind/dist/unit/atf-src/configure
+19,118-0external/bsd/bind/dist/bin/tests/system/limits/ns1/example.db
+18,065-0external/bsd/bind/dist/lib/dns/zone.c
+17,706-0external/bsd/bind/dist/doc/arm/Bv9ARM-book.xml
+15,908-0external/bsd/bind/dist/bin/pkcs11/openssl-0.9.8zc-patch
+114,519-04,291 files not shown
+1,147,530-74,297 files

Minix 3/src 9f20bfaexternal/bsd/dhcpcd/dist dhcp6.c dhcp.c

Import NetBSD dhcpcd(8)

The port could be improved by adding support for pselect(2).

Other than that, this port has a few MINIX-specific changes:

- we undefine IN_IFF_ flags to stop dhcpcd from thinking that we have
  operating system support for link-local IPv4 address management;
- we work around one crash bug that seems triggered by using dhcpcd
  on some but not all interfaces;
- we add "noalias" to the default dhcpcd.conf(5) configuration file.

Change-Id: I8a81c2c2af353c5ce08335673b1ab2d4b39178da
DeltaFile
+3,533-0external/bsd/dhcpcd/dist/dhcp6.c
+3,488-0external/bsd/dhcpcd/dist/dhcp.c
+2,483-0external/bsd/dhcpcd/dist/if-options.c
+2,178-0external/bsd/dhcpcd/dist/ipv6.c
+1,910-0external/bsd/dhcpcd/dist/dhcpcd.c
+1,700-0external/bsd/dhcpcd/dist/ipv6nd.c
+15,292-066 files not shown
+31,203-272 files

Minix 3/src d642636external/bsd/openresolv/dist resolvconf.in resolvconf.conf.5.in, share/man/man5 resolv.conf.5

Import NetBSD resolvconf(8)

Also known as "openresolv".  Needed for dhcpcd(8).

Change-Id: Ibcb616837e9a5293377e451c6f6218a37260ed80
DeltaFile
+771-0external/bsd/openresolv/dist/resolvconf.in
+318-0external/bsd/openresolv/dist/resolvconf.conf.5.in
+306-0external/bsd/openresolv/dist/resolvconf.8.in
+296-0share/man/man5/resolv.conf.5
+246-0external/bsd/openresolv/dist/libc.in
+202-0external/bsd/openresolv/dist/dnsmasq.in
+2,139-013 files not shown
+2,574-519 files

Minix 3/src c3b6f8fetc inetd.conf, usr.sbin/inetd inetd.c inetd.8

Import NetBSD inetd(8)

Do not start it by default just yet.

Change-Id: Id8d2dd33eb67ae74b3ef3060638e20c781e8e37d
DeltaFile
+2,383-0usr.sbin/inetd/inetd.c
+650-0usr.sbin/inetd/inetd.8
+159-0usr.sbin/inetd/ipsec.c
+86-0etc/inetd.conf
+36-0usr.sbin/inetd/pathnames.h
+34-0usr.sbin/inetd/ipsec.h
+3,348-09 files not shown
+3,410-315 files

Minix 3/src e044baflibexec/telnetd state.c telnetd.c

Import NetBSD telnetd(8)

Change-Id: Ie1ae80e8a4945f6f4ccce8f468c1b04a8d89cf43
DeltaFile
+1,680-0libexec/telnetd/state.c
+1,159-0libexec/telnetd/telnetd.c
+1,077-0libexec/telnetd/utility.c
+798-0libexec/telnetd/sys_term.c
+620-0libexec/telnetd/termstat.c
+591-0libexec/telnetd/telnetd.8
+5,925-012 files not shown
+7,086-318 files

Minix 3/src 72e899edistrib/sets/lists/minix-base mi, distrib/sets/lists/minix-debug mi

Import NetBSD traceroute6(8)

Change-Id: I040651cf29a9efd6b85afafe6813e48c2f1a4f2d
DeltaFile
+1,307-0usr.sbin/traceroute6/traceroute6.c
+121-0usr.sbin/traceroute6/traceroute6.8
+29-0usr.sbin/traceroute6/Makefile
+1-1usr.sbin/Makefile
+1-0distrib/sets/lists/minix-base/mi
+1-0distrib/sets/lists/minix-debug/mi
+1,460-11 files not shown
+1,461-17 files

Minix 3/src 7348b5clib/libtelnet encrypt.c, usr.bin/telnet commands.c telnet.c

Import NetBSD telnet(1)

Change-Id: Ib58b43cc9baabe183a59410212827f65ec117277
DeltaFile
+2,907-0usr.bin/telnet/commands.c
+2,648-0usr.bin/telnet/telnet.c
+1,414-0usr.bin/telnet/telnet.1
+960-0lib/libtelnet/encrypt.c
+925-0usr.bin/telnet/utilities.c
+763-0usr.bin/telnet/README
+9,617-038 files not shown
+17,305-344 files

Minix 3/src 903ca1esbin/ping6 ping6.c ping6.8

Import NetBSD ping6(8)

Change-Id: Ife49f5fac0e50852c74a0f85b6129c204d172c68
DeltaFile
+2,666-0sbin/ping6/ping6.c
+449-0sbin/ping6/ping6.8
+86-0sbin/ping6/prog_ops.h
+60-0sbin/ping6/ping6_rumpops.c
+55-0sbin/ping6/ping6_hostops.c
+32-0sbin/ping6/Makefile
+3,348-04 files not shown
+3,353-010 files

Minix 3/src 04e82b7usr.sbin/arp arp.c arp.8

Import NetBSD arp(8)

Behaviorally this port should already be largely on par with the
NetBSD 8 version, in that it sets the RTF_LLDATA flag on routing
socket requests to indicate that they target link-local data.

Many parts of the arp(8) functionality are currently not yet supported
by the operating system, largely due to lwIP not exposing appropriate
means of implementing them.

Change-Id: Icfac054b4deddda03eee4acf0e261aa48cd031ba
DeltaFile
+747-0usr.sbin/arp/arp.c
+153-0usr.sbin/arp/arp.8
+123-0usr.sbin/arp/arp.4
+68-0usr.sbin/arp/prog_ops.h
+56-0usr.sbin/arp/arp_rumpops.c
+52-0usr.sbin/arp/arp_hostops.c
+1,199-05 files not shown
+1,219-111 files

Minix 3/src 66dfcc8usr.bin/netstat inet6.c if.c

Import NetBSD netstat(1)

The port forces the use of sysctl(7), as obtaining information through
KVM is not and will never be viable.  The sysctl mode of netstat(1) is
currently somewhat limited and buggy, though.  We fix a few minimal
issues, but more improvements will have to come from NetBSD reimports.

Some of netstat(1)'s views are currently not supported by the
operating system.  Later improvements on this point will not require
changes to the imported code, though.

Change-Id: If74a6811f0fc81bd1ecc31010a28379b14b2a0eb
DeltaFile
+1,533-0usr.bin/netstat/inet6.c
+1,050-0usr.bin/netstat/if.c
+1,037-0usr.bin/netstat/inet.c
+883-0usr.bin/netstat/main.c
+476-0usr.bin/netstat/netstat.1
+439-0usr.bin/netstat/vtw.c
+5,418-020 files not shown
+8,394-126 files

Minix 3/src 483e595sbin/route route.c rtutil.c

Import NetBSD route(8)

Change-Id: I724a2a56157ea72afdd3f6a82239687894c8e3e8
DeltaFile
+1,809-0sbin/route/route.c
+806-0sbin/route/rtutil.c
+449-0sbin/route/route.8
+144-0sbin/route/show.c
+128-0sbin/route/keywords.sh
+73-0sbin/route/prog_ops.h
+3,409-011 files not shown
+3,783-117 files

Minix 3/src 90b8012sbin/ifconfig ifconfig.c ieee80211.c

Import NetBSD ifconfig(8)

Not all of its functionality is actually implemented in the operating
system.  In addition, a few modules (agr, vlan) have been disabled
because we have not imported the necessary headers yet.

Change-Id: I4c9271065d640bd9112b4bd27e2652e1d51b18b4
DeltaFile
+1,476-0sbin/ifconfig/ifconfig.c
+1,375-0sbin/ifconfig/ieee80211.c
+995-0sbin/ifconfig/parse.c
+920-0sbin/ifconfig/ifconfig.8
+516-0sbin/ifconfig/af_inet6.c
+464-0sbin/ifconfig/media.c
+5,746-027 files not shown
+9,028-233 files

Minix 3/src f1fab66lib/libwrap options.c hosts_access.c

Import NetBSD libwrap

Change-Id: Ib8b979fb9a96c2048b8ea93038944c743048bff4
DeltaFile
+634-0lib/libwrap/options.c
+569-0lib/libwrap/hosts_access.c
+424-0lib/libwrap/hosts_access.5
+291-0lib/libwrap/socket.c
+237-0lib/libwrap/rfc931.c
+209-0lib/libwrap/tcpd.h
+2,364-023 files not shown
+3,730-129 files

Minix 3/src c2a43b2distrib/sets/lists/minix-base mi, distrib/sets/lists/minix-man mi

Import NetBSD nsswitch.conf(5)

Change-Id: I0464b474d50b39cd6259c492e1fae6fecfd9d984
DeltaFile
+272-0share/man/man5/nsswitch.conf.5
+29-0etc/nsswitch.conf
+1-1share/man/man5/Makefile
+1-0distrib/sets/lists/minix-man/mi
+1-0distrib/sets/lists/minix-base/mi
+1-0etc/Makefile
+305-16 files