Mods from Al Longyear and Robert Geer to add REPORT stuff.

This commit is contained in:
Paul Mackerras 1995-06-12 11:24:15 +00:00
parent 2a09df9e05
commit c3931bd326
3 changed files with 497 additions and 167 deletions

View File

@ -1,14 +1,13 @@
# $Id: Makefile.linux,v 1.1 1995/04/28 05:26:48 paulus Exp $ # $Id: Makefile.linux,v 1.2 1995/06/12 11:24:12 paulus Exp $
BINDIR=/usr/etc BINDIR=/usr/etc
CDEF1= -DTERMIOS # Use the termios structure CDEF1= -DTERMIOS # Use the termios structure
CDEF2= -DPIDSTRING # I like ascii pid values CDEF2= -DPIDSTRING # I like ascii pid values
CDEF3= -DLOCK_DIR=\"/usr/spool/uucp\" # Directory for lock file CDEF3= -DSIGTYPE=void # Standard definition
CDEF4= -DSIGTYPE=void # Standard definition CDEF4= -UNO_SLEEP # Use the usleep function
CDEF5= -UNO_SLEEP # Use the usleep function CDEF5= -DFNDELAY=O_NDELAY # Old name value
CDEF6= -DFNDELAY=O_NDELAY # Old name value CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) $(CDEF5)
CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) $(CDEF5) $(CDEF6)
CFLAGS= -O2 -N $(CDEFS) CFLAGS= -O2 -N $(CDEFS)

View File

@ -1,12 +1,12 @@
.\" -*- nroff -*- .\" -*- nroff -*-
.\" manual page [] for chat 1.8 .\" manual page [] for chat 1.8
.\" $Id: chat.8,v 1.1 1995/04/28 05:27:25 paulus Exp $ .\" $Id: chat.8,v 1.2 1995/06/12 11:24:14 paulus Exp $
.\" SH section heading .\" SH section heading
.\" SS subsection heading .\" SS subsection heading
.\" LP paragraph .\" LP paragraph
.\" IP indented paragraph .\" IP indented paragraph
.\" TP hanging label .\" TP hanging label
.TH CHAT 8 "17 April 1994" "Chat Version 1.8" .TH CHAT 8 "5 May 1995" "Chat Version 1.9"
.SH NAME .SH NAME
chat \- Automated conversational script with a modem chat \- Automated conversational script with a modem
.SH SYNOPSIS .SH SYNOPSIS
@ -30,25 +30,6 @@ have read access to the file. Multiple lines are permitted in the
file. Space or horizontal tab characters should be used to separate file. Space or horizontal tab characters should be used to separate
the strings. the strings.
.TP .TP
.B -l \fI<lock file>
Perform the UUCP style locking using the indicated lock file.
.IP
If the file could not be created then the \fIchat\fR program will
fail. The lock file will be deleted only if the \fIchat\fR program
fails to perform the script for any reason. If the script is
successful the lock file will be left on the disk. It is expected that
the lock file will be deleted when the \fIpppd\fR process no longer
wishes to use the serial device.
.IP
The use of a lock file with
.I chat
and
\fIpppd\fR\'s
.I lock
option should not be used at the same time. They are mutually
exclusive options and will cause one or the other program to fail to
achieve the required lock if you use both.
.TP
.B -t \fI<timeout> .B -t \fI<timeout>
Set the timeout for the expected string to be received. If the string Set the timeout for the expected string to be received. If the string
is not received within the time limit then the reply string is not is not received within the time limit then the reply string is not
@ -56,6 +37,12 @@ sent. An alternate reply may be sent or the script will fail if there
is no alternate reply string. A failed script will cause the is no alternate reply string. A failed script will cause the
\fIchat\fR program to terminate with a non-zero error code. \fIchat\fR program to terminate with a non-zero error code.
.TP .TP
.B -r \fI<report file>
Set the file for output of the report strings. If you use the keyword
\fIREPORT\fR, the resulting strings are written to this file. If this
option is not used and you still use \fIREPORT\fR keywords, the
\fIstderr\fR file is used for the report strings.
.TP
.B -v .B -v
Request that the \fIchat\fR script be executed in a verbose mode. The Request that the \fIchat\fR script be executed in a verbose mode. The
\fIchat\fR program will then log all text received from the modem and \fIchat\fR program will then log all text received from the modem and
@ -80,9 +67,9 @@ allotted, it is to send a break sequence to the remote and then expect the
string "ogin:". If the first "ogin:" is received then the break sequence is string "ogin:". If the first "ogin:" is received then the break sequence is
not generated. not generated.
.LP .LP
Once it received the login prompt the \fIchat\fR program will send the string ppp Once it received the login prompt the \fIchat\fR program will send the
and then expect the prompt "ssword:". When it receives the prompt for the string ppp and then expect the prompt "ssword:". When it receives the
password, it will send the password hello2u2. prompt for the password, it will send the password hello2u2.
.LP .LP
A carriage return is normally sent following the reply string. It is not A carriage return is normally sent following the reply string. It is not
expected in the "expect" string unless it is specifically requested by using expected in the "expect" string unless it is specifically requested by using
@ -141,6 +128,32 @@ character sequence. The script will then fail because it found a match to
the abort string. If it received the string \fINO CARRIER\fR, it will abort the abort string. If it received the string \fINO CARRIER\fR, it will abort
for the same reason. Either string may be received. Either string will for the same reason. Either string may be received. Either string will
terminate the \fIchat\fR script. terminate the \fIchat\fR script.
.SH REPORT STRINGS
A \fBreport\fR string is similar to the ABORT string. The difference
is that the strings, and all characters to the next control character
such as a carriage return, are written to the report file.
.LP
The report strings may be used to isolate the transmission rate of the
modem's connect string and return the value to the chat user. The
analysis of the report string logic occurs in conjunction with the
other string processing such as looking for the expect string. The use
of the same string for a report and abort sequence is probably not
very useful, however, it is possible.
.LP
The report strings to no change the completion code of the program.
.LP
These "report" strings may be specified in the script using the \fIREPORT\fR
sequence. It is written in the script as in the following example:
.IP
REPORT CONNECT ABORT BUSY '' ATDT5551212 CONNECT '' ogin: account
.LP
This sequence will expect nothing; and then send the string
ATDT5551212 to dial the telephone. The expected string is
\fICONNECT\fR. If the string \fICONNECT\fR is received the remainder
of the script is executed. In addition the program will write to the
expect-file the string "CONNECT" plus any characters which follow it
such as the connection rate.
.SH TIMEOUT .SH TIMEOUT
The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR The initial timeout value is 45 seconds. This may be changed using the \fB-t\fR
parameter. parameter.
@ -240,10 +253,55 @@ character.
Substitute the sequence with the control character represented by C. Substitute the sequence with the control character represented by C.
For example, the character DC1 (17) is shown as \^^Q. For example, the character DC1 (17) is shown as \^^Q.
.I (some characters are not valid in expect.) .I (some characters are not valid in expect.)
.SH TERMINATION CODES
The \fIchat\fR program will terminate with the following completion
codes.
.TP
.B 0
The normal termination of the program. This indicates that the script
was executed without error to the normal conclusion.
.TP
.B 1
One or more of the parameters are invalid or an expect string was too
large for the internal buffers. This indicates that the program as not
properly executed.
.TP
.B 2
An error occurred during the execution of the program. This may be due
to a read or write operation failing for some reason or chat receiving
a signal such as SIGINT.
.TP
.B 3
A timeout event occurred when there was an \fIexpect\fR string without
having a "-subsend" string. This may mean that you did not program the
script correctly for the condition or that some unexpected event has
occurred and the expected string could not be found.
.TP
.B 4
The first string marked as an \fIABORT\fR condition occurred.
.TP
.B 5
The second string marked as an \fIABORT\fR condition occurred.
.TP
.B 6
The third string marked as an \fIABORT\fR condition occurred.
.TP
.B 7
The fourth string marked as an \fIABORT\fR condition occurred.
.TP
.B ...
The other termination codes are also strings marked as an \fIABORT\fR
condition.
.LP
Using the termination code, it is possible to determine which event
terminated the script. It is possible to decide if the string "BUSY"
was received from the modem as opposed to "NO DIAL TONE". While the
first event may be retried, the second will probably have little
chance of succeeding during a retry.
.SH SEE ALSO .SH SEE ALSO
Additional information about \fIchat\fR scripts may be found with UUCP Additional information about \fIchat\fR scripts may be found with UUCP
documentation. The \fIchat\fR script was taken from the ideas proposed by the documentation. The \fIchat\fR script was taken from the ideas proposed
scripts used by the \fIuucico\fR program. by the scripts used by the \fIuucico\fR program.
.LP .LP
uucico(1), uucp(1) uucico(1), uucp(1)
.SH COPYRIGHT .SH COPYRIGHT

File diff suppressed because it is too large Load Diff