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