1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00

196 Commits

Author SHA1 Message Date
Mark Pizzolato
85e1957fd0 ETHER: Coalesce Ethernet devices with consistent hierarchical attach help
Migrate platform dependencies into sim_ether's help rather that
scattered amongst each functional Ethernet device.
2025-10-10 17:53:57 -10:00
Mark Pizzolato
7619e27394 ETHER: Avoid theoretical buffer overrun defining SIM_ETHER_CAPABILITIES 2025-09-06 12:40:39 -10:00
Mark Pizzolato
716b8117e1 SCP: Add Regex comparison condition to the IF command 2025-08-30 20:09:08 -10:00
Mark Pizzolato
903bf30280 ETHER: Fixed hanging SHOW ETHER on some platforms 2025-08-15 18:15:24 -10:00
Mark Pizzolato
caea0c0970 ETHER: Add vmnet support for macOS Catalina 10.15.7 through Big Sur 11.7.10 2025-08-14 08:55:49 -10:00
Mark Pizzolato
4915cdb4a7 ETHER: Support older versions of vmnet on macOS 2025-07-30 18:14:45 -10:00
Mark Pizzolato
e300c26b4e ETHER: Properly close file during running as root check 2025-07-26 17:12:48 -10:00
Mark Pizzolato
7bf227f02d ETHER: Properly report WiFi devices in SHOW ETHERNET output on Windows 2025-06-12 04:07:42 -10:00
Mark Pizzolato
0c46000d7a ETHER: Avoid another possible string truncation gcc warning 2025-06-08 16:05:25 -10:00
Mark Pizzolato
a212909a6c ETHER: Avoid possible string truncation gcc warning 2025-06-08 13:42:18 -10:00
Mark Pizzolato
44aef3392e ETHER: Properly determine interface MAC address under vmnet APIs
- Avoid using vmnet when compiler is gcc since completion routines
  are a clang only feature
2025-06-08 08:58:33 -10:00
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
a6aaa0a84f ETHER: Add missing declaration when Ethernet support is unavailable 2024-11-11 20:10:50 -10:00
Peter Schorn
c7df248f09 SIMH: Fix spelling errors in comments and strings 2024-07-16 12:04:53 -10:00
Mark Pizzolato
6073c022f8 ETHER: Give priority to grep -E vs egrep when determining device mac address 2024-06-21 11:38:12 -10:00
Mark Pizzolato
997952e712 ETHER: Add build support leveraging libpcap shared object without pcap.h
Some host systems come with the libpcap shared object installed.  If that
is the case, since the default build behavior is to dynamically load libpcap,
builds can now potentially avoid a forced install of the libpcap-devel package.
2024-04-17 11:12:42 -10:00
Mark Pizzolato
4dfb3508bf ETHER: Make sure SET NOASYNC is effective for Ethernet devices
- Make sure that asynchronous mode can't be changed if devices using
   sim_ether are already attached.
- Add missing DEV_ETHER type flag for the only sim_ether using device
   that didn't already have it.
2024-01-06 14:55:06 -10:00
Mark Pizzolato
0dfe5a40a0 ETHER: Load VDE support dynamically 2023-07-29 08:10:50 -10:00
Mark Pizzolato
63028863e4 SCP: Default to dynamically loading LIBEDIT, LIBPCRE and LIBPNG 2023-07-27 06:28:53 -10:00
Mark Pizzolato
79714192b4 SCP: Define and use a global macro to stringify macro values 2023-07-21 04:13:35 -10:00
Mark Pizzolato
ed5e47ab73 ETHER: Enhance version info and location of Npcap 2023-04-26 10:00:46 -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
88c6f7847f ETHER: Avoid errant stderr output while determining NIC MAC address
Also add grep -E as an alternate output filter
2023-01-16 16:50:30 -10:00
Mark Pizzolato
4377d93049 SCP: Avoid compile errors when compiled with UNICODE defined
On windows all platform specific APIs deliberately use ANSI APIs.
Fix these few inconsistencies.
2022-11-14 17:18:55 -10:00
Mark Pizzolato
bbc7bad132 ETHER: Give platform appropriate advice when no pcap devices are available
Windows needs Npcap/Winpcap, *nix systems usually need to run as root.
2022-08-12 13:39:03 -10:00
Mark Pizzolato
5823913230 ETHER: Make all supported packet types visible in eth_version() result 2022-08-11 02:35:04 -10:00
Mark Pizzolato
107813b11b SCP: Change sim_abort to SIM_SCP_ABORT macro.
SIM_SCP_ABORT is ONLY for use in scp support libraries
2022-07-30 11:18:08 -10:00
Mark Pizzolato
bc98e1c609 SCP: Be sure to flush output files when aborting.
Emit a last gasp message prior to flushing files before aborting.
2022-07-17 13:01:25 -10:00
Mark Pizzolato
becceeb889 ETHER: Assure there's enough space to fetch the system GUID on Windows 2022-03-17 12:17:40 -07:00
Mark Pizzolato
4fa0eaad99 ETHER: Correct reversed supported version check for Npcap 2022-03-12 14:28:24 -08:00
Mark Pizzolato
5465707d77 PDP11, VAX: Fix Coverity issues in XQ and XU devices 2022-03-11 12:34:59 -08:00
Mark Pizzolato
660e2b9f3f ETHER: Add stub to support shared code with simh v3.x code base 2022-02-20 09:01:54 -08:00
Mark Pizzolato
e6ebf96f05 ETHER: Fix stub unit test routine declaration when sim_ether isn't used 2022-02-07 23:08:20 -08:00
Mark Pizzolato
a4054f33b8 SCP: Add command argument passed into library unit test routines 2022-02-07 04:21:16 -08:00
Mark Pizzolato
7756a38e31 ETHER: Silence stderr when determining NIC hardware addresses
As reported in #1112
2022-01-10 04:08:44 -08:00
Paul Koning
5cd1e8b7ac TMXR, PDP11, PDP10, VAX: Add DDCMP sync framer support
This adds support for the "framer" device, which is a USB-connected
device built around a Raspberry Pico that connects to a synchronous
line, either RS-232 or DEC "integral modem" coax connection.  It
implements the framing portion of DDCMP: clock recovery for the
integral modem case, byte sync, and DDCMP frame handling including
CRC.  The actual DDCMP protocol state machine, with its handling of
sequencing, timeout and retransmit, etc. is left to the host
software.  All the design files for the framer may be found at
https://github.com/pkoning2/ddcmp .

