Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!sunybcs!krishnan From: krishnan@sunybcs.UUCP Newsgroups: comp.unix.wizards Subject: Re: 4.2BSD LPR Spooler Protocol Message-ID: <2830@sunybcs.UUCP> Date: Fri, 3-Apr-87 12:53:37 EST Article-I.D.: sunybcs.2830 Posted: Fri Apr 3 12:53:37 1987 Date-Received: Sun, 5-Apr-87 07:20:31 EST References: <328@hqda-ai.UUCP> Organization: SUNY/Buffalo Computer Science Lines: 99 Keywords: bsd spooler protocol These are the comments I extracted from the program I wrote for printing from a Lisp Machine ( Symbolics or TI's ) to a printer on a Unix machine. The top level interface was designed by Bill Baxter. ;;; The 4.3 BSD line printer protocol is described below. This is implemented ;;; by the function lpd ;;; ;;; The lisp machine is a client which talks with the Unix machine through ;;; the lpd port # 515 and a local port 515. The local port number should ;;; less than 1023 for "lpd" on the Unix machine to acknowledge the request. ;;; ;;; The following protocol is followed for each of the necessary operations ;;; while sending a job to be queued. ;;; ;;; Printing a file "lpr" :: ;;; ;;; 1) Send the string "^Bprinter\n" ;;; 2) Check for a response of 0 from the Unix machine ;;; 3) Send the data file over using the sub-protocol described below. ;;; 3.1) Send the string "^C \n" ;;; 3.2) Send the data file ;;; 3.3) Check for a response of 0 from the Unix machine ;;; 4) Send the control file using the same sub-protocol ;;; ;;; ;;; Checking the queue "lpq" :: ;;; ;;; 1) Send the string "^Cprinter\n" ;;; ;;; Checking the queue more thoroughly "lpq -l" :: ;;; ;;; 1) Send the string "^Dprinter\n" ;;; ;;; Removing jobs from a queue "lprm" ;;; ;;; 1) Send the string "^Eprinter person job-number\n" ;;; ;;; Note that you cannot remove a remote job unless the request comes from the ;;; machine where the print request was originally made ;;; ;;; This program does not incorporate a local queue and relies on the ;;; queue of the Unix machine. ;;; ;;; Examples: ;;; ;;; Lpr file-name qms ellie :landscape ( t/nil ) ;;; ;;; The program keeps track of the default file name, the default-host, and the ;;; default-printer. Once a command has been issued with the the necessary keyword ;;; parameters, the default parameters are updated suitably. ;;; ;;; Now the user can simply type ;;; ;;; Lpr ;;; ;;; to print the file again. ;;; ;;; To display the queue, the user can simply type ;;; ;;; Lpq ;;; ;;; The default host name, and the default printer are "ellie" and "qms" ;;; "qms" respectively until they are explicitly changed by invoking the ;;; function with a keyword parameter ;;; ;;; To remove this job from the queue, the user can type ;;; ;;; Lprm ;;; ;;; The job number is understood to be the last job spooled ;;; ;;; ;;; Job numbers can be explicitly specified by typing ;;; ;;; Lprm :job ;;; There is a security problem if you want to control access to printers. This arises because, the Unix host has to make the symbolics a trusted host for printing by including it in the "hosts.lpd" file. We are currently working on a solution to that problem. G. Krishnan -------------- UUCP : {cmc12,hao,harpo}!seismo!rochester!rocksvax!sunybcs!krishnan ...{allegra,decvax,watmath}!sunybcs!krishnan CSNET : krishnan@buffalo ARPA : krishnan%buffalo@csnet-relay BITNET : krishnan@sunybcs --------------