Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
40.  UUCP Reference UUCP /etc/uucp/Systems File UUCP Chat Script Field  Previous   Contents   Next 
   
 

The expect field can be composed of subfields of the following form:

expect[-send-expect]...

send is sent if the prior expect is not successfully read, and the -expect that follows the send is the next expected string.

For example, with strings login--login, the UUCP on the local host expects login. If UUCP receives login from the remote machine, it goes to the next field. If it does not receive login, it sends a carriage return, then looks for login again. If the local computer initially does not expect any characters, use the characters "" (NULL string) in the expect field. All send fields are sent with a carriage return appended unless the send string is terminated with a \c.

Here is an example of a Systems file entry that uses an expect-send string:

System-Name  Time  Type  Speed  Phone     Chat Script
sonora Any ACUEC 9600 2223333 "" \r \r ogin:-BREAK-ogin: Puucpx ssword: xyzzy

This example tells UUCP on the local host to send two carriage returns and wait for ogin: (for Login:). If ogin: is not received, send a BREAK. When you do receive ogin: send the login name Puucpx. When you receive ssword: (for Password:), send the password xyzzy.

The following table lists some useful escape characters.

Table 40-2 Escape Characters Used in Systems File Chat Script

Escape Character Meaning 

\b

Sends or expects a backspace character.

\c

If at the end of a string, suppresses the carriage return that is normally sent. Ignored otherwise.

\d

Delays 1-3 seconds before sending more characters.

\E

Starts echo checking. From this point on, whenever a character is transmitted, UUCP waits for the character to be received before continuing its checks.

\e

Echoes check-off.

\H

Ignores one hangup. Use this option for dialback modems.

\K

Sends a BREAK character.

\M

Turns on CLOCAL flag.

\m

Turns off CLOCAL flag.

\n

Sends or expects a newline character.

\N

Sends a NULL character (ASCII NUL).

\p

Pauses for approximately 1/4 to 1/2 second.

\r

Sends or expects a carriage return.

\s

Sends or expects a space character.

\t

Sends or expects a tab character.

EOT

Sends an EOT, followed by newline twice.

BREAK

Sends a break character.

\ddd

Sends or expects the character that is represented by the octal digits (ddd).

Enabling Dialback Through the Chat Script

Some companies set up dial-in servers to handle calls from remote computers. For example, your company might have a dial-in server with a dialback modem that employees can call from their home computers. After the dial-in server identifies the remote machine, it disconnects the link to the remote machine and then calls back the remote machine. The communications link is then reestablished.

You can facilitate dialback by using the \H option in the Systems file chat-script at the place where dialback should occur. Include the \H as part of an expect string at the place where the dial-in server is expected to hang up.

For example, suppose the chat-script that calls a dial-in server contains the following string:

INITIATED\Hogin:

The UUCP dialing facility on the local machine expects to receive the characters INITIATED from the dial-in server. After the INITIATED characters have been matched, the dialing facility flushes any subsequent characters it receives until the dial-in server hangs up. The local dialing facility then waits until it receives the next part of the expect string, the characters ogin:, from the dial-in server. When it receives the ogin:, the dialing facility then continues through the chat-script.

You need not to have a string of characters directly preceding or following the \H, as shown in the previous sample string.

UUCP Hardware Flow Control

You can also use the pseudo-send STTY=value string to set modem characteristics. For instance, STTY=crtscts enables hardware flow control. STTY accepts all stty modes. See the stty(1) and termio(7I) man pages for complete details.

The following example would enable hardware flow control in a Systems file entry:

System-Name  Time  Type  Speed  Phone     Chat Script
unix Any ACU 2400 12015551212 "" \r login:-\r-login:-\r-login: 
nuucp password: xxx "" \ STTY=crtscts 

This pseudo-send string can also be used in entries in the Dialers file.

UUCP Setting Parity

In some situations, you have to reset the parity because the system that you are calling checks port parity and drops the line if it is wrong. The expect-send couplet "" P_ZERO sets the high-order bit (parity bit) to 0. For example:

System-Name  Time  Type  Speed  Phone     Chat Script
unix Any ACU 2400 12015551212 "" P_ZERO "" \r login:-\r-login:-\r-login: 
nuucp password: xxx 

In the same manner, P_EVEN sets parity to even (the default), P_ODD sets odd parity, and P_ONE sets the parity bit to 1.

The parity couplet can be inserted anywhere in the chat-script. The couplet applies to all information in the chat-script that follows the "" P_ZERO. The couplet can also be used in entries in the Dialers file.

UUCP /etc/uucp/Devices File

The /etc/uucp/Devices file contains information for all the devices that can be used to establish a link to a remote computer. These devices include ACUs--which includes modern, high-speed modems--direct links, and network connections.

Here is an entry in /etc/uucp/Devices for a US Robotics V.32bis modem that is attached to port A and running at 38,400 bps.

Type   Line  Line2 Class Dialer-Token-Pairs
 ACUEC  cua/a -     38400 usrv32bis-ec

Each field is described in the next section.

UUCP Type Field

This field describes the type of link that the device establishes. The UUCP Type field can contain one of the keywords that is described in the sections that follow.

Direct Keyword

The Direct keyword appears mainly in entries for cu connections. This keyword indicates that the link is a direct link to another computer or a port selector. Create a separate entry for each line that you want to reference through the -l option of cu.

ACU Keyword

The ACU keyword indicates that the link to a remote computer (whether through cu, UUCP, asppp, or Solaris PPP 4.0) is made through a modem. This modem can be connected either directly to your computer or indirectly through a port selector.

Port Selector

This is a variable that is replaced in the Type field by the name of a port selector. Port selectors are devices that are attached to a network that prompts for the name of a calling modem, then grant access. The file /etc/uucp/Dialers contains caller scripts only for the micom and develcon port selectors. You can add your own port selector entries to the Dialers file. See "UUCP /etc/uucp/Dialers File" for more information.

Sys-Name

This variable is replaced by the name of a machine in the Type field, indicating that the link is a direct link to this particular computer. This naming scheme is used to associate the line in this Devices entry with an entry in /etc/uucp/Systems for the computer Sys-Name.

Type Field and /etc/uucp/Systems File

Example 40-5 shows a comparison between the fields in /etc/uucp/Devices and fields in /etc/uucp/Systems. The titles of each column apply only to fields in the Devices file.

The keyword that is used in the Type field of the Devices file is matched against the third field of the Systems file entries. In the Devices file, the Type field has the entry ACUEC, indicating an automatic call unit, in this instance a V.32bis modem. This value is matched against the third field in the Systems file, which also contains the entry ACUEC. See "UUCP /etc/uucp/Systems File" for more information.


Example 40-5 Type Field and /etc/uucp/Systems File Equivalent

File Name Type   Line  Line2 Class Dialer-Token-Pairs
 
Devices   ACUEC  cua/a -     38400 usrv32bis-ec
 
System    nubian Any   ACUEC 38400 9998888 "" \d\d\r\n\c-ogin-\r\n\c-ogin.......      
 

UUCP Line Field

This field contains the device name of the line (port) that is associated with the Devices entry. If the modem that is associated with a particular entry were attached to the /dev/cua/a device (serial port A), the name that is entered in this field would be cua/a. An optional modem control flag, M, can be used in the Line field to indicate that the device should be opened without waiting for a carrier. For example:

cua/a,M

UUCP Line2 Field

This field is a placeholder. Always use a dash (-) here. 801-type dialers, which are not supported in the Solaris environment, use the Line2 field. Non-801 dialers do not normally use this configuration, but still require a hyphen in this field.

UUCP Class Field

The Class field contains the speed of the device, if the keyword ACU or Direct is used in the Type field. However, the Class field can contain a letter and a speed (for example, C1200, D1200) to differentiate between classes of dialers (Centrex or Dimension PBX).

This differentiation is necessary because many larger offices can have more than one type of telephone network: one network might be dedicated to serving only internal office communications while another handles the external communications. In such a situation, you must distinguish which line(s) should be used for internal communications and which should be used for external communications.

The keyword that is used in the Class field of the Devices file is matched against the Speed field of Systems file.


Example 40-6 UUCP Class Field

File Name  Type   Line  Line2  Class  Dialer-Token-Pairs
 
Devices    ACU    cua/a -      D2400  hayes

Some devices can be used at any speed, so the keyword Any can be used in the Class field. If Any is used, the line matches any speed that is requested in the Speed field of the Systems file. If this field is Any and the Systems file Speed field is Any, the speed defaults to 2400 bps.

 
 
 
  Previous   Contents   Next