File: jobtransfer.htm

package info (click to toggle)
lprng 3.8.10-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 13,076 kB
  • ctags: 4,348
  • sloc: ansic: 35,394; sh: 10,756; perl: 2,210; makefile: 1,046
file content (326 lines) | stat: -rw-r--r-- 10,552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content="HTML Tidy, see www.w3.org">
    <title>Job Transfer</title>
    <meta name="GENERATOR" content=
    "Modular DocBook HTML Stylesheet Version 1.71 ">
    <link rel="HOME" title=" LPRng-HOWTO" href="index.htm">
    <link rel="UP" title="RFC 1179 - Line Printer Daemon Protocol "
    href="rfc1179ref.htm">
    <link rel="PREVIOUS" title="Protocol Requests and Replies "
    href="remotesupport.htm">
    <link rel="NEXT" title="Data File Transfer" href="x9971.htm">
  </head>

  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
  "#0000FF" vlink="#840084" alink="#0000FF">
    <div class="NAVHEADER">
      <table summary="Header navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <th colspan="3" align="center">LPRng-HOWTO: 1 Apr 2002
          (For LPRng-3.8.10)</th>
        </tr>

        <tr>
          <td width="10%" align="left" valign="bottom"><a href=
          "remotesupport.htm" accesskey="P">Prev</a></td>

          <td width="80%" align="center" valign="bottom">Chapter
          19. RFC 1179 - Line Printer Daemon Protocol</td>

          <td width="10%" align="right" valign="bottom"><a href=
          "x9971.htm" accesskey="N">Next</a></td>
        </tr>
      </table>
      <hr align="LEFT" width="100%">
    </div>

    <div class="SECT1">
      <h1 class="SECT1"><a name="JOBTRANSFER">19.3. Job
      Transfer</a></h1>

      <p>Options used:</p>

      <ul>
        <li>
          <p><tt class="LITERAL">longnumber</tt> FLAG <i class=
          "EMPHASIS">Long job number (6 digits)</i></p>
        </li>

        <li>
          <p><tt class="LITERAL">send_data_first</tt> FLAG <i
          class="EMPHASIS">Send data files first</i></p>
        </li>

        <li>
          <p><tt class="LITERAL">use_shorthost</tt><i class=
          "EMPHASIS">Use short hostname</i></p>
        </li>
      </ul>
      <br>
      <br>

      <p>A job transfer operation starts with a job transfer
      request, followed by several file transfer operations. At the
      end of the file transfers, the connection should be
      closed.</p>

      <p>A file transfer request has the form:</p>

      <div class="INFORMALTABLE">
        <a name="AEN9880"></a>

        <table border="1" class="CALSTABLE">
          <thead>
            <tr>
              <th align="LEFT" valign="TOP">Command</th>

              <th align="LEFT" valign="TOP">Purpose</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td align="LEFT" valign="TOP">\001\n</td>

              <td align="LEFT" valign="TOP">abort</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\002nnnn cfname</td>

              <td align="LEFT" valign="TOP">control file
              transfer</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\003nnnn dfname</td>

              <td align="LEFT" valign="TOP">data file transfer</td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <br>

      <p>The abort operation is used to terminate job transfer and
      indicate that the job should not be processed for printing.
      The connection will be closed and the partly transferred job
      will be discarded.</p>

      <p>The control file and data file transfer commands have a
      length (in bytes) of the file and the name of the file to be
      transferred. When the command is received, the server will
      reply with a status line:</p>

      <div class="INFORMALTABLE">
        <a name="AEN9898"></a>

        <table border="1" class="CALSTABLE">
          <thead>
            <tr>
              <th align="LEFT" valign="TOP">Status</th>

              <th align="LEFT" valign="TOP">Purpose</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td align="LEFT" valign="TOP">\000</td>

              <td align="LEFT" valign="TOP">Accepted, proceed</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\nnn</td>

              <td align="LEFT" valign="TOP">Rejected with error
              code</td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <br>

      <p>The reply is only a single octet. Some defective
      implementations of RFC1179 send a LF after the octet, which
      makes life very difficult. <b class="APPLICATION">LPRng</b>
      makes an effort to detect these non-conforming RFC1179
      systems and will accept jobs from them. However, it will not
      send jobs to them.</p>

      <p>If <b class="APPLICATION">LPRng</b> sends a reject code,
      as an extension to RFC1179 it also sends an error message.
      Note that the values for error codes are not defined, nor are
      their causes. <b class="APPLICATION">LPRng</b> uses the
      following values for error codes, which appear to be
      compatible with many, but not all, of the BSD <b class=
      "APPLICATION">lpd</b> based systems:</p>

      <div class="INFORMALTABLE">
        <a name="AEN9917"></a>

        <table border="1" class="CALSTABLE">
          <thead>
            <tr>
              <th align="LEFT" valign="TOP">Code</th>

              <th align="LEFT" valign="TOP">Error</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td align="LEFT" valign="TOP">\000</td>

              <td align="LEFT" valign="TOP">Accepted, proceed</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\001</td>

              <td align="LEFT" valign="TOP">Queue not accepting
              jobs</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\002</td>

              <td align="LEFT" valign="TOP">Queue temporarily full,
              retry later</td>
            </tr>

            <tr>
              <td align="LEFT" valign="TOP">\003</td>

              <td align="LEFT" valign="TOP">Bad job format, do not
              retry</td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <br>

      <p>When the sender gets the reply indicating success, it
      sends the <tt class="LITERAL">nnnn</tt> bytes of the control
      or data file, followed by a <tt class="LITERAL">\000</tt>
      octet. The receiver will then reply as above; a single <tt
      class="LITERAL">\000</tt> octet indicating success.</p>

      <p>The above procedure is carried out until all data files
      and the control file of a job are transferred.</p>

      <p>RFC1179 is silent on the following issues:</p>

      <ol type="1">
        <li>
          <p>When sending a job, do you send the control file
          first, followed by the data file(s), or the data files
          first?</p>
        </li>

        <li>
          <p>When sending multiple jobs, can you send them on a
          single connection, or do you have to establish a new
          connection for each job?</p>
        </li>
      </ol>
      <br>
      <br>

      <p><b class="APPLICATION">LPRng</b> will <i class=
      "EMPHASIS">accept</i> jobs whether they are sent control or
      data files first. By default, it sends the control file
      first, followed by the data file. If the destination system
      requires that the data files be sent first, the <tt class=
      "LITERAL">send_data_first</tt> printcap option can be used to
      force data files to be sent first.</p>

      <p>RFC1179 states that: <a name="AEN9952"></a></p>

      <blockquote class="BLOCKQUOTE">
        <p>The name of the control file ... should start with ASCII
        "cfA", followed by a three digit job number, followed by
        the host name which has constructed the control file.</p>
      </blockquote>
      <br>
      <br>

      <p>The <i class="EMPHASIS">should</i> in this wording
      indicates that this is simply a guideline, and that other
      formats are possible. Some of the major problems with this
      format are as follows:</p>

      <ol type="1">
        <li>
          <p>The restriction to 3 digits means that at most 1000
          jobs can be in a queue. Strangely, some systems generate
          far more than 1000 jobs a day, and need to archive them
          on a regular basis. The <tt class=
          "LITERAL">longnumber</tt> option will allow <b class=
          "APPLICATION">LPRng</b> to use a 6 digit job number for
          files in the print queue.</p>
        </li>

        <li>
          <p>The host name format is not specified. Some
          implementations consider that this is the short host
          name, while others think it is the fully qualified domain
          name (FQDN). <b class="APPLICATION">LPRng</b>, by
          default, will use the FQDN host name. However, the <tt
          class="LITERAL">use_shorthost</tt> option will force it
          to use short host names in control and data files.</p>
        </li>

        <li>
          <p>The <tt class="LITERAL">cfA</tt> control file name was
          modified to allow the job priority to be used as the A
          letter of the control file. By default, this is A
          (lowest, i.e. <tt class="LITERAL">cfA</tt>) and but can
          range to Z (highest, i.e. <tt class="LITERAL">cfZ</tt>).
          All known spoolers except <b class=
          "APPLICATION">LPRng</b> seem to ignore the actual value
          of the letter.</p>
        </li>
      </ol>
      <br>
      <br>
    </div>

    <div class="NAVFOOTER">
      <hr align="LEFT" width="100%">

      <table summary="Footer navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="33%" align="left" valign="top"><a href=
          "remotesupport.htm" accesskey="P">Prev</a></td>

          <td width="34%" align="center" valign="top"><a href=
          "index.htm" accesskey="H">Home</a></td>

          <td width="33%" align="right" valign="top"><a href=
          "x9971.htm" accesskey="N">Next</a></td>
        </tr>

        <tr>
          <td width="33%" align="left" valign="top">Protocol
          Requests and Replies</td>

          <td width="34%" align="center" valign="top"><a href=
          "rfc1179ref.htm" accesskey="U">Up</a></td>

          <td width="33%" align="right" valign="top">Data File
          Transfer</td>
        </tr>
      </table>
    </div>
  </body>
</html>