The TELNET port driver (TNDRIVER) provides terminal session
support for TCP streaming connections using the RAW, NVT, RLOGIN,
and TELNET protocols. Either a remote device or an application
can be present at the remote endpoint of the connection.
A user program can manage a TELNET connection with the standard
OpenVMS $QIO system service by using the IO$_TTY_PORT and IO$_
TTY_PORT_BUFIO I/O function codes.
1 – Interface Definition
The following definitions are used by the interface. The symbols
are defined in SYS$LIBRARY:TNIODEF.H.
1.1 – Item List Codes
The following table describes the symbols used with the p5
parameter.
Maximum
Item Code Size Description
TN$_ACCPORNAM 64 Access port name string. When
written, the string's length is
determined by the item_length
field. The value of item_length
should not be more than 63 bytes.
When read, the string is returned
in ASCIC format (the first byte
contains the string's length), so a
size of 64 is appropriate.
TN$_ 4 Characteristics mask. This longword
CHARACTERISTICS contains a bit mask of the device's
characteristics read or to be
written. (See Characteristic Mask
Bits for a table that describes the
characteristic mask bits.)
TN$_CONNECTION_ 4 Reconnection attempts. This item
ATTEMPTS is the number of unsuccessful
reconnection attempts which have
been made on a reconnectable
device. The value will be
reinitialized when a successful
connection is made. This item is
read only.
TN$_CONNECTION_ 4 Minimum time (in seconds) before
INTERVAL reconnection attempts.
TN$_CONNECTION_ 4 Current time (in seconds) since
TIMEOUT the last reconnection attempt. This
item is read only.
TN$_DATA_HIGH 4 Maximum amount of output data (in
bytes) buffered at the network
port. This number does not affect
the amount of data buffered within
the socket.
TN$_DEVICE_UNIT 4 Terminal device unit number. When
written, this value must be between
1 and 9999.
TN$_IDLE_INTERVAL 4 Maximum idle time (in seconds)
allowed before a connection is
to be broken. Connections are not
broken if the device is stalled.
TN$_IDLE_TIMEOUT 4 Current time (in seconds) since
last output on the terminal. This
item is read only.
TN$_LOCAL_ADDRESS 32 Local sockaddr of the active
connection. When written, the
value of item_length determines
the size of the sockaddr. Note that
the sockaddr is in BSD Version 4.4
format, which includes a sockaddr
size field. (C programs should be
compiled with the _SOCKADDR_LEN
symbol defined.) This item is read
only.
TN$_NETWORK_ 64 Name of the network pseudodevice
DEVICE_NAME currently bound to the terminal.
When read, the data is returned
in ASCIC format (the first byte
contains the string's length). This
item is read only.
TN$_PROTOCOL 4 Session protocol. (See the table in
Protocol Types.)
TN$_REMOTE_ADDRESS 32 Remote peer's sockaddr of the
active connection. Note that
the sockaddr is in BSD Version
4.4 format, which includes a
sockaddr size field. The size of
the sockaddr should be determined
from this field. This item is read
only.
TN$_SERVICE_TYPE 4 Class of terminal service. (See the
table in Service Types.)
TN$_STATUS 4 Current device and session status.
This item is read only.
1.2 – Characteristic Mask Bits
The following table describes the characteristic mask bits used
with the p5 parameter.
Characteristic Description
TN$M_AUTOCONNECT The device supports automatic
connect/reconnect.
TN$M_LOGIN_ON_ Initiate a login when the TELNET device is
DASSGN deassigned. This characteristic requires the
BYPASS or SYSNAM privilege or executive or
kernel mode calls.
TN$M_LOGIN_TIMER Used in conjunction with TN$M_LOGIN_ON_DASSGN,
this bit indicates that the login completion
timer applies. If the TN device fails to
login within 60 seconds, the connection will
be broken and the device deallocated. This
characteristic requires the BYPASS or SYSNAM
privileges or executive or kernel mode calls.
TN$M_PERMANENT_ The TELNET device is to remain until
UCB explicitly deleted.
TN$M_RETAIN_ON_ The TELNET device is not to be deleted upon
DASSGN the deassignment of the last channel to this
device. This condition is cleared on this
last deassignment, so that a subsequent assign
and deassign will result in the device being
deleted.
TN$M_VIRTUAL_ When logging in under this device, a virtual
TERMINAL terminal is to be created by TTDRIVER.
1.3 – Protocol Types
The following table describes the protocol types used with the p5
parameter.
Protocol Type Description
TN$K_PROTOCOL_ There is no explicit protocol for this
UNDEFINED session. Data is transmitted and received
on the socket without any interpretation.
This is a raw connection.
TN$K_PROTOCOL_NVT Network Virtual Terminal (NVT) protocol.
The protocol understands basic session
control but does not include the options
negotiation present in the TELNET
protocol.
TN$K_PROTOCOL_RLOGIN BSD Remote Login protocol. This simple
protocol provides some special control
character support but lacks the
architecture independence of the NVT and
TELNET protocols.
TN$K_PROTOCOL_TELNET TELNET protocol. Including the basic NVT
protocol, TELNET adds support for options
negotiation. This can provide an enhanced
terminal session depending upon the client
and server involved.
1.4 – Service Types
The following table describes the service type codes used with
the p5 parameter.
Service Type Description
TN$K_SERVICE_NONE The service type is not currently known.
TN$K_SERVICE_ The service is an incoming connection.
INCOMING
TN$K_SERVICE_ The service is an outgoing connection.
OUTGOING
2 – Passing Parameters to the TELNET Port Driver
The IO$_TTY_PORT function is used to pass $QIO parameters
through the terminal driver to the TELNET port driver. The actual
subfunction is encoded as an option mask and may be:
o IO$M_TN_STARTUP - Bind socket to a TELNET terminal.
o IO$M_TN_SHUTDOWN - Unbind socket from a TELNET terminal.