Skip to content

Commit c064bb6

Browse files
committed
Revert vmnet support, PR #443
This reverts commits 361ef76 through 6fd146a.
1 parent c20b391 commit c064bb6

File tree

6 files changed

+0
-350
lines changed

6 files changed

+0
-350
lines changed

0readme_ethernet.txt

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -213,79 +213,6 @@ Note: As mentioned above, NAT networking is specifically capable of providing
213213
packets.
214214

215215

216-
-------------------------------------------------------------------------------
217-
Another alternative to pcap and tun/tap on macOS is using the vmnet framework.
218-
The vmnet framework provides simh a way to provide emulated systems networking,
219-
without requiring any additional software. Because tun/tap support requires
220-
third-party kernel extensions (which is heavily discouraged by Apple), this
221-
provides an equivalent that doesn't require reducing OS security.
222-
223-
vmnet provides Layer 2 networking, so things like DECnet and MOP will work
224-
properly, even across multiple systems. It can be used to either bridge to a
225-
physical network, or provide a virtual network for systems, including NAT.
226-
227-
simh must be running as root. (Running without root is possible if simh is a
228-
notarized application. You're very unlikely to be building simh like this, so
229-
de facto it needs root.) vmnet.framework requires macOS 10.10; macOS 10.15 is
230-
required for bridged networking.
231-
232-
When attaching an ethernet device, you have three options available:
233-
234-
- "vmnet:host": This provides "host-only" networking. It allows the system to
235-
talk to the host Mac, as well as other emulated systems on the host-only VM
236-
network.
237-
- "vmnet:shared": This extends the host-only network to add NAT, using the
238-
host as a gateway.
239-
- "vmnet:<device>": This bridges vmnet to a physical network. You must
240-
specify a valid network device to use.
241-
242-
You can use SHOW ETHERNET in SCP to see what devices are allowed to be
243-
bridged; these are likely your Ethernet and Wi-Fi devices.
244-
245-
sim> show eth
246-
ETH devices:
247-
eth0 vmnet:en0
248-
eth1 vmnet:en7
249-
eth2 udp:sourceport:remotehost:remoteport
250-
sim> attach xq vmnet:en0
251-
252-
You can verify with i.e. "ifconfig" to see if this is the correct interface
253-
to bridge to.
254-
255-
When using the host and shared modes, the host system create an IPv4 and v6
256-
subnet for the emulated systems. macOS will provide DHCP and other discovery
257-
protocols on the virtual network as well. To see what IP and subnet the host
258-
has claimed, you can use "ifconfig" to display it; macOS will bind its IP to
259-
the bridgeN device, with the simh instance having its own vmenetN device joined
260-
to that bridgeN device:
261-
262-
vmenet0: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
263-
options=60<TSO4,TSO6>
264-
ether a6:94:63:7e:f3:04
265-
media: autoselect
266-
status: active
267-
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
268-
options=3<RXCSUM,TXCSUM>
269-
ether b2:f1:d8:65:66:64
270-
inet 192.168.67.1 netmask 0xffffff00 broadcast 192.168.67.255
271-
inet6 fe80::b0f1:d8ff:fe65:6664%bridge100 prefixlen 64 scopeid 0x23
272-
inet6 fd91:d62b:63cd:ec3d:4ad:c40c:d0b8:5826 prefixlen 64 autoconf secured
273-
Configuration:
274-
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
275-
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
276-
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
277-
ipfilter disabled flags 0x0
278-
member: vmenet0 flags=3<LEARNING,DISCOVER>
279-
ifmaxaddr 0 port 34 priority 0 path cost 0
280-
nd6 options=201<PERFORMNUD,DAD>
281-
media: autoselect
282-
status: active
283-
284-
Currently, settings like the subnet ranges nor port forwarding are controllable
285-
via simh. For finer grained control over how systems are addressed, you can use
286-
a bridged network instead of a host-only or shared network. These settings are
287-
provided by macOS, so a future version of simh may be able to adopt these.
288-
289216
-------------------------------------------------------------------------------
290217

291218
Windows notes:

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ option(WITH_VDE
199199
option(WITH_TAP
200200
"Enable (=1)/disable (=0) TAP/TUN device network support. (def: enabled)"
201201
TRUE)
202-
option(WITH_VMNET
203-
"Enable (=1)/disable (=0) macOS vmnet.framework network support. (def: enabled)"
204-
TRUE)
205202
option(WITH_VIDEO
206203
"Enable (=1)/disable (=0) simulator display and graphics support (def: enabled)"
207204
TRUE)

cmake/dep-link.cmake

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -351,36 +351,6 @@ if (WITH_NETWORK)
351351
list(APPEND NETWORK_PKG_STATUS "NAT(SLiRP)")
352352
endif (WITH_SLIRP)
353353

354-
if (WITH_VMNET AND APPLE)
355-
# CMAKE_OSX_DEPLOYMENT_TARGET is attractive, but not set by default.
356-
# See what we're using, either by default or what the user has set.
357-
check_c_source_compiles(
358-
"
359-
#include <Availability.h>
360-
#if TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
361-
#error macOS too old
362-
#endif
363-
int main(int argc, char **argv) { return 0; }
364-
" TARGETING_MACOS_10_10)
365-
if (NOT TARGETING_MACOS_10_10)
366-
message(FATAL_ERROR "vmnet.framework requires targeting macOS 10.10 or newer")
367-
endif()
368-
369-
# vmnet requires blocks for its callback parameter, even in vanilla C.
370-
# This is only supported in clang, not by GCC. It's default in clang,
371-
# but we should be clear about it. Do a feature instead of compiler
372-
# check anyways though, in case GCC does add it eventually.
373-
check_c_compiler_flag(-fblocks HAVE_C_BLOCKS)
374-
if (NOT HAVE_C_BLOCKS)
375-
message(FATAL_ERROR "vmnet.framework requires blocks support in the C compiler")
376-
endif()
377-
target_compile_options(simh_network INTERFACE -fblocks)
378-
379-
target_link_libraries(simh_network INTERFACE "-framework vmnet")
380-
target_compile_definitions(simh_network INTERFACE HAVE_VMNET_NETWORK)
381-
list(APPEND NETWORK_PKG_STATUS "macOS vmnet.framework")
382-
endif(WITH_VMNET AND APPLE)
383-
384354
## Finally, set the network runtime
385355
if (NOT network_runtime)
386356
## Default to USE_SHARED... USE_NETWORK is deprecated.

makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,13 +1063,6 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
10631063
NETWORK_CCDEFS += -DUSE_NETWORK
10641064
endif
10651065
endif
1066-
# XXX: Check for the target version of macOS, check for -fblocks
1067-
ifeq (Darwin,$(OSTYPE))
1068-
# Provide support for macOS vmnet.framework (requires 10.10)
1069-
NETWORK_CCDEFS += -fblocks -DHAVE_VMNET_NETWORK
1070-
NETWORK_LAN_FEATURES += vmnet.framework
1071-
NETWORK_LDFLAGS += -framework vmnet
1072-
endif
10731066
ifeq (slirp,$(shell if ${TEST} -e slirp_glue/sim_slirp.c; then echo slirp; fi))
10741067
NETWORK_CCDEFS += -Islirp -Islirp_glue -Islirp_glue/qemu -DHAVE_SLIRP_NETWORK -DUSE_SIMH_SLIRP_DEBUG slirp/*.c slirp_glue/*.c
10751068
NETWORK_LAN_FEATURES += NAT(SLiRP)

0 commit comments

Comments
 (0)