Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

Section 21.5 Source Code 797


40 #define STAT_SRV_INTERN 0x0500 /* unexpected internal error */
41 #define STAT_SRV_NOTSUP 0x0501 /* operation not supported */
42 #define STAT_SRV_UNAVAIL 0x0502 /* service unavailable */
43 #define STAT_SRV_BADVER 0x0503 /* version not supported */
44 #define STAT_SRV_DEVERR 0x0504 /* device error */
45 #define STAT_SRV_TMPERR 0x0505 /* temporary error */
46 #define STAT_SRV_REJECT 0x0506 /* server not accepting jobs */
47 #define STAT_SRV_TOOBUSY 0x0507 /* server too busy */
48 #define STAT_SRV_CANCEL 0x0508 /* job has been canceled */
49 #define STAT_SRV_NOMULTI 0x0509 /* multi-doc jobs unsupported */
50 /*
51 * Operation IDs
52 */
53 #define OP_PRINT_JOB 0x02
54 #define OP_PRINT_URI 0x03
55 #define OP_VALIDATE_JOB 0x04
56 #define OP_CREATE_JOB 0x05
57 #define OP_SEND_DOC 0x06
58 #define OP_SEND_URI 0x07
59 #define OP_CANCEL_JOB 0x08
60 #define OP_GET_JOB_ATTR 0x09
61 #define OP_GET_JOBS 0x0a
62 #define OP_GET_PRINTER_ATTR 0x0b
63 #define OP_HOLD_JOB 0x0c
64 #define OP_RELEASE_JOB 0x0d
65 #define OP_RESTART_JOB 0x0e
66 #define OP_PAUSE_PRINTER 0x10
67 #define OP_RESUME_PRINTER 0x11
68 #define OP_PURGE_JOBS 0x12
69 /*
70 * Attribute Tags.
71 */
72 #define TAG_OPERATION_ATTR 0x01 /* operation attributes tag */
73 #define TAG_JOB_ATTR 0x02 /* job attributes tag */
74 #define TAG_END_OF_ATTR 0x03 /* end of attributes tag */
75 #define TAG_PRINTER_ATTR 0x04 /* printer attributes tag */
76 #define TAG_UNSUPP_ATTR 0x05 /* unsupported attributes tag */

[40 – 49] We continue to define status codes. The ones in the range0x500to0x5ffare
server error codes. All codes aredescribed in Sections 13.1.1 through 13.1.5 in
RFC 2911.
[50 – 68] We define the various operation IDs next. There is one ID for each task defined
by IPP (see Section 4.4.15 in RFC 2911). In our example, we will use only the
print-job operation.
[69 – 76] The attribute tags delimit the attribute groups in the IPP request and response
messages. The tag values aredefined in Section 3.5.1 of RFC 2910.
Free download pdf