Commit graph

62 commits

Author SHA1 Message Date
Mark Pizzolato
e69c3adf5f SOCKETS: Suppress expected read error message on close of a blocking socket. 2015-02-15 12:06:53 -08:00
Mark Pizzolato
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
Mark Pizzolato
4c8e1631b5 FRONTPANEL: Cleanup for building as C++. Add initial support for device panels concurrently on a simulator. Added an API to set a register value. 2015-02-12 14:59:24 -08:00
Mark Pizzolato
bc9e79a266 SOCKETS: Fixed error suppression when connecting a blocking mode TCP socket 2015-02-11 13:47:54 -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
f2674766ca SOCK: Add TCP keepalive support to all incoming and outgoing TCP sockets.
This allows detection of network failures when there is no traffic across established circuits,
2015-02-06 14:52:09 -08:00
Mark Pizzolato
c083b45c14 TMXR, SOCK: Properly declare as const string input only arguments. 2014-12-06 03:50:45 -08:00
François Revol
b2aaec0b3e Haiku has socklen_t 2014-08-31 22:31:30 +02: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
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
02cb5c2d88 Compiler suggested cleanups.
Mostly silencing noise warnings, but bugs were found in sim_console.c and pdp11_dmc.c
2014-02-14 17:07:45 -08:00
Mark Pizzolato
c8991a4084 SOCK: avoid calling strcpy with overlapping arguments when converting IPv4-mapped address strings. Fixes issue #111 2014-02-12 03:40:10 -08:00
Mark Pizzolato
9ab6c4d1c1 SOCKET: Extended TMXR packet capabilities to disable the Nagle algorithm when TCP packets transports are used. 2014-01-23 09:31:05 -08:00
Mark Pizzolato
86e342501d SCP: One more static analyzer potential issue from Peter Schorn. 2013-12-28 05:31:07 -08:00
Mark Pizzolato
2bb502ee64 SCP: Static Analyzer cleanups suggested by Peter Schorn 2013-12-27 07:08:17 -08:00
Mark Pizzolato
834e986eaf ETHER,VAX,PDP11: Added UDP as a link type for Ethernet packet connectivity.
This will allow a single simulator to directly connect to HECnet systems without needing an external bridge program.
2013-12-05 11:58:58 -08:00
Mark Pizzolato
c9f73eac90 H316: Rewrote h316_udp to use TMXR lines for UDP transport of data. Changed h316_mi to leverage built-in loopback mode in TMXR.
This gives UDP transport on all simh host platforms.
2013-11-26 13:30:11 -08:00
Mark Pizzolato
beac643acb SCP/SOCKET: Apply default host more reasonably when parsing host:port strings 2013-11-26 11:07:21 -08:00
Mark Pizzolato
4259b3c83a TMXR: Added option to use UDP transport for packet transport 2013-11-25 04:36:21 -08:00
Mark Pizzolato
2e85e74699 SCP: Various cleanups.
- Avoid assignments of void * values.  Cast all memory allocation return values to appropriate types.
- Add output to sim_log where missing in various places.
- Fixed issue with lost file positions after a restore for devices which leverage the UNIT_SEQ flag.
2013-11-20 09:13:27 -08:00
Mark Pizzolato
43f85d1f3a SCP/TMXR: Fix to socket writes to return 0 bytes written as an expected condition when the output socket is full (EAGAIN or EWOULDBLOCK). 2013-11-04 05:21:58 -08:00
Mark Pizzolato
c22063c431 sim_sock.c allow validation address to match various forms of literal localhost addresses. 2013-08-27 10:41:49 -07:00
Mark Pizzolato
8d1a1344f0 Added sim_getnames_sock to get a printable form of the endpoints of a socket 2013-05-15 13:47:40 -07:00
Mark Pizzolato
0b1fe53943 Use generic message routine for sim_accept_conn and sim_read_sock and don't emit a message if a read fails due to ECONNRESET (this is expected). 2013-05-14 17:10:51 -07:00
Mark Pizzolato
9faef6ea89 Added separate debugging ability to trace line connect/disconnect activities to better debug virtual null modem cable activities. 2013-05-06 07:50:09 -07:00
Mark Pizzolato
60695d3647 Missing change for issue #48 2013-04-23 12:53:35 -07:00
Mark Pizzolato
b04b7ae5b1 Fixed socket creation issue which happens on some IPv6 capable systems which don't have IPv6 enabled but return IPv6 family addresses with getaddrinfo. This is issue #48 2013-04-23 12:27:16 -07:00
Mark Pizzolato
34ad155854 Compiler suggested cleanups 2013-04-13 05:25:25 -07:00
Mark Pizzolato
6fd3e5f498 Added an message text for additional socket error which can be expected to happen on windows 2013-04-12 12:58:08 -07:00
Mark Pizzolato
6f44a394e6 Added option to create listen sockets with SO_REUSEADDR if attach is done with -U switch set. Requested by Michael Mondy 2013-04-12 12:40:56 -07:00
Mark Pizzolato
b125da77cc Fixed prior logic in sim_check_conn to return error conditions prior to read/write checks and to validate the peer's address on both read and write connection checks. 2013-03-31 20:32:41 -07:00
Mark Pizzolato
d308a234e2 Fixed sim_check_conn to return error status if the socket being checked is writable and no peer name exists (i.e. when a connect has failed). Suggested by Paul Koning 2013-03-31 10:44:17 -07:00
Mark Pizzolato
1e515d8357 HP-UX socket fixes from Mikulas Patocka.
1. getaddrinfo returns IPv6 address even if IPv6 is not configured.
The socket syscalls fails to create IPv6 socket. This is fixed by retrying for all possible addresses returned by getaddrinfo.

2. On HP-UX EAGAIN is used, not EWOULDBLOCK.
2013-03-18 06:07:27 -07:00
Mark Pizzolato
eb101e3881 HP-UX port supplied by Mikulas Patocka 2013-03-05 13:29:38 -08:00
Mark Pizzolato
4ff56d6c15 Changed all internal #ifdef's which were conditional on __linux to be conditional on either __linux or __linux__. Some platforms (PPC) don't define __linux when gcc is invoked with -std=c99. 2013-02-20 21:57:02 -08:00
Mark Pizzolato
e6eae9194f Fixed last change which only still worked if the OS returned the IPv6 socket first and now failed completely if not. 2013-01-23 15:12:35 -08:00
Mark Pizzolato
6dfef8a471 Prefer IPv6 addrinfo structures when binding a listening port. Not all platforms (OSX) return IPv6 addrinfo blocks as the first entry in the list. 2013-01-23 14:19:38 -08:00
Mark Pizzolato
5f44b2e7db Add support to listen on IPv4 and IPv6 sockets when compiling on XP but running on later (IPv6 capable) Windows environments 2013-01-13 21:01:49 -08:00
Mark Pizzolato
dac73b9381 Migrating scp and library global variables to be declared as extern in the appropriate library include file and remove repetitive declarations in referencing modules. 2013-01-10 13:29:15 -08:00
Mark Pizzolato
f51a702ebd Fixed sim_parse_addr to actually use the default_host parameter if a host component wasn't provided in the input 2013-01-06 05:11:51 -08:00
Mark Pizzolato
3346f4a32c Fix build on VMS (IA64) 2012-12-19 12:45:03 -08:00
Mark Pizzolato
d955c383e9 Fixed compiler warnings and errors when compiling with MinGW 2012-12-15 09:41:13 -08:00
Mark Pizzolato
0450a9b430 Compiler suggested cleanup 2012-12-15 07:56:42 -08:00
Mark Pizzolato
b466bdc9c6 Compiler warning cleanup 2012-12-13 13:41:57 -08:00
Mark Pizzolato
7f6a1af5bf Added an optional validation argument to sim_parse_addr for callers which need to confirm incoming connections come from expected sources 2012-12-09 12:12:09 -08:00
Mark Pizzolato
3e78dc6732 sim_sock.c - preferred a bare textual IPv4 address be returned over an IPv4-mapped format address when returning the connecting IP address string in sim_accept_conn. 2012-11-06 16:38:43 -08:00
Mark Pizzolato
02cb620c9b Change to support serial ports on multiplexer devices without any changes to existing multiplexer device emulation code.
Added support for per line tcp listen ports.
Added support for per line outgoing tcp/telnet connections.

Removed DEV_NET from pdp11_dz and pdp11_vh emulators to allow proper restore of
2012-10-17 08:40:01 -07:00
Mark Pizzolato
30ce7fdbaa Revised the socket library sim_sock(.c & .h) to support both IPv4 and IPv6 leveraging the RFC3493 APIs.
All dependent code has been updated to use the revised interfaces.
2012-09-28 15:34:55 -07:00
Mark Pizzolato
aa7c50eb38 Compiler cleanup for issues noticed during x64 compiles 2012-01-17 04:09:34 -08:00
Bob Supnik
a9fd3dd518 Notes For V3.8
The makefile now works for Linux and most Unix's. However, for Solaris
and MacOS, you must first export the OSTYPE environment variable:

> export OSTYPE
> make

Otherwise, you will get build errors.

1. New Features

1.1 3.8-0

1.1.1 SCP and Libraries

- BREAK, NOBREAK, and SHOW BREAK with no argument will set, clear, and
  show (respectively) a breakpoint at the current PC.

1.1.2 GRI

- Added support for the GRI-99 processor.

1.1.3 HP2100

- Added support for the BACI terminal interface.
- Added support for RTE OS/VMA/EMA, SIGNAL, VIS firmware extensions.

1.1.4 Nova

- Added support for 64KW memory (implemented in third-party CPU's).

1.1.5 PDP-11

- Added support for DC11, RC11, KE11A, KG11A.
- Added modem control support for DL11.
- Added ASCII character support for all 8b devices.

1.2 3.8-1

1.2.1 SCP and libraries

- Added capability to set line connection order for terminal multiplexers.

1.2.2 HP2100

- Added support for 12620A/12936A privileged interrupt fence.
- Added support for 12792C eight-channel asynchronous multiplexer.

1.3 3.8-2

1.3.1 SCP and libraries

- Added line history capability for *nix hosts.
- Added "SHOW SHOW" and "SHOW <dev> SHOW" commands.

1.3.2 1401

- Added "no rewind" option to magtape boot.

1.3.3 PDP-11

- Added RD32 support to RQ
- Added debug support to RL

1.3.4 PDP-8

- Added FPP support (many thanks to Rick Murphy for debugging the code)

1.3.5 VAX-11/780

- Added AUTORESTART switch support, and VMS REBOOT command support

2. Bugs Fixed

Please see the revision history on http://simh.trailing-edge.com or
in the source module sim_rev.h.
2011-04-15 08:36:09 -07:00