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