• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/LPRng/DOCS/LPRng-Reference-Multipart/
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<html>
4  <head>
5    <meta name="generator" content="HTML Tidy, see www.w3.org">
6    <title>Job Transfer</title>
7    <meta name="GENERATOR" content=
8    "Modular DocBook HTML Stylesheet Version 1.7">
9    <link rel="HOME" title=" LPRng Reference Manual" href=
10    "index.htm">
11    <link rel="UP" title="RFC 1179 - Line Printer Daemon Protocol "
12    href="rfc1179ref.htm">
13    <link rel="PREVIOUS" title="Protocol Requests and Replies "
14    href="remotesupport.htm">
15    <link rel="NEXT" title="Data File Transfer" href="x10191.htm">
16  </head>
17
18  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
19  "#0000FF" vlink="#840084" alink="#0000FF">
20    <div class="NAVHEADER">
21      <table summary="Header navigation table" width="100%" border=
22      "0" cellpadding="0" cellspacing="0">
23        <tr>
24          <th colspan="3" align="center">LPRng Reference Manual: 5
25          Sep 2003 (For LPRng-3.8.22)</th>
26        </tr>
27
28        <tr>
29          <td width="10%" align="left" valign="bottom"><a href=
30          "remotesupport.htm" accesskey="P">Prev</a></td>
31
32          <td width="80%" align="center" valign="bottom">Chapter
33          19. RFC 1179 - Line Printer Daemon Protocol</td>
34
35          <td width="10%" align="right" valign="bottom"><a href=
36          "x10191.htm" accesskey="N">Next</a></td>
37        </tr>
38      </table>
39      <hr align="LEFT" width="100%">
40    </div>
41
42    <div class="SECT1">
43      <h1 class="SECT1"><a name="JOBTRANSFER">19.3. Job
44      Transfer</a></h1>
45
46      <p>Options used:</p>
47
48      <ul>
49        <li>
50          <p><var class="LITERAL">longnumber</var> FLAG <span
51          class="emphasis"><i class="EMPHASIS">Long job number (6
52          digits)</i></span></p>
53        </li>
54
55        <li>
56          <p><var class="LITERAL">send_data_first</var> FLAG <span
57          class="emphasis"><i class="EMPHASIS">Send data files
58          first</i></span></p>
59        </li>
60
61        <li>
62          <p><var class="LITERAL">use_shorthost</var><span class=
63          "emphasis"><i class="EMPHASIS">Use short
64          hostname</i></span></p>
65        </li>
66      </ul>
67      <br>
68      <br>
69
70      <p>A job transfer operation starts with a job transfer
71      request, followed by several file transfer operations. At the
72      end of the file transfers, the connection should be
73      closed.</p>
74
75      <p>A file transfer request has the form:</p>
76
77      <div class="INFORMALTABLE">
78        <a name="AEN10100"></a>
79
80        <table border="1" frame="border" rules="all" class=
81        "CALSTABLE">
82          <col>
83          <col>
84
85          <thead>
86            <tr>
87              <th>Command</th>
88
89              <th>Purpose</th>
90            </tr>
91          </thead>
92
93          <tbody>
94            <tr>
95              <td>\001\n</td>
96
97              <td>abort</td>
98            </tr>
99
100            <tr>
101              <td>\002nnnn cfname</td>
102
103              <td>control file transfer</td>
104            </tr>
105
106            <tr>
107              <td>\003nnnn dfname</td>
108
109              <td>data file transfer</td>
110            </tr>
111          </tbody>
112        </table>
113      </div>
114      <br>
115      <br>
116
117      <p>The abort operation is used to terminate job transfer and
118      indicate that the job should not be processed for printing.
119      The connection will be closed and the partly transferred job
120      will be discarded.</p>
121
122      <p>The control file and data file transfer commands have a
123      length (in bytes) of the file and the name of the file to be
124      transferred. When the command is received, the server will
125      reply with a status line:</p>
126
127      <div class="INFORMALTABLE">
128        <a name="AEN10118"></a>
129
130        <table border="1" frame="border" rules="all" class=
131        "CALSTABLE">
132          <col>
133          <col>
134
135          <thead>
136            <tr>
137              <th>Status</th>
138
139              <th>Purpose</th>
140            </tr>
141          </thead>
142
143          <tbody>
144            <tr>
145              <td>\000</td>
146
147              <td>Accepted, proceed</td>
148            </tr>
149
150            <tr>
151              <td>\nnn</td>
152
153              <td>Rejected with error code</td>
154            </tr>
155          </tbody>
156        </table>
157      </div>
158      <br>
159      <br>
160
161      <p>The reply is only a single octet. Some defective
162      implementations of RFC1179 send a LF after the octet, which
163      makes life very difficult. <b class="APPLICATION">LPRng</b>
164      makes an effort to detect these non-conforming RFC1179
165      systems and will accept jobs from them. However, it will not
166      send jobs to them.</p>
167
168      <p>If <b class="APPLICATION">LPRng</b> sends a reject code,
169      as an extension to RFC1179 it also sends an error message.
170      Note that the values for error codes are not defined, nor are
171      their causes. <b class="APPLICATION">LPRng</b> uses the
172      following values for error codes, which appear to be
173      compatible with many, but not all, of the BSD <b class=
174      "APPLICATION">lpd</b> based systems:</p>
175
176      <div class="INFORMALTABLE">
177        <a name="AEN10137"></a>
178
179        <table border="1" frame="border" rules="all" class=
180        "CALSTABLE">
181          <col>
182          <col>
183
184          <thead>
185            <tr>
186              <th>Code</th>
187
188              <th>Error</th>
189            </tr>
190          </thead>
191
192          <tbody>
193            <tr>
194              <td>\000</td>
195
196              <td>Accepted, proceed</td>
197            </tr>
198
199            <tr>
200              <td>\001</td>
201
202              <td>Queue not accepting jobs</td>
203            </tr>
204
205            <tr>
206              <td>\002</td>
207
208              <td>Queue temporarily full, retry later</td>
209            </tr>
210
211            <tr>
212              <td>\003</td>
213
214              <td>Bad job format, do not retry</td>
215            </tr>
216          </tbody>
217        </table>
218      </div>
219      <br>
220      <br>
221
222      <p>When the sender gets the reply indicating success, it
223      sends the <var class="LITERAL">nnnn</var> bytes of the
224      control or data file, followed by a <var class=
225      "LITERAL">\000</var> octet. The receiver will then reply as
226      above; a single <var class="LITERAL">\000</var> octet
227      indicating success.</p>
228
229      <p>The above procedure is carried out until all data files
230      and the control file of a job are transferred.</p>
231
232      <p>RFC1179 is silent on the following issues:</p>
233
234      <ol type="1">
235        <li>
236          <p>When sending a job, do you send the control file
237          first, followed by the data file(s), or the data files
238          first?</p>
239        </li>
240
241        <li>
242          <p>When sending multiple jobs, can you send them on a
243          single connection, or do you have to establish a new
244          connection for each job?</p>
245        </li>
246      </ol>
247      <br>
248      <br>
249
250      <p><b class="APPLICATION">LPRng</b> will <span class=
251      "emphasis"><i class="EMPHASIS">accept</i></span> jobs whether
252      they are sent control or data files first. By default, it
253      sends the control file first, followed by the data file. If
254      the destination system requires that the data files be sent
255      first, the <var class="LITERAL">send_data_first</var>
256      printcap option can be used to force data files to be sent
257      first.</p>
258
259      <p>RFC1179 states that: <a name="AEN10172"></a></p>
260
261      <blockquote class="BLOCKQUOTE">
262        <p>The name of the control file ... should start with ASCII
263        "cfA", followed by a three digit job number, followed by
264        the host name which has constructed the control file.</p>
265      </blockquote>
266      <br>
267      <br>
268
269      <p>The <span class="emphasis"><i class=
270      "EMPHASIS">should</i></span> in this wording indicates that
271      this is simply a guideline, and that other formats are
272      possible. Some of the major problems with this format are as
273      follows:</p>
274
275      <ol type="1">
276        <li>
277          <p>The restriction to 3 digits means that at most 1000
278          jobs can be in a queue. Strangely, some systems generate
279          far more than 1000 jobs a day, and need to archive them
280          on a regular basis. The <var class=
281          "LITERAL">longnumber</var> option will allow <b class=
282          "APPLICATION">LPRng</b> to use a 6 digit job number for
283          files in the print queue.</p>
284        </li>
285
286        <li>
287          <p>The host name format is not specified. Some
288          implementations consider that this is the short host
289          name, while others think it is the fully qualified domain
290          name (FQDN). <b class="APPLICATION">LPRng</b>, by
291          default, will use the FQDN host name. However, the <var
292          class="LITERAL">use_shorthost</var> option will force it
293          to use short host names in control and data files.</p>
294        </li>
295
296        <li>
297          <p>The <var class="LITERAL">cfA</var> control file name
298          was modified to allow the job priority to be used as the
299          A letter of the control file. By default, this is A
300          (lowest, i.e. <var class="LITERAL">cfA</var>) and but can
301          range to Z (highest, i.e. <var class=
302          "LITERAL">cfZ</var>). All known spoolers except <b class=
303          "APPLICATION">LPRng</b> seem to ignore the actual value
304          of the letter.</p>
305        </li>
306      </ol>
307      <br>
308      <br>
309    </div>
310
311    <div class="NAVFOOTER">
312      <hr align="LEFT" width="100%">
313
314      <table summary="Footer navigation table" width="100%" border=
315      "0" cellpadding="0" cellspacing="0">
316        <tr>
317          <td width="33%" align="left" valign="top"><a href=
318          "remotesupport.htm" accesskey="P">Prev</a></td>
319
320          <td width="34%" align="center" valign="top"><a href=
321          "index.htm" accesskey="H">Home</a></td>
322
323          <td width="33%" align="right" valign="top"><a href=
324          "x10191.htm" accesskey="N">Next</a></td>
325        </tr>
326
327        <tr>
328          <td width="33%" align="left" valign="top">Protocol
329          Requests and Replies</td>
330
331          <td width="34%" align="center" valign="top"><a href=
332          "rfc1179ref.htm" accesskey="U">Up</a></td>
333
334          <td width="33%" align="right" valign="top">Data File
335          Transfer</td>
336        </tr>
337      </table>
338    </div>
339  </body>
340</html>
341
342