|
|
This chapter describes the print server program, USPOOL for the UNIX lpr command. It contains these sections:
The print server program, USPOOL, runs as a server process within Cisco IOS for S/390. USPOOL lets a UNIX user route print data through a network and print it on a line printer that is attached to the IBM host. Print requests are generated on the UNIX system with the UNIX lpr command.
The formats and protocols used by USPOOL and the lpr facility are described in this chapter. Information required by UNIX system programmers to make the necessary resource definitions is also included. Information required by IBM system programmers is mentioned here and described in the Cisco IOS for S/390 Customization Guide. Users with an interest in a more complete lpr server and lpr client should investigate the Enterprise Print Services product.
While the information in this chapter refers to UNIX-based systems, any system implementing the USPOOL lpr formats and protocols can use the USPOOL print server program. The lpr command has been ported to some IBM PC-based TCP/IP products.
The UNIX lpr command initiates print requests from a UNIX system. If the print request is destined to a remote printer, the remote printer daemon opens a TCP connection (default port 515) to the host that owns the remote printer. It then transfers the print data to the remote host using the prescribed formats and protocols.
In addition to the lpr command, other lp commands require processing at the remote host. These commands also operate across a TCP connection to remote port 515. These sections describe the lp commands. See the UNIX User's Manual for more information about these UNIX commands.
The UNIX lpr command creates remote and local print requests. For remote requests, the printer daemon transmits two files across the network to the remote system. One consists of the file to be printed, the other consists of control information such as print classification, job name, and title. USPOOL currently reads the control file, but does not process its contents. The data file is printed using standard defaults.
The UNIX lpq command queries the status of pending print requests, both local and remote. USPOOL ignores this command, and no response is printed at your terminal.
The UNIX lprm command cancels pending print requests generated by the lpr command. This applies to both local and remote printers. USPOOL support for remote lprm processing is not yet implemented; when issued to Cisco IOS for S/390, this command is ignored.
The line printer daemon is the UNIX server that initiates the operations of lp requests. The daemon listens for TCP connections on default port 515. Once a connection has been established, the remote system sends the character string indicating the type of lp request and the printer name. The daemon then initiates the desired action.
A remote printer is defined to a UNIX (BSD 4.3) system in the file /etc/printcap. This file assigns the remote printer and remote host names as well as other printer configuration information. The remote printer name assigned here is transferred over the TCP connection when an lp request is made to a remote host. Consult your UNIX system administrator or appropriate UNIX manual to define the remote printer.
Once a TCP connection to port 515 has been established by the line printer daemon, lp commands and data can be exchanged between the two systems. First, the UNIX system sends a character string to the remote computer to identify the type of request (lpr, lpq, or lprm) and the name of the remote printer the request is for. An lpr request causes print files and control information to be sent across the TCP connection as described in following sections. The lpq command causes status information to be returned to the requester. The lprm command causes the result of the requested operation to be returned.
This section describes the sequence of events that effects the sending of lpr print data from the local to the remote computer. (See Figure 8-1.)This protocol is implemented over a TCP connection. Acknowledgments (ACKs) delimit the phases of the transfer. In lpr, an ACK is one zero value byte. There are three phases of an lpr transfer.
For the first phase (the transfer of the file header) the sender transfers a character string that identifies the type of request and the printer name. The first byte of the character string represents the request type. It has one of the values listed in this table:
The ASCII character string that immediately follows the request type character is the remote printer name destination. The remote printer name is terminated with one zero value byte (ACK). The format of the data and control files is described in the following sections.
The data file consists of a data file header followed by the print data.
The data file header has the format
\3XXXXX dfYZZZAAAAA\n| \3 | Indicates the data file |
| XXXXX | Number of characters in the data file |
| df | specifies the data file |
| Y | File sequence associated with job number |
| ZZZ | Job number |
| AAAAA | Sending host name |
| \n | End of data file header |
The strings XXXXX and AAAAA are variable-length fields.
The string d fYZZZAAAAA is the data file name. All characters are ASCII.
The remote computer must send an acknowledgment of the data file header before the data file is sent.
The data file consists of only the number of ASCII characters indicated in the data file header. The data file is terminated with 0 (an ACK).
The remote computer must again send an ACK when receipt of the data file (including the \0) is complete.
The sender then transmits either the next data file (if any), or the control file. Data files should not be printed at this point, but should be spooled temporarily so the control commands can manipulate them as directed by the originating computer.
The current USPOOL implementation does not spool the file at this point, but immediately queues the file for printing. Printing of the data files by USPOOL is currently not affected by the contents of the control file.
The control file is similar to the data file in that they both consist of a header followed by the contents of the file. In fact, the control file header is identical to the data file header except for the file-type designator (2 for the control files) and the first character of the file name (c for control file). Acknowledgment of the control file and control file header is the same as for data files.
The control file consists of a series of commands describing actions and options for processing the previously spooled data files. The command verb is the first character of each line in the command file. Arguments make up the remainder of the line.
Table 8-1 lists the control file commands:
| Command | Description |
|---|---|
| J | Places the job name on banner page |
| C | Places the class name on banner page |
| L | Prints literal user's name on banner |
| T | Provides a title for the print file |
| H | Indicates the name of host machine where the lpr command was issued |
| P | Indicates the user's login name |
| I | Specifies the amount of space to indent the output |
| f | Specifies the name of the text file to print |
| l | Specifies the name of the text file with control characters |
| p | Specifies the name of the text file to print with pr (1) |
| t | Specifies the name of the troff (1) file to print |
| n | Specifies the name of the ditroff (1) file to print |
| d | Specifies the name of the dvi file to print |
| g | Specifies the name of the plot (1G) file to print |
| v | Specifies the name of the plain raster file to print |
| c | Specifies the name of the c if plot file to print |
| 1 | Specifies the R font file for troff |
| 1 | Specifies the B font file for troff |
| 4 | Specifies the S font file for troff |
| N | Specifies the name of file (used by lpq) |
| U | Specifies the unlink name of file to remove |
| M | Mails to user when done printing |
The Cisco IOS for S/390 print server facility provides a print server capability that lets remote users access MVS printers.
USPOOL is invoked by the incoming logger function of Cisco IOS for S/390 when a connection request (TCSYN) is sent to port 515 (or whatever port number the UNIX and IBM system programmers have defined). USPOOL initialization consists of obtaining a reentrant work area from Cisco IOS for S/390, locating USPOOL SERVICE APPCFGxx parameters, completing the TCP connection open, validating the remote host, loading the translate table, initializing buffers, processing the lp request string, and allocating and opening the SYSOUT data set. USPOOL then drops into the main loop. Each iteration of the main loop handles a data file or the control file and send required acknowledgments. In the case of data files, an inner loop invokes a hierarchy of programs to get data from the network, format print records, translate ASCII to EBCDIC, handle the ASCII control characters (BS, HT, LF, FF, CR), write the records to the JES SYSOUT queue, and check for and process acknowledgments received.
When all functions have been completed, USPOOL does a program cleanup and closes the TCP connection.
You can replace the standard USPOOL translate table with your own. Read the Cisco IOS for S/390 Customization Guide for details. If you have a 3800 printer you can use a replacement translate table to reproduce the ASCII characters.
USPOOL supports the ASCII backspace (x'08'), horizontal tab (x'09'), line feed (x'0A'), form feed (x'0C'), and carriage return (x'0D') control characters. These characters, except horizontal tab, are translated into the appropriate IBM machine code control character (the first character on the print line) in print-then-act mode. Read the control characters appendix in your most current version of the IBM publication, MVS/370 Data Management Services, for descriptions of the machine codes.
Since it is impossible to do character backspacing on a line printer, a line that contains backspace characters must be formatted into multiple print lines. These print lines must then be printed with the print-only machine code set in all but the last line.
A horizontal tab character causes the print line to be padded with blanks up to the next module 8 print position.
The current line is printed and formatting begins for the next print line.
The Skip to Channel 1 machine code is set in the current line. The line is printed and formatting begins for the next line.
The print only machine code is set in the current line. The line is printed and formatting begins for the next line.
Cisco IOS for S/390 does not support the lpq or lprm commands.
Although these two limitations exist in Cisco IOS for S/390, the Enterprise Print Services provides support for them:
Parameter support for the USPOOL LPR statement in APPCFGxx lets an installation select the SYSOUT class of print requests, the name of a module used as the translate table, the size (number of bytes) used for the TCP buffers, and whether all print requests, only print requests from the local network, or only print requests from the local subnet are accepted for printing. You can change the TCP port from the default (515), but you must change this on the UNIX system also. Read the Cisco IOS for S/390 Customization Guide for information about how to manipulate the APPCFGxx parameters.
|
|