]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | .\" |
bfbd0197 | 2 | .\" Backend man page for CUPS. |
ef416fc2 | 3 | .\" |
87030afb MS |
4 | .\" Copyright © 2007-2019 by Apple Inc. |
5 | .\" Copyright © 1997-2006 by Easy Software Products. | |
ef416fc2 | 6 | .\" |
87030afb MS |
7 | .\" Licensed under Apache License v2.0. See the file "LICENSE" for more |
8 | .\" information. | |
ef416fc2 | 9 | .\" |
87030afb | 10 | .TH backend 7 "CUPS" "26 April 2019" "Apple Inc." |
ef416fc2 | 11 | .SH NAME |
12 | backend \- cups backend transmission interfaces | |
ef416fc2 | 13 | .SH SYNOPSIS |
14 | .B backend | |
15 | .br | |
16 | .B backend | |
bfbd0197 MS |
17 | .I job |
18 | .I user | |
19 | .I title | |
20 | .I num-copies | |
21 | .I options | |
22 | [ | |
ef416fc2 | 23 | .I filename |
24 | ] | |
bfbd0197 MS |
25 | .nf |
26 | ||
27 | \fB#include <cups/cups.h>\fR | |
28 | ||
29 | \fBconst char *cupsBackendDeviceURI\fR(\fBchar **\fIargv\fR); | |
30 | ||
31 | \fBvoid cupsBackendReport\fR(\fBconst char *\fIdevice_scheme\fR, | |
32 | \fBconst char *\fIdevice_uri\fR, | |
33 | \fBconst char *\fIdevice_make_and_model\fR, | |
34 | \fBconst char *\fIdevice_info\fR, | |
35 | \fBconst char *\fIdevice_id\fR, | |
36 | \fBconst char *\fIdevice_location\fR); | |
37 | ||
38 | \fBssize_t cupsBackChannelWrite\fR(\fBconst char *\fIbuffer\fR, | |
39 | \fBsize_t \fIbytes\fR, \fBdouble \fItimeout\fR); | |
40 | ||
41 | \fBint cupsSideChannelRead\fR(\fBcups_sc_command_t *\fIcommand\fR, | |
42 | \fBcups_sc_status_t *\fIstatus\fR, \fBchar *\fIdata\fR, | |
43 | \fBint *\fIdatalen\fR, \fBdouble \fItimeout\fR); | |
44 | ||
45 | \fBint cupsSideChannelWrite\fR(\fBcups_sc_command_t \fIcommand\fR, | |
46 | \fBcups_sc_status_t \fIstatus\fR, \fBconst char *\fIdata\fR, | |
47 | \fBint \fIdatalen\fR, \fBdouble \fItimeout\fR); | |
48 | .fi | |
ef416fc2 | 49 | .SH DESCRIPTION |
bfbd0197 MS |
50 | Backends are a special type of |
51 | .BR filter (7) | |
52 | which is used to send print data to and discover different devices on the system. | |
ef416fc2 | 53 | .LP |
bfbd0197 | 54 | Like filters, backends must be capable of reading from a filename on the command-line or from the standard input, copying the standard input to a temporary file as required by the physical interface. |
ef416fc2 | 55 | .LP |
87030afb MS |
56 | The command name (\fIargv[0]\fR) is set to the device URI of the destination printer. |
57 | Authentication information in | |
bfbd0197 MS |
58 | .I argv[0] |
59 | is removed, so backend developers are urged to use the | |
60 | .B DEVICE_URI | |
61 | environment variable whenever authentication information is required. The | |
62 | .BR cupsBackendDeviceURI () | |
63 | function may be used to retrieve the correct device URI. | |
ef416fc2 | 64 | .LP |
bfbd0197 | 65 | Back-channel data from the device should be relayed to the job filters using the \fIcupsBackChannelWrite\fR function. |
f3c17241 | 66 | .LP |
bfbd0197 MS |
67 | Backends are responsible for reading side-channel requests using the |
68 | .BR cupsSideChannelRead () | |
69 | function and responding with the | |
1515fed2 | 70 | .BR cupsSideChannelWrite () |
bfbd0197 MS |
71 | function. The |
72 | .B CUPS_SC_FD | |
73 | constant defines the file descriptor that should be monitored for incoming requests. | |
74 | .SS DEVICE DISCOVERY | |
87030afb MS |
75 | When run with no arguments, the backend should list the devices and schemes it supports or is advertising to the standard output. |
76 | The output consists of zero or more lines consisting of any of the following forms: | |
ef416fc2 | 77 | .nf |
bfbd0197 | 78 | |
bd7854cb | 79 | device-class scheme "Unknown" "device-info" |
80 | device-class device-uri "device-make-and-model" "device-info" | |
81 | device-class device-uri "device-make-and-model" "device-info" "device-id" | |
749b1e90 | 82 | device-class device-uri "device-make-and-model" "device-info" "device-id" "device-location" |
ef416fc2 | 83 | .fi |
ef416fc2 | 84 | .LP |
bfbd0197 MS |
85 | The |
86 | .BR cupsBackendReport () | |
87 | function can be used to generate these lines and handle any necessary escaping of characters in the various strings. | |
88 | .LP | |
89 | The | |
90 | .I device-class | |
91 | field is one of the following values: | |
ef416fc2 | 92 | .TP 5 |
bfbd0197 MS |
93 | .B direct |
94 | The device-uri refers to a specific direct-access device with no options, such as a parallel, USB, or SCSI device. | |
ef416fc2 | 95 | .TP 5 |
bfbd0197 | 96 | .B file |
ef416fc2 | 97 | The device-uri refers to a file on disk. |
ef416fc2 | 98 | .TP 5 |
bfbd0197 | 99 | .B network |
f3c17241 MS |
100 | The device-uri refers to a networked device and conforms to the general form for |
101 | network URIs. | |
ef416fc2 | 102 | .TP 5 |
bfbd0197 | 103 | .B serial |
87030afb MS |
104 | The device-uri refers to a serial device with configurable baud rate and other options. |
105 | If the device-uri contains a baud value, it represents the maximum baud rate supported by the device. | |
ef416fc2 | 106 | .LP |
fbfee7a8 | 107 | The |
bfbd0197 | 108 | .I scheme |
87030afb MS |
109 | field provides the URI scheme that is supported by the backend. |
110 | Backends should use this form only when the backend supports any URI using that scheme. | |
111 | The | |
bfbd0197 MS |
112 | .I device-uri |
113 | field specifies the full URI to use when communicating with the device. | |
ef416fc2 | 114 | .LP |
bfbd0197 MS |
115 | The |
116 | .I device-make-and-model | |
87030afb MS |
117 | field specifies the make and model of the device, e.g. "Example Foojet 2000". |
118 | If the make and model is not known, you must report "Unknown". | |
ef416fc2 | 119 | .LP |
bfbd0197 MS |
120 | The |
121 | .I device-info | |
87030afb MS |
122 | field specifies additional information about the device. |
123 | Typically this includes the make and model along with the port number or network address, e.g. "Example Foojet 2000 USB #1". | |
ef416fc2 | 124 | .LP |
bfbd0197 MS |
125 | The optional |
126 | .I device-id | |
127 | field specifies the IEEE-1284 device ID string for the device, which is used to select a matching driver. | |
749b1e90 | 128 | .LP |
bfbd0197 MS |
129 | The optional |
130 | .I device-location | |
131 | field specifies the physical location of the device, which is often used to pre-populate the printer-location attribute when adding a printer. | |
132 | .SS PERMISSIONS | |
87030afb MS |
133 | Backends without world read and execute permissions are run as the root user. |
134 | Otherwise, the backend is run using an unprivileged user account, typically "lp". | |
bfbd0197 MS |
135 | .SH EXIT STATUS |
136 | The following exit codes are defined for backends: | |
ef416fc2 | 137 | .TP 5 |
bfbd0197 | 138 | .B CUPS_BACKEND_OK |
f3c17241 | 139 | The print file was successfully transmitted to the device or remote server. |
ef416fc2 | 140 | .TP 5 |
bfbd0197 | 141 | .B CUPS_BACKEND_FAILED |
ef416fc2 | 142 | .br |
87030afb MS |
143 | The print file was not successfully transmitted to the device or remote server. |
144 | The scheduler will respond to this by canceling the job, retrying the job, or stopping the queue depending on the state of the | |
bfbd0197 | 145 | .I printer-error-policy |
f3c17241 | 146 | attribute. |
ef416fc2 | 147 | .TP 5 |
bfbd0197 | 148 | .B CUPS_BACKEND_AUTH_REQUIRED |
87030afb MS |
149 | The print file was not successfully transmitted because valid authentication information is required. |
150 | The scheduler will respond to this by holding the job and adding the 'cups-held-for-authentication' keyword to the "job-reasons" Job Description attribute. | |
ef416fc2 | 151 | .TP 5 |
bfbd0197 | 152 | .B CUPS_BACKEND_HOLD |
87030afb MS |
153 | The print file was not successfully transmitted because it cannot be printed at this time. |
154 | The scheduler will respond to this by holding the job. | |
ef416fc2 | 155 | .TP 5 |
bfbd0197 | 156 | .B CUPS_BACKEND_STOP |
87030afb MS |
157 | The print file was not successfully transmitted because it cannot be printed at this time. |
158 | The scheduler will respond to this by stopping the queue. | |
22c9029b | 159 | .TP 5 |
bfbd0197 | 160 | .B CUPS_BACKEND_CANCEL |
87030afb MS |
161 | The print file was not successfully transmitted because one or more attributes are not supported or the job was canceled at the printer. |
162 | The scheduler will respond to this by canceling the job. | |
22c9029b | 163 | .TP 5 |
bfbd0197 | 164 | .B CUPS_BACKEND_RETRY |
87030afb MS |
165 | The print file was not successfully transmitted because of a temporary issue. |
166 | The scheduler will retry the job at a future time - other jobs may print before this one. | |
bfbd0197 MS |
167 | .TP 5 |
168 | .B CUPS_BACKEND_RETRY_CURRENT | |
87030afb MS |
169 | The print file was not successfully transmitted because of a temporary issue. |
170 | The scheduler will retry the job immediately without allowing intervening jobs. | |
ef416fc2 | 171 | .PP |
172 | All other exit code values are reserved. | |
bfbd0197 MS |
173 | .SH ENVIRONMENT |
174 | In addition to the environment variables listed in | |
175 | .BR cups (1) | |
176 | and | |
177 | .BR filter (7), | |
178 | CUPS backends can expect the following environment variable: | |
179 | .TP 5 | |
180 | .B DEVICE_URI | |
181 | The device URI associated with the printer. | |
182 | .SH FILES | |
183 | .I /etc/cups/cups-files.conf | |
184 | .SH NOTES | |
87030afb MS |
185 | CUPS backends are not generally designed to be run directly by the user. |
186 | Aside from the device URI issue ( | |
bfbd0197 MS |
187 | .I argv[0] |
188 | and | |
189 | .B DEVICE_URI | |
87030afb MS |
190 | environment variable contain the device URI), CUPS backends also expect specific environment variables and file descriptors, and typically run in a user session that (on macOS) has additional restrictions that affect how it runs. |
191 | Backends can also be installed with restricted permissions (0500 or 0700) that tell the scheduler to run them as the "root" user instead of an unprivileged user (typically "lp") on the system. | |
bfbd0197 | 192 | .LP |
87030afb MS |
193 | Unless you are a developer and know what you are doing, please do not run backends directly. |
194 | Instead, use the | |
bfbd0197 MS |
195 | .BR lp (1) |
196 | or | |
197 | .BR lpr (1) | |
198 | programs to send print jobs or | |
199 | .BR lpinfo (8) | |
87030afb MS |
200 | to query for available printers using the backend. |
201 | The one exception is the SNMP backend - see | |
bfbd0197 MS |
202 | .BR cups-snmp (8) |
203 | for more information. | |
87030afb MS |
204 | .SH NOTES |
205 | CUPS printer drivers and backends are deprecated and will no longer be supported in a future feature release of CUPS. | |
206 | Printers that do not support IPP can be supported using applications such as | |
207 | .BR ippeveprinter (1). | |
ef416fc2 | 208 | .SH SEE ALSO |
bfbd0197 MS |
209 | .IR cups (1), |
210 | .IR cups-files.conf (5), | |
211 | .IR cups-snmp (8), | |
212 | .IR cupsd (8), | |
213 | .IR filter (7), | |
214 | .IR lp (1), | |
215 | .IR lpinfo (8), | |
216 | .IR lpr (1), | |
ef416fc2 | 217 | .br |
bfbd0197 | 218 | CUPS Online Help (http://localhost:631/help) |
ef416fc2 | 219 | .SH COPYRIGHT |
87030afb | 220 | Copyright \[co] 2007-2019 by Apple Inc. |