This commit adds code to drive the framer from the TMXR library,
allowing it to be used either from simulated DMC-11 or simulated
DUP-11 devices.  Both have been tested, using RSTS/E, RSX-11/M+, and
TOPS-20.

Fixed the one-digit limit on eth<n> device names, the limit is now 2.
2022-01-08 14:24:42 -08:00
Mark Pizzolato
8b33921c92 PDP11, VAX, ETHER: Generalize XQ device address filtering
Add optional enabling of broadcast address to hash based filter model.
LANCE based devices which use its AUTODIN II based hash generally
match the broadcast address independent of the contents of the
multicast hash.

This change to XQ mostly undoes the prior change to pdp11_xq and
brings the functionality into sim_ether so that it is generally available
for future ethernet devices.
2021-12-14 11:39:18 -08:00
Mark Pizzolato
c5cd38afbf SCP, makefile: Rename build conditional HAVE_DLOPEN to SIM_HAVE_DLOPEN
Some dependent packages on some platforms may also define HAVE_DLOPEN
and that definition may have different syntax or semantics.  This change
avoids the potential symbol conflict.

As reported in #1098
2021-12-04 17:44:57 -08:00
Mark Pizzolato
4c64878f7c ETHER: When opening an unused interface , avoid invoking non existent programs 2021-08-28 13:15:54 -07:00
Mark Pizzolato
153d849c13 ETHER: When gathering host NIC address, avoid invoking non existent programs
Historically on *nix platforms ifconfig was used to find the host system's
interface MAC address.  This isn't always available on all systems since
it's being replaced by the ip command.  We now only invoke commands
that exist.
2021-08-28 05:01:47 -07:00
Mark Pizzolato
3597772a08 TMXR, ETHER: Silence potential compiler warnings 2021-06-08 13:39:20 -07:00
Mark Pizzolato
e82910570f ETHER: Add support to determine host NIC address without ifconfig
- Recent Linux versions don't install ifconfig by default and now use
  the new ip command for network details.
- Avoid writing command results to a temp file and use popen instead.
2021-01-31 12:56:05 -08:00
Mark Pizzolato
beaa1e7387 ETHER: Properly support builds when pcap isn't available 2020-12-24 21:38:22 -08:00
Mark Pizzolato
bcaf577d21 ETHER: Reorg for warning free build with and without Ethernet support 2020-12-11 07:18:59 -08:00
Mark Pizzolato
2f38b5f779 ETHER: Proper cleanup while getting Linux system id 2020-12-11 07:18:43 -08:00
Lars Brinkhoff
970fb8ec95 PDP10, ETHER, VIDEO, VAX: Fix set but unused variables. 2020-11-25 04:50:47 -08:00
Mark Pizzolato
31606161ce SCP: Avoid potential compiler warnings
Essentially all are non-functional problems but silencing them is a good idea
2020-10-09 05:09:41 -07:00
Mark Pizzolato
5e46b298f1 ETHER: Silence several Coverity warnings.
Most were noise and non-issues, but the change from fclose() to
pclose() was absolutely needed.

A false positive remains regarding tun variable going out of scope.
Under the conditions where a resource leak could occur, the tun
variable is saved in *fd_handle and thus not leaked.
2020-08-08 17:52:04 -07:00
Mark Pizzolato
782ee133df ETHER: Update comments and network notes to describe Npcap support 2020-06-13 14:40:17 -07:00
Mark Pizzolato
8c57893675 ETHER: Avoid potential compiler warning about version string overrun
gcc 9.3.0 on Ubuntu 20.04 somehow knows that the length of the
string pcap_lib_version() returns can be 256 bytes long.  It then
generates a warning about truncation potential.  The problematic
code path will only be executed on Windows with an old version of
Npcap, but the compiler can't know that.  Make the local buffer
larger to silence the resulting noise.
2020-05-08 05:28:52 -07:00