Copyright © 2017, Bjorn Victor (email@example.com).
Issue: most(?) networked computers are in these days mobile and connecting to many different networks. Therefore modern networks are usually dynamically configured, and hosts don't need to know their IP address, netmask, default router, DNS servers, etc.
The Lisp Machines are from another era, where computers were stationary and rather few. Networks and hosts were manually configured and things didn't change much.
This code tries to make the Lambda (more of) a modern netizen in enabling Dynamic Hosts Configuration (DHCP, RFC 2131/2132). It allows to dynamically set up your IP address, netmask, router, DNS server, local domain, etc.
After copying the tape to disk, you will need to copy the files DHCP.SYSTEM and DHCP.TRANSLATIONS to your SYS:SITE; directory, and possibly update the logical host translations. Then simply (MAKE-SYSTEM :DHCP) should do the trick.
To enable it, all you need to do is to set the site option :DYNAMIC-INTERNET-ADDRESS to T in SYS:SITE;SITE LISP (and then compile it, e.g. with (MAKE-SYSTEM :SITE :COMPILE :NOLOAD :NOCONFIRM :NO-RELOAD-SYSTEM-DECLARATION), and run (UPDATE-SITE-CONFIGURATION-INFO).)
You do NOT need to set the options :NETWORK-NAMES (for IP address and network mask), :DEFAULT-INTERNET-ROUTING (for default router), :LOCAL-INTERNET-DOMAINS (for local host domains), or, if you use my DNS system, the DNS servers.
You are notified when your IP address changes, and if no lease can be acquired or renewed. You can inspect the current lease with (dhcp:describe-current-lease).
Caveat: when no IP address has been set up, we can't send/receive UDP packets, so we first use Link-Local IP (RFC 3927) to get a temporary address in the 169.254.x.y range.
Caveat (more technical): to change IP address, ideally only IP:SETUP-IP would be necessary. But since it doesn't re-enable UDP/TCP etc, we use NET:CONFIGURE instead. This has the side effect of resetting also Chaosnet. This is not too bad (it happens only when you change the IP address), unless you get a new IP while a Chaosnet connection is up. Under “normal circumstances” you get a new lease for the same address, and thus only reset Chaosnet initially. A workaround (refactoring NET:CONFIGURE to only affect IP) would be good, but I'll leave that for future work.
Download here in LambdaDelta tape format.