Commit graph

172 commits

Author SHA1 Message Date
Peter Schorn
0f6bcb9682 SIMH: Fix spelling errors in comments and strings 2024-07-11 12:29:53 +02:00
Steven A. Falco
5904fceddc The use of egrep is deprecated
On Fedora40, I get warnings that egrep is deprecated.  Replacing "egrep"
with "grep -E" eliminates the warnings, and is functionally identical.
2024-06-17 14:00:05 -04:00
Mark Pizzolato
7a6a325580 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-02-01 12:54:53 -05:00
B. Scott Michel
b588b4c28c ETHER: Add stub for clean compiles when building without network support 2022-09-19 12:17:48 -07: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
Mark Pizzolato
07c274ac97 ETHER: Restore support fir Windows Npcap as Ethernet packet API
Version of Npcap 0.9990 restores full WinPcap functionality

As discussed in nmap/nmap#1929 and nmap/nmap#1343
2020-04-06 10:36:31 -07:00
Ryo Kogulé
7fe9434528 ETHER: Fix tap support on OS/X
As reported in #823
2020-03-22 09:19:25 -07:00
Mark Pizzolato
b3214fcb59 ETHER: Emit advice when asynch operation is attempted without USE_READER_THREAD 2020-03-10 19:53:25 -07:00
Mark Pizzolato
de335bfd6a ETHER: Silence Coverity indicated potential issues 2020-03-07 22:36:24 -08:00
Mark Pizzolato
565596a5af ETHER: Minor adjustments for building on the simh 3.x codebase 2020-03-06 15:32:12 -08:00
Mark Pizzolato
721e2f42c5 ETHER: Report Windows Npcap as unsupported in the Ethernet version string
Current versions of Npcap can talk directly to the host system's network
stack.  This defect was just discovered.  Fortunately, WinPcap 4.1.3 works
as needed and is still functional on Windows 10.

As discussed in nmap/nmap#1929 and nmap/nmap#1343
2020-02-19 01:39:13 -08:00
Mark Pizzolato
27ebb9a8ee ETHER: Fix typo in comment 2020-02-16 17:13:38 -08:00
Mark Pizzolato
9ba85568ac ETHER: Review and revise code to address Coverity endianness concerns 2020-01-30 21:46:20 -08:00
Mark Pizzolato
15590be464 ETHER: Avoid potential memory leak on network shutdown. 2020-01-30 04:26:36 -08:00
Mark Pizzolato
829e64ae67 ETHER: Fix Coverity identified issues
- Let dynamically loaded (Shared Library) routines do argument checking
  if they've been successfully loaded.
- Properly cast file descriptors into SOCKET when stored in the fd_handle
- Clean up error paths when opening tun/tap transports - potential leaks.
- Avoid possible string overflow when opening a tap device on Linux
- Try another way to ignore a return from fread() without getting
  warnings.
2020-01-30 02:26:20 -08:00
Mark Pizzolato
30c182a10c ETHER: Clean compile warning on Windows compiled as C++ 2020-01-29 11:33:41 -08:00
Mark Pizzolato
c88a450628 ETHER: Restore missing _eth_devices() stub when networking is disabled 2020-01-23 23:42:28 -08:00
Mark Pizzolato
ff0ee479a2 ETHER: Simplify error messages when dynamic libpcap loading fails
Only issue load failure message once per execution.
2020-01-23 22:40:18 -08:00
Mark Pizzolato
b18912cda8 SCP: Silence GCC optimizer warnings about unused function results 2019-12-30 15:33:51 -08: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
7398e63b00 ETHER: Only reference pcap_lib_version() when HAVE_PCAP_NETWORK is defined 2019-09-03 00:39:09 -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
b1f3441f7f ETHER: Start newly opened interfaces blocking all packets
A device simulator is responsible for specifying exactly what categories of
packets it wants to receive.  It should do that after having opened the device.
This change avoids collecting packets that aren't actually interesting until
after the device designates which packets it is interested in.
2019-05-07 18:41:36 -07:00
Mark Pizzolato
5343dae137 ETHER: Fix potential compile warning about buffer overrun 2019-04-16 15:56:32 -07:00
Mark Pizzolato
456aa3ed5d ETHER: Gracefully handle dynamic pcap library initialization errors
- Test BPF using all available Ethernet capable interfaces
2019-04-15 16:49:08 -07:00
Mark Pizzolato
c7b0928b33 SCP: Avoid potential buffer overruns by using strlcpy() and strlcat() 2019-03-08 12:31:01 -08:00
Mark Pizzolato
a1ecce16bf ETHER: Add tests for crc and bpf filter construction logic 2019-02-02 12:44:09 -08:00
Mark Pizzolato
f7a17cae15 ETHER: Fix BPF filter generation for promiscuous mode when reflections 2019-01-29 23:03:04 -08:00