Just as the user receives
certain prompts from the Telnet session and responds to them, the
connection client (specifically, TelnetConnectClient or TunneledConnectClient)
behaves the same way. It waits for certain prompts from the Telnet
or spawner session (or from the tunnel feature's server programs)
and then responds.
The prompt/response
pairs that you need depend on which connection daemon you are using.
You can create all the prompt and response properties required to
pass the information that your connection daemon requires, using the
following format:
Where x is any number, and the value corresponds to
the prompt that you want to pass.
Where x is any number, and the value corresponds to
the connection information that you want to pass.
It is important that
you label prompt/response pairs in numerical order, without skipping
any numbers. For example, if you create a prompt5/response5 pair,
but you do not define a prompt4/response4 pair, the prompt5/response5
properties are ignored and the connection fails.
Note: All but one of the connection
properties is created using this format. One property, sasPortTag,
is hardcoded to specify the
port tag.
Extending the example
provided here, the following illustrates how to specify the required
connection information using three prompt/response pairs. In this
case, we are using connection properties to meet the most common requirements:
-
The user name prompt is specified
using the prompt1 property; the user name response is specified using
the response1 property.
-
The password prompt is specified
using the prompt2 property; the password response is specified using
the response2 property.
-
The command prompt is specified
using the prompt3 property; the command response is specified using
the response3 property.
The prompt/response
pairs needed for this example are as follows:
The connection client
uses this value to determine when it should send the user name response.
Note: The prompt1 value is a substring
that the connection client compares with the message from the Telnet
session. It must be a unique substring. If the complete Telnet message
is
Login:
, the value
in:
would be a valid prompt1 value because it uniquely identifies the
login prompt. A colon (:) would not be a valid prompt1 value because
it is not a unique identifier. The connection client would not know
what information to prompt the user for, and the connection to the
remote system would fail.
The connection client
sends this response after it has received the user name prompt from
the Telnet session.
The connection client
uses this value to determine when it should send the password response.
Note: The prompt2 value is a substring
that the connection client compares with the message from the Telnet
session. It must be a unique substring. If the complete Telnet message
is
Password:
, the value
word:
would be a valid prompt2 value because it uniquely identifies the
password prompt. A colon (:) would not be a valid prompt2 value because
it is not a unique identifier. The connection client would not know
what information to prompt the user for, and the connection to the
remote system would fail.
The connection client
sends this response after it has received the password prompt from
the Telnet session.
The connection client
uses this value to determine when it should send the command.
Note: The prompt3 value is a substring
that the connection client compares with the message from the Telnet
session. It must be a unique substring. If the complete Telnet message
is
Hostname>
, greater than (>) would
be a valid prompt3 value because it uniquely identifies the command
prompt.
(response3, sas -dmr -noterminal -nosyntaxcheck)
This is the complete
response to the command prompt.
This uniquely identifies
that the SAS session has completed initialization and allows the connection
client to parse the port value from the message.
Note: The sasPortTag value must
be the substring that immediately precedes the port value. Although
the substring
ESTABLISHED
uniquely
identifies the message, it does not immediately precede the port number,
and the connection client fails to establish a connection to the SAS
session.