Go forward to UUCP Protocol Commands.
Go backward to UUCP Protocol.
Go up to UUCP Protocol.

The Initial Handshake
---------------------

   Before the initial handshake, the caller will usually have logged in
the called machine and somehow started the UUCP package there.  On Unix
this is normally done by setting the shell of the login name used to
`/usr/lib/uucp/uucico'.

   All messages in the initial handshake begin with a `^P' (a byte with
the octal value `\020') and end with a null byte (`\000').  A few
systems end these messages with a line feed character (`\012') instead
of a null byte; the examples below assume a null byte is being used.

   Some options below are supported by QFT, which stands for Queued File
Transfer, and is (or was) an internal Bell Labs version of UUCP.

   Taylor UUCP size negotiation was introduced by Taylor UUCP, and is
also supported by DOS based UUPlus and Amiga based wUUCP and UUCP-1.17.

   The initial handshake goes as follows.  It is begun by the called
machine.

called: `\020Shere=hostname\000'
     The hostname is the UUCP name of the called machine.  Older UUCP
     packages do not output it, and simply send `\020Shere\000'.

caller: `\020Shostname options\000'
     The hostname is the UUCP name of the calling machine.  The
     following options may appear (or there may be none):

    `-QSEQ'
          Report sequence number for this conversation.  The sequence
          number is stored at both sites, and incremented after each
          call.  If there is a sequence number mismatch, something has
          gone wrong (somebody may have broken security by pretending
          to be one of the machines) and the call is denied.  If the
          sequence number changes on one of the machines, perhaps
          because of an attempted breakin or because a disk backup was
          restored, the sequence numbers on the two machines must be
          reconciled manually.

    `-xLEVEL'
          Requests the called system to set its debugging level to the
          specified value.  This is not supported by all systems.

    `-pGRADE'
    `-vgrade=GRADE'
          Requests the called system to only transfer files of the
          specified grade or higher.  This is not supported by all
          systems.  Some systems support `-p', some support `-vgrade='.
          UUPlus allows either `-p' or `-v' to be specified on a
          per-system basis in the `SYSTEMS' file (`gradechar' option).

    `-R'
          Indicates that the calling UUCP understands how to restart
          failed file transmissions.  Supported only by System V
          Release 4 UUCP, QFT, and Taylor UUCP.

    `-ULIMIT'
          Reports the ulimit value of the calling UUCP.  The limit is
          specified as a base 16 number in C notation (e.g.,
          `-U0x1000000').  This number is the number of 512 byte blocks
          in the largest file which the calling UUCP can create.  The
          called UUCP may not transfer a file larger than this.
          Supported only by System V Release 4 UUCP, QFT and UUPlus.
          UUPlus reports the lesser of the available disk space on the
          spool directory drive and the ulimit variable in
          `UUPLUS.CFG'.  Taylor UUCP understands this option, but does
          not generate it.

    `-N[NUMBER]'
          Indicates that the calling UUCP understands the Taylor UUCP
          size negotiation extension.  Not supported by traditional
          UUCP packages.  Supported by UUPlus.  The optional number is
          a bitmask of features supported by the calling UUCP, and is
          described below.

called: `\020ROK\000'
     There are actually several possible responses.
    `ROK'
          The calling UUCP is acceptable, and the handshake proceeds to
          the protocol negotiation.  Some options may also appear; see
          below.

    `ROKN[NUMBER]'
          The calling UUCP is acceptable, it specified `-N', and the
          called UUCP also understands the Taylor UUCP size limiting
          extensions.  The optional number is a bitmask of features
          supported by the called UUCP, and is described below.

    `RLCK'
          The called UUCP already has a lock for the calling UUCP,
          which normally indicates the two machines are already
          communicating.

    `RCB'
          The called UUCP will call back.  This may be used to avoid
          impostors (but only one machine out of each pair should call
          back, or no conversation will ever begin).

    `RBADSEQ'
          The call sequence number is wrong (see the `-Q' discussion
          above).

    `RLOGIN'
          The calling UUCP is using the wrong login name.

    `RYou are unknown to me'
          The calling UUCP is not known to the called UUCP, and the
          called UUCP does not permit connections from unknown systems.
          Some versions of UUCP just drop the line rather than sending
          this message.

     If the response is `ROK', the following options are supported by
     System V Release 4 UUCP and QFT.
    `-R'
          The called UUCP knows how to restart failed file
          transmissions.

    `-ULIMIT'
          Reports the ulimit value of the called UUCP.  The limit is
          specified as a base 16 number in C notation.  This number is
          the number of 512 byte blocks in the largest file which the
          called UUCP can create.  The calling UUCP may not send a file
          larger than this.  Also supported by UUPlus.  Taylor UUCP
          understands this option, but does not generate it.

    `-xLEVEL'
          I'm not sure just what this means.  It may request the
          calling UUCP to set its debugging level to the specified
          value.

     If the response is not `ROK' (or `ROKN') both sides hang up the
     phone, abandoning the call.

called: `\020Pprotocols\000'
     Note that the called UUCP outputs two strings in a row.  The
     protocols string is a list of UUCP protocols supported by the
     caller.  Each UUCP protocol has a single character name.  These
     protocols are discussed in more detail later in this document.
     For example, the called UUCP might send `\020Pgf\000'.

caller: `\020Uprotocol\000'
     The calling UUCP selects which protocol to use out of the protocols
     offered by the called UUCP.  If there are no mutually supported
     protocols, the calling UUCP sends `\020UN\000' and both sides hang
     up the phone.  Otherwise the calling UUCP sends something like
     `\020Ug\000'.

   Most UUCP packages will consider each locally supported protocol in
turn and select the first one supported by the called UUCP.  With some
versions of HDB UUCP, this can be modified by giving a list of protocols
after the device name in the `Devices' file or the `Systems' file.  For
example, to select the `e' protocol in `Systems',
         airs Any ACU,e ...
   or in Devices,
         ACU,e ttyXX ...
   Taylor UUCP provides the `protocol' command which may be used either
for a system (see Protocol Selection.) or a port (*note port
File::.).  UUPlus allows specification of the protocol string on a
per-system basis in the `SYSTEMS' file.

   The optional number following a `-N' sent by the calling system, or
an `ROKN' sent by the called system, is a bitmask of features supported
by the UUCP package.  The optional number was introduced in Taylor UUCP
version 1.04.  The number is sent as an octal number with a leading
zero.  The following bits are currently defined.  A missing number
should be taken as `011'.

`01'
     UUCP supports size negotiation.

`02'
     UUCP supports file restart.

`04'
     UUCP supports the `E' command.

`010'
     UUCP requires the file size in the `S' and `R' commands to be in
     base 10.  This bit is used by default if no number appears, but
     should not be explicitly sent.

`020'
     UUCP expects a dummy string between the notify field and the size
     field in an `S' command.  This is true of SVR4 UUCP.  This bit
     should not be used.

   After the protocol has been selected and the initial handshake has
been completed, both sides turn on the selected protocol.  For some
protocols (notably `g') a further handshake is done at this point.