|
Table of Contents1 Scope 2 References 3 Design Overview
|
|
1 Scope |
Contents Next |
1.1 IdentificationThis software design description document provides detailed information on the architecture and coding of the Common UNIX Printing System ("CUPS") Version 1.0. |
Contents Previous Next |
1.2 System OverviewThe Common UNIX Printing System provides a portable printing layer for UNIX® operating systems. It has been developed by Easy Software Products to promote a standard printing solution for all UNIX vendors and users. CUPS provides the System V and Berkeley command-line interfaces.CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis for managing print jobs and queues. The Line Printer Daemon (LPD, RFC1179), Server Message Block (SMB), and AppSocket protocols are also supported with reduced functionality. CUPS adds network printer browsing and PostScript Printer Description ("PPD")-based printing options to support real world applications under UNIX. CUPS also includes a customized version of GNU GhostScript (currently based off GNU GhostScript 4.03) and an image file RIP that can be used to support non-PostScript printers. |
Contents Previous Next |
1.3 Document OverviewThis software design description document is organized into the following sections:
|
Contents Previous Next |
2 References |
Contents Previous Next |
2.1 CUPS DocumentationThe following CUPS documentation is referenced by this document:
|
Contents Previous Next |
2.2 Other DocumentsThe following non-CUPS documents are referenced by this document:
|
Contents Previous Next |
3 Design OverviewCUPS is composed of 7 software sub-systems that operate together to perform common printing tasks:
|
Contents Previous Next |
3.1 BackendsThe backends implement communications over a number of different interfaces. All backends are called with a common set of arguments:
3.1.1 ippThe ipp backend sends the specified job to a network printer or host using the Internet Printing Protocol. The URI is as specified by the
printer-uri-supported attribute from the printer or host.
3.1.2 lpdThe lpd backend sends the specified job to a network printer or host using the Line Printer Daemon protocol. The URI is of the form:lpd://hostname/queue 3.1.3 parallelThe parallel backend sends the specified job to a local printer connected via the specified parallel port device. The URI is of the form:parallel:/dev/file 3.1.4 serialThe serial backend sends the specified job to a local printer connected via the specified serial port device. The URI is of the form:serial:/dev/file?option[+option+...]The options can be any combination of the following:
3.1.5 socketThe socket backend sends the specified job to a network host using the AppSocket protocol commonly used by Hewlett-Packard and Tektronix printers. The URI is of the form:socket://hostname[:port]The default port number is 9100. |
Contents Previous Next |
3.2 Berkeley CommandsThe Berkeley commands provide a simple command-line interface to CUPS to submit and control print jobs. It is provided for compatibility with existing software that is hard coded to use the Berkeley commands.3.2.1 lpcThe lpc command allows users and administrators to check the status and control print queues. The version provided with CUPS supports the following commands:
3.2.2 lprThe lpr command submits a job for printing. The CUPS version of lpr silently ignores the "i", "t", "m", "h", and "s" options.3.2.3 lprmThe lprm removes one or more print jobs. |
Contents Previous Next |
3.3 CGIThe Common Gateway Interface (CGI) programs provide a web-based status interface to monitor the status of printers, classes, and jobs.3.3.1 classes.cgiThe classes CGI lists the available printer classes and any pending jobs for the class. The user can click on individual classes to limit the display and click on jobs to see the job status.3.3.2 jobs.cgiThe jobs CGI lists the queued print jobs in order of priority. The list can be limited by printer or job. When the user displays the status of an individual print job all job options are displayed.3.3.3 printers.cgiThe printers CGI lists the available printer queues and any pending jobs for the printer. The user can click on individual printers to limit the display and click on jobs to see the job status. |
Contents Previous Next |
3.4 CUPS Interface LibraryThe CUPS interface library provides common convenience, HTTP, IPP, language, MIME, PPD, and raster functions used by the CUPS software.3.4.1 Convenience FunctionsConvenience functions are provided to submit an IPP request, send a print file, cancel a job, get a list of available printers, get a list of available classes, get the default printer or class, get the default server name, get the local username, and get a password string.3.4.2 HTTP FunctionsThe HTTP functions provide functions to connect to HTTP servers, issue requests, read data from a server, and write data to a server.3.4.3 IPP FunctionsThe IPP function provide functions to manage IPP request data and attributes, read IPP responses from a server, and write IPP requests to a server.3.4.4 Language FunctionsThe language functions provide a standard interface for retrieving common textual messages for a particular locale and determining the correct encoding (e.g. US ASCII, ISO-8859-1, etc.)3.4.5 MIME FunctionsThe Multimedia Internet Mail Exchange functions manage a MIME type and conversion database that supports file typing by extension and content, and least-cost file filtering from a source to a destination file type.3.4.6 PPD FunctionsThe PostScript Printer Description functions manage PPD files, select options, check for option conflicts, and emit selected options in the correct order.3.4.7 Raster FunctionsThe raster functions manage streams of CUPS raster data (described in the Interface Design Document) used by non-PostScript printer drivers. |
Contents Previous Next |
3.5 FiltersThe filters implement file conversion services for CUPS. All filters are called with a common set of arguments:
3.5.1 hpgltopsThe hpgltops filter converts HP-GL/2 files into PostScript.3.5.2 imagetopsThe imagetops filter converts image files into PostScript.3.5.3 imagetorasterThe imagetoraster filter converts image files into CUPS raster data.3.5.4 pstopsThe pstops filter inserts printer-specific commands from PPD files and performs page filtering as requested by the user.3.5.5 pstorasterThe pstoraster filter converts PostScript program data into CUPS raster data.3.5.6 rastertohpThe rastertohp filter handles converting CUPS raster data to HP PCL and supports both color and black-and-white printers.3.5.7 texttopsThe texttops filter converts text files into PostScript. |
Contents Previous Next |
3.6 SchedulerThe scheduler is a fully-functional HTTP/1.1 and IPP/1.0 server that manages the printers, classes, and jobs in the system. It also handles a simple broadcast-based directory service so that remote print queues and classes can be accessed transparently from the local system.3.6.1 AuthorizationThe authorization module is responsible for performing access control and authentication for all HTTP and IPP requests entering the system.3.6.2 ClassesThe classes module is responsible for managing printer classes in the system. Each class is a collection of local and/or remote printers. The classes module also reads and writes the classes configuration file.3.6.3 ClientThe client module is responsible for all HTTP client communications. It handles listening on selected interfaces, accepting connections from prospective clients, processing incoming HTTP requests, and sending HTTP responses to those requests. The client module also is responsible for executing the external CGI programs as needed to support web-based printer, class, and job status monitoring.Once authorized, all IPP requests are sent to the IPP module. 3.6.4 ConfigurationThe configuration module is responsible for reading the CUPS configuration file and initializing the appropriate data structures and values. The configuration module also stops CUPS services before reading the configuration file and restarts them after the configuration file has been read.3.6.5 Directory ServicesThe directory services module sends and recieves printer state information over a broadcast socket. Remote printers and classes are automatically added to or removed from the local printer and class lists as needed.The directory services module can only recieve printer state information over a single UDP port, however it can broadcast to multiple addresses and ports as needed. 3.6.6 IPPThe IPP module handles IPP requests and acts accordingly. URI validation is also performed here, as a client can post IPP data to any URI on the server which might sidestep the access control or authentication of the HTTP server.3.6.7 JobsThe jobs module manages print jobs, starts filter and backend processes for jobs to be printed, and monitors status messages from those filters and backends.3.6.8 LoggingThe logging module manages the access, error, and page log files that are generated by the scheduler.3.6.9 MainThe main module is responsible for timing out and dispatching input and output for client connections. It also watches for incoming
SIGHUP and SIGCHLD signals, reloads the server configuration files as needed, and
handles child process errors and exits.
3.6.10 PrintersThe printers module is responsible for managing printers and PPD files in the system. The printers module also reads and writes the printers configuration file. |
Contents Previous Next |
3.7 System V CommandsThe System V commands provide a robust command-line interface to CUPS to submit and control printers and jobs.3.7.1 acceptThe accept command tells the scheduler to accept new jobs for specific printers.3.7.2 cancelThe cancel command tells the scheduler to cancel one or more jobs that are queued for printing.3.7.3 disableThe disable command tells the scheduler to stop printing jobs on the specified printers.3.7.4 enableThe enable command tells the scheduler to start printing jobs on the specified printers.3.7.5 lpThe lp command submits submits files for printing. Unlike the standard System V lp command, a single CUPS lp command will generate a separate job ID for each file that is printed. Also, the Solaris "f", "H", "P", "S", and "y" options are silently ignored.3.7.6 lpadminThe lpadmin command manages printer queues and classes. The Solaris "A", "F", "I", "M", "P", "Q", "S", "T", "U", "W", "f", "l", "m", "o", "s", "t", and "u" options are not supported, and new options "P" (PPD file), "F" (filter), and "E" (enable and accept) are provided to configure CUPS-specific features such as PPD file and conversion filters.3.7.7 lpstatThe lpstat command lists printers, classes, and jobs as requested by the user.3.7.8 rejectThe reject command tells the scheduler not to accept new jobs for specific printers. |
Contents Previous Next |
A Glossary |
Contents Previous Next |
A.1 Terms
|
Contents Previous Next |
A.2 Acronyms
|