1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
---|
2 | <HTML> |
---|
3 | <HEAD> |
---|
4 | <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> |
---|
5 | <TITLE> LPRng-HOWTO: RFC 1179 - Line Printer Daemon Protocol</TITLE> |
---|
6 | <LINK HREF="LPRng-HOWTO-19.html" REL=next> |
---|
7 | <LINK HREF="LPRng-HOWTO-17.html" REL=previous> |
---|
8 | <LINK HREF="LPRng-HOWTO.html#toc18" REL=contents> |
---|
9 | </HEAD> |
---|
10 | <BODY> |
---|
11 | <A HREF="LPRng-HOWTO-19.html">Next</A> |
---|
12 | <A HREF="LPRng-HOWTO-17.html">Previous</A> |
---|
13 | <A HREF="LPRng-HOWTO.html#toc18">Contents</A> |
---|
14 | <HR> |
---|
15 | <H2><A NAME="rfc1179ref"></A> <A NAME="s18">18. RFC 1179 - Line Printer Daemon Protocol</A></H2> |
---|
16 | |
---|
17 | <P>RFC1179 can be obtained from the LPRng distribution, in the LPRng_DOC/rfc1179 directory, |
---|
18 | or from one of many sites which mirror the RFCs. |
---|
19 | <P>This RFC is an <EM>informational</EM> RFC, |
---|
20 | which means that the information in it is meant as a guide to users, |
---|
21 | and not as a fixed standard. |
---|
22 | In addition, |
---|
23 | the RFC tried to document the behavior of the BSD LPD print server, |
---|
24 | and left out many details dealing with error recover, |
---|
25 | error messages, |
---|
26 | extensions to the protocol, |
---|
27 | etc. |
---|
28 | <P>In this section, |
---|
29 | I will try to explain what RFC1179 specifies as a protocol, |
---|
30 | and many of the problems encountered in trying to use it. |
---|
31 | <H2><A NAME="socketlinger"></A> <A NAME="retrynolink"></A> <A NAME="retryeconnrefused"></A> <A NAME="reuseaddr"></A> <A NAME="originateport"></A> <A NAME="lpdport"></A> <A NAME="ss18.1">18.1 Ports and Connections</A> |
---|
32 | </H2> |
---|
33 | |
---|
34 | <P>Options used: |
---|
35 | <UL> |
---|
36 | <LI> <CODE>lpd_port=</CODE><EM>Port for LPD to accept connection</EM></LI> |
---|
37 | <LI> <CODE>originate_port=</CODE><EM>Ports to originate connections on</EM></LI> |
---|
38 | <LI> <CODE>reuse_addr</CODE><EM> Set SO_REUSEADDR flag on connection</EM></LI> |
---|
39 | <LI> <CODE>retry_econnrefused</CODE><EM> Retry on connect ECONNREFUSED error</EM></LI> |
---|
40 | <LI> <CODE>retry_nolink</CODE><EM> Retry on device open or connection ffailure</EM></LI> |
---|
41 | <LI> <CODE>socket_linger#</CODE><EM> Linger time for sockets</EM></LI> |
---|
42 | </UL> |
---|
43 | <P>RFC1179 requires that the <CODE>lpd</CODE> server listen for TCP/IP connections |
---|
44 | on port 515. |
---|
45 | This port is registered with the Internet Naming Authority, |
---|
46 | and the <CODE>/etc/services</CODE> file or TCP/IP services database usually has an entry: |
---|
47 | <BLOCKQUOTE><CODE> |
---|
48 | <PRE> |
---|
49 | printer 515/tcp spooler # line printer spooler |
---|
50 | </PRE> |
---|
51 | </CODE></BLOCKQUOTE> |
---|
52 | <P>RFC1179 explicitly states that all connections to port 515 must originate from |
---|
53 | ports 721-731. |
---|
54 | The reason for this restriction is due to the UNIX concept of <EM>reserved</EM> |
---|
55 | and <EM>privileged</EM> ports. |
---|
56 | By convention, |
---|
57 | ports in the range 1-1023 can only <B>bound</B> by processes whose Effective User ID (EUID) |
---|
58 | is 0 (root). |
---|
59 | This, |
---|
60 | ordinary users could not originate a connection from the reserved or privileged port range. |
---|
61 | <P>In a UNIX environment, this means that the user programs |
---|
62 | <CODE>lpr</CODE>, |
---|
63 | <CODE>lprm</CODE>, |
---|
64 | <CODE>lpq</CODE>, |
---|
65 | and |
---|
66 | <CODE>lpc</CODE> |
---|
67 | would have to be SETUID root. |
---|
68 | <P>As experience has shown, for security purposes, |
---|
69 | the fewer programs that need to have privileged status, |
---|
70 | the better. |
---|
71 | LPRng uses the |
---|
72 | <CODE>lpd_port=printer</CODE> configuration option to set the actual port to be use. |
---|
73 | By default, this is port 515, but can be set to other values. |
---|
74 | <P>The restriction of originating ports to 721-731 causes another set of problems. |
---|
75 | Part of the TCP/IP protocol is concerned with avoiding communications problems |
---|
76 | resulting from the arrival of old or <EM>stale</EM> packets. |
---|
77 | When a connection between |
---|
78 | <CODE>sourcehost, sourceport</CODE> and <CODE>desthost, destport</CODE> |
---|
79 | is made, |
---|
80 | a set of sequence numbers is established and used for sending and acknowledgement of data. |
---|
81 | When the connection terminates, |
---|
82 | the TCP/IP protocol restricts the establishment of a new connection between |
---|
83 | <CODE>sourcehost, sourceport</CODE> and <CODE>desthost, destport</CODE> for a period long |
---|
84 | enough for all <EM>stale</EM> packets to be removed from the system. |
---|
85 | This is approximately 10 minutes long. |
---|
86 | <P>In order to simplify assignments of ports, |
---|
87 | timing out connections, and other matters, |
---|
88 | many TCP/IP packages do keep track of explicit connections |
---|
89 | <EM>originating</EM> from a port, |
---|
90 | but simply prevent the port from being reused for either origination |
---|
91 | or reception of a connection. |
---|
92 | They do, |
---|
93 | however, |
---|
94 | keep track of the active connections <B>to</B> a port, |
---|
95 | and perform timeouts on these. |
---|
96 | This is usually much simpler to implement, |
---|
97 | as it can be done with a list attached to the port. |
---|
98 | <P>This implementation method creates some problems when |
---|
99 | a large number of connections must be originated from a |
---|
100 | relatively small number of port numbers. |
---|
101 | Observe what happens when host 1 tries to send a large number of jobs to a server 2. |
---|
102 | The following connections are established and terminated:<BR> |
---|
103 | <CODE>host 1, port 721</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
104 | <CODE>host 1, port 722</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
105 | <CODE>host 1, port 723</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
106 | <CODE>host 1, port 724</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
107 | <CODE>host 1, port 725</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
108 | <CODE>host 1, port 726</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
109 | <CODE>host 1, port 727</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
110 | <CODE>host 1, port 728</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
111 | <CODE>host 1, port 729</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
112 | <CODE>host 1, port 730</CODE> and <CODE>host 2, port 515</CODE><BR> |
---|
113 | <CODE>host 1, port 731</CODE> and <CODE>host 2, port 515</CODE> |
---|
114 | <P>Now according to the RFC1179 rules and the TCP/IP protocol, |
---|
115 | we will have to wait until one of these connections terminates before we |
---|
116 | can make another. |
---|
117 | On the originating system, |
---|
118 | if the TCP/IP implementation does timeouts on the originating port, |
---|
119 | we will have to wait for the timeout to elapse before we can make a new |
---|
120 | connection. |
---|
121 | Unfortunately, there is no way to find out what the status of the port |
---|
122 | is, so we will have to try them each in turn until we get |
---|
123 | a successful connection. |
---|
124 | <P>The LPRng code has tried to provide several methods to deal with |
---|
125 | these problems. |
---|
126 | Firstly, |
---|
127 | the |
---|
128 | <CODE>originate_port=512 1023</CODE> |
---|
129 | option specifies the range |
---|
130 | of ports used to originate connections |
---|
131 | when the software is running either as ROOT or SETUID root. |
---|
132 | By strict RFC1179 rules, |
---|
133 | this should be |
---|
134 | <CODE>originate_port=721 731</CODE>, |
---|
135 | but it turns out that most BSD LPD based implementations only |
---|
136 | check for a <EM>reserved</EM> originating port. |
---|
137 | By using 512 ports we get a greatly reduced rate of errors due |
---|
138 | to lack of ports due to pending timeouts. |
---|
139 | <P>However, |
---|
140 | on some systems which are acting as servers for a large number of |
---|
141 | printers even increasing this port range is insufficient, |
---|
142 | and steps need to be taken use the originating port numbers |
---|
143 | more efficiently. |
---|
144 | The Berkeley TCP/IP implementation |
---|
145 | <CODE>getsockopt()</CODE> |
---|
146 | and |
---|
147 | <CODE>setsockopt()</CODE> |
---|
148 | allows the user to manipulate some of the underlying timeouts and options |
---|
149 | of the TCP/IP network. |
---|
150 | When a TCP/IP connection is established, |
---|
151 | the |
---|
152 | <CODE>setsockopt()</CODE> |
---|
153 | facility can be used to set the |
---|
154 | <CODE>SO_REUSEADDR</CODE> |
---|
155 | flag on the connection. |
---|
156 | This flag effectively sets the timeout value on the ports |
---|
157 | and connections to 0, |
---|
158 | allowing immediate reuse of the ports. |
---|
159 | When done on an originating end of a connection, |
---|
160 | this will allow the originating port number to be reused immediately. |
---|
161 | <P>It would appear that by setting |
---|
162 | <CODE>SO_REUSEADDR</CODE> |
---|
163 | on the originating end that we have solved our problems. |
---|
164 | However, |
---|
165 | unless the destination end of the connection sets its |
---|
166 | <CODE>SO_REUSEADDR</CODE> |
---|
167 | flag on the connection, |
---|
168 | it will still do a timeout. |
---|
169 | Thus when we try to make a connection from a port |
---|
170 | that was active within a short period of time to the |
---|
171 | same host, |
---|
172 | then it will reject the connection until the |
---|
173 | timeout is over. |
---|
174 | <P>The |
---|
175 | <CODE>reuse_addr</CODE> |
---|
176 | flag (default off) forces |
---|
177 | the LPRng software to set the |
---|
178 | <CODE>SO_REUSEADDR</CODE> |
---|
179 | flag on originating connections. |
---|
180 | As indicated, |
---|
181 | this will allow ports to be reused immediately for outgoing connections, |
---|
182 | rather than waiting for a timeout. |
---|
183 | <P>While the |
---|
184 | <CODE>reuse_addr</CODE> |
---|
185 | flag usually allows us to reuse ports, |
---|
186 | there is still the problem of dealing with connections failing due to the |
---|
187 | remote site rejecting the connection due to a pending timeout |
---|
188 | from a previous connection. |
---|
189 | A careful study of the original BSD TCP/IP network code and of some |
---|
190 | others indicates that when a connection fails due to a pending timeout, |
---|
191 | an ECONNREFUSED error code is returned to a |
---|
192 | <CODE>connect()</CODE> system call. |
---|
193 | If this happens and we suspect that the remote site is rejecting |
---|
194 | the connection due to a timeout problem, |
---|
195 | then we should retry making the connection but from a new port, |
---|
196 | and continue retrying until all possible ports are used. |
---|
197 | <P>The <CODE>retry_econnrefused</CODE> (default on) flag is used to |
---|
198 | specify that we retry connections in this manner. |
---|
199 | When this is set, |
---|
200 | a <CODE>connection refused</CODE> |
---|
201 | error causes the connection to be retried using a new port. |
---|
202 | This will be repeated until all available ports have been tried. |
---|
203 | <P>When |
---|
204 | printing a job and the <CODE>lpd</CODE> server connection to a remote |
---|
205 | site or device open fails, |
---|
206 | the <CODE>retry_nolink</CODE> (default on) |
---|
207 | will cause the attempt to be retried indefinitely. |
---|
208 | The combination of <CODE>retry_econnrefused</CODE> and <CODE>retry_nolink</CODE> |
---|
209 | will provide robust connection attempts to remote systems. |
---|
210 | <P>While the above problems cause difficulties when making connections, |
---|
211 | there are also problems when terminating connections. |
---|
212 | After closing a socket, |
---|
213 | the TCP/IP software will try to flush any pending data to the destination. |
---|
214 | Unfortunately, |
---|
215 | on some systems it will only do this while the process is active. |
---|
216 | This has caused problems on systems which terminate |
---|
217 | a process it has received an abnormal (signal caused) termination. |
---|
218 | <P>The <CODE>setsockopt()</CODE> SO_LINGER option allows the user to specify |
---|
219 | that when a socket is closed normally, |
---|
220 | that the process should block until pending data is flushed or |
---|
221 | for the <CODE>socket_linger</CODE> period. |
---|
222 | If <CODE>socket_linger</CODE> is 0, |
---|
223 | then no SO_LINGER operation is done. |
---|
224 | <P>In summary, if you experience problems with connection failures due |
---|
225 | to port exhaustion, |
---|
226 | first try setting the |
---|
227 | <CODE>reuse_port</CODE> flag, |
---|
228 | and you should see a reduction. |
---|
229 | Check to ensure that the <CODE>retry_econnrefused</CODE> |
---|
230 | and <CODE>retry_nolink</CODE> flags are set, |
---|
231 | and the error code in the log and status files. |
---|
232 | If the failures continue, then the problem is caused by the |
---|
233 | remote end having timeout limitations and there is little you |
---|
234 | can do except to set a very long <CODE>connect_retry</CODE> |
---|
235 | interval, say <CODE>connect_retry=120</CODE> (2 minutes). |
---|
236 | <H2><A NAME="remotesupport"></A> <A NAME="ss18.2">18.2 Protocol Requests and Replies</A> |
---|
237 | </H2> |
---|
238 | |
---|
239 | <P>Options used: |
---|
240 | <UL> |
---|
241 | <LI> <CODE>remote_support=</CODE><EM>Remote operations supported</EM></LI> |
---|
242 | </UL> |
---|
243 | <P>After a connection has been established, |
---|
244 | a request can be sent to the <CODE>lpd</CODE> |
---|
245 | server. |
---|
246 | The request consists of a single octet indicating the request type, |
---|
247 | followed by the printer (or print queue) name, followed by |
---|
248 | a set of options for the request, |
---|
249 | followed by a LF (line feed) character. |
---|
250 | <BLOCKQUOTE><CODE> |
---|
251 | <PRE> |
---|
252 | \NNNprinter[ options]\n |
---|
253 | NNN Operation |
---|
254 | </PRE> |
---|
255 | </CODE></BLOCKQUOTE> |
---|
256 | <P> |
---|
257 | <CENTER><TABLE BORDER><TR><TD> |
---|
258 | <BR> |
---|
259 | NNN</TD><TD>RFC1179</TD><TD>Operation</TD><TD>program</TD></TR><TR><TD> |
---|
260 | 1</TD><TD>yes</TD><TD>start print</TD><TD><CODE>lpc</CODE></TD></TR><TR><TD> |
---|
261 | 2</TD><TD>yes</TD><TD>transfer a printer job</TD><TD><CODE>lpr</CODE></TD></TR><TR><TD> |
---|
262 | 3</TD><TD>yes</TD><TD>print short form of queue status</TD><TD><CODE>lpq</CODE></TD></TR><TR><TD> |
---|
263 | 4</TD><TD>yes</TD><TD>print long form of queue status</TD><TD><CODE>lpq</CODE></TD></TR><TR><TD> |
---|
264 | 5</TD><TD>yes</TD><TD>remove jobs</TD><TD><CODE>lprm</CODE></TD></TR><TR><TD> |
---|
265 | 6</TD><TD>LPRng</TD><TD>do control operation</TD><TD><CODE>lpc</CODE></TD></TR><TR><TD> |
---|
266 | 7</TD><TD>LPRng</TD><TD>transfer a block format print job</TD><TD><CODE>lpr</CODE></TD></TR><TR><TD> |
---|
267 | 8</TD><TD>LPRng</TD><TD>secure command transfer</TD><TD><CODE>lpc</CODE></TD></TR><TR><TD> |
---|
268 | 9</TD><TD>LPRng</TD><TD>verbose status information</TD><TD><CODE>lpq</CODE></TD></TR><TR><TD> |
---|
269 | |
---|
270 | </TD></TR></TABLE></CENTER> |
---|
271 | <P>After the request has been sent, |
---|
272 | then a reply will be returned. |
---|
273 | In general the reply has the following form: |
---|
274 | <BLOCKQUOTE><CODE> |
---|
275 | <PRE> |
---|
276 | \000\n Success |
---|
277 | \NNN\n Failure (NNN is error code) |
---|
278 | text\n Text or status information |
---|
279 | </PRE> |
---|
280 | </CODE></BLOCKQUOTE> |
---|
281 | <P>As can be seen, |
---|
282 | this protocol is extremely simple, |
---|
283 | but there are a set of problems due to the loosely written language of RFC1179. |
---|
284 | <OL> |
---|
285 | <LI>Firstly, |
---|
286 | while RFC1179 sets limits on the lengths of commands, |
---|
287 | it does not strictly set limits on the characters set used in the commands. |
---|
288 | This can result in problems when trying to print status information, |
---|
289 | headers on banners, |
---|
290 | and other details.</LI> |
---|
291 | <LI>The original RFC1179 protocol did not provide any way to do remote control |
---|
292 | of queues or LPD servers. |
---|
293 | This has been added to the protocol. |
---|
294 | As a side effect, |
---|
295 | if you try to use |
---|
296 | <CODE>lpc</CODE> to control a non-LPRng printer, |
---|
297 | it will not work.</LI> |
---|
298 | <LI>You can specify that a network printer is non-LPRng by using the |
---|
299 | <CODE>remote_support=RQVMC</CODE> option and specify the operations |
---|
300 | supported by the printer. |
---|
301 | The letters R, Q, V, M, and C stand for |
---|
302 | <CODE>lpr</CODE>, |
---|
303 | <CODE>lpq</CODE>, |
---|
304 | <CODE>lpq -v</CODE> (verbose), |
---|
305 | verbose <CODE>lpq</CODE>, |
---|
306 | <CODE>lprm</CODE>, |
---|
307 | and <CODE>lpc</CODE> operations respectively, |
---|
308 | and indicate that these are supported. |
---|
309 | If <CODE>remote_support</CODE> does not allow a particular operation, |
---|
310 | then the LPRng software will not send a corresponding request to the printer. |
---|
311 | For example, |
---|
312 | <CODE>remote_support=R</CODE> |
---|
313 | would restrict operations to spooling jobs only, |
---|
314 | and the LPRng software would not query the printer for status.</LI> |
---|
315 | </OL> |
---|
316 | <H2><A NAME="useshorthost"></A> <A NAME="longnumber"></A> <A NAME="senddatafirst"></A> <A NAME="ss18.3">18.3 Job Transfer</A> |
---|
317 | </H2> |
---|
318 | |
---|
319 | <P>Options used: |
---|
320 | <UL> |
---|
321 | <LI> <CODE>longnumber</CODE><EM> Long job number (6 digits)</EM></LI> |
---|
322 | <LI> <CODE>send_data_first</CODE><EM> Send data files first</EM></LI> |
---|
323 | <LI> <CODE>use_shorthost</CODE><EM> Use short hostname</EM></LI> |
---|
324 | </UL> |
---|
325 | <P>A job transfer operation starts with a job transfer request, |
---|
326 | followed by several file transfer operations. |
---|
327 | At the end of the file transfers, |
---|
328 | the connection should be closed. |
---|
329 | <P>A file transfer request has the form: |
---|
330 | <CENTER><TABLE BORDER><TR><TD> |
---|
331 | <BR> |
---|
332 | Command</TD><TD>Purpose</TD></TR><TR><TD> |
---|
333 | \001\n</TD><TD>abort</TD></TR><TR><TD> |
---|
334 | \002nnnn cfname</TD><TD>control file transfer</TD></TR><TR><TD> |
---|
335 | \003nnnn dfname</TD><TD>data file transfer</TD></TR><TR><TD> |
---|
336 | |
---|
337 | </TD></TR></TABLE></CENTER> |
---|
338 | <P>The abort operation is used to terminate job transfer and indicate that |
---|
339 | the job should not be processed for printing. |
---|
340 | The connection will be closed and the partly transferred job |
---|
341 | will be discarded. |
---|
342 | <P>The control file and data file transfer commands have a length (in bytes) |
---|
343 | of the file and the name of the file to be transferred. |
---|
344 | When the command is received, |
---|
345 | the server will reply with a status line: |
---|
346 | <CENTER><TABLE BORDER><TR><TD> |
---|
347 | <BR> |
---|
348 | Status</TD><TD>Purpose</TD></TR><TR><TD> |
---|
349 | \000</TD><TD>Accepted, proceed</TD></TR><TR><TD> |
---|
350 | \nnn</TD><TD>Rejected with error code</TD></TR><TR><TD> |
---|
351 | |
---|
352 | </TD></TR></TABLE></CENTER> |
---|
353 | <P>The reply is only a single octet. |
---|
354 | Some defective implementations of RFC1179 send a LF after the octet, |
---|
355 | which makes life very difficult. |
---|
356 | LPRng makes an effort to detect these non-conforming RFC1179 systems |
---|
357 | and will accept jobs from them. |
---|
358 | However, it will not send jobs to them. |
---|
359 | <P>If LPRng sends a reject code, as an extension to RFC1179 it also |
---|
360 | sends an error message. Note that the values for error codes |
---|
361 | are not defined, |
---|
362 | nor are their causes. |
---|
363 | LPRng uses the following values for error codes, |
---|
364 | which appear to be compatible with many, |
---|
365 | but not all, of the BSD LPD based systems: |
---|
366 | <CENTER><TABLE BORDER><TR><TD> |
---|
367 | <BR> |
---|
368 | Code</TD><TD>Error</TD></TR><TR><TD> |
---|
369 | \000</TD><TD>Accepted, proceed</TD></TR><TR><TD> |
---|
370 | \001</TD><TD>Queue not accepting jobs</TD></TR><TR><TD> |
---|
371 | \002</TD><TD>Queue temporarily full, retry later</TD></TR><TR><TD> |
---|
372 | \003</TD><TD>Bad job format, do not retry</TD></TR><TR><TD> |
---|
373 | |
---|
374 | </TD></TR></TABLE></CENTER> |
---|
375 | <P>When the sender gets the reply indicating success, |
---|
376 | it sends the <CODE>nnnn</CODE> bytes of the control or data file, |
---|
377 | followed by a <CODE>\000</CODE> octet. |
---|
378 | The receiver will then reply as above; |
---|
379 | a single <CODE>\000</CODE> octet indicating success. |
---|
380 | <P>The above procedure is carried out until all data files and the control |
---|
381 | file of a job are transferred. |
---|
382 | <P>RFC1179 is silent on the following issues: |
---|
383 | <OL> |
---|
384 | <LI>When sending a job, |
---|
385 | do you send the control file first, followed by the data file(s), |
---|
386 | or the data files first?</LI> |
---|
387 | <LI>When sending multiple jobs, |
---|
388 | can you send them on a single connection, |
---|
389 | or do you have to establish a new connection for each job?</LI> |
---|
390 | </OL> |
---|
391 | <P>LPRng will <EM>accept</EM> jobs whether they are sent control or data files |
---|
392 | first. |
---|
393 | By default, |
---|
394 | it sends the control file first, |
---|
395 | followed by the data file. |
---|
396 | If the destination system requires that the data files |
---|
397 | be sent first, |
---|
398 | the <CODE>send_data_first</CODE> printcap option can be used to force |
---|
399 | data files to be sent first. |
---|
400 | <P>RFC1179 states that: |
---|
401 | <BLOCKQUOTE> |
---|
402 | The name of the control file ... should start with ASCII "cfA", followed by a three |
---|
403 | digit job number, followed by the host name which has constructed the |
---|
404 | control file. |
---|
405 | </BLOCKQUOTE> |
---|
406 | <P>The <EM>should</EM> in this wording indicates that this is simply a guideline, |
---|
407 | and that other formats are possible. |
---|
408 | Some of the major problems with this format are as follows: |
---|
409 | <OL> |
---|
410 | <LI> The restriction to 3 digits means that at most 1000 jobs |
---|
411 | can be in a queue. |
---|
412 | Strangely, some systems generate far more than 1000 jobs a day, |
---|
413 | and need to archive them on a regular basis. |
---|
414 | The <CODE>longnumber</CODE> option will allow LPRng to use a 6 digit |
---|
415 | job number for files in the print queue.</LI> |
---|
416 | <LI>The host name format is not specified. |
---|
417 | Some implementations consider that this is the short host name, |
---|
418 | while others think it is the fully qualified domain name (FQDN). |
---|
419 | LPRng, |
---|
420 | by default, |
---|
421 | will use the FQDN host name. |
---|
422 | However, the <CODE>use_shorthost</CODE> option will force it to |
---|
423 | use short host names in control and data files.</LI> |
---|
424 | <LI>The <CODE>cfA</CODE> control file name was modified to allow the |
---|
425 | job priority to be used as the A letter of the control file. |
---|
426 | By default, |
---|
427 | this is A (lowest, i.e. <CODE>cfA</CODE>) and |
---|
428 | but can range to Z (highest, i.e. <CODE>cfZ</CODE>). |
---|
429 | All known spoolers except LPRng seem to ignore the actual value of |
---|
430 | the letter.</LI> |
---|
431 | </OL> |
---|
432 | <H2><A NAME="ss18.4">18.4 Data File Transfer</A> |
---|
433 | </H2> |
---|
434 | |
---|
435 | <P>As discussed, |
---|
436 | a data file is transferred using the command below. |
---|
437 | <CENTER><TABLE BORDER><TR><TD> |
---|
438 | <BR> |
---|
439 | Command</TD><TD>Purpose</TD></TR><TR><TD> |
---|
440 | \003nnnn dfname</TD><TD>data file transfer</TD></TR><TR><TD> |
---|
441 | |
---|
442 | </TD></TR></TABLE></CENTER> |
---|
443 | <P>From RFC1179: |
---|
444 | <BLOCKQUOTE> |
---|
445 | The data file may contain any 8 bit values at all. The total number |
---|
446 | of bytes in the stream may be sent as the first operand, otherwise |
---|
447 | the field should be cleared to 0. The name of the data file should |
---|
448 | start with ASCII "dfA". This should be followed by a three digit job |
---|
449 | number. The job number should be followed by the host name which has |
---|
450 | constructed the data file. Interpretation of the contents of the |
---|
451 | data file is determined by the contents of the corresponding control |
---|
452 | file. |
---|
453 | </BLOCKQUOTE> |
---|
454 | <P>There are several surprises in RFC1179. |
---|
455 | <OL> |
---|
456 | <LI>Apparently a job should only consist of a single data file. |
---|
457 | This is a severe limitation, and in fact the BSD LPR and other |
---|
458 | print spoolers process jobs with multiple data files. |
---|
459 | By convention, these data files have names of the form |
---|
460 | <CODE>dfA</CODE>, |
---|
461 | <CODE>dfB</CODE>, |
---|
462 | ... |
---|
463 | <CODE>dfZ</CODE>, |
---|
464 | <CODE>dfa</CODE>, |
---|
465 | <CODE>dfz</CODE>.</LI> |
---|
466 | <LI>The RFC does not specify that the control file and data file job numbers |
---|
467 | must be identical. |
---|
468 | Most implementations follow this convention, which simplifies life |
---|
469 | tremendously.</LI> |
---|
470 | <LI>The RFC does not specify that the control file and data file job host names |
---|
471 | must be identical. |
---|
472 | Most implementations follow this convention, which simplifies life |
---|
473 | tremendously.</LI> |
---|
474 | <LI>A zero length data file does not cause a data transfer to take place. |
---|
475 | LPRng modifies this action to be slightly different. |
---|
476 | When a zero length data file transfer is indicated, |
---|
477 | all of the input until the connection is closed is used as the |
---|
478 | contents of the data file. |
---|
479 | <P>When 'piping' into the <CODE>lpr</CODE> program, |
---|
480 | this can be very useful as it eliminates the need to create temporary |
---|
481 | files on the senders host. |
---|
482 | The <CODE>lpr -k</CODE> option for details. |
---|
483 | Note that some print spoolers do not use this interpretation, |
---|
484 | and this option should be used carefully. |
---|
485 | </LI> |
---|
486 | </OL> |
---|
487 | <H2><A NAME="ss18.5">18.5 Control File Contents</A> |
---|
488 | </H2> |
---|
489 | |
---|
490 | <P>The control file consists of a set of lines which either provide |
---|
491 | printing information or specify data files to be printed. |
---|
492 | The information lines start with upper case letters or digits, |
---|
493 | while the data files lines start with lower case letters. |
---|
494 | Here is a sample control file: |
---|
495 | <BLOCKQUOTE><CODE> |
---|
496 | <PRE> |
---|
497 | Hastart4.astart.com |
---|
498 | J(stdin) |
---|
499 | CA |
---|
500 | Lpapowell |
---|
501 | Apapowell@astart4+955 |
---|
502 | Ppapowell |
---|
503 | fdfA955astart4.astart.com |
---|
504 | N(stdin) |
---|
505 | UdfA955astart4.astart.com |
---|
506 | </PRE> |
---|
507 | </CODE></BLOCKQUOTE> |
---|
508 | <P>The following are the letters and their meanings in the control file. |
---|
509 | <CENTER><TABLE BORDER><TR><TD> |
---|
510 | <BR> |
---|
511 | X</TD><TD>RFC1179</TD><TD>Meaning</TD></TR><TR><TD> |
---|
512 | A</TD><TD>LPRng</TD><TD>Identifier for job</TD></TR><TR><TD> |
---|
513 | C</TD><TD>RFC1179</TD><TD>Class for banner page</TD></TR><TR><TD> |
---|
514 | H</TD><TD>RFC1179</TD><TD>Host name</TD></TR><TR><TD> |
---|
515 | I</TD><TD>RFC1179</TD><TD>Indent Printing</TD></TR><TR><TD> |
---|
516 | J</TD><TD>RFC1179</TD><TD>Job name for banner page</TD></TR><TR><TD> |
---|
517 | L</TD><TD>RFC1179</TD><TD>Print banner page</TD></TR><TR><TD> |
---|
518 | M</TD><TD>RFC1179</TD><TD>Mail When Printed</TD></TR><TR><TD> |
---|
519 | N</TD><TD>RFC1179</TD><TD>Name of source file</TD></TR><TR><TD> |
---|
520 | P</TD><TD>RFC1179</TD><TD>User identification</TD></TR><TR><TD> |
---|
521 | Q</TD><TD>LPRng</TD><TD>Queue name</TD></TR><TR><TD> |
---|
522 | R</TD><TD>LPRng</TD><TD>Accounting info</TD></TR><TR><TD> |
---|
523 | S</TD><TD>RFC1179</TD><TD>Symbolic link data</TD></TR><TR><TD> |
---|
524 | T</TD><TD>RFC1179</TD><TD>Title for pr</TD></TR><TR><TD> |
---|
525 | U</TD><TD>RFC1179</TD><TD>Unlink data file</TD></TR><TR><TD> |
---|
526 | W</TD><TD>RFC1179</TD><TD>Width of output</TD></TR><TR><TD> |
---|
527 | Z</TD><TD>LPRng</TD><TD>Filter options</TD></TR><TR><TD> |
---|
528 | 1</TD><TD>RFC1179</TD><TD>troff R font</TD></TR><TR><TD> |
---|
529 | 2</TD><TD>RFC1179</TD><TD>troff I font</TD></TR><TR><TD> |
---|
530 | 3</TD><TD>RFC1179</TD><TD>troff B font</TD></TR><TR><TD> |
---|
531 | 4</TD><TD>RFC1179</TD><TD>troff S font</TD></TR><TR><TD> |
---|
532 | c</TD><TD>RFC1179</TD><TD>Plot CIF file</TD></TR><TR><TD> |
---|
533 | d</TD><TD>RFC1179</TD><TD>Print DVI file</TD></TR><TR><TD> |
---|
534 | f</TD><TD>RFC1179</TD><TD>Print formatted file</TD></TR><TR><TD> |
---|
535 | g</TD><TD>RFC1179</TD><TD>Plot file</TD></TR><TR><TD> |
---|
536 | k</TD><TD>RFC1179</TD><TD>Reserved for use by Kerberized LPR clients and servers.</TD></TR><TR><TD> |
---|
537 | l</TD><TD>RFC1179</TD><TD>Print file leaving control characters</TD></TR><TR><TD> |
---|
538 | n</TD><TD>RFC1179</TD><TD>Print ditroff output file</TD></TR><TR><TD> |
---|
539 | o</TD><TD>RFC1179</TD><TD>Print Postscript output file</TD></TR><TR><TD> |
---|
540 | p</TD><TD>RFC1179</TD><TD>Print file with 'pr' format</TD></TR><TR><TD> |
---|
541 | t</TD><TD>RFC1179</TD><TD>Print troff output file</TD></TR><TR><TD> |
---|
542 | v</TD><TD>RFC1179</TD><TD>Print raster file</TD></TR><TR><TD> |
---|
543 | z</TD><TD>RFC1179</TD><TD>Reserved for future use with the Palladium print system.</TD></TR><TR><TD> |
---|
544 | |
---|
545 | </TD></TR></TABLE></CENTER> |
---|
546 | <P>The |
---|
547 | <CODE>A</CODE> (Identifier) |
---|
548 | line was introduced to record a unique |
---|
549 | system wide job identifier for LPRng submitted jobs. |
---|
550 | This is basically formed from the user name, |
---|
551 | job number, and host at the time of submission. |
---|
552 | For example: <CODE>papowell@astart4+955</CODE> |
---|
553 | is job number 995 submitted by papowell from host astart4. |
---|
554 | <P>The |
---|
555 | <CODE>C</CODE> (Class) |
---|
556 | line is set by the <CODE>lpr -C class</CODE> option, |
---|
557 | and the value can be used to control printing. |
---|
558 | For example, |
---|
559 | the <CODE>lpc class zone </CODE> command would restrict job printing to |
---|
560 | only jobs with class <CODE>zone</CODE>. |
---|
561 | <P>The |
---|
562 | <CODE>H</CODE> (hostname), |
---|
563 | <CODE>P</CODE> (username), |
---|
564 | and |
---|
565 | <CODE>J</CODE> (jobname) |
---|
566 | fields are used to identify the host and user which sent the job, |
---|
567 | and to provide information to be displayed by <CODE>lpq</CODE> |
---|
568 | when reporting job status. |
---|
569 | <P>The |
---|
570 | <CODE>L</CODE> (print banner page) field is one that has caused many |
---|
571 | problems for users. |
---|
572 | RFC1179 indicates that its presence causes the banner page to be printed, |
---|
573 | and its absence suppresses banner pages. |
---|
574 | The <CODE>lpr -h</CODE> option suppresses putting this line into the |
---|
575 | control file. |
---|
576 | Usually the <CODE>L</CODE> field is a duplicate of the <CODE>P</CODE> |
---|
577 | field. |
---|
578 | <P>The <CODE>M</CODE> (mail information) |
---|
579 | field supplies a mail address for LPRng to send mail to when |
---|
580 | a job is completed. |
---|
581 | See |
---|
582 | <A HREF="LPRng-HOWTO-17.html#mail">LPR -m and user logging</A> |
---|
583 | for more details. |
---|
584 | <P>The <CODE>N</CODE> (file name) field is usually provided to identify |
---|
585 | the file name corresponding to the data file. |
---|
586 | This can be used to print names on page separators, etc. |
---|
587 | LPRng largely ignores this line. |
---|
588 | <P>The |
---|
589 | <CODE>I</CODE> (indent) |
---|
590 | and |
---|
591 | <CODE>W</CODE> (width) |
---|
592 | fields are supposed to specify a page indent and width for printing. |
---|
593 | These fields are passed to filters if they are present. |
---|
594 | <P>The <CODE>Q</CODE> (queue name) |
---|
595 | field is an LPRng extension, |
---|
596 | and contains the name of the print queue the job was originally sent to. |
---|
597 | See |
---|
598 | <A HREF="LPRng-HOWTO-11.html#qq">qq printcap option</A> for details. |
---|
599 | <P>The <CODE>R</CODE> (accounting info) field was added by LPRng to allow |
---|
600 | a specified account to be billed for job printing. |
---|
601 | The <CODE>lpr -Rname</CODE> option can be used to specify the accounting name. |
---|
602 | <P>The |
---|
603 | <CODE>S</CODE> (symbolic link) |
---|
604 | and |
---|
605 | <CODE>U</CODE> (unlink after printing) |
---|
606 | lines were used by the original BSD LPD print system to control |
---|
607 | how it passed files to the print server. |
---|
608 | LPRng ignores these lines. |
---|
609 | In fact, it will remove <CODE>S</CODE> lines and force the <CODE>U</CODE> |
---|
610 | lines to refer only to job data files. |
---|
611 | This closes a nasty security loophole on non-LPRng print spoolers. |
---|
612 | <P>The <CODE>T</CODE> (pr job title) is used with the <CODE>lpr -p</CODE> |
---|
613 | operation to supply a banner to the <CODE>pr</CODE> program. |
---|
614 | <P>The <CODE>Z</CODE> (filter options) value is specified with |
---|
615 | <CODE>lpr -Zoption</CODE> and is passed to the data file filters |
---|
616 | during the printing operation. |
---|
617 | See |
---|
618 | <A HREF="LPRng-HOWTO-13.html#secfilter">Filters</A> for details on how the |
---|
619 | this is used during the printing process. |
---|
620 | <P>All of the lower case letters are reserved for format specifications for |
---|
621 | data files. |
---|
622 | In the control file, these are followed by the name of the data file |
---|
623 | to which they correspond. |
---|
624 | While in principle different data files in the control file can have |
---|
625 | different formats, |
---|
626 | this has not been implemented in any known spooling system. |
---|
627 | See |
---|
628 | <A HREF="LPRng-HOWTO-13.html#secfilter">Filters</A> for details on how the |
---|
629 | data file formats are used during the printing process. |
---|
630 | <H2><A NAME="ss18.6">18.6 LPQ Requests</A> |
---|
631 | </H2> |
---|
632 | |
---|
633 | <P>The RFC1179 protocol specifies that <CODE>lpq</CODE> print status |
---|
634 | requests can be sent to the <CODE>lpd</CODE> server. |
---|
635 | The lpq requests have the format: |
---|
636 | <BLOCKQUOTE><CODE> |
---|
637 | <PRE> |
---|
638 | \003printer [id]* \n short |
---|
639 | \004printer [id]* \n long |
---|
640 | \009printer [id]* \n LPRng extension- verbose |
---|
641 | </PRE> |
---|
642 | </CODE></BLOCKQUOTE> |
---|
643 | <P>The <CODE>lpd</CODE> print server will then return queue status |
---|
644 | and close the data connection. |
---|
645 | <P>RFC1179 does not state in any manner what the format of the queue status |
---|
646 | should be. |
---|
647 | Thus, implementors have been free to augment or change the status as |
---|
648 | they like. |
---|
649 | Even the BSD LPR status format has been changed from different versions. |
---|
650 | <P>See |
---|
651 | <A HREF="LPRng-HOWTO-17.html#statusref">Status Monitoring and Logging</A> |
---|
652 | for information on the formats returned. |
---|
653 | <P>The <CODE>id</CODE> values are used to select the jobs to be displayed. |
---|
654 | LPRng displays any job whose ID, hostname, or user name information |
---|
655 | from the control file |
---|
656 | <CODE>A</CODE>, |
---|
657 | <CODE>H</CODE>, |
---|
658 | or |
---|
659 | <CODE>P</CODE> fields match any of the id values. |
---|
660 | <P>Note that since there is no identification of the information requestor, |
---|
661 | then restriction of information is almost impossible. |
---|
662 | <P> |
---|
663 | <H2><A NAME="ss18.7">18.7 LPRM Requests</A> |
---|
664 | </H2> |
---|
665 | |
---|
666 | <P>The RFC1179 protocol specifies that <CODE>lprm</CODE> job removal |
---|
667 | requests can be sent to the <CODE>lpd</CODE> server. |
---|
668 | The lpq requests have the format: |
---|
669 | <BLOCKQUOTE><CODE> |
---|
670 | <PRE> |
---|
671 | \005printer user [id]* \n |
---|
672 | </PRE> |
---|
673 | </CODE></BLOCKQUOTE> |
---|
674 | <P>The <CODE>lpd</CODE> print server will search the specified print queue |
---|
675 | and remove any job whose ID, hostname, or user name information |
---|
676 | from the control file |
---|
677 | <CODE>A</CODE>, |
---|
678 | <CODE>H</CODE>, |
---|
679 | or |
---|
680 | <CODE>P</CODE> fields match any of the id values |
---|
681 | and for which the user has permission to perform a removal operation. |
---|
682 | See the |
---|
683 | <A HREF="LPRng-HOWTO-14.html#lpdpermsref">/etc/lpd.perms</A> file for details on |
---|
684 | permissions. |
---|
685 | <P>Most RFC1179 compatible spoolers use the user information in the |
---|
686 | request as the name of the user which spooled the job. |
---|
687 | However, |
---|
688 | in a network environment this is extremely easy to fabricate, |
---|
689 | and is at best a weak type of authentication. |
---|
690 | <H2><A NAME="lpcreread"></A> <A NAME="ss18.8">18.8 LPC Requests</A> |
---|
691 | </H2> |
---|
692 | |
---|
693 | <P>LPRng has extended the RFC1179 protocol to allow queue and printer control |
---|
694 | commands to be sent to the LPD server. |
---|
695 | The format of these commands are: |
---|
696 | <P> |
---|
697 | <BLOCKQUOTE><CODE> |
---|
698 | <PRE> |
---|
699 | \006printer user key [options] |
---|
700 | </PRE> |
---|
701 | </CODE></BLOCKQUOTE> |
---|
702 | <P>The following commands are supported. |
---|
703 | <CENTER><TABLE BORDER><TR><TD> |
---|
704 | <BR> |
---|
705 | Command</TD><TD>Operation</TD></TR><TR><TD> |
---|
706 | <CODE> active [printer[@host]]</CODE></TD><TD>check to see if server accepting connections</TD></TR><TR><TD> |
---|
707 | <CODE> abort (printer[@host] | all) </CODE></TD><TD>terminate server process printing job</TD></TR><TR><TD> |
---|
708 | <CODE> disable (printer[@host] | all) </CODE></TD><TD>disable queueing</TD></TR><TR><TD> |
---|
709 | <CODE> debug (printer[@host] | all) debugparms </CODE></TD><TD>set debug level for printer</TD></TR><TR><TD> |
---|
710 | <CODE> enable (printer[@host] | all) </CODE></TD><TD>enable queueing</TD></TR><TR><TD> |
---|
711 | <CODE> hold (printer[@host] | all) (name[@host] | job | all)* </CODE></TD><TD>hold job</TD></TR><TR><TD> |
---|
712 | <CODE> holdall (printer[@host] | all) </CODE></TD><TD>hold all jobs on</TD></TR><TR><TD> |
---|
713 | <CODE> kill (printer[@host] | all) </CODE></TD><TD>stop and restart server</TD></TR><TR><TD> |
---|
714 | <CODE> lpd [printer[@host]] </CODE></TD><TD>get LPD PID for server</TD></TR><TR><TD> |
---|
715 | <CODE> lpq (printer[@host] | all) (name[@host] | job | all)* </CODE></TD><TD>invoke LPQ</TD></TR><TR><TD> |
---|
716 | <CODE> lprm (printer[@host] | all) (name[@host]|host|job| all)* </CODE></TD><TD>invoke LPRM</TD></TR><TR><TD> |
---|
717 | <CODE> move printer (user|jobid)* target </CODE></TD><TD>move jobs to new queue</TD></TR><TR><TD> |
---|
718 | <CODE> noholdall (printer[@host] | all) </CODE></TD><TD>hold all jobs off</TD></TR><TR><TD> |
---|
719 | <CODE> printcap (printer[@host] | all) </CODE></TD><TD>report printcap values</TD></TR><TR><TD> |
---|
720 | <CODE> quit </CODE></TD><TD>exit LPC</TD></TR><TR><TD> |
---|
721 | <CODE> redirect (printer[@host] | all) (printer@host | off )* </CODE></TD><TD>redirect jobs</TD></TR><TR><TD> |
---|
722 | <CODE> release (printer[@host] | all) (name[@host] | job | all)* </CODE></TD><TD>release job</TD></TR><TR><TD> |
---|
723 | <CODE> reread [printer[@host]]</CODE></TD><TD>LPD reread database information</TD></TR><TR><TD> |
---|
724 | <CODE> start (printer[@host] | all) </CODE></TD><TD>start printing</TD></TR><TR><TD> |
---|
725 | <CODE> status (printer[@host] | all) </CODE></TD><TD>status of printers</TD></TR><TR><TD> |
---|
726 | <CODE> stop (printer[@host] | all) </CODE></TD><TD>stop printing</TD></TR><TR><TD> |
---|
727 | <CODE> topq (printer[@host] | all) (name[@host] | job | all)* </CODE></TD><TD>reorder job</TD></TR><TR><TD> |
---|
728 | <CODE> defaultq </CODE></TD><TD>default queue for LPD server</TD></TR><TR><TD> |
---|
729 | <CODE> local (printer | all) </CODE></TD><TD>client printcap and configuration information</TD></TR><TR><TD> |
---|
730 | <CODE> server (printer | all) </CODE></TD><TD>server printcap and configuration information</TD></TR><TR><TD> |
---|
731 | |
---|
732 | </TD></TR></TABLE></CENTER> |
---|
733 | <P>Many of these commands support extremely specialized operations for |
---|
734 | print queue management, |
---|
735 | However, the following are the most commonly used and are supported by |
---|
736 | the BSD LPD print spooling system as well: |
---|
737 | <UL> |
---|
738 | <LI><CODE> start, stop, enable, disable </CODE><BR> |
---|
739 | Start and stop will start and stop printing for a specified queue. |
---|
740 | Enable and disable enable and disable sending and/or accepting jobs |
---|
741 | for the queue.</LI> |
---|
742 | <LI><CODE> abort, kill </CODE><BR> |
---|
743 | Abort will cause the process doing the actual job printing to be terminated. |
---|
744 | Kill does an abort, and then restarts the printing process. |
---|
745 | These commands are used to restart a queue printing after some disaster.</LI> |
---|
746 | <LI><CODE> topq </CODE> |
---|
747 | Places selected jobs at the top of the print queue.</LI> |
---|
748 | <LI><CODE> status </CODE><BR> |
---|
749 | Shows a status display of the print spools on the server.</LI> |
---|
750 | </UL> |
---|
751 | <P>The following commands are extensions to the basic set provided by the |
---|
752 | BSD LPD system. |
---|
753 | <UL> |
---|
754 | <LI><CODE> lpq, lprm </CODE><BR> |
---|
755 | Invokes the lpq or lprm program from lpc. |
---|
756 | Useful when in the interactive mode.</LI> |
---|
757 | <LI><CODE> hold, holdall, release </CODE><BR> |
---|
758 | The hold command will cause the selected jobs to be held until |
---|
759 | released. |
---|
760 | The holdall jobs sets all jobs submitted to the queue to be held until |
---|
761 | released. |
---|
762 | The release command releases jobs for printing. |
---|
763 | If a job has had an error and is in the error state, |
---|
764 | the release command will cause it to be reprinted.</LI> |
---|
765 | <LI><CODE> move, redirect </CODE><BR> |
---|
766 | The move command will move selected jobs to the specified spool queue. |
---|
767 | The redirect command sends all jobs submitted to the queue to be |
---|
768 | sent to the specified queue.</LI> |
---|
769 | <LI><CODE> active, lpd, reread </CODE><BR> |
---|
770 | The active command will connect to the server for the printer. |
---|
771 | This is used to check to see if non-LPRng print servers are active. |
---|
772 | The lpd command will connect to the server and |
---|
773 | get the process id (PID) of the <CODE>lpd</CODE> server. |
---|
774 | The reread command causes a SIGHUP signal to be sent to the lpd process, |
---|
775 | causing it to reread the |
---|
776 | <CODE>/etc/lpd.conf</CODE>, |
---|
777 | <CODE>/etc/printcap</CODE>, |
---|
778 | or |
---|
779 | <CODE>/etc/lpd.perms</CODE> files. |
---|
780 | This is usually done when some important configuration information has |
---|
781 | been modified and the administrator wants to have the server use the |
---|
782 | new information.</LI> |
---|
783 | <LI><CODE> debug </CODE><BR> |
---|
784 | This is a desperation facility for developers that allows dynamic enabling |
---|
785 | of debug information generation. |
---|
786 | Not normally used in general operation.</LI> |
---|
787 | <LI><CODE> local, server </CODE><BR> |
---|
788 | These commands will print out the configuration information in the |
---|
789 | local |
---|
790 | <CODE>/etc/lpd.conf</CODE> file, |
---|
791 | as well as the printcap information for the specified printers; |
---|
792 | <CODE>local</CODE> |
---|
793 | prints what the LPRng clients (<CODE>lpr, lpq, ...</CODE>) would use |
---|
794 | while |
---|
795 | <CODE>server</CODE> |
---|
796 | prints what the LPRng server (<CODE>lpd</CODE>) would use if running on this host. |
---|
797 | This is an extremely useful diagnostic tool for administrators. |
---|
798 | Not normally used in general operation.</LI> |
---|
799 | </UL> |
---|
800 | <H2><A NAME="blocktransfer"></A> <A NAME="sendblockformat"></A> <A NAME="ss18.9">18.9 Block Job Transfer</A> |
---|
801 | </H2> |
---|
802 | |
---|
803 | <P>Options used: |
---|
804 | <UL> |
---|
805 | <LI> <CODE>send_block_format</CODE><EM> Transfer job as a block</EM></LI> |
---|
806 | </UL> |
---|
807 | <P>In normal job transfer operations, |
---|
808 | the sender and receiver have a handshake interaction in order to transfer |
---|
809 | a print job. |
---|
810 | Each file is sent individually. |
---|
811 | The <CODE>send_block_format</CODE> option forces |
---|
812 | a Block Job Transfer operation. |
---|
813 | This causes the sender to transfer a single file containing all the |
---|
814 | job printing information, |
---|
815 | including control file and data files. |
---|
816 | <P>The transfer command line has the form: |
---|
817 | <BLOCKQUOTE><CODE> |
---|
818 | <PRE> |
---|
819 | \007printer size\n |
---|
820 | </PRE> |
---|
821 | </CODE></BLOCKQUOTE> |
---|
822 | <P>The receiver will return any acknowledgement of a single 0 octet, |
---|
823 | and then the size bytes of the job will be transferred by the sender. |
---|
824 | At the end of the transfer a single 0 octet is added, |
---|
825 | and the receiver will indicate success by returning a single 0 octet. |
---|
826 | Any other value returned by the receiver indicates an error condition. |
---|
827 | <P>The file transferred by the sender is simply the command lines that it |
---|
828 | would have normally sent for job transfer, |
---|
829 | followed by the control or data file values. |
---|
830 | <H2><A NAME="ss18.10">18.10 Authenticated Transfer</A> |
---|
831 | </H2> |
---|
832 | |
---|
833 | <P>RFC1179 does not provide any authentication or encryption mechanism |
---|
834 | for the transfer of jobs or commands to the <CODE>lpd</CODE> |
---|
835 | print server. |
---|
836 | The Authenticated Transfer operation was added to allow an encrypted |
---|
837 | or authenticated transfer of print jobs or commands. |
---|
838 | <P>Since there are various restrictions on the incorporation of authentication |
---|
839 | facilities into programs, |
---|
840 | LPRng supports authentication by providing a simple interface to |
---|
841 | encryption programs. |
---|
842 | <P>The idea is that when authentication is required when sending a job, |
---|
843 | LPRng will generate a block transfer job as described for the |
---|
844 | <A HREF="#blocktransfer">Block Transfer operation,</A> |
---|
845 | and then invoke a set of programs to encryt and transfer the file, |
---|
846 | and encrypt and transfer the returned status. |
---|
847 | <P>Similarly, |
---|
848 | when sending a command, |
---|
849 | the command information will be placed in a file |
---|
850 | and the encrypted file will be transferred. |
---|
851 | <P>This technique means that the programs and support to do encryption |
---|
852 | are external to LPRng, |
---|
853 | and can use any type of method that they choose to implement the |
---|
854 | secure and/or authenticated transfer. |
---|
855 | <P>See |
---|
856 | <A HREF="LPRng-HOWTO-16.html#authref">Authentication and Encryption</A> |
---|
857 | for details on the authentication interface. |
---|
858 | <HR> |
---|
859 | <A HREF="LPRng-HOWTO-19.html">Next</A> |
---|
860 | <A HREF="LPRng-HOWTO-17.html">Previous</A> |
---|
861 | <A HREF="LPRng-HOWTO.html#toc18">Contents</A> |
---|
862 | </BODY> |
---|
863 | </HTML> |
---|