1
0
mirror of https://github.com/simh/simh.git synced 2026-02-28 09:18:31 +00:00
Commit Graph

26 Commits

Author SHA1 Message Date
Mark Pizzolato
61fe27cb47 ETHER: Add Apple vmnet support when running on macOS
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.
2025-06-06 14:51:46 -10:00
Mark Pizzolato
be831daa1d SCP: Assure that ASSURE() gets used instead of assert() 2023-06-27 13:27:56 -10:00
Mark Pizzolato
194b313179 SCP: Fold up include files used by all simulators
- Add common system includes used in may places which are allowed
  and thus added directly in sim_defs.h.
- Separate completely private system data structures and system APIs
  for use only by SCP library routines into sim_scp_private.h.
2023-03-04 17:51:49 -10:00
Mark Pizzolato
0429c25ae7 slirp_glue: Set line endings to CRLF for consistency with other simh source 2023-03-04 14:26:04 -10:00
Mark Pizzolato
89cd649c77 SOCKET: Implement missing non-blocking for TCP sockets opened with connect
Outbound connections are rare and most may have wanted explicit blocking
behavior, so no one noticed the missing non-blocking case.

Any place which did do outbound connects have explicitly added
SIM_SOCK_OPT_BLOCKING so that the prior behavior is preserved.

The SIM_SOCK_OPT_BLOCKING flag is no honored as it was originally
intended to be.
2020-03-18 00:47:48 -07:00
Mark Pizzolato
108291b3d4 ETHER: Fix fault when parsing bad NAT: parameters adding better error reporting 2019-09-05 17:40:16 -07:00
Mark Pizzolato
a031e69881 ETHER: Fix additional race when closing a NAT(slirp) network connected device 2019-08-23 23:55:41 -07:00
Mark Pizzolato
6a193c032d ETHER: Fix possible race conditions when closing a network device
Added pcap version to the SCP output of SHOW VERSION command.
2019-08-13 20:04:09 -07:00
Mark Pizzolato
06d78600b3 SLIRP: Fix Coverity changes 2019-04-12 00:39:49 -07:00
Mark Pizzolato
b57b1b99ba SLIRP: Enrich help info to clarify NAT option parameters 2019-01-22 11:18:04 -08:00
Mark Pizzolato
9e60a8e783 slirp: Accommodate building under newer C++ compilers 2018-07-15 07:37:54 -07:00
Mark Pizzolato
0c0a9958b1 slirp: change tabs to spaces 2018-05-08 13:04:39 -07:00
Mark Pizzolato
0da9a49c66 slirp: Avoid warnings when compiling with both new and older versions of clang 2017-12-02 15:56:48 -08:00
Mark Pizzolato
b080aa7a2f slirp: Avoid compiler warnings about address of packet members 2017-12-02 15:50:24 -08:00
Mark Pizzolato
b5a5aec57a SCP: Avoid potential macro redefinition for strcasecmp() and strncasecmp() 2017-04-24 13:44:40 -07:00
Mark Pizzolato
3af3a8ea54 SLIRP:: Coverity cleanup 2017-03-31 17:48:30 -07:00
Mark Pizzolato
d98564544e SLIRP: silence Coverity noise 2017-03-27 20:48:27 -07:00
Mark Pizzolato
489752596b SLIRP: Coverity identified warning 2017-03-26 11:49:05 -07:00
Mark Pizzolato
979aec293e SLIRP: Fix potential NULL pointer dereference and excess left shift (COVERITY) 2017-03-13 12:58:40 -07:00
Mark Pizzolato
d4f38d5358 SCP: Add compiled architecture and release/debug info to SHOW VERSION 2016-10-01 07:38:42 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
1b6f28a743 SLIRP: Allow NAT networking even if pthreads are not available.
As mentioned in #284
2016-03-09 10:02:13 -08:00
Tony Nicholson
4d25cc4bc5 slirp_glue: cleanup compiler warning of duplicate definition of O_BINARY under Cygwin 2016-02-25 10:03:49 +11:00
Mark Pizzolato
1d0a3b4402 slirp: Describe NAT limitations in the attach help 2015-10-29 05:06:01 -07:00
Mark Pizzolato
480c71dea5 slirp: Fix g_array_free to correctly handle freeing an unallocateed GArray. Fix #243 2015-10-26 06:03:12 -07:00
Mark Pizzolato
7ad57d7fa8 slirp: cleanup for submission upstream back to qemu
Minimize the include file set and their contents to only provide the slirp
 referenced qemu includes and interfaces.
2015-10-22 09:55:05 -07:00