[comp.os.minix] kermit checksum and man page

hedrick@geneva.rutgers.edu (Charles Hedrick) (10/19/88)

Ast asked me to post some additional information about the kermit that
I posted last week.  Here are checksums and size information:

  sum kermit     34510 117
  size kermit    41904 text + 17712 data + 15240 bss + 32584 stack = 107440
  ls -l kermit   59648

The following man page was produced by ast from builtin help messages
in the full version.  I've checked it against the real manual.  I
would normally post the official kermit.doc file, except that it is
96Kbytes and this is only 18.

There are two common file transfer programs: kermit and the ..modem
family.  Kermit has the following advantages:

  - It has the whole thing in one program, including making terminal
	connections and both ends of the file transfer.  (However it
	does not have a terminal emulator.  It relies on the
	escape sequence support built into the console driver.)

  - There is only one kermit, unlike xmodem, ymodem, and zmodem.
	Kermits negotiate about options, so that performance improvements
	can be added without breaking compatibility with old versions.

  - Kermit is designed to work with half duplex systems if necessary
	and with systems that can't handle control characters.  It does
	not require an 8-bit transparent path.  It normally works the
	first time.  However in particularly unfavorable cases you may
	have to play with packet start char, padding, etc.

This kermit is based on C Kermit 4E(070), from January.  However edit
70 as distributed by Columbia had a bug that prevented extended
packets (packets longer than 94 bytes) from working.  That bug is
fixed in this copy.  It is safe to use this copy with the broken
version, since the broken version simply ignores the request to use
extended packets.


				KERMIT

1. INTRODUCTION

Kermit is a program that allows remote login and file transfer over an RS232
line.  MINIX kermit is a subset of full kermit.  The help facility, script
command, and auto-dial support had to be removed, however documentation for
them is still present in this man page.

To start the program, type: kermit.  To get a list of commands type kermit -h.


2. USAGE:  kermit [-x arg [-x arg] ... [-yyy] ... ]

Normally you run kermit with no arguments.  This will get you an
interactive command mode.  However you may also specify commands on
the command line:

   x is an option that requires an argument, y an option with no argument:
     actions (* options also require -l and -b) --
       -s file(s)   send (use '-s -' to send from stdin)
       -r           receive
       -k           receive to stdout
     * -g file(s)   get remote file(s) from server (quote wildcards)
       -a name      alternate name, used with -s, -r, -g
       -x           enter server mode
     * -f           finish remote server
     * -c           connect before transaction
     * -n           connect after transaction
       -h           help - print this message
     settings --
       -l line      communication line device, e.g. -l /dev/tty1
       -b baud      line speed, e.g. 1200
       -i           binary file or Unix-to-Unix
       -p x         parity, x is one of e,o,m,s,n
       -t           line turnaround handshake = xon, half duplex
       -w           don't write over preexisting files
       -e n         extended packets, n is size in bytes, 10 to 1000
       -q           be quiet during file transfer
       -d           log debugging info to debug.log
 If no action command is included, enter interactive dialog.


The default terminal to use is /dev/tty.  So on your local machine,
you must specify the name of the modem or other line to use.  On
Minix, this will normally be /dev/tty1, which is the modem line.  On
the remote machine, the default is fine, since you will be sending and
receiving files using the line over which you are logged in.

Note that there are two different ways to handle file transfer.  In
one, you give explicit commands on both ends.  That is, you give a
"send" command on the end that is sending and a "receive" command on
the end that is receiving.  The commands specify the name of the file
on their system.  With this method, you must give a new command on
each end for each file.  A simpler way is to put the remote machine
into "server" mode.  This effectively makes Kermit on the remote
machine a slave of Kermit on your local machine.  In this mode, you
only need to type commands to your own machine.  It will use the
Kermit protocol to send appropriate commands to the remote machine.
The example below will use this method.


3. EXAMPLE OF KERMIT USAGE

Run kermit, and then type
   set line /dev/tty1
   set speed 2400
   connect
(It's more convenient if you put these commands in .kermrc in your
home directory, so that they get done automatically whenever you
run kermit.)  This will connect you to the modem or whatever on
the serial port.  You are now talking to the other system.  Log into
it.

When you want to transfer files, run kermit on the other system.
To it, type
   server
This puts its kermit into "slave mode."  Now come back to the command
level on Minix kermit, by typing the escape character followed "c".
(kermit will tell you the current escape character when you do the
connect command.)  At this point you can issue various commands.  Your
kermit will coordinate things with kermit on the other machine so that
you only have to type commands at one end.  Common commands are

   get filename
   put filename
   remote dir

Filenames can include wildcards.  By default, kermit works in a
system-independent, text mode.  (In effect it assumes that the
whole world is MS-DOS and converts end of line and file names
accordingly.)  To send binary files, you will want to type
   set file type bin
on both ends before starting any transfers.  This disables
CR LF to newline conversion.  If both of your systems are some
flavor of Unix, you might as well put this in .kermrc on both
ends and run in binary mode all the time.  Also, if both systems
are Unix I recommend
    set file name lit
on both ends.  This causes it to keep file names unchanged,
rather than mapping to legal MS-DOS names.

Here's typical .kermrc for use on minix:

   set file type bin
   set file name lit
   set rec pack 1000
   set esc 29
   set prompt Minix Kermit>
   connect

set rec pack 1000 says to request 1000-byte packets when receiving
files.  (This will be ignored if the other end doesn't support
long packets.)  This makes line utilization more efficient than
the default 90-byte packets, though it isn't critical.  (You may
not want to do this unless you have installed my changes to 
increase buffer sizes, though on a 10MHz AT, 1000-byte packets
work even without the patch as long as you are using a disk rather
than a floppy.)

set esc 29 sets the escape character to ^].  No particular reason.
You can use a different one if you like.

You should change the prompt if the other end is also running C Kermit.
Otherwise both ends will prompt
   C Kermit>
which is sort of confusing.

Here's a typical .kermrc for use on Unix hosts:

   set rec packet 1000
   set fil name lit
   set fil type bin
   server

4.  HOW FILES AND FILE NAMES ARE TRANSFORMED

Unix files are linear (sequential) streams of 8-bit bytes.  Text files
consist of 7-bit ASCII characters, with the high-order bit off (0),
and lines separated by the Unix newline character, which is linefeed
(LF, ASCII 10).  This distinguishes Unix text files from those on
most other ASCII systems, in which lines are separated by a
carriage-return linefeed sequence (CRLF, ASCII 13, followed by
linefeed, ASCII 10).  Binary files are likely to contain data in the
high bits of the file bytes, and have no particular line or record
structure.

When transferring files, C-Kermit will convert between upper and lower
case filenames and between LF and CRLF line terminators automatically,
unless told to do otherwise.  When binary files must be transferred,
the program must be instructed not to perform LF/CRLF conversion (-i
on the command line or "set file type binary" interactively; see
below).

Files are sent with their own names, except that lowercase letters are
raised to upper, pathnames are stripped off, certain special
characters like (`~') and (`#') are changed to `X', and if the file
name begins with a period, an `X' is inserted before it.  Incoming
files are stored under their own names except that uppercase letters
are lowered, and, if -w was specified, a "generation number" is
appended to the name if it has the same name as an existing file which
would otherwise be overwritten.  If the -a option is included, then
the same rules apply to its argument.  The file transfer display shows
any transformations performed upon filenames.  File name
transformations can be disabled using "set file name literal."


5. LINE EDITING CONVENTIONS

When using kermit, the following line editing conventions are used:

 DEL, RUBOUT, BACKSPACE, CTRL-H: Delete the most recent character typed.
 CTRL-W: Delete the most recent word typed.
 CTRL-U: Delete the current line.
 CTRL-R: Redisplay the current line.
 ?       (question mark) display help on the current command or field.
 ESC     (Escape or Altmode) Attempt to complete the current field.
 \       (backslash) include the following character literally.



6. LIST OF COMMANDS

Kermit understands the following commands.  The ones in parentheses are
not available on MINIX kermit.

 !                  bye                close              connect
 cwd                (dial)             directory          echo
 exit               finish             get                (help)
 log                quit               receive            remote
 (script)           send               server             set
 show               space              statistics         take
 

6.1 Command: !
Issue a command to the Unix shell (space required after '!')


6.2 Command: bye
Shut down and log out a remote Kermit server


6.3 Command: close
Close one of the following logs:
 session, transaction, packet, debugging -- 'help log' for further info.


6.4 Command: connect 
Create an interactive connection to a remote system via the tty device
given in the most recent 'set line' command.


6.5 Command: cwd 
Change Working Directory, equivalent to Unix 'cd' command


6.6 Command: dial 
Dial a number using modem autodialer


6.7 Command: directory 
Display a directory of local files


6.8 Command: echo 
Display the rest of the command on the terminal,
useful in command files.


6.9 Command: exit 
Exit from the Kermit program, closing any open logs.  Does not close
the terminal or hang up an attached modem.


6.10 Command: finish 
Tell the remote Kermit server to shut down without logging out.


6.11 Command: get Format: 'get filespec'.  Tell the remote Kermit
server to send the named files.  If filespec is omitted, then you are
prompted for the remote and local filenames separately.  The remote
Kermit should be in "server" mode.  There are two ways to send files
using kermit.  In one, you give a "send" command on one end and a
"receive" command on the other end, each specifying the file names on
their machines.  In the other, you put the remote kermit in "server"
mode, and control it entirely from kermit on your machine using "get"
and "send" commands.



6.12 Command: help

Type ? for a list of commands, type 'help x' for any command x.


6.13 Command: log 
Record information in a log file:

 debugging             Debugging information, to help track down
  (default debug.log)  bugs in the C-Kermit program.

 packets               Kermit packets, to help track down protocol problems.
  (packet.log)

 session               Terminal session, during CONNECT command.
  (session.log)

 transactions          Names and statistics about files transferred.
  (transact.log)



6.14 Command: quit 
Same as exit.


6.15 Command: receive 
Format: 'receive [filespec]'.  Wait for a file to arrive from the other
Kermit, which must be given a 'send' command.  If the optional filespec is
given, the (first) incoming file will be stored under that name, otherwise
it will be stored under the name it arrives with.  See 'get' for the
difference between 'receive' and 'get.'


6.16 Command: remote 
The 'remote' command is used to send file management instructions to a
remote Kermit server.  There should already be a Kermit running in server
mode on the other end of the currently selected line.  Type 'remote ?' to
see a list of available remote commands.  Type 'help remote x' to get
further information about a particular remote command 'x'.


6.17 Command: script 

Syntax: script text

Login to a remote system using the text provided.  The login script
is intended to operate similarly to uucp "L.sys" entries.
A login script is a sequence of the form:

	expect send [expect send] . . .

where 'expect' is a prompt or message to be issued by the remote site, and
'send' is the names, numbers, etc, to return.  The send may also be the
keyword EOT, to send control-d, or BREAK, to send a break.  Letters in
send may be prefixed by ~ to send special characters.  These are:
~b backspace, ~s space, ~q '?', ~n linefeed, ~r return, ~c don't
append a return, and ~o[o[o]] for octal of a character.  As with some 
uucp systems, sent strings are followed by ~r unless they end with ~c.

Only the last 7 characters in each expect are matched.  A null expect,
e.g. ~0 or two adjacent dashes, causes a short delay.  If you expect
that a sequence might not arrive, as with uucp, conditional sequences
may be expressed in the form:

	-send-expect[-send-expect[...]]

where dashed sequences are followed as long as previous expects fail.


6.18 Command: send 
Format: 'send file1 [file2]'.  File1 may contain wildcard characters '*' or
'?'.  If no wildcards, then file2 may be used to specify the name file1 is
sent under; if file2 is omitted, file1 is sent under its own name.  See
'get' for a description of two different ways to use 'send.'



6.19 Command: server 
Enter server mode on the currently selected line.  All further commands
will be taken in packet form from the other Kermit program.


6.20 Command: set 
The 'set' command is used to establish various communication or file
parameters.  The 'show' command can be used to display the values of
'set' parameters.  Help is available for each individual parameter;
type 'help set ?' to see what's available.


6.21 Command: show 
Communications Parameters:
 Line: /dev/tty, speed: -1, mode: remote, modem-dialer: direct
 Parity: none, duplex: full, flow: xon/xoff, handshake: none

Protocol Parameters:   Send    Receive
 Timeout:               10        7
 Padding:                0        0
 Pad Character:          0        0
 Packet Start:           1        1
 Packet End:            13       13
 Packet Length:         90       90

Block Check Type: 1, Delay: 5

File parameters:
 File Names:   literal        Debugging Log:    none
 File Type:    binary         Packet Log:       none
 File Warning: off            Session Log:      none
 File Display: on             Transaction Log:  none

Incomplete File Disposition: discard, Init file: .kermrc


6.22 Command: space
Display disk usage in current device, directory


6.23 Command: statistics 
Display statistics about most recent file transfer


6.24 Command: take 
Take Kermit commands from the named file.  Kermit command files may
themselves contain 'take' commands, up to a reasonable depth of nesting.



6. PARAMETERS THAT CAN BE SET WITH THE 'SET' COMMAND

 block-check        delay              duplex             escape-character
 file               flow-control       handshake          incomplete
 line               modem-dialer       parity             prompt
 receive            send               speed              


6.1 Set block-check 
Type of packet block check to be used for error detection, 1, 2, or 3.
Type 1 is standard, and catches most errors.  Types 2 and 3 specify more
rigorous checking at the cost of higher overhead.  Not all Kermit programs
support types 2 and 3.


6.2 Set delay 
Number of seconds to wait before sending first packet after 'send' command.


6.3 Set duplex 
During 'connect': 'full' means remote host echoes, 'half' means this program
does its own echoing.


6.4 Set escape-character 
Decimal ASCII value for escape character during 'connect', normally 28
(Control-\)


6.5 Set file: names, type, warning, display.

'names' are normally 'converted', which means file names are converted
to 'common form' during transmission; 'literal' means use filenames
literally (useful between like systems).

'type' is normally 'text', in which conversion is done between Unix
newlines and CRLF line delimiters; 'binary' means to do no conversion.
Use 'binary' for executable programs or binary data.  If you know
both systems are Unix-like, you can use 'binary' all the time.  
A 7 or 8 may be used after the type, e.g. 'type text 7'.  If you
specify 7, the high order bit will be stripped from each byte of
sent and received files.

'warning' is 'on' or 'off', normally off.  When off, incoming files will
overwrite existing files of the same name.  When on, new names will be
given to incoming files whose names are the same as existing files.

'display' is normally 'on', causing file transfer progress to be displayed
on your screen when in local mode.  'set display off' is useful for
allowing file transfers to proceed in the background.


6.6 Set flow-control 
Type of flow control to be used.  Choices are 'xon/xoff' and 'none'.
normally xon/xoff.


6.7 Set handshake 
Decimal ASCII value for character to use for half duplex line turnaround
handshake.  Normally, handshaking is not done.


6.8 Set incomplete 
Incomplete file disposition: discard or keep.  Normally discard.


6.9 Set line 
Device name of communication line to use.  Normally /dev/tty.
If you set the line to other than /dev/tty, then Kermit
will be in 'local' mode; 'set line' will reset Kermit to its default mode.
'set line /dev/tty' will always put Kermit in remote mode.
If the line has a modem, and if the modem-dialer is set to direct, this
command causes waiting for a carrier detect (e.g. on a hayes type modem).
This can be used to wait for incoming calls.
To use the modem to dial out, first set modem-dialer (e.g., to hayes), then
6.x Set line, next issue the dial command, and finally connect.


6.10 Set modem-dialer 
Type of modem for dialing remote connections.  Needed to indicate modem can
be commanded to dial without 'carrier detect' from modem.  Many recently
manufactured modems use 'hayes' protocol.  Type 'set modem ?' to see what
types of modems are supported by this program.


6.11 Set parity 
Parity to use during terminal connection and file transfer:
even, odd, mark, space, or none.  Normally none.


6.12 Set prompt 
Prompt string for this program, normally 'C-Kermit>'.


6.13 Set receive 
Specify parameters for inbound packets:
End-Of-Packet (ASCII value), Packet-Length (1000 or less),
Padding (amount, 94 or less), Pad-Character (ASCII value),
Start-Of-Packet (ASCII value), and Timeout (94 seconds or less, 0
means wait forever), all specified as decimal numbers.  The only
one of these you are likely to want to set is the packet length.
It defaults to 90.  Large values can increase line utilization
considerably.  Not all implementations can handle values
over 95.  If you specify a length of 95 or more and the other
end doesn't implement extended packets, the default length will
be used.


6.14 Set send 
Specify parameters for outbound packets:
End-Of-Packet (ASCII value), Packet-Length (94 or less),
Padding (amount, 94 or less), Pad-Character (ASCII value),
Start-Of-Packet (ASCII value), and Timeout (94 seconds or less),
all specified as decimal numbers.  See the comment on receive
packet length.


6.15 Set speed 
Communication line speed for external tty line specified in most recent
'set line' command.  Any of the common baud rates:
 0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600.