Commit graph

129 commits

Author SHA1 Message Date
Mark Pizzolato
c083b45c14 TMXR, SOCK: Properly declare as const string input only arguments. 2014-12-06 03:50:45 -08:00
Mark Pizzolato
4eed007607 SCP: Restructured timer/co-scheduling activities to support co-scheduling on specific timers 2014-12-02 05:33:59 -08:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
2e1167d4a0 Compiler suggested cleanups - mostly const fixups 2014-10-26 17:06:24 -07:00
Mark Pizzolato
02e90de6a4 SCP: Added EXPECT and SEND commands to react to data from and inject data into the simulated console port (and other MUX ports)
Ideas based on Dave Bryan's console halt efforts.

	sim> SEND {<mux>:line} {DELAY=n,}"string"

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
Delay is optional and once set persists for subsequent SEND operations to the same device.  Delay defaults to 1000.  The DELAY value is a minimum number of instructions which must execute before the next character in the provided string will be injected to the console port.  The DELAY value has effect between the characters delivered as well.  "string" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).

Each device (console, and each line in each mux) has a separate value for DELAY.

An arbitrary number of 'expect' conditions can be defined.  The command syntax is:

              sim> EXPECT {<mux>:line} {[cnt]} "matchstring" {actioncommand {; actioncommand ...}}

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
"matchstring" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).  The quotes used can be single or double quotes, but the closing quote must match the opening quote.  The match string might be extended to allow the use of perl style regular expressions in the "matchstring" when a -R switch is specified on the command line.

              sim> EXPECT "Enter Color: "  SEND "Red\r"; g

A specific 'expect' condition can be removed with:

              sim> NOEXPECT {<mux>:line} "matchstring"

All 'expect' conditions can be removed with:

              sim> NOEXPECT {<mux>:line}

'expect' conditions can be examined with:

              sim> SHOW EXPECT {<mux>:line}

Expect rules are one-shots (i.e. they disappear once a match has occurred) unless they are explicitly described as persistent with the -P switch.
The -C switch is available when defining expect rules.  The effect of a rule defined with the -C flag is that when an expect match occurs for that rule, ALL rules are cleared for that device (console or <mux>:line).
2014-10-14 10:49:24 -07:00
Mark Pizzolato
f6eb4bc4f5 SCP: Fix buffered console implementation to correctly retain buffering attributes across independent SET CONSOLE commands 2014-05-11 06:16:46 -07:00
Mark Pizzolato
746e5ab88c SCP: Fix reporting of console's buffering status. Fix parsing of MUX settings which were simply interpreted by matching a single token. Reported by Mark Bensen. 2014-05-05 05:30:35 -07:00
Mark Pizzolato
84707acc7e Compiler suggested cleanup 2014-04-11 09:39:19 -07:00
Mark Pizzolato
74482ce448 PDP10, PDP11, VAX: Make sure that the DMC and DUP devices produce the right messages when an attach is attempted to an already attached line 2014-04-06 16:42:10 -07:00
Mark Pizzolato
ff0191cf29 TMXR: Properly enable packet mode (as inherited from the main mux) on each line. Only produce modem debug output when modem signals have changed. Cleanup the output of SHOW MUX. 2014-04-02 13:07:26 -07:00
Mark Pizzolato
edb475fcc1 PDP10, PDP11, VAX: Fix DMC & DUP unit attach strings for multi-line device configurations. 2014-04-02 08:47:35 -07:00
Mark Pizzolato
e79e41d9e4 TMXR: Change DSR to reflect attached state of line and DCD to reflect connected state of the line. 2014-04-01 19:45:47 -07:00
Mark Pizzolato
0f417ed4ca TMXR: Change modem DSR & DCD to never be indicated as on unless a connection is present. 2014-04-01 08:07:43 -07:00
Mark Pizzolato
017141c9a3 TMXR: Enable proper inheritance of mux global/default buffering value to individual lines. 2014-03-30 13:36:41 -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
fc885f80dc TMXR: Be sure to correctly allocate the appropriate sized line transmit and receive buffers when a mux or line is attached. 2014-03-27 04:35:16 -07:00
Mark Pizzolato
66a02b877b TMXR: Avoid attempting to manage unit connect strings for never attached devices 2014-03-25 06:47:37 -07:00
Mark Pizzolato
090b2f83f2 PDP10, PDP11, VAX: Avoid corrupting a DMC/DMR unit attach string when a line state transitions 2014-03-17 08:48:02 -07:00
Mark Pizzolato
194b35f6e8 TMXR: avoid calling strcpy with overlapping arguments 2014-03-11 19:30:28 -07:00
Mark Pizzolato
44f66e90eb MUX: Added delay after closing a socket created to validate a port specification. Suggested by Mark Emmer
The network stack on Windows XP needs an opportunity to cleanup after closing a listening socket which was created but not used,
2014-02-23 08:54:00 -08: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
cde0be5573 TMXR: Added support to reasonably set modem bits when a line has dedicated listen port defined or uses datagram transport. 2014-02-06 17:08:38 -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
33248778cf TMXR: Correct const attributes for packet reading APIs. 2013-12-02 10:29:04 -08:00
Mark Pizzolato
0f01e08a13 TMXR: Added loopback support for datagram configured lines to pass full packets in loopback mode. 2013-11-29 23:41:28 -08:00
Mark Pizzolato
54b92b878e TMXR: Support loopback when using packet APIs even if a connection is not active 2013-11-26 15:25:00 -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
378e3e03a3 TMXR: Tolerate situations where independent devices are bound to different lines of a multi-line MUX. 2013-11-26 11:09:14 -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
00b77c8533 TMXR: Packet, Loopback and Half-Duplex enhancements
- Added halfduplex mode for network connections and corrected modem signal DSR to reflect connection status (vs original attach status), and DCD follows DSR (except in halfduplex mode where it follows CTS).

