@chapter TCP/IP Applications @label[chapter-doc-tcp-app] Note that many of the TCP/IP functions documented below which take as an argument the name of a remote host will also accept an Internet address. @cindex[host arguments] This permits communication with a host that is not specified in the loaded site information. @section FTP - TCP File Transfer Protocol @label[section-ftp] The FTP specification specifies that a command interface be provided to make conventional FTP commands available at the user level. On the Lambda, it is generally not necessary to use the command interface; @cindex[file access] rather, the normal file system commands -- @l[copy-file], @l[viewf], etc. -- and utility interfaces -- @l[ZMacs], @l[Dired] -- will go through FTP as required. This ``transparent'' access provided by the Lambda software is an important feature of the networking software. The command interface is also provided, with the LISP function @l(ftp:cmd). It is useful on the Lambda if, for example, the normal Lambda file access functions are not working because of pathname parsing problems. @cindex[pathname problems] Pathnames are passed without translation from @l(ftp:ftp) to the remote FTP server. @defun ftp:ftp &optional remote-hostname The File Transfer Protocol command. Optionally connects to specified @l(REMOTE-HOSTNAME). @end(defun) @ref[figure-ftp] illustrates an example FTP session. Type ``@i(?)'' to see the help on each command. In the help listing, optional arguments are enclosed in brackets, after any required arguments. If a command is entered without arguments, the user is prompted for every one; enter @return@ to skip options. The most commonly used commands include: @itemize @bullet @item @i(? [command]) - help information on all commands (or a specific @i(command)) @item @i(OPEN to) - open a connection to a remote host. @item @i(CD remote-directory) - change remote working directory to @i(remote-directory). The working directory is used to apply pathname defaults to relative pathnames or where @i(remote-directory) is optional. @item @i(PWD) - display current working directory on remote host. @item @i(DIR [remote-directory] [local-file]) - list directory contents of current directory or @i(remote-directory); optionally, save listing in @i(local-file). @item @i(STATUS) - show current status of environment commands. @item @i(USER [username] [password] [account]) - login and send new user information. @item @i(SEND local-file [remote-file]) - transfer @i(local-file) from local system to @i(remote-file) on remote system. @item @i(RECV remote-file [local-file]) - transfer @i(remote-file) from remote system to local system as @i(local-file). @item @i(CLOSE) - terminate FTP session. @item @i(QUIT) - terminate FTP session and exit. @end(itemize) @figure @setq figure-ftp figure-page @smalllisp @include ftplog @end(smalllisp) @caption Example @l[FTP:FTP] session @end(figure) @section Telnet - TCP Terminal Network Access Protocol @label[section-telnet] There are four different ways to access the Telnet program from LISP. @cindex[terminal access] The Kermit interfaces provide H19 terminal emulation, which is supported by many other Telnet servers. The other Telnet and ``glass tty'' interfaces provides only the most basic ``dumb terminal'' capability. The primary Telnet interface in LISP is through the Kermit program. Within @b(Review Parameters), the user selects @mouseditem(TCP Telnet) to specify Telnet for future connections. The @b(Connect) command is then used to connect the H19 terminal emulation window to the remote host's Telnet server. Use the keystroke @neton[K] to disconnect after logging out. @c @b???test-VAX flaky, 'connection refused' most of the time @defun kermit:telnet-h19 &optional to-host Connect to @l(TO-HOST). Substantially the same as the Kermit window interface, but can be invoked from LISP. @end(defun) @defun tcp:telnet host Open a Telnet connection to the remote @l(HOST) with no special terminal emulation. @end(defun) @defun telnet:telnet-glass-tty address &optional (port "TELNET") (HALF-DUPLEX NIL) This glass TTY works well enough for testing purposes. The host's Internet @l(ADDRESS) is specified as a string, for example, "101.0.0.10". @end(defun) The @l(TELNET-GLASS-TTY) function is particularly useful for debugging purposes. @cindex[network debugging] You can verify the ability to connect to specific TCP services on a remote host by specifying the @l(PORT) argument. And, as noted previously, specifying an Internet address, rather than a host name, effectively bypasses the site file information (or lack thereof) regarding the particular host. For example, to test whether a remote host is accessible, and to verify that it provides FTP, execute the following (specifying the actual address): @lisp (telnet:telnet-glass-tty "101.0.0.10" "FTP") @end(lisp) @section SMTP - TCP Simple Mail Transfer Protocol @label[section-smtp] @section Imagen Printer Driver @label[section-imagen] The networking and printer software provide a driver for stand-alone Imagen laser printers (model IP/II and compatibles) that are accessed remotely via TCP/IP. @cindex[Imagen printer] This is a popular printing device, since much of the printing processing is done off-line by the Imagen. @subsection Defining an Imagen Host An Imagen host is defined with system type and machine type @l(IMAGEN). The following @l(HOSTS.TEXT) entry defines a stand-alone Imagen printer: @lisp HOST OUR-IMAGEN, INTERNET 101.0.0.202,SERVER,IMAGEN,IMAGEN,[IMA] @end(lisp) In @l(SITE.LISP) you can define an Imagen printer by name. You can optionally specify a stand-alone Imagen as the default printer for text and/or graphics. The following entries define the Imagen host "IMA" and make it the default for all printing: @lisp (DEFSITE ... ... (:PRINTER-NAMES '((("DOC-PRINTER") (:IMAGEN "IMA")) (("LABEL-PRINTER") (:TI855 "XTRA-HOST")))) (:DEFAULT-PRINTER "DOC-PRINTER") (:DEFAULT-BIT-ARRAY-PRINTER "DOC-PRINTER") ...) @end(lisp) @subsection Setting Imagen Hardcopy Options The following function allows you to set Imagen options for hardcopy requests: @defun tcpa:set-imagen-print-options &key copies form-length form-width line-wrapping forms-per-page left-margin line-numbers page-headings ok-wait ok-wait-tries notifications If any Imagen print option(s) is(are) specified, set it(them); otherwise, bring up a choose-variable-values menu for specifying options. @end(defun) These options set global variables which specify default options for hardcopy requests going to the Imagen printer(s). This function can also be invoked by selecting @mouseditem[Imagen Options] from the System Menu. @subsection Printing to the Imagen If the Imagen is specified as the default text printer, hardcopy functions such as @l(hardcopy-file) will automatically route to the Imagen. If the Imagen is specified as the default bit-array printer, bit-array printing functions such as the @termon[Q] screen-dump program will route to the Imagen. If some other type of printer is the default, you can still specify the Imagen to functions such as @l(hardcopy-file) by using the name you provided in @l(SITE.LISP): @lisp (hardcopy-file "lm:keith;myfile.text" :printer "doc-printer") @end(lisp) The Imagen routing software knows how to handle IMPRESS format files; for example, @cindex Impress format @lisp (hardcopy-file "lm:keith;myfile.impress" :printer "doc-printer" :format :impress) @end(lisp) @section DISK - TCP Lambda Disk Protocol @label[section-disk] The TCP DISK protocol is provided for compatibility with Chaosnet network disk functions such as @l(print-disk-label) and @l(si:copy-disk-partition) over TCP. These functions will ``prefer'' to go through Chaosnet with the default value of @see[net:*network-protocols*][var]. If this variable is modified -- if its value, a list, is reversed -- DISK functions will prefer TCP over Chaosnet. See Section @ref[section-generic-disk] for the syntax of specifying disk units. @c end tcp-app2