mirror of
https://github.com/simh/simh.git
synced 2026-02-27 17:13:44 +00:00
Base vmnet support covers bridged network interfaces and locally accessible TAP network connections. These reflect the vmnet bridged and host behaviors which are leveraged under the covers, but configured using the original sim_ether commands. The resulting bridged case behaves like the Windows network connections do (with direct access to and from the local LAN as well as the host system) using the natural interface name. NAT behaviors are specifically supported using the original SLiRP code since the vmnet support depends on simulators primarily getting IPv4 addressing via DHCP, but essentially no simh simulators actually had OS network code which used DHCP and all merely used static network address setup. The vmnet (shared/NAT) support can't be configured to operate with the same DHCP and static IP addresses provided by the original SLiRP implementation and to avoid the need to specifically change hard coded simulator IPv4 addresses before things could work. - Detect which network interfaces are WiFi (when possible) and thus not useful candidates for bridging. - Cleanly report when running as root is needed. - Avoid allowing network connections to interfaces which aren't actually connected to a network. - Add support to explicitly set TAP network host side network interface's IPv4 address and netmask. This optional support is provided specifically for the Apple vmnet case, but not for other platforms using TAP network connections due to the various ways that must be handled with external commands. - Add host system's IPv4 address, netmask, media type and connection state to interface descriptions visible via SHOW ETHERNET. Some system environments may have a significant number of potential network interfaces, most of which aren't interesting to connect simulators to. Knowing which interfaces are actually in useful states helps users select the correct device. The vmnet aspect of this functionality was originally inspired by Calvin Buckley's pull request to the open-simh repository. That solution wouldn't actually operate well certainly for NAT cases due to the forced DHCP to non-configurable address blocks and the lack of any way to support static addresses TCP or UDP port mapping.
The files in and below this directory are the necessary glue and stubs to allow the effectively unmodified qemu slirp code to be used in simh as a network connection mechanism. Most of the include files here started from related files in the qemu include directories and have been chopped up and tweaked as necessary so that the slirp code can be used outside of qemu. Slirp depends on a small set of capabilities from glib (GArrays mostly). All of the other include files exist so that the references in the slirp code don't have to be modified. - Mark Pizzolato