1.\" Copyright (c) 1986, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)tn3270.1 4.3 (Berkeley) 06/11/90 7.\" 8.Dd 9.Dt TN3270 1 10.Os BSD 4.3 11.Sh NAME 12.Nm tn3270 13.Nd full-screen remote login to IBM VM/CMS 14.Sh SYNOPSIS 15.Nm tn3270 16.Op Fl d 17.Op Fl n Ar filename 18.Op Fl t Ar commandname 19.Op Ar sysname Op port 20.Sh DESCRIPTION 21.Nm Tn3270 22permits a full-screen, full-duplex connection 23from a UNIX 24machine 25to an IBM (or compatible) machine. 26.Nm Tn3270 27gives the appearance of being logged in 28to the remote machine 29from an IBM 3270 terminal. 30Of course, you must have an account on the machine 31to which you connect in order to log in. 32.Nm Tn3270 33looks to the user in many respects 34like the Yale ASCII Terminal Communication System II. 35.Nm Tn3270 36is actually a modification of the Arpanet TELNET user interface (see 37.Xr telnet 1 ) 38which will, in certain circumstances, interpret and generate 39raw 3270 control streams. 40.Pp 41The flags to 42.Nm tn3270 43are as follows: 44.Tw Fl 45.Tp Fl d 46Turn on socket-level tracing (for super-user only) 47.Ct Fl n 48.Ar filename 49.Cx 50Specify a file to receive network trace data 51output (from commands "toggle netdata" and 52"toggle options", see 53.Xr telnet 1 ) ; 54the default is for output 55to be directed to the standard error file. 56.Ct Fl t 57.Ar commandname 58.Cx 59Specify a UNIX 60command to process IBM 4994 style transparent mode 61data received from the remote IBM machine. 62.Tp Ar sysname 63The name of the remote system. If the remote name 64is NOT specified, the user will be prompted for a 65command (see below). 66.Tp Ar port 67The port to connect to on the remote system. 68Normally, 69.Nm tn3270 70attempts to connect to the 71standard TELNET port (port 7223) on the remote machine. 73.Tp 74.Pp 75When 76.Nm tn3270 77first connects to the remote system, it will negotiate to go into 783270 mode. 79Part of this negotiation involves telling the remote system what model 803270 it is emulating. 81In all cases, 82.Nm tn3270 83emulates a 3278 terminal. 84To decide which specific model, 85.Nm tn3270 86looks at the number of lines and columns on the actual terminal (as 87defined in the 88.Ev TERM 89environment variable; see 90.Xr termcap 5 ) . 91The terminal (or window in which 92.Nm tn3270 93is running, on multiple 94window systems) must have at least 80 columns and 24 lines, or 95.Nm tn3270 96will not go into emulation mode. 97If the terminal does have at least 80 columns and at least 24 lines, 98the following table describes the emulation: 99.Pp 100.ne 7v 101.Ds C 102.Cw (rows*columns) 103.Cl minimum_size emulated 104.Cl (rows*columns) terminal 105.Cl -------------- ------------ 106.Cl 27*132 3278 model 5 107.Cl 43*80 3278 model 4 108.Cl 32*80 3278 model 3 109.Cl 24*80 3278 model 2. 110.Cw 111.De 112.Pp 113.Pp 114Emulation of the 3270 terminal is done in the UNIX 115process. 116This emulation involves mapping 1173270-style commands from the host 118into appropriate sequences to control the user's terminal screen. 119.Nm Tn3270 120uses 121.Xr curses 3 122and the 123.Pa /usr/share/misc/termcap 124file to do this. 125The emulation also involves simulating the special 3270 keyboard keys 126(program function keys, etc.) 127by mapping sequences of keystrokes 128from the ASCII keyboard into appropriate 3270 control strings. 129This mapping is terminal dependent and is specified 130in a description file, 131.Pa /usr/share/misc/map3270 , 132(see 133.Xr map3270 5 ) 134or in an environment variable 135.Ev MAP3270 136(and, if necessary, 137.Ev MAP3270A , 138.Ev MAP3270B , 139and so on - see 140.Xr mset 1 ) . 141Any special function keys on the ASCII keyboard are used whenever possible. 142If an entry for the user's terminal 143is not found, 144.Nm tn3270 145looks for an entry for the terminal type 146.Em unknown . 147If this is not found, 148.Nm tn3270 149uses a default keyboard mapping 150(see 151.Xr map3270 5 ) . 152.Pp 153The first character of each special keyboard mapping sequence 154is either an ASCII escape (ESC), 155a control character, or an ASCII delete (DEL). 156If the user types an unrecognized function key sequence, 157.Nm tn3270 158sends an ASCII bell (BEL), or a visual bell if 159defined in the user's termcap entry, to the user's terminal 160and nothing is sent to the IBM host. 161.Pp 162If 163.Nm tn3270 164is invoked without specifying a remote host system name, 165it enters local command mode, 166indicated by the prompt 167.Dq Li tn3270>\ . 168In this mode, 169.Nm tn3270 170accepts and executes 171all the commands of 172.Xr telnet 1 , 173plus one additional command: 174.Pp 175.Tw Ar 176.Tp Ic transcom 177Specify UNIX 178command for IBM 4994 style transparent mode processing. 179.Tp 180.Pp 181.Nm Tn3270 182command mode may also be entered, after connecting to a host, by typing 183a special escape sequence. 184If 185.Nm tn3270 186has succeeded in negotiating 3270 mode with the remote host, the 187escape sequence will be as defined by the map3270 (see 188.Xr map3270 5 ) 189entry for the user's terminal type 190(typically control-C); 191otherwise the escape sequence will initially be set to the 192single character 193.Sq Li \&^] 194(control right square bracket). 195.Pp 196While in command mode, any host login session is still alive 197but temporarily suspended. 198The host login session may be resumed by entering an empty line 199(press the 200.Li RETURN 201key) 202in response to the command prompt. 203A session may be terminated by logging off the foreign host, 204or by typing ``quit'' or ``close'' while in local command mode. 205.Sh FILES 206.Dw /usr/share/misc/termcap 207.Di L 208.Dp Pa /usr/share/misc/termcap 209.br 210.Dp Pa /usr/share/misc/map3270 211.Dp 212.Sh AUTHOR 213Greg Minshall 214.Sh NOTES 215The IBM 4994 style transparent mode command is invoked when 216.Nm tn3270 217receives IBM 4994 style transparent output from the remote host. 218Output and input pipes are created for communication between the two 219processes. 220The pipes are closed when a 3270 clear command is received from the remote 221hosts, signalling the end of transparent mode output. 222Transparent mode is necessary for sending ASCII control characters over the 2233270 terminal connection; ASCII graphics terminal support is accomplished this 224way. 225Developers of 226.Ic transcom 227commands should note that the 228.Ic transcom 229stdin pipe end will be in CBREAK mode, with ECHO and CRMOD turned off. 230.Sh ENVIRONMENT 231.Nm Tn3270 232checks the following environment variables: 233.Ev TERM , 234.Ev MAP3270 , 235.Ev MAP3270[A...] . 236Information on these can be found in 237.Xr mset 1 . 238.Nm Tn3270 239also checks 240.Ev SHELL , 241.Ev KEYBD 242and 243.Ev API3270 . 244.Sh SEE ALSO 245.Xr mset 1 , 246.Xr telnet 1 , 247.Xr curses 3 , 248.Xr termcap 3 , 249.Xr termcap 5 , 250.Xr map3270 5 , 251.br 252.Em Yale ASCII Terminal Communication 253.Em System II Program Description/Operator's Manual 254.Pq IBM SB30-1911 255.Sh HISTORY 256.Nm 257appeared in 4.3 BSD. 258.Sh BUGS 259Tn3270 is slow and uses system resources prodigiously. 260.Pp 261Not all 3270 functions are supported, 262nor all Yale enhancements. 263.Pp 264Error conditions (attempting to enter data in a protected field, for 265example) should cause a message to be sent to the user's terminal 266instead of just ringing a bell. 267