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