- Enhance tmxr_set_get_modem_bits to also return the modem DTR and RTS state.

- Separate RTS from DTR when manipulating modem state bits

- Minor fixes to loopback functionality after direct testing with the first loopback client device (DMC11).

- Fix clearing of break input buffer now that input buffers are dynamically allocated

- Changed Modem bit logic to have CTS reflect RTS as expected by devices which may expect this.

- Changed receive buffers to be dynamically allocated and the same size as transmit buffers when transmit buffers are non-default sized.

- Added TMXR line attach in loopback mode.  Fixed loopback buffer management

- Added loopback support to TMXR lines

- Added functioning connect poll capability to revised DMC

- Added connection destination display to connection status even when a connection has not yet been established.

- Added extended packet sending and receiving semantics to TMXR allowing for an optional frame byte to exist between length prefixed data packets
2013-11-20 12:18:02 -08:00
Mark Pizzolato
6f4e718fda PDP8: Refinement to prior fix for issue #86. Avoid data loss if prior character hasn't been read yet when a poll event happens. 2013-11-03 13:08:17 -08:00
Mark Pizzolato
db964d126c SCP/TMXR: Fix crashing bug when a multiplexer line has logging enabled before a mux attach, 2013-10-17 07:04:04 -07:00
Mark Pizzolato
5a21db5df6 Fix TMXR line transmit buffer allocation to always be allocated if a listening socket is open 2013-06-24 10:58:28 -07:00
Mark Pizzolato
486ef58595 Compiler warning cleanup 2013-06-01 23:04:45 -07:00
Mark Pizzolato
4d34547b05 Cleanup DUP11 implementation and refactor for shared use by another device (KMC11). 2013-05-31 11:58:09 -07:00
Mark Pizzolato
4ba152db79 Fix packet transmit overrun behaviors which caused DECnet circuit failures. 2013-05-28 17:35:49 -07:00
Mark Pizzolato
f30d43209e Fixes to:
1) retain the buffered/unbuffered line specific details across save/restore
 2) retain modem control outgoing bits (CTS and DTR) accross line resets which may occur due to carrier/connection loss.
 3) change the behavior which sends  the prior contents of the transmit buffer on a line reconnect to only happen for buffered telnet lines.
 4) avoid crash in SHOW MULTIPLEXER output when only specific lines have been attached instead of
2013-05-27 15:14:54 -07:00
Mark Pizzolato
1eb15fc917 Fix to support multiplexer devices which call tmxr_open_master directly instead of tmxr_attach so that the resulting TMXR will be in the open multiplexer list 2013-05-24 17:53:12 -07:00
Mark Pizzolato
44d6651f99 Added hex debug output for tcp session data on non-telnet line debug 2013-05-19 06:50:12 -07:00
Mark Pizzolato
784bc5daa2 Added new tmxr_line_attach_string API to return the attach string specific to a a particular multiplexer line.
Added parsing logic to allow tcp port and connect strings to end in either ";notelnet" or ";telnet" as desired to specifically describe a port setup.
Fixed bug in single line multiplexer attach which returned failed status when it should not have if a tcp connect destination was specified.
Relaxed parsing rules to allow a single line multiplexer to have a listen port specified at either the line level or the mux level.
2013-05-17 08:07:00 -07:00
Mark Pizzolato
e8e751c2fd Added randomization to the checking for success of outgoing connections and the arrival of incoming connections 2013-05-15 15:34:45 -07:00
Mark Pizzolato
7edcf5f36e Added stability to virtual null modem connections by consuming all incoming per line connections until a good one (or none) is found.
Extended debugging to describe the socket endpoints when connections are established.
Extended XMT and RCV debugging to include the line number in debug messages.
2013-05-15 13:53:32 -07:00
Mark Pizzolato
145b5c6a00 Added per line Modem Control capabilities to TMXR 2013-05-15 05:42:36 -07:00
Mark Pizzolato
3448edf608 enhanced the relatively new tmxr_linemsgf api to dynamically flush a completely full transmit buffer as needed. 2013-05-13 08:16:25 -07:00
Mark Pizzolato
671644ff41 Avoid passing negative values (i.e. signed characters) to isprint() which is not happy with doing this on some platforms. 2013-05-12 11:58:34 -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
67712d0095 Added more extensive debug output of tmxr telnet parameter and data 2013-05-01 13:43:10 -07:00
Mark Pizzolato
b1e31a7034 Fixed Remote Console to tolerate bare LF as a line terminator and enhanced the tmxr debug output for special characters 2013-04-30 08:37:11 -07:00
Mark Pizzolato
d364571c2c Added tmxr_linemsgf api to send formatted messages to a multiplexer line. 2013-04-24 09:00:36 -07:00
Mark Pizzolato
4c6f086eb3 Fix compiler identified typo reported by Peter Schorn 2013-04-21 05:45:40 -07:00