Commit graph

137 commits

Author SHA1 Message Date
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
Mark Pizzolato
68e442358b ETHER: Issue normal messages with sim_messagef() when appropriate 2019-01-22 13:56:12 -08:00
Mark Pizzolato
efd52d96bd ETHER: Explicitly allow MAC address to be the host interface MAC address
A warning will be issued unless an attach is done with the -Q switch.
2019-01-22 13:36:19 -08:00
Mark Pizzolato
ad40f57809 ETHER: Force a dedicated interface "up" if it is down 2019-01-20 18:23:49 -08:00
Mark Pizzolato
6f1255c142 ETHER: Fix reflection count error logic recently broken
Removed overloaded ambiguous return values from eth_reflect() and
eth_check_address_conflic().
2019-01-20 15:02:25 -08:00
Mark Pizzolato
7478ddc7d4 ETHER: Reject invalid MAC addresses while looking for address conflicts 2019-01-11 23:08:20 -08:00
Mark Pizzolato
8385ef50a6 ETHER: Only convert attach argument to lower case when it contains a ':' 2018-10-10 08:30:00 -07:00
Mark Pizzolato
6e65b635e3 ETHER: Accept upper or lower attach transport types (UDP, TAP, VDE, NAT) 2018-10-09 23:23:39 -07:00
Mark Pizzolato
0e544b71ff SCP: Fix various compiler warnings 2018-09-28 18:05:39 -07:00
Mark Pizzolato
0daa80e03d SCP: Add support for library unit test routines 2018-08-26 18:15:30 -07:00
Jordi Guillaumes Pons
2924b338df ETHER: Allow VDE connections to specify a particular virtual switch port
Syntax: attach XXX vde:/switch-path{:port}

Port is optional, if not specified VDE will choose (and maybe create) one
automatically
2018-01-27 03:10:02 -08:00
Mark Pizzolato
e058b0124b ETHER: Allow clean build with USE_NETWORK and not USE_READER_THREAD 2017-06-04 11:13:37 -07:00
Mark Pizzolato
2c6c8f4ef8 SCP: Always invoke strlcpy, strlcat, strcasecmp and strcasencmp vs sim_ forms 2017-05-07 19:19:55 -07:00
Mark Pizzolato
f5a1048101 ETHER: Explicitly use GetModuleHandleA API when finding DLL entry points 2017-05-07 19:00:49 -07:00
Mark Pizzolato
168d0d9c47 SCP: add generic length limted and case independent string for all platforms 2017-04-22 21:28:48 -07:00
Mark Pizzolato
c48b254228 ETHER: Fix packet length check to properly accomodate CRC data if needed
As discussed in #419
2017-04-03 14:49:54 -07:00
Mark Pizzolato
f4b7d1fbf8 SCP: Migrate some use of strcat() to sim_strlcat() 2017-03-27 08:23:03 -07:00
Mark Pizzolato
2d5711961f ETHER: Fix potential unterminated string (COVERITY) 2017-03-11 09:17:40 -08:00
Mark Pizzolato
c94659571f ETHER: Fix potential unterminated string and packet buffer overrun (COVERITY) 2017-03-11 03:14:33 -08:00
Mark Pizzolato
a8e93d2998 ETHER: include threading vs polling in the eth_capabilities() information. 2017-02-08 13:31:01 -08:00
Mark Pizzolato
08665e4989 ETHER: Add warning about potentially running as root for unavailable devices 2016-11-19 19:20:46 -08:00
Mark Pizzolato
7ab9b6abec ETHER: Support building with MinGW environment 2016-10-22 01:46:31 -07:00
Mark Pizzolato
1c4a1ed871 ETHER: Removed references to pcap_get_servicename since that API won't exist
Early versions of Npcap for Windows added pcap_get_servicename, but this
code was dropped when the latest libpcap codebase was merged into Npcap.
2016-08-12 12:36:10 -07:00
Mark Pizzolato
4065f47f8c SCP: Add sim_strncasecmp for platforms which may not have strncasecmp
Consolidated the existing two previously implementations which existed in
sim_serial and sim_ether.
2016-07-12 09:23:46 -07:00
Mark Pizzolato
626c3309fc ETHER: Support Npcap for Windows Ethernet packet transport
Prefer Npcap over WinPcap and support Npcap in either WinPcap compatible
mode or native mode.
2016-06-23 03:05:32 -07:00
Mark Pizzolato
a24aba69ae VIDEO: Added priority boost to thread performing SDL processing and updates
Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
2016-06-11 09:52:33 -07:00
Tony Nicholson
d9f3743783 ETHER: Fix incompatible ptr type and relocate _eth_get_system_id for Cygwin
Compilation under Cygwin with gcc 5.3.0 - missing const gave rise to
incompatible pointer type warning, and _eth_get_system_id for _WIN32
was included under a conditional for either _WIN32 or __CYGWIN__
and later redefined for !_WIN32
2016-06-03 00:35:54 -07:00
Mark Pizzolato
3dcd5124e9 ETHER: issue explanatory messages when rejecting invalid MAC addresses. 2016-05-24 08:45:28 -07:00
Mark Pizzolato
2d907980f1 ETHER: Add support for generated interface MAC addresses
sim> SET XQ MAC=aa:bb:cc:dd:ee:ff{/bits}{>filespec}

where:

- all of the aa:bb:cc:dd:ee:ff values must be hex digits
- bits is the number of bits which are to be taken from the supplied
   MAC aa:bb:cc:dd:ee:ff with legal values from 16 to 48 and a default
   of 48 bits.
- filespec specifies a file which contains the MAC address to be used
   and if it doesn't exist an appropriate generated address will be stored
   in this file and a subsequent SET MAC invocation specifying the same
   file will use the value stored in the file rather than generating a new
   MAC.

As discussed in #317
2016-05-23 16:56:06 -07:00
Mark Pizzolato
d3bc8f6633 ETHER: Fix compile issue when building on VMS. 2016-05-20 10:18:36 -07:00
Mark Pizzolato
2c16110d94 ETHER: Properly describe const MAC address parameter in eth_mac_fmt
Fix problem reported in #316
2016-05-18 14:43:49 -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
beaabbc35b ETHER: Add libpcap version information to the output of SHOW ETHERNET 2016-03-22 13:35:04 -07:00
Mark Pizzolato
7ad92f15fd ETHER: Avoid meaningless "No description available" output when opening device. 2016-02-07 06:51:08 -08:00
Mark Pizzolato
9df1b0e5b5 ETHER: Add local system adapter description to the attach confirmation message 2016-02-04 10:17:50 -08:00
Mark Pizzolato
027b15fe0f ETHER: Tolerate whitespace after network transport designators (tap:, vde:, nat:, udp:) 2015-10-20 14:12:44 -07:00