Commit graph

124 commits

Author SHA1 Message Date
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
Mark Pizzolato
5c117caaed slirp: Fix slow/choppy data flow. 2015-10-16 05:10:30 -07:00
Mark Pizzolato
40a3e8b635 slirp: Enable slirp debugging using XQ DEBUG=ETH 2015-10-15 15:57:53 -07:00
Mark Pizzolato
86d1e36f29 all VAX, PDP11: Add initial NAT based ethernet connectivity via SLiRP.
This should work on all byte addressable host systems using GCC/clang to build.

The QEMU slirp code has been pried out of QEMU and stubs have been created to solve where the current slirp is entangled with the QEMU code.  Ths slirp/simh directory contains all the necessary include and glue files to make this useful.  Everything in the slirp directory is unmodified QEMU code.
2015-10-15 12:59:32 -07:00
Mark Pizzolato
73d7aee71f SCP: Add printf style format argument validation for all functions which take printf arguments.
These include: sim_printf(), sim_messagef(), Fprint() and sim_debug().

Fix current use of these functions which had invalid arguments.
2015-10-09 04:12:25 -07:00
Mark Pizzolato
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
Mark Pizzolato
1fb209c275 SOCKETS: Cleanup, simplify and extend the sim_sock API set.
Cleanup/Simplification by:
	1) removing irrelevant master flag variable from sim_close_sock and thus sim_err_sock
	2) change previous boolean feature arguments (datagram, nodelay, reuseaddr) to flag bits in a single option argument.  This allows for features to be added by new flag bits which don't change the calling signatures.
	3) changed all status returns to be int (vs t_stat) with success being 0 and error being -1
	4) removed unneeded simh specific type references to allow sim_sock to be used by n
Extended API by providing flags to influence socket setup/behavior:
	SIM_SOCK_OPT_REUSEADDR	Retains prior behavior when sim_switches had -U set
	SIM_SOCK_OPT_DATAGRAM	UDP socket setup provided for when prior datagram argument was specified
	SIM_SOCK_OPT_NODELAY		TCP Nagle disable provided for when prior nodelay argument was specified
	SIM_SOCK_OPT_BLOCKING	Blocking socket mode (detault is non blocking)
2015-02-11 09:41:18 -08:00
Mark Pizzolato
fe43187cde ETHER: Fix compile when threaded network I/O is disabled on OS X (found by Martin Vorländer) 2015-01-02 05:01:32 -08:00
Mark Pizzolato
9c5df04de4 PDP11, VAX: Make sure to initialize amount of data processed for incoming packets which get read into multiple buffer descriptors 2014-10-09 11:15:11 -07:00
Mark Pizzolato
01c725fcdf ETHER: Avoid compiling internal support routines for simulators which don't have ethernet devices 2014-10-04 12:44:05 -07:00
Mark Pizzolato
9a0d035e78 ETHER: Fix asynch reader thread rundown in error recovery path. 2014-07-17 08:58:50 -07:00
Mark Pizzolato
b907790cc1 ETHER: Fix to allow proper building and operation when networking support is undesired or unavailable. #143 2014-07-10 14:53:21 -07:00
Mark Pizzolato
d26bf25e97 Compiler suggested cleanups 2014-06-10 14:21:11 -07:00
Mark Pizzolato
c15c0058f4 ETHER: Made LAN connections more robust under failing network conditions.
Avoid permanent network network hangs when a network transport starts to return errors for various reasons.
These hangs also result in at least one thread in a CPU bound loop attempting to read on a pcap connection which will never be useful again.

When transmit or receive errors occur, the invoking thread sleeps for 1 second and subsequent operations proceed.  When the total of read + write errors reaches a multiple of ETH_ERROR_REOPEN_THRESHOLD the current transport connection (usually pcap) is closed and re-opened after a ETH_ERROR_REOPEN_PAUSE second delay.  If the open succeeds, we're happy.  If it fails, then the link behaves as if it were never attached until some subsequent operator intervention is performed.

Activities which are known to induce this problems include (but are not limited to) when a simulator is running in a Windows Virtual Machine on a Hyper-V host system and the Hyper-V host system performs a SAVE and a subsequent Restart of the Guest Windows Virtual Machine.  This operation can occur due to specific operator requests or merely when the Hyper-V host system reboots.
2014-06-10 10:20:02 -07:00