Preface concerning documentation for the Data General C-Kermit: In making this commentary, I only rewrote the host-dependent sections of the original Unix document. Very few differences exist between Unix C-Kermit and Data General C-Kermit. But the entire document is included because of its utility to Data General users. The terms "Unix Kermit", "C-Kermit", "Data General Kermit", and "Kermit" are used as if they were identical in meaning. Discussion about "Unix files" and "Unix-to-Unix" transfers was left alone, so long was not confusing Data General users. The terms "DG" and "Data General" refer to all systems which run this version of Kermit, which includes AOS/VS (and AOS/DVS) as a minimum, and perhaps includes AOS/RT32 and MV/UX if the source is recompiled and relinked. DG/UX would need to re-insert some of the Unix-isms that I removed to make this version compatible in a non-Unix environment. For details on installation or adapting the source, see ckdker.bld. Also, DG/UX may not support the calls used from the System Call Dictionary for AOS/VS and AOS/DVS. See ckdker.bwr for further details about this programs limitations. Additions to the following headers are: Program: Data General Version by Phil Julian, SAS Institute, Inc. Language: DG's version 3.21 of C, with Rev 7.54 of AOS/VS Documentation: Adapted by Phil Julian Version: 4D(061) Date: May 12, 1987 9. UNIX KERMIT, adapted to the Data General computers Program: Frank da Cruz, Bill Catchings, Jeff Damens, Columbia University; Herm Fischer, Encino CA; contributions by many others. Language: C Documentation: Frank da Cruz, Herm Fischer Version: 4D(061) Date: September 9, 1986 C-Kermit is an implementation of Kermit, written modularly and transportably in C. The protocol state transition table is written in wart, a (non-proprietary) lex-like preprocessor for C. System-dependent primitive functions are isolated into separately compiled modules so that the program should be easily portable among Unix systems and also to non-Unix systems that have C compilers, such as the Apple Macintosh, the Commodore Amiga, and the Data General minicomputers. This document applies to Unix implementations of C-Kermit, and in most ways also to the VMS and other implementations. Data General Kermit Capabilities At A Glance: Local operation: Yes Remote operation: Yes Login scripts: No Transfer text files: Yes Transfer binary files: Yes Wildcard send: Yes File transfer interruption: Yes Filename collision avoidance: Yes Can time out: Yes 8th-bit prefixing: Yes Repeat count prefixing: Yes Alternate block checks: Yes Terminal emulation: Yes Communication settings: Yes Transmit BREAK: Maybe no (I can't really test this) Support for dialout modems: No DIAL command IBM mainframe communication: Yes Transaction logging: Yes Session logging: Yes Debug logging: Yes Packet logging: Yes Act as server: Yes Talk to server: Yes Advanced server functions: Yes Local file management: Yes Command/Init files: Yes UUCP and multiuser line locking: Yes File attributes packets: No Command macros: No Raw file transmit: No All numbers in the C-Kermit documentation are decimal unless noted otherwise. C-Kermit provides traditional Data General command line operation as well as interactive command prompting and execution. The command line options provide access to a basic subset of C-Kermit's capabilities; the interactive command set is far richer. On systems with dialout modems, C-Kermit's command file and login script facilities provide a counterpart to UUCP for file transfer with non-UNIX operating systems, including the use of scheduled (e.g. late night) unattended operation. 9.1. The Data General File System Data General has a different file system from Unix. Consult your book on CLI (Command Line Interpreter) or the DG operating system. These comments apply specifically to AOS/VS. Other DG operating systems may have different file structures, and may in fact be supported transparently by the operating system. (I have only tested this version of Kermit on AOS/VS, and I leave it to others to verify the results under AOS/DVS, AOS/RT32, and MV/UX.) In general, Data General files can have lowercase and/or uppercase in its file names, and the operating system treats names as if they were all upper case. Directory levels are separated by colon (":") characters. For example, :udd:foo:bar denotes the file bar in the directory :udd:foo. Wildcard or "meta" characters allow groups of files to be specified. "+" matches any string; "*" matches any single character besides a "."; "-" matches any any string up to the next "."; "#" matches the current directory and all sub-directories. When C-Kermit is invoked with file arguments specified on the CLI command line, the CLI expands the meta characters itself, and in this case a few additional characters available. For example, xeq kermit -s :udd:[!user]:ck-. is expanded by the CLI into a list of all the files in the user's home directory (:udd:[!user]) that start with the characters "ck", followed by a single character "u", "v", or "m", followed by zero or more characters, followed by a dot, followed by one of the strings "upd" or "bwr". Note the use of the "<>" macro characters to do an in-line expansion of arguments. Internally, the C-Kermit program itself expands only the "-" meta character. The "-" meta character does not conflict with the "-" wildcard character, because of the context of the character. Also, note that any wildcard is expanded by the DG Kermit program, and not by the CLI shell. Some additional meta characters are available in AOS/VS, "()", "[]", and "&". A "[!" followed directly by a name, and terminated by "]", is a DG pseudo-macro; for example, "[!user]" expands to the login name used. Parentheses will repeat each command for each argument. For example: xeq kermit -s :udd:[!user]:ck-.(upd bwr) will expand into two CLI commands: xeq kermit -s :udd:[!user]:ck-.upd xeq kermit -s :udd:[!user]:ck-.bwr The square brackets are used to read from an external file, for example: xeq kermit [args.file] where args.file contains the line: -s :udd:[!user]:ck-.(upd bwr) Finally, to continue the command to the next line, end the line with an ampersand character, "&". In the following example, ")" is the default AOS/VS prompt, and "&)" is the line continuation prompt: ) xeq kermit & &) -s :udd:[!user]:ck-.(upd bwr) 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 distin- guishes 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 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). 9.2. File Transfer If C-Kermit is in local mode, the screen (stdout) is continously updated to show the progress of the file transer. A dot is printed for every four data packets, other packets are shown by type: I Exchange Parameter Information R Receive Initiate S Send Initiate F File Header G Generic Server Command C Remote Host Command N Negative Acknowledgement (NAK) E Fatal Error T Indicates a timeout occurred Q Indicates a damaged, undesired, or illegal packet was received % Indicates a packet was retransmitted You may type certain "interrupt" commands during file transfer: Control-F: Interrupt the current File, and go on to the next (if any). Control-B: Interrupt the entire Batch of files, terminate the transaction. Control-R: Resend the current packet Control-A: Display a status report for the current transaction. These interrupt characters differ from the ones used in other Kermit implementations to avoid conflict with commonly used Unix shell interrupt characters. With Version 7, System III, and System V implementations of Unix, interrupt commands must be preceeded by the 'connect' escape character (e.g. normally Ctrl-\). The Data General does not need the escape character, but accepts the interrupt characters directly. Ctrl-F and Ctrl-B are effective only during the transfer of data (D) packets, and cannot be used to interrupt a transfer that has not yet reached that stage. CAUTION: If Control-F or Control-B is used to cancel an incoming file, and a file of the same name previously existed, and the "file warning" feature is not enabled, then the previous copy of the file will dis- appear. EMERGENCY EXIT: When running Data General Kermit in remote mode, if you have started a protocol operation (sending or receiving a file, server command wait, etc), you will not be able to regain control of the terminal until the protocol operation has run its course (completed or timed out). In particular, you cannot stop the protocol by typing the normal Data General interrupt characters, since the terminal has been put in "raw mode". If you need to regain control quickly -- for instance, because the protocol is stuck -- you can type the following sequence of three characters directly to the Data General Kermit program ("connect" first if necessary): BREAK Control-C Control-A or BREAK Control-C Control-B This will cause the program to exit and restore the terminal to normal. WARNING: Data General Kermit conifigures the console line to CHAR/BREAK=BMOB so that a BREAK will exit a binary-mode read operation ("raw mode" input). Then the normal interrupt characters for a C program are accepted by the operating system. When Kermit ends, the console line characteristics are restored to their state when the program was initiated. 9.3. Command Line Operation The C-Kermit command line syntax conforms to the Proposed Syntax Standards for Unix System Commands put forth by Kathy Hemenway and Helene Armitage of AT&T Bell Laboratories in Unix/World, Vol.1, No.3, 1984. The rules that apply are: - Command names must be between 2 and 9 characters ("kermit" is 6). - Command names must include lower case letters and digits only. - An option name is a single character. - Options are delimited by '-'. - Options with no arguments may be grouped (bundled) behind one delimiter. - Option-arguments cannot be optional. - Arguments immediately follow options, separated by whitespace. - The order of options does not matter. - '-' preceded and followed by whitespace means standard input. A group of bundled options may end with an option that has an argument. The following notation is used in command descriptions: fn A DG file specification, possibly containing the "wildcard" characters `*', '-', '#', or `+' (`+' matches all character strings, `*' matches any single character, '-' matches any string up to a '.', and '#' matches the current and all subdirectories). Other special characters are possible, such as '^' to move up a directory, or '=' to use the current working directory, or '@' to use the peripheral directory (:PER). fn1 A DG file specification which may not contain `*', '-', '#', or `+', but it may contain other special characters such as '^' to move up a directory, '=' to use the current working directory, or '@' to use the peripheral directory (:PER). rfn A remote file specification in the remote system's own syntax, which may denote a single file or a group of files. rfn1 A remote file specification which should denote only a single file. n A decimal number between 0 and 94. c A decimal number between 0 and 127 representing the value of an ASCII character. cc A decimal number between 0 and 31, or else exactly 127, representing the value of an ASCII control character. [ ] Any field in square braces is optional. {x,y,z} Alternatives are listed in curly braces. C-Kermit command line options may specify either actions or settings. If C-Kermit is invoked with a command line that specifies no actions, then it will issue a prompt and begin interactive dialog. Action options specify either protocol transactions or terminal connection. -s fn Send the specified file or files. If fn contains wildcard (meta) characters, the DG Kermit program (and not the CLI shell) expands it into a list. If fn is '-' then Kermit sends from standard input, which must come from a file: xeq kermit/i=foo.bar -s - ( Parallel process pipes, signified by "|", are not available except perhaps under MV/UX. ) You could use this mechanism to send terminal typein, using control-D as the EOF character, such as: xeq kermit/i=@console -s - -r Receive a file or files. Wait passively for files to arrive. -k Receive (passively) a file or files, sending them to standard output. This option can be used in several ways: xeq kermit/o=fn1 -k Sends the incoming file or files to the named file, fn1. If more than one file arrives, all are concatenated together into the single file fn1. "kermit -k | command" is not available except perhaps on MV/UX. -a fn1 If you have specified a file transfer option, you may give an alternate name for a single file with the -a ("as") option. For example, xeq kermit -s foo -a bar sends the file foo telling the receiver that its name is bar. If more than one file arrives or is sent, only the first file is affected by the -a option: xeq kermit -ra baz stores the first incoming file under the name baz. -x Begin server operation. May be used in either local or remote mode. Before proceeding, a few words about remote and local operation are necessary. C-Kermit is "local" if it is running on PC or workstation that you are using directly, or if it is running on a multiuser system and transferring files over an external communication line -- not your job's controlling terminal or con- sole. C-Kermit is remote if it is running on a multiuser system and transfer- ring files over its own controlling terminal's communication line (normally @OUTPUT), connected to your PC or workstation. If you are running C-Kermit on a PC, it is in local mode by default, with the "back port" designated for file transfer and terminal connection. If you are running C-Kermit on a multiuser (timesharing) system, it is in remote mode un- less you explicitly point it at an external line for file transfer or terminal connection. The following command sets C-Kermit's "mode": -l dev Line -- Specify a terminal line to use for file transfer and terminal connection, as in xeq kermit -l @con5 When an external line is being used, you might also need some additional op- tions for successful communication with the remote system: -b n Baud -- Specify the baud rate for the line given in the -l option, as in xeq kermit -l @con5 -b 9600 This option should always be included with the -l option, since the speed of an external line is not necessarily what you expect. -p x Parity -- e,o,m,s,n (even, odd, mark, space, or none). If parity is other than none, then the 8th-bit prefixing mechanism will be used for transferring 8-bit binary data, provided the opposite Kermit agrees. The default parity is none. -t Specifies half duplex, line turnaround with XON as the handshake character. The following commands may be used only with a C-Kermit which is local either by default or else because the -l option has been specified. -g rfn Actively request a remote server to send the named file or files; rfn is a file specification in the remote host's own syntax. Since CLI does not expand wildcard characters, they need not be quoted. But other special characters, "()" or "<>" or "&" if at the end of a line, must be entered by using the "[!ascii]" pseudo-macro; for example, "" becomes "[!ascii 74]xyz[!ascii 76]". xeq kermit -g x*.? -f Send a 'finish' command to a remote server. -c Establish a terminal connection over the specified or default com- munication line, before any protocol transaction takes place. Get back to the local system by typing the escape character (normally Control-Backslash) followed by the letter 'c'. -n Like -c, but after a protocol transaction takes place; -c and -n may both be used in the same command. The use of -n and -c is illustrated below. On a timesharing system, the -l and -b options will also have to be included with the -r, -k, or -s options if the other Kermit is on a remote system. Several other command-line options are provided: -i Specifies that files should be sent or received exactly "as is" with no conversions. This option is necessary for transmitting binary files. It may also be used in Unix-to-Unix transfers (it must be given to both Unix Kermit programs), where it will improve performance by circumvent- ing the normal text-file conversions, and will allow mixture of text and binary files in a single file group. -w Write-Protect -- Avoid filename collisions for incoming files. -q Quiet -- Suppress screen update during file transfer, for instance to allow a file transfer to proceed in the background. -d Debug -- Record debugging information in the file debug.log in the cur- rent directory. Use this option if you believe the program is mis- behaving, and show the resulting log to your local kermit maintainer. -h Help -- Display a brief synopsis of the command line options. The Data General allows several switches on the "xeq" command line for AOS/VS and AOS/RT32. These switches are described in chapter 11 of the C reference manual, and are in summary: xeq kermit/e ... Append standard error output to @output xeq kermit/e=filename ... Create "filename" for standard error output xeq kermit/ee=filename ... Append standard error output to "filename" xeq kermit/i ... Get standard input from @DATA xeq kermit/i=filename ... Get standard input from "filename" xeq kermit/l ... Append standard output to @LIST xeq kermit/l= ... Identical to "xeq kermit/o=filename" xeq kermit/o=filename ... Create "filename" for standard output xeq kermit/oo=filename ... Append standard output to "filename" The command line may contain no more than one protocol action option. Files are sent with their own names, except that lowercase letters are raised to upper, pathnames are stripped off. Incoming files are stored under their own names except that all letters are uppercased, 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. During transmission, files are encoded as follows: - Control characters are converted to prefixed printables. - Sequences of repeated characters are collapsed via repeat counts, if the other Kermit is also capable of repeated-character compression. - If parity is being used on the communication line, data characters with the 8th (parity) bit on are specially prefixed, provided the other Kermit is capable of 8th-bit prefixing; if not, 8-bit binary files cannot be successfully transferred. - Conversion is done between Unix newlines and carriage-return-linefeed sequences unless the -i option was specified. Command Line Examples: xeq kermit -l @con5 -b 1200 -cn -r This command connects you to the system on the other end of @con5 at 1200 baud, where you presumably log in and run Kermit with a 'send' command. After you escape back, C-Kermit waits for a file (or files) to arrive. When the file transfer is completed, you are reconnected to the remote system so that you can logout. xeq kermit -l @con4 -b 1800 -cntp m -r -a foo This command is like the preceding one, except the remote system in this case uses half duplex communication with mark parity. The first file that arrives is stored under the name foo. xeq kermit -l @con6 -b 9600 -c | tek (only perhaps under MV/UX) xeq kermit -l @con6 -b 9600 -nf This command would be used to shut down a remote server and then connect to the remote system, in order to log out or to make further use of it. The -n option is invoked after -f (-c would have been invoked before). Where ")" and "))" are the AOS/VS system prompts, enter the following: ) qbatch/i ;comment -- Add any other needed switches )) xeq kermit -l @con6 -b 9600 -qg foo.* ))) ;comment -- Enter a ")" to exit the qbatch/i command This command causes C-Kermit to be invoked in a batch job, getting a group of files from a remote server (note that the '*' character is not quoted, since the CLI does not expand wildcard characters). No display occurs on the screen, and the keyboard is not sampled for interruption commands. ( Some DG users may want to provide examples using the PROC command, which is more like a background job than a batch job. But we needed a batch example anyway. ) Where ")" and "))" are the AOS/VS system prompts, enter the following: ) qbatch/i ;comment -- Add any other needed switches )) x kermit/i=@NULL/o=foo.log -l @con6 -b 9600 -g foo.* ))) ;comment -- Enter a ")" to exit the qbatch/i command This command is like the previous one, except the file transfer display has been redirected to the file foo.log. Standard input is also redirected, to prevent C-Kermit from sampling it for interruption commands. xeq kermit -iwx This command starts up C-Kermit as a server. Files are transmitted with no newline/carriage-return-linefeed conversion; the -i option is necessary for bi- nary file transfer and recommended for Unix-to-Unix transfers. Incoming files that have the same names as existing files are given new, unique names. xeq kermit -l @con6 -b 9600 This command sets the communication line and speed. Since no action is specified, C-Kermit issues a prompt and enters an interactive dialog with you. Any settings given on the command line remain in force during the dialog, un- less explicitly changed. xeq kermit This command starts up Kermit interactively with all default settings. The next example shows how Unix Kermit might be used to send an entire direc- tory tree from one Unix system to another, using the tar program as Kermit's standard input and output. On the orginating system, in this case the remote, type (for instance): tar cf - /usr/fdc | kermit -is - (Not available) kermit -il /dev/ttyi5 -b 9600 -k | tar xf - (Not available) compress file | kermit -is - (sender) (Not available) kermit -ik | uncompress (receiver) (Not available) Exit Status Codes: Status codes are not returned, and the string variable is not set to return the error message. 9.4. Interactive Operation WARNING: If you have a non-DG type of terminal, enter this command: CHAR/ON/NAS and Kermit will supply the correct backspace character and delete characters properly on the screen. In other words, this DG Kermit supports DG and non-DG style terminals. C-Kermit's interactive command prompt is "C-Kermit>". In response to this prompt, you may type any valid command. C-Kermit executes the command and then prompts you for another command. The process continues until you instruct the program to terminate. Commands begin with a keyword, normally an English verb, such as "send". You may omit trailing characters from any keyword, so long as you specify suf- ficient characters to distinguish it from any other keyword valid in that field. Certain commonly-used keywords (such as "send", "receive", "connect") also have special non-unique abbreviations ("s" for "send", "r" for "receive", "c" for "connect"). Certain characters have special functions during typein of interactive com- mands: ? Question mark, typed at any point in a command, will produce a message explaining what is possible or expected at that point. Depending on the context, the message may be a brief phrase, a menu of keywords, or a list of files. ESC (The Escape or Altmode key) -- Request completion of the current keyword or filename, or insertion of a default value. The result will be a beep if the requested operation fails. DEL (The Delete or Rubout key) -- Delete the previous character from the command. You may also use BS (Backspace, Control-H) for this function. ^W (Control-W) -- Erase the rightmost word from the command line. ^U (Control-U) -- Erase the entire command. ^R (Control-R) -- Redisplay the current command. SP (Space) -- Delimits fields (keywords, filenames, numbers) within a com- mand. HT (Horizontal Tab) may also be used for this purpose. CR (Carriage Return) -- Enters the command for execution. LF (Linefeed) or FF (formfeed) may also be used for this purpose. \ (Backslash) -- Enter any of the above characters into the command, literally. To enter a backslash, type two backslashes in a row (\\). A backslash at the end of a command line causes the next line to be treated as a continuation line; this is useful for readability in com- mand files, especially in the 'script' command. You may type the editing characters (DEL, ^W, etc) repeatedly, to delete all the way back to the prompt. No action will be performed until the command is entered by typing carriage return, linefeed, or formfeed. If you make any mis- takes, you will receive an informative error message and a new prompt -- make liberal use of `?' and ESC to feel your way through the commands. One impor- tant command is "help" -- you should use it the first time you run C-Kermit. A command line beginning with a percent sign "%" is ignored. Such lines may be used to include illustrative commentary in Kermit command dialogs. Interactive C-Kermit accepts commands from files as well as from the keyboard. When you enter interactive dialog, C-Kermit looks for the file .kermrc in your home or current directory (first it looks in the home directory, then in the current one) and executes any commands it finds there. These commands must be in interactive format, not Data General command-line format (the initialization file is processed if you invoke Kermit with command-line action arguments, such that it does not enter interactive dialog). A "take" command is also provided for use at any time during an interactive session, to allow interactive-format commands to be executed from a file; command files may be nested to any reasonable depth. Here is a brief list of C-Kermit interactive commands: ! Execute a Data General shell command, or start a shell. bye Terminate and log out a remote Kermit server. close Close a log file. connect Establish a terminal connection to a remote system. cwd Change Working Directory. dial Dial a telephone number. (Not Available) directory Display a directory listing. echo Display arguments literally. exit Exit from the program, closing any open files. finish Instruct a remote Kermit server to exit, but not log out. get Get files from a remote Kermit server. help Display a help message for a given command. log Open a log file -- debugging, packet, session, transaction. quit Same as 'exit'. receive Passively wait for files to arrive. remote Issue file management commands to a remote Kermit server. script Execute a login script with a remote system. (Not Available) send Send files. server Begin server operation. set Set various parameters. show Display values of 'set' parameters. space Display current disk space usage. statistics Display statistics about most recent transaction. take Execute commands from a file. The 'set' parameters are: block-check Level of packet error detection. delay How long to wait before sending first packet. duplex Specify which side echoes during 'connect'. escape-character Prefix for "escape commands" during 'connect'. file Set various file parameters. flow-control Communication line full-duplex flow control. handshake Communication line half-duplex turnaround character. incomplete Disposition for incompletely received files. line Communication line device name. modem-dialer Type of modem-dialer on communication line. (Not Available) parity Communication line character parity. prompt The C-Kermit program's interactive command prompt. receive Parameters for inbound packets. send Parameters for outbound packets. speed Communication line speed. The 'remote' commands are: cwd Change remote working directory. delete Delete remote files. directory Display a listing of remote file names. help Request help from a remote server. host Issue a command to the remote host in its own command language space Display current disk space usage on remote system. type Display a remote file on your screen. who Display who's logged in, or get information about a user. Most of these commands are described adequately in the Kermit User Guide. Spe- cial aspects of certain Unix Kermit commands are described below. THE 'SEND' COMMAND Syntax: send fn - or - send fn1 rfn1 Send the file or files denoted by fn to the other Kermit, which should be running as a server, or which should be given the 'receive' command. Each file is sent under its own name (as described above, or as specified by the 'set file names' command). If the second form of the 'send' command is used, i.e. with fn1 denoting a single Data General file, rfn1 may be specified as a name to send it under. The 'send' command may be abbreviated to 's', even though 's' is not a unique abbreviation for a top-level C-Kermit command. The wildcard (meta) characters `+', '-', '#', and `*' are accepted in fn. "+" matches any string; "*" matches any single character besides a "."; "-" matches any any string up to the next "."; "#" matches the current directory and all sub-directories. Other notations for file groups, like `og', are not available in interactive commands (though of course they are available on the command line). When fn contains `+', '-', '#', or `*' characters, there is a limit to the number of files that can be matched, which varies from system to system. If you get the message "Too many files match" then you'll have to make a more judicious selection. If fn was of the form :udd:longname:anotherlongname:+ then C-Kermit's string space will fill up rapidly -- try doing a cwd (see below) to the path in question and reissuing the command. Note -- C-Kermit sends only from the current or specified directory. It only traverses directory trees when the '#' character is used. If the source directory contains subdirectories, they will be skipped (except for '#'). By the same token, C-Kermit does not create directories when receiving files. Another Note -- DG has no "invisible" files. THE 'RECEIVE' COMMAND Syntax: receive - or - receive fn1 Passively wait for files to arrive from the other Kermit, which must be given the 'send' command -- the 'receive' command does not work in conjunction with a server (use 'get' for that). If fn1 is specified, store the first incoming file under that name. The 'receive' command may be abbreviated to 'r'. THE 'GET' COMMAND: Syntax: get rfn or: get rfn fn1 Request a remote Kermit server to send the named file or files. Since a remote file specification (or list) might contain spaces, which normally delimit fields of a C-Kermit command, an alternate form of the command is provided to allow the inbound file to be given a new name: type 'get' alone on a line, and you will be prompted separately for the remote and local file specifications, for example C-Kermit>get Remote file specification: profile exec Local name to store it under: profile.exec As with 'receive', if more than one file arrives as a result of the 'get' com- mand, only the first will be stored under the alternate name given by fn1; the remaining files will be stored under their own names if possible. If a `?' is to be included in the remote file specification, you must prefix it with `\' to suppress its normal function of providing help. If you have started a multiline 'get' command, you may escape from its lower- level prompts by typing a carriage return in response to the prompt, e.g. C-Kermit>get Remote file specification: foo Local name to store it under: (Type a carriage return here) (cancelled) C-Kermit> THE 'SERVER' COMMAND: The 'server' command places C-Kermit in "server mode" on the currently selected communication line. All further commands must arrive as valid Kermit packets from the Kermit on the other end of the line. The Data General Kermit server can respond to the following commands: Command Server Response get Sends files send Receives files bye Attempts to log itself out (DG doesn't log off) finish Exits to level from which it was invoked remote directory Sends directory lising remote delete Removes files remote cwd Changes working directory remote type Sends files to your screen remote space Reports about its disk usage remote who Shows who's logged in remote host Executes a Unix shell command remote help Lists these capabilities Note that the Unix Kermit server cannot always respond to a BYE command. It will attempt to do so using "kill()", but this will not work on all systems or under all conditions. The Data General Kermit will only exit Kermit, but it will not log off. If the Kermit server is directed at an external line (i.e. it is in "local mode") then the console may be used for other work if you have 'set file dis- play off'; normally the program expects the console to be used to observe file transfers and enter status queries or interruption commands. The way to get Data General C-Kermit into background operation from interactive command level is to run a batch job. (Perhaps some DG users can add some examples and information on using the PROC command to run a background task.) The more common method is to invoke the program with the desired command line arguments, after entering a "qbatch/i" command. When the Unix Kermit server is given a 'remote host' command, it executes it using the shell invoked upon login, which is always CLI, except perhaps on MV/UX. THE 'REMOTE', 'BYE', AND 'FINISH' COMMANDS: C-Kermit may itself request services from a remote Kermit server. In addition to 'send' and 'get', the following commands may also be sent from C-Kermit to a Kermit server: remote cwd [directory] If the optional remote directory specification is included, you will be prompted on a separate line for a password, which will not echo as you type it. remote delete rfn delete remote file or files. remote directory [rfn] directory listing of remote files. remote host command command in remote host's own command language. remote space [rfn1] disk usage report from remote host. remote type [rfn] display remote file or files on the screen. remote who [user] display information about who's logged in. remote help display remote server's capabilities. bye and finish: When connected to a remote Kermit server, these commands cause the remote server to terminate; 'finish' returns it to Kermit or system command level (depending on the implementation or how the program was invoked); 'bye' also requests it to log itself out. THE 'LOG' AND 'CLOSE' COMMANDS: Syntax: log {debugging, packets, session, transactions} [ fn1 ] C-Kermit's progress may be logged in various ways. The 'log' command opens a log, the 'close' command closes it. In addition, all open logs are closed by the 'exit' and 'quit' commands. A name may be specified for a log file; if the name is omitted, the file is created with a default name as shown below. log debugging This produces a voluminous log of the internal workings of C-Kermit, of use to Kermit developers or maintainers in tracking down suspected bugs in the C-Kermit program. Use of this feature dramatically slows down the Kermit protocol. Default name: debug.log. log packets This produces a record of all the packets that go in and out of the com- munication port. This log is of use to Kermit maintainers who are tracking down protocol problems in either C-Kermit or any Kermit that C-Kermit is connected to. Default name: packet.log. log session This log will contain a copy of everything you see on your screen during the 'connect' command, except for local messages or interaction with local escape commands. Default name: session.log. log transactions The transaction log is a record of all the files that were sent or received while transaction logging was in effect. It includes time stamps and statistics, filename transformations, and records of any errors that may have occurred. The transaction log allows you to have long unattended file transfer sessions without fear of missing some vital screen message. Default name: transact.log. The 'close' command explicitly closes a log, e.g. 'close debug'. Note: Debug and Transaction logs are a compile-time option; C-Kermit may be compiled without these logs, in which case it will run faster, it will take up less space on the disk, and the commands relating to them will not be present. LOCAL FILE MANAGEMENT COMMANDS: Unix Kermit allows some degree of local file management from interactive com- mand level: directory [fn] Displays a listing of the names, sizes, and dates of files matching fn (which defaults to '+'). Equivalent to `filestatus/assortment'. cwd [directory-name] Changes Kermit's working directory to the one given, or to the default directory if the directory name is omitted. This command affects only the Kermit process and any processes it may subsequently create. DG Kermit may use '=' to display the current working directory, and '^' may be used to traverse up the directory trees. space [directory-name] Display information about disk space and/or quota in the current directory and device. If a directory-name is given, give space for that directory or logical device. ! [command] The command is executed by CLI. If no command is specified, then an interactive shell is started; exiting from the shell, e.g. by typing Control-D or 'bye', will return you to C-Kermit command level. Use the `!' command to provide file management or other functions not explicitly provided by C-Kermit commands. The `!' command has certain peculiarities: - C-Kermit attempts to use your preferred, customary (login) shell, which is always CLI, except on MV/UX. - At least one space must separate the '!' from the shell command. - A 'dir' (change directory) command executed in this manner will have no effect -- use the C-Kermit 'cwd' command instead. THE 'SET' AND 'SHOW' COMMANDS: Since Kermit is designed to allow diverse systems to communicate, it is often necessary to issue special instructions to allow the program to adapt to peculiarities of the another system or the communication path. These instruc- tions are accomplished by the 'set' command. The 'show' command may be used to display current settings. Here is a brief synopsis of settings available in the current release of C-Kermit: block-check {1, 2, 3} Determines the level of per-packet error detection. "1" is a single- character 6-bit checksum, folded to include the values of all bits from each character. "2" is a 2-character, 12-bit checksum. "3" is a 3-character, 16-bit cyclic redundancy check (CRC). The higher the block check, the better the error detection and correction and the higher the resulting overhead. Type 1 is most commonly used; it is supported by all Kermit implementations, and it has proven adequate in most circumstances. Types 2 or 3 would be used to advantage when transferring 8-bit binary files over noisy lines. delay n How many seconds to wait before sending the first packet after a 'send' command. Used in remote mode to give you time to escape back to your local Kermit and issue a 'receive' command. Normally 5 seconds. duplex {full, half} For use during 'connect'. Specifies which side is doing the echoing; 'full' means the other side, 'half' means C-Kermit must echo typein itself. escape-character cc For use during 'connect' to get C-Kermit's attention. The escape character acts as a prefix to an 'escape command', for instance to close the connec- tion and return to C-Kermit or Unix command level. The normal escape character is Control-Backslash (28). The escape character is also used in System III/V implementations to prefix interrupt commands during file transfers. file {display, names, type, warning} Establish various file-related parameters: display {on, off} Normally 'on'; when in local mode, display progress of file transfers on the screen (stdout), and listen to the keyboard (stdin) for inter- ruptions. If off (-q on command line) none of this is done, and the file transfer may proceed in the background oblivious to any other work concurrently done at the console terminal. names {converted, literal} Normally converted, which means that outbound filenames have path specifications stripped, lowercase letters raised to upper, tildes and extra periods changed to X's, and an X inserted in front of any name that starts with period. Incoming files have uppercase letters lowered. Literal means that none of these conversions are done; there- fore, any directory path appearing in a received file specification must exist and be write-accessible. When literal naming is being used, the sender should not use path names in the file specification unless the same path exists on the target system and is writable. type {binary, text} Normally text, which means that conversion is done between Unix newline characters and the carriage-return/linefeed sequences required by the canonical Kermit file transmission format, and in common use on non- Unix systems. Binary means to transmit file contents without conver- sion. Binary (`-i' in command line notation) is necessary for binary files, and desirable in all Unix-to-Unix transactions to cut down on overhead. warning {on, off} Normally off, which means that incoming files will silently overwrite existing files of the same name. When on (`-w' on command line) Kermit will check if an arriving file would overwrite an existing file; if so, it will construct a new name for the arriving file, of the form foo?n, where foo is the name they share and n is a "generation number"; if foo exists, then the new file will be called foo?1. If foo and foo?1 ex- ist, the new file will be foo?2, and so on. If the new name would be longer than the maximum length for a filename, then characters would be deleted from the end first, for instance, thelongestname on a system with a limit of 14 characters would become thelongestn?1. CAUTION: If Control-F or Control-B is used to cancel an incom- ing file, and a file of the same name previously existed, and the "file warning" feature is not enabled, then the previous copy of the file will disappear. flow-control {none, xon/xoff} Normally xon/xoff for full duplex flow control. Should be set to 'none' if the other system cannot do xon/xoff flow control, or if you have issued a 'set handshake' command. If set to xon/xoff, then handshake should be set to none. This setting applies during both terminal connection and file transfer. Warning: This command may have no effect on certain Unix sys- tems, where Kermit puts the communication line into 'rawmode', and rawmode precludes flow control. incomplete {discard, keep} Disposition for incompletely received files. If an incoming file is inter- rupted or an error occurs during transfer, the part that was received so far is normally discarded. If you "set incomplete keep" then such file fragments will be kept. handshake {xon, xoff, cr, lf, bell, esc, none} Normally none. Otherwise, half-duplex communication line turnaround hand- shaking is done, which means Unix Kermit will not reply to a packet until it has received the indicated handshake character or has timed out waiting for it; the handshake setting applies only during file transfer. If you set handshake to other than none, then flow should be set to none. line [device-name] The device name for the communication line to be used for file transfer and terminal connection, e.g. @con3. If you specify a device name, Kermit will be in local mode, and you should remember to issue any other necessary 'set' commands, such as 'set speed'. If you omit the device name, Kermit will revert to its default mode of operation. If you specify @OUTPUT, Kermit will enter remote mode (useful when logged in through the "back port" of a system normally used as a local-mode workstation). When Unix Kermit enters local mode, it locks out all other processes from using the line. If you run Kermit from within Kermit, then you will not be able to use the same communication line as the parent process. The method used for locking is inherent in the operating system and the way that PMGR controls character devices, and will be explained in more detail later. modem-dialer {direct, hayes, racalvadic, ventel, ...} Not available. No DIAL command. parity {even, odd, mark, space, none} Specify character parity for use in packets and terminal connection, nor- mally none. If other than none, C-Kermit will seek to use the 8th-bit prefixing mechanism for transferring 8-bit binary data, which can be used successfully only if the other Kermit agrees; if not, 8-bit binary data cannot be successfully transferred. prompt [string] The given string will be substituted for "C-Kermit>" as this program's prompt. If the string is omitted, the prompt will revert to "C-Kermit>". If the string is enclosed in doublequotes, the quotes will be stripped and any leading and trailing blanks will be retained. send parameter Establish parameters to use when sending packets. These will be in effect only for the initial packet sent, since the other Kermit may override these parameters during the protocol parameter exchange (unless noted below). end-of-packet cc Specifies the control character needed by the other Kermit to recognize the end of a packet. C-Kermit sends this character at the end of each packet. Normally 13 (carriage return), which most Kermit implemen- tations require. Other Kermits require no terminator at all, still others may require a different terminator, like linefeed (10). packet-length n Specify the maximum packet length to send. Normally 90. Shorter packet lengths can be useful on noisy lines, or with systems or front ends or networks that have small buffers. The shorter the packet, the higher the overhead, but the lower the chance of a packet being cor- rupted by noise, and the less time to retransmit corrupted packets. This command overrides the value requested by the other Kermit during protocol initiation. pad-character cc Designate a character to send before each packet. Normally, none is sent. Outbound padding is sometimes necessary for communicating with slow half duplex systems that provide no other means of line turnaround control. It can also be used to send special characters to communica- tions equipment that needs to be put in "transparent" or "no echo" mode, when this can be accomplished in by feeding it a certain control character. padding n How many pad characters to send, normally 0. start-of-packet cc The normal Kermit packet prefix is Control-A (1); this command changes the prefix C-Kermit puts on outbound packets. The only reasons this should ever be changed would be: Some piece of equipment somewhere be- tween the two Kermit programs will not pass through a Control-A; or, some piece of of equipment similarly placed is echoing its input. In the latter case, the recipient of such an echo can change the packet prefix for outbound packets to be different from that of arriving pack- ets, so that the echoed packets will be ignored. The opposite Kermit must also be told to change the prefix for its inbound packets. timeout n Specifies the number of seconds you want the other Kermit to wait for a packet before timing it out and requesting retransmission. If n is non-zero and less than 2, then n will be given a value of 2, since PMGR does not set device timeouts at less than 2 seconds. receive parameter Establish parameters to request the other Kermit to use when sending pack- ets. end-of-packet cc Requests the other Kermit to terminate its packets with the specified character. packet-length n Specify the maximum packet length to that you want the other Kermit to send. Normally 90. pad-character cc C-Kermit normally does not need to have incoming packets preceded with pad characters. This command allows C-Kermit to request the other Ker- mit to use cc as a pad character. Default cc is NUL, ASCII 0. padding n How many pad characters to ask for, normally 0. start-of-packet cc Change the prefix C-Kermit looks for on inbound packets to correspond with what the other Kermit is sending. timeout n Normally, each Kermit partner sets its packet timeout interval based on what the opposite Kermit requests. This command allows you to override the normal procedure and specify a timeout interval for Unix Kermit to use when waiting for packets from the other Kermit. If you specify 0, then no timeouts will occur, and Unix Kermit will wait forever for ex- pected packets to arrive. If n is non-zero and less than 2, then n will be given a value of 2, since PMGR does not set device timeouts at less than 2 seconds. speed {0, 50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200, 38400} The baud rate for the external communication line. This command cannot be used to change the speed of your own console terminal. Data General systems require that you must give this command after a 'set line' command before you can use the line. 'set baud' is a synomym for 'set speed'. THE 'SHOW' COMMAND: Syntax: show {parameters, versions} The "show" command with the default argument of "parameters" displays the values of all the 'set' parameters described above. If you type "show versions", then C-Kermit will display the version numbers and dates of all its internal modules. You should use the "show versions" command to ascertain the vintage of your Kermit program before reporting problems to Kermit maintainers. THE 'STATISTICS' COMMAND: The statistics command displays information about the most recent Kermit protocol transaction, including file and communication line i/o, timing and ef- ficiency, as well as what encoding options were in effect (such as 8th-bit prefixing, repeat-count compression). THE 'TAKE' AND 'ECHO' COMMANDS: Syntax: take fn1 echo [text to be echoed] The 'take' command instructs C-Kermit to execute commands from the named file. The file may contain any interactive C-Kermit commands, including 'take'; com- mand files may be nested to any reasonable depth. The 'echo' command may be used within command files to issue greetings, announce progress, ring the ter- minal bell, etc. The 'echo' command should not be confused with the Unix 'echo' command, which can be used to show how meta characters would be expanded. The Kermit echo command simply displays its text argument (almost) literally at the terminal; the argument may contain octal escapes of the form "\ooo", where o is an octal digit (0-7), and there may be 1, 2, or 3 such digits, whose value specify an ASCII character, such as "\007" (or "\07" or just "\7") for beep, "\012" for newline, etc. Of course, each backslash must be must be entered twice in order for it to be passed along to the echo command by the Kermit command parser. Take-command files are in exactly the same syntax as interactive commands. Note that this implies that if you want to include special characters like question mark or backslash that you would have to quote with backslash when typing interactive commands, you must quote these characters the same way in command files. Long lines may be continued by ending them with a single back- slash. Command files may be used in lieu of command macros, which have not been imple- mented in this version of C-Kermit. For instance, if you commonly connect to a system called 'B' that is connected to @con7 at 4800 baud, you could create a file called b containing the commands % C-Kermit command file to connect to System B thru @con7 set line @con7 set speed 4800 % Beep and give message echo \\007Connecting to System B... connect and then simply type 'take b' (or 't b' since no other commands begin with the letter 't') whenever you wish to connect to system B. Note the comment lines and the beep inserted into the 'echo' command. For connecting to IBM mainframes, a number of 'set' commands are required; these, too, are conveniently collected into a 'take' file like this one: % Sample C-Kermit command file to set up current line % for IBM mainframe communication % set parity mark set handshake xon set flow-control none set duplex half Note that no single command is available to wipe out all of these settings and return C-Kermit to its default startup state; to do that, you can either res- tart the program, or else make a command file that executes the necessary 'set' commands: % Sample C-Kermit command file to restore normal settings % set parity none set handshake none set flow-control xon/xoff set duplex full An implicit 'take' command is executed upon your .kermrc file upon C-Kermit's initial entry into interactive dialog. The .kermrc file should contain 'set' or other commands you want to be in effect at all times. For instance, you might want override the default action when incoming files have the same names as existing files -- in that case, put the command set file warning on in your .kermrc file. On some non-Unix systems that run C-Kermit, this file might have a different name, such as kermit.ini. The Data General initialization file is named .kermrc. WARNING: Unlike the Unix Kermits, the initialization file IS processed if kermit is invoked with an action command from the command line. Commands executed from take files are not echoed at the terminal. If you want to see the commands as well as their output, you could feed the command file to C-Kermit via redirected stdin, as in 'xeq kermit/i=cmdfile' Errors encountered during execution of take files (such as failure to complete dial or script operations) cause termination of the current take file, popping to the level that invoked it (take file, interactive level, or the shell). When kermit is executed in the background, errors during execution of a take file are fatal. THE 'CONNECT' COMMAND: The connect command links your terminal to another computer as if it were a lo- cal terminal to that computer, through the device specified in the most recent 'set line' command, or through the default device if your system is a PC or workstation. All characters you type at your keyboard are sent out the com- munication line, all characters arriving at the communication port are dis- played on your screen. Current settings of speed, parity, duplex, and flow- control are honored. If you have issued a 'log session' command, everything you see on your screen will also be recorded to your session log. This provides a way to "capture" files from systems that don't have Kermit programs available. To get back to your own system, you must type the escape character, which is Control-Backslash (^\) unless you have changed it with the 'set escape' com- mand, followed by a single-character command, such as 'c' for "close connection". Single-character commands include: c Close the connection b Send a BREAK signal (May not work??) 0 (zero) send a null s Give a status report about the connection h Hangup the phone ^\ Send Control-Backslash itself (whatever you have defined the escape character to be, typed twice in a row sends one copy of it). Uppercase and control equivalents for these letters are also accepted. A space typed after the escape character is ignored. Any other character will produce a beep. The connect command simply displays incoming characters on the screen. It is assumed any screen control sequences sent by the host will be handled by the firmware in your terminal or PC. kermit -l /dev/acu -b 1200 -c | tek (Not available, except perhaps MV/UX) 'c' is an acceptable non-unique abbreviation for 'connect'. THE 'DIAL' COMMAND: Not available. THE 'SCRIPT' COMMAND: Not available. THE 'HELP' COMMAND: Syntax: help or: help keyword or: help {set, remote} keyword Brief help messages or menus are always available at interactive command level by typing a question mark at any point. A slightly more verbose form of help is available through the 'help' command. The 'help' command with no arguments prints a brief summary of how to enter commands and how to get further help. 'help' may be followed by one of the top-level C-Kermit command keywords, such as 'send', to request information about a command. Commands such as 'set' and 'remote' have a further level of help. Thus you may type 'help', 'help set', or 'help set parity'; each will provide a successively more detailed level of help. THE 'EXIT' AND 'QUIT' COMMANDS: These two commands are identical. Both of them do the following: - Attempt to insure that the terminal is returned to normal. - Relinquish access to any communication line assigned via 'set line'. - Relinquish any uucp and multiuser locks on the communications line. - Hang up the modem, if the communications line supports data terminal ready. - Close any open log files. After exit from C-Kermit, your default directory will be the same as when you started the program. The 'exit' command is issued implicitly whenever C-Kermit halts normally, e.g. after a command line invocation, or after certain kinds of interruptions. 9.5. UUCP Lock Files Data General always gains exclusive access to an external communication line after that line is opened. When you issue the 'set line' command to Data General Kermit, the operating system agent, PMGR, grants exclusive access to your process and pid. But a child process and pid will not be able to access that same line, even though (as a user) you still own the line. You should not use a CLI command like "assign @con5" to gain access to an external communication line, since this action will prevent Kermit from gaining access to the line (i.e., another process or pid owns the line). When Data General Kermit terminates for any reason, the line is closed by the operating system, and should be available immediately. 9.6. C-Kermit under Berkeley or System III/V Unix: C-Kermit may be interrupted at command level or during file transfer by typing Control-C. The program will perform its normal exit function, restoring the terminal and releasing any lock. If a protocol transaction was in progress, an error packet will be sent to the opposite Kermit so that it can terminate cleanly. C-Kermit may be invoked in the background ("&" on shell commmand line). If a background process is "killed", the user will have to manually remove any lock file and may need to restore the modem. This is because the kill signal (kill(x,9)) cannot be trapped by Kermit. During execution of a system command ('directory', 'cwd', or `!'), C-Kermit can often be returned to command level by typing a single Control-C. (With System III/V, the usual interrupt function (often the DEL key) is replaced by Control-C.) Under Berkeley Unix only: C-Kermit may also be interrupted by ^Z to put the process in the background. In this case the terminal is not restored. You will have to type Control-J followed by "reset" followed by another Control-J to get your terminal back to normal. Control-C, Control-Z, and Control-\ lose their normal functions during terminal connection and also during file transfer when the controlling tty line is being used for packet i/o. If you are running C-Kermit in "quiet mode" in the foreground, then interrupt- ing the program with a console interrupt like Control-C will not restore the terminal to normal conversational operation. This is because the system call to enable console interrupt traps will cause the program to block if it's run- ning in the background, and the primary reason for quiet mode is to allow the program to run in the background without blocking, so that you can do other work in the foreground. If C-Kermit is run in the background ("&" on shell commmand line), then the in- terrupt signal (Control-C) (and System III/V quit signal) are ignored. This prevents an interrupt signal intended for a foreground job (say a compilation) from being trapped by a background Kermit session. 9.7. C-Kermit on the DEC Pro-3xx with Pro/Venix Version 1 The DEC Professional 300 series are PDP-11/23 based personal computers. Venix Version 1 is a Unix v7 derivative. It should not be confused with Venix Ver- sion 2, which is based on ATT System V; these comments apply to Venix Version 1 only. C-Kermit runs in local mode on the Pro-3xx when invoked from the con- sole; the default device is /dev/com1.dout. When connected to a remote system (using C-Kermit's 'connect' command), Pro/Venix itself (not Kermit) provides VT52 terminal emulation. Terminal operation at high speeds (like 9600 baud) requires xon/xoff flow control, which unfortunately interferes with applica- tions such as the EMACS that use Control-Q and Control-S as commands. When logging in to a Pro-3xx (or any workstation) through the "back port", it may be necessary to give the command "set line /dev/tty" in order to get C-Kermit to function correctly in remote mode (on a system in which it normally expects to be operating in local mode). 9.8. C-Kermit under VAX/VMS Version 4C of C-Kermit can be built using VAX-11 C to run under VMS. Most of the descriptions in this manual hold true, but it should be noted that as of this writing the VMS support is not thoroughly tested, and no explicit support exists for the various types of VMS files and their attributes. The C-Kermit init file for VMS is called KERMIT.INI. 9.9. C-Kermit on the Macintosh and other Systems The "protocol kernel" of C-Kermit is also used by Columbia's Macintosh Kermit. The user and system interface is entirely different, and is covered in a separate document. There is also a Kermit for the Commodore Amiga based on C-Kermit, as well as versions for MS-DOS. 9.10. C-Kermit Restrictions and Known Bugs 1. Editing characters: The program's interactive command interrupt, delete, and kill characters are Control-C, Delete (or Backspace), and Control-U, respectively. There is currently no way to change them to suit your taste or match those used by your shell, in case those are different. NOTE: Both DG and non-DG terminals are supported if the correct "CHAR" command is issued. 2. High baud rates: There's no way to specify baud rates higher than 9600 baud. Most Unix systems don't supply symbols for them (unless you use EXTA, EXTB), and even when they do, the program has no way of knowing whether a specific port's serial i/o controller supports those rates. NOTE: Baud rates up to 38400 baud are supported. 3. Modem controls: If a connection is made over a communication line (rather than on the controlling terminal line), and that line has modem controls, (e.g. data terminal ready and carrier detection implementation), returning to the shell level will disconnect the conversation. In that case, one should use interactive mode com- mands, and avoid use of piped shell-level operation (also see 'set modem-dialer' and 'dial' commands.) NOTE: Returning to the shell should not disconnect the conversation on the Data General minicomputers. 4. Login Scripts: The present login scripts implementation follows the Unix conventions of uucp's "L.sys" file, rather than the normal Ker- mit "INPUT/OUTPUT" style, so there's no way to arbitrarily mingle script output with Kermit commands (e.g. changing parity or duplex in the middle of a script). 5. Dial-out vs dial-in communications lines: C-Kermit requires a dial-out or dedicated line for the "set line" or "-l" options. Most systems have some lines dedicated to dial-in, which they enable "loggers" on, and some lines available for dial-out. Where a line must be shared between dial-in and dial-out, several options are available (though they are, strictly speaking, outside the pervue of C-Kermit). A simple shell program can be used to change directionality of the line if your Unix has the enable(8) and disable(8) commands. In that case, the shell program could "grep" a "who" to see if anybody is logged onto the desired line; if not, it could "disable" the line. The shell program will need to be set-uID'ed to root. The shell program can be called from kermit prior to a dial command, e.g., "! mydisable.shellprog". Prior to the final "quit" from C-Kermit, another shell program could be executed to "enable" the line again. This program also needs to be set-uID'ed to root. If your Unix lacks the enable(8) and disable(8) commands, another common technique works if your system supports the /etc/ttys file. A shell program could call up an awk program to find the line in the file and set the enable byte to 0 (to directly disable the line). Likewise, it can be reenabled by a counterpart at the end. It may be necessary to pause for 60 seconds after modifying that file be- fore the logger sees it and actually disables the line. NOTE: DG cannot share a line for both dial-in and dial-out. Such lines must be defined when the system is initialized by PID 2. Any dial-out line should be disabled, by issuing the command, for example: CX DISABLE @CON5 6. Using C-Kermit on Local Area Networks: C-Kermit can successfully operate at speeds up to 9600 baud over LANs, provided the network buffers are big enough to accommodate Kermit packets (which are al- most always less than 100 characters long). When computers are connected to LAN's through asynchronous terminal interfaces, then the connection should be configured to do XON/XOFF flow control between the network interface and the computer, rather than passing these signals through transparently. This can help prevent Kermit from overrunning the LAN's buffers if they are small (or if the LAN is congested), and will can also prevent the LAN from overrunning a slow Kermit's buffers. If the network hardware cannot accept 100 characters at a time, and flow control cannot be done between the network and the computer, then Kermit's "set send/receive packet-length" command can be used to shorten the packets. 7. Resetting terminal after abnormal termination or kill: When C-Kermit terminates abnormally (say, for example, by a kill command issued by the operator) the user may need to reset the terminal state. If commands do not seem to be accepted at the shell prompt, try Control-J "stty sane" Control-J (use "reset" on Berkeley Unix). That should take the terminal out of "raw mode" if it was stuck there. NOTE: DG does not have this problem. 8. Remote host commands may time-out on lengthy activity: Using "remote host" to instruct the C-Kermit server to invoke Unix func- tions (like "make") that might take a long time to produce output can cause timeout conditions. 9. XOFF deadlocks: When connecting back to C-Kermit after a trans- action, or after finishing the server, it may be necessary to type a Control-Q to clear up an XOFF deadlock. There's not much the program can do about this... 10. PC/IX Login Scripts -- Unfound Bug: Though login scripts appear to work properly on most processors, in the case of the PC/XT with PC/IX, it appears that longer scripts need to be broken up into shorter scripts (invoked sequentially from the take file). This is because the portion of the script handler which checks if an opera- tion timed out seems to leave the processor in a strange state (i.e. hung). 9.11. How to Build C-Kermit for a Unix System See ckdker.bld for information on building Kermit for Data General systems. The C-Kermit files, as distributed from Columbia, all begin with the prefix "ck". You should make a directory for these files and then cd to it. A makefile is provided to build C-Kermit for various Unix systems (there are separate makefiles for VMS and the Macintosh). As distributed, the makefile has the name "ckuker.mak". You should rename it to "makefile" and then type "make xxx", where xxx is the symbol for your system, for instance "make bsd" to make C-Kermit for 4.x BSD Unix. The result will be a program called "wermit". You should test this to make sure it works; if it does, then you can rename it to "kermit" and install it for general use. See the makefile for a list of the systems supported and the corresponding "make" arguments. 9.12. Adapting C-Kermit to Other Systems C-Kermit is designed for portability. The level of portability is indicated in parentheses after the module name: "C" means any system that has a C compiler that conforms to the description in "The C Programming Language" by Kernighan & Ritchie (Prentice-Hall, 1978). "Cf" is like "C", but also requires "standard" features like printf and fprintf, argument passing via argv/argc, and so on, as described in Kernighan & Ritchie. "Unix" means the module should be useful un- der any Unix implementation; it requires features such as fork() and pipes. Anything else means that the module is particular to the indicated system. C-Kermit file names are of the form: ck. where the part before the dot is no more than 6 characters long, the part after the dot no more than 3 characters long, and: is the file type: c: C language source h: Header file for C language source w: Wart preprocessor source, converted by Wart (or Lex) to a C program nr: Nroff/Troff text formatter source mss: Scribe text formatter source doc: Documentation hlp: Help text bld: Instructions for building the program bwr: A "beware" file - list of known bugs upd: Program update log mak: Makefile is a single character to tell what system the file applies to: a: Descriptive material, documentation c: All systems with C compilers d: Data General (not MS-DOS) m: Macintosh u: Unix v: VAX/VMS w: Wart is mnemonic (up to 3 characters) for what's in the file: aaa: A "read-me" file, like this one cmd: Command parsing con: Connect command deb: Debug/Transaction Log formats, Typedefs dia: Modem/Dialer control fio: System-depdendent File I/O fns: Protocol support functions fn2: More protocol support functions ker: General C-Kermit definitions, information, documentation mai: Main program pro: Protocol scr: Script command tio: System-dependent terminal i/o & control and interrupt handing usr: User interface us2: More user interface us3: Still more user interface Examples: ckufio.c File i/o for Unix ckmtio.c Terminal i/o for Macintosh ckuker.mss Scribe source for for Kermit User Guide chapter ckuker.nr Nroff source file for Unix C-Kermit man page The following material discusses each of the C-Kermit modules briefly. ckcmai.c, ckcker.h, ckcdeb.h (Cf): This is the main program. It contains declarations for global variables and a small amount of code to initialize some variables and invoke the com- mand parser. In its distributed form, it assumes that command line ar- guments are passed to it via argc and argv. Since this portion of code is only several lines long, it should be easy to replace for systems that have different styles of user interaction. The header files define symbols and macros used by the various modules of C-Kermit. ckcdeb.h is the only header file that is included by all the C-Kermit modules, so it contains not only the debug format definitions, but also any compiler-dependent typedefs. ckwart.c (Cf), ckcpro.w (C): The ckcpro module embodies the Kermit protocol state table and the code to accomplish state switching. It is written in "wart", a language which may be regarded as a subset of the Unix "lex" lexical analyzer generator. Wart implements enough of lex to allow the ckprot module to function. Lex it- self was not used because it is proprietary. The protocol module ckcpro.w is read by wart, and a system-independent C program is produced. The syn- tax of a Wart program is illustrated by ckcpro.w, and is described in ckwart.doc. ckcfns.c (C): The module contains all the Kermit protocol support functions -- packet formation, encoding, decoding, block check calculation, filename and data conversion, protocol parameter negotiation, and high-level interaction with the communication line and file system. To accommodate small systems, this module has been split into two -- ckcfns.c and ckcfn2.c. ckutio.c: This module contains the system-dependent primitives for communication line i/o, timers, and interrupts for the various versions of Unix. Certain im- portant variables are defined in this module, which determine whether C-Kermit is by default remote or local, what the default communication device is, and so forth. The tio module maintains its own private database of file descriptors and modes for the console terminal and the file trans- fer communication line so that other modules (like ckcfns or the terminal connect module) need not be concerned with them. The variations among Unix implementations with respect to terminal control and timers are accom- modated via conditional compilation. ckufio.c: This module contains system-dependent primitives for file i/o, wildcard (meta character) expansion, file existence and access checking, and system command execution for the various versions of Unix. It maintains an inter- nal database of i/o "channels" (file pointers in this case) for the files C-Kermit cares about -- the input file (the file which is being sent), the output file (the file being received), the various logs, the screen, and so forth. This module varies little among Unix implementations except for the wildcard expansion code; the directory structure of 4.2bsd Unix is dif- ferent from that of other Unix systems. Again, variation among Unix sys- tems is selected using conditional compilation. ckuusr.h, ckuusr.c, ckuus2.c, ckuus3.c (Unix): This is the "user interface" for C-Kermit. It includes the command parser, the screen output functions, and console input functions. The command par- ser comes in two pieces -- the traditional Unix command line decoder (which is quite small and compact), and the interactive keyword parser (which is rather large). This module is fully replacable; its interface to the other modules is very simple, and is explained at the beginning of the source file. The ckuusr module also includes code to execute any commands directly which don't require the Kermit protocol -- local file management, etc. The module is rated "Unix" because it makes occasional use of the system() function. Note that while ckuusr is logically one module, it has been split up into three C source files, plus a header file for the symbols they share in com- mon. This is to accommodate small systems that cannot handle big modules. ckuusr.c has the command line and top-level interactive command parser; ckuus2.c has the help command and strings; ckuus3 has the set and remote commands along with the logging, screen, and "interrupt" functions. ckucmd.c, ckucmd.h (Cf): This is an interactive command parsing package developed for C-Kermit. It is written portably enough to be usable on any system that has a C compiler that supports functions like printf. The file name parsing functions depend upon primitives defined in the fio module; if these primitives can- not be supplied for a certain system, then the filename parsing functions can be deleted, and the package will still be useful for parsing keywords, numbers, arbitrary text strings, and so forth. The style of interaction is the same as that found on the DECSYSTEM-20. ckucon.c (Unix): This is the connect module. As supplied, it should operate in any Unix en- vironment, or any C-based environment that provides the fork() function. The module requires access to global variables that specify line speed, parity, duplex, flow control, etc, and invokes functions from the tio module to accomplish the desired settings and input/output, and functions from the fio module to perform session logging. No terminal emulation is performed, but since standard i/o is used for the console, this may be piped through a terminal emulation filter. The ckucon function may be en- tirely replaced, so long as the global settings are honored by its replace- ment. PC implementations of C-Kermit may require the ck?con module to do screen control, escape sequence interpretation, etc, and may also wish to write special code to get the best possible performance. ckudia.c (Unix): This is the dialer module. As supplied, it handles Hayes, Ventel, Penril, Racal-Vadic, and several other modems. ckuscr.c (Unix): This is the login script module. As supplied, it handles uucp-style scripts. Moving C-Kermit to a new system entails: 1. Creating a new ck?tio module in C, assembler, or whatever language is most appropriate for system programming on the new system. If the system is Unix-like, then support may be added within the ckutio.c module itself using conditional compilation. 2. Creating a new ck?fio module, as above. 3. If the system is not Unix-like, then a new ckuusr module may be re- quired, as well as a different invocation of it from ckcmai. 4. If the distributed connect module doesn't work or performs poorly, then it may be replaced. For instance, interrupt-driven i/o may be required, especially if the system doesn't have forks. Those who favor a different style of user/program interaction from that provided in ckuusr.c may replace the entire module, for instance with one that provides a mouse/window/icon environment, a menu/function-key environment, etc. A few guidelines should be followed to maintain portability: - Keep variable and function names to 6 characters or less. Don't use identifiers that are distinguished from one another only by al- phabetic case. - Keep modules small. For instance, on a PDP-11 it is necessary to keep the code segment of each module below 8K in order to allow the segment mapping to occur which is necessary to run programs larger than 64K on a non-I-and-D-space machine. - Keep strings short; many compilers have restrictive maximum lengths; 128 is the smallest maximum string constant length we've encountered so far. - Keep (f,s)printf formats short. If these exceed some compiler de- pendent maximum (say, 128) memory will be overwritten and the program will probably core dump. - Do not introduce system dependencies into ckcpro.w or ckcfn*.c. - If a variable is a character, declare as CHAR, not int, to prevent the various sign extension and byte swapping foulups that occur when characters are placed in integer variables. - Remember that different systems may use different length words for different things. Don't assume an integer can be used as a pointer, etc. - Don't declare static functions; these can wreak havoc with systems that do segment mapping. - In conditional compilations expressions, use #ifdef and #ifndef and not #if, which is not supported by some compilers. Also, don't use any operators in these expressions; many compilers will fail to un- derstand expressions like #ifdef FOO | BAR. - Don't define multiline macros. In general, remember that this program will have to be compilable by old com- pilers and runnable on small systems.