xref: /386bsd/usr/src/usr.bin/tn3270/tn3270.1 (revision a2142627)
1.\" Copyright (c) 1986, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"	@(#)tn3270.1	4.6 (Berkeley) 7/27/91
33.\"
34.Dd July 27, 1991
35.Dt TN3270 1
36.Os BSD 4.3
37.Sh NAME
38.Nm tn3270
39.Nd full-screen remote login to
40.Tn IBM VM/CMS
41.Sh SYNOPSIS
42.Nm tn3270
43.Op Fl d
44.Op Fl n Ar filename
45.Op Fl t Ar commandname
46.Op Ar sysname Op port
47.Sh DESCRIPTION
48.Nm Tn3270
49permits a full-screen, full-duplex connection
50from a
51.Tn UNIX
52machine
53to an
54.Tn IBM
55(or compatible) machine.
56.Nm Tn3270
57gives the appearance of being logged in
58to the remote machine
59from an
60.Tn IBM
613270 terminal.
62Of course, you must have an account on the machine
63to which you connect in order to log in.
64.Nm Tn3270
65looks to the user in many respects
66like the Yale
67.Tn ASCII
68Terminal Communication System II.
69.Nm Tn3270
70is actually a modification of the Arpanet
71.Tn TELNET
72user interface (see
73.Xr telnet  1  )
74which will, in certain circumstances, interpret and generate
75raw 3270 control streams.
76.Pp
77The flags to
78.Nm tn3270
79are as follows:
80.Bl -tag -width Fl
81.It Fl d
82Turn on socket-level tracing (for super-user only)
83.Fl n Ns Ar filename
84Specify a file to receive network trace data
85output (from commands "toggle netdata" and
86"toggle options", see
87.Xr telnet 1 ) ;
88the default is for output
89to be directed to the standard error file.
90.Fl t Ns Ar commandname
91Specify a
92.Tn UNIX
93command to process
94.Tn IBM
954994 style transparent mode
96data received from the remote
97.Tn IBM
98machine.
99.It Ar sysname
100The name of the remote system.  If the remote name
101is NOT specified, the user will be prompted for a
102command (see below).
103.It Ar port
104The port to connect to on the remote system.
105Normally,
106.Nm tn3270
107attempts to connect to the
108standard
109.Tn TELNET
110port (port
11123) on the remote machine.
112.El
113.Pp
114When
115.Nm tn3270
116first connects to the remote system, it will negotiate to go into
1173270 mode.
118Part of this negotiation involves telling the remote system what model
1193270 it is emulating.
120In all cases,
121.Nm tn3270
122emulates a 3278 terminal.
123To decide which specific model,
124.Nm tn3270
125looks at the number of lines and columns on the actual terminal (as
126defined in the
127.Ev TERM
128environment variable; see
129.Xr termcap  5  ) .
130The terminal (or window in which
131.Nm tn3270
132is running, on multiple
133window systems) must have at least 80 columns and 24 lines, or
134.Nm tn3270
135will not go into emulation mode.
136If the terminal does have at least 80 columns and at least 24 lines,
137the following table describes the emulation:
138.Pp
139.ne 7v
140.Bd -filled -offset center
141.Bl -column (rows*columns)
142.It minimum_size	emulated
143.It (rows*columns)	terminal
144.It --------------	------------
145.It 27*132	3278 model 5
146.It 43*80	3278 model 4
147.It 32*80	3278 model 3
148.It 24*80	3278 model 2.
149.El
150.Ed
151.Pp
152Emulation of the 3270 terminal is done in the
153.Tn UNIX
154process.
155This emulation involves mapping
1563270-style commands from the host
157into appropriate sequences to control the user's terminal screen.
158.Nm Tn3270
159uses
160.Xr curses 3
161and the
162.Pa /usr/share/misc/termcap
163file to do this.
164The emulation also involves simulating the special 3270 keyboard keys
165(program function keys, etc.)
166by mapping sequences of keystrokes
167from the
168.Tn ASCII
169keyboard into appropriate 3270 control strings.
170This mapping is terminal dependent and is specified
171in a description file,
172.Pa /usr/share/misc/map3270 ,
173(see
174.Xr map3270  5  )
175or in an environment variable
176.Ev MAP3270
177(and, if necessary,
178.Ev MAP3270A  ,
179.Ev MAP3270B ,
180and so on - see
181.Xr mset  1  ) .
182Any special function keys on the
183.Tn ASCII
184keyboard are used whenever possible.
185If an entry for the user's terminal
186is not found,
187.Nm tn3270
188looks for an entry for the terminal type
189.Em unknown .
190If this is not found,
191.Nm tn3270
192uses a default keyboard mapping
193(see
194.Xr map3270  5  ) .
195.Pp
196The first character of each special keyboard mapping sequence
197is either an
198.Tn ASCII
199escape
200.Pq Tn ESC ,
201a control character, or an
202.Tn ASCII
203delete
204.Pq Tn DEL .
205If the user types an unrecognized function key sequence,
206.Nm tn3270
207sends an
208.Tn ASCII
209bell
210.Pq Tn BEL ,
211or a visual bell if
212defined in the user's termcap entry, to the user's terminal
213and nothing is sent to the
214.Tn IBM
215host.
216.Pp
217If
218.Nm tn3270
219is invoked without specifying a remote host system name,
220it enters local command mode,
221indicated by the prompt
222.Dq Li tn3270>\  .
223In this mode,
224.Nm tn3270
225accepts and executes
226all the commands of
227.Xr telnet  1  ,
228plus one additional command:
229.Pp
230.Bl -tag -width Ar
231.It Ic transcom
232Specify
233.Tn UNIX
234command for
235.Tn IBM
2364994 style transparent mode processing.
237.El
238.Pp
239.Nm Tn3270
240command mode may also be entered, after connecting to a host, by typing
241a special escape sequence.
242If
243.Nm tn3270
244has succeeded in negotiating 3270 mode with the remote host, the
245escape sequence will be as defined by the map3270 (see
246.Xr map3270  5  )
247entry for the user's terminal type
248(typically control-C);
249otherwise the escape sequence will initially be set to the
250single character
251.Sq Li \&^]
252(control right square bracket).
253.Pp
254While in command mode, any host login session is still alive
255but temporarily suspended.
256The host login session may be resumed by entering an empty line
257(press the
258.Tn RETURN
259key)
260in response to the command prompt.
261A session may be terminated by logging off the foreign host,
262or by typing ``quit'' or ``close'' while in local command mode.
263.Sh FILES
264.Bl -tag -width /usr/share/misc/termcap -compact
265.It Pa /usr/share/misc/termcap
266.It Pa /usr/share/misc/map3270
267.El
268.\" .Sh AUTHOR
269.\" Greg Minshall
270.Sh NOTES
271The
272.Tn IBM
2734994 style transparent mode command is invoked when
274.Nm tn3270
275receives
276.Tn IBM
2774994 style transparent output from the remote host.
278Output and input pipes are created for communication between the two
279processes.
280The pipes are closed when a 3270 clear command is received from the remote
281hosts, signalling the end of transparent mode output.
282Transparent mode is necessary for sending
283.Tn ASCII
284control characters over the
2853270 terminal connection;
286.Tn ASCII
287graphics terminal support is accomplished this
288way.
289Developers of
290.Ic transcom
291commands should note that the
292.Ic transcom
293stdin pipe end will be in
294.Dv CBREAK
295mode, with
296.Dv ECHO
297and
298.Dv CRMOD
299turned off.
300.Sh ENVIRONMENT
301.Nm Tn3270
302checks the following environment variables:
303.Ev TERM ,
304.Ev MAP3270 ,
305.Ev MAP3270[A...] .
306Information on these can be found in
307.Xr mset 1 .
308.Nm Tn3270
309also checks
310.Ev SHELL ,
311.Ev KEYBD
312and
313.Ev API3270 .
314.Sh SEE ALSO
315.Xr mset 1 ,
316.Xr telnet 1 ,
317.Xr curses 3 ,
318.Xr termcap 3 ,
319.Xr termcap 5 ,
320.Xr map3270 5 ,
321.Rs
322.%T "Yale ASCII Terminal Communication"
323.%B "System II Program Description/Operator's Manual"
324.%R IBM SB30-1911
325.Re
326.Sh HISTORY
327The
328.Nm tn3270
329command appeared in
330.Bx 4.3 .
331.Sh BUGS
332Tn3270 is slow and uses system resources prodigiously.
333.Pp
334Not all 3270 functions are supported,
335nor all Yale enhancements.
336.Pp
337Error conditions (attempting to enter data in a protected field, for
338example) should cause a message to be sent to the user's terminal
339instead of just ringing a bell.
340