source: server/lib/gutenbach/ipp/core/constants.py @ 793432f

no-cups
Last change on this file since 793432f was 793432f, checked in by Jessica B. Hamrick <jhamrick@…>, 12 years ago

Reorganization

  • Property mode set to 100644
File size: 9.0 KB
Line 
1__all__ = [
2    'MiscConstants',
3    'JobStates',
4    'PrinterStates',
5    'OperationCodes',
6    'SuccessCodes',
7    'ClientErrorCodes',
8    'ServerErrorCodes',
9    'ErrorCodes',
10    'StatusCodes',
11    'CUPSPrinterType',
12    'AttributeTags',
13    'OutOfBandTags',
14    'IntegerTags',
15    'OctetStringTags',
16    'CharacterStringTags',
17]
18
19class MiscConstants():
20    """Miscellaneous config options for the IPP server.
21   
22    """
23   
24    IPP_VERSION = "1.1"
25    IPP_PORT = 8000
26
27    def __init__(self): pass
28
29class JobStates():
30    """Job state codes, as defined by RFC 2911, Section 4.3.7
31   
32    """
33   
34    PENDING    = 3
35    HELD       = 4
36    PROCESSING = 5
37    STOPPED    = 6
38    CANCELLED  = 7
39    ABORTED    = 8
40    COMPLETE   = 9
41
42    def __init__(self): pass
43
44class PrinterStates():
45    """Printer state codes, as defined by RFC 2911, Section 4.4.11
46   
47    """
48
49    IDLE       = 3
50    PROCESSING = 4
51    STOPPED    = 5
52
53    def __init__(self): pass
54
55class OperationCodes():
56    """IPP and CUPS IPP Operations, as defined in various RFCs:
57
58        0x0002 - 0x0012      RFC 2911 (Section 4.4.15)
59        0x0013 - 0x0015      RFC 3380 (Section 4)
60        0x0016 - 0x001b      RFC 3995 (Section 7.1)
61        0x0022 - 0x0031      RFC 3998 (Section 14.3)
62        0x4000 - 0x4027      CUPS IPP Actions
63       
64    """
65
66    # These are defined in RFC 2911, Section 4.4.15
67    PRINT_JOB              = 0x0002
68    PRINT_URI              = 0x0003
69    VALIDATE_JOB           = 0x0004
70    CREATE_JOB             = 0x0005
71    SEND_DOCUMENT          = 0x0006
72    SEND_URI               = 0x0007
73    CANCEL_JOB             = 0x0008
74    GET_JOB_ATTRIBUTES     = 0x0009
75    GET_JOBS               = 0x000a
76    GET_PRINTER_ATTRIBUTES = 0x000b
77    #HOLD_JOB              = 0x000c
78    #RELEASE_JOB           = 0x000d
79    RESTART_JOB            = 0x000e
80    PAUSE_PRINTER          = 0x0010
81    RESUME_PRINTER         = 0x0011
82    #PURGE_JOBS            = 0x0012
83
84    # These are defined in RFC 3380, Section 4
85    SET_PRINTER_ATTRIBUTES           = 0x0013
86    SET_JOB_ATTRIBUTES               = 0x0014
87    #GET_PRINTER_SUPPORTED_VALUES    = 0x0015
88
89    # These are defined in RFC 3995, Section 7.1
90    #CREATE_PRINTER_SUBSCRIPTION     = 0x0016
91    #CREATE_JOB_SUBSCRIPTION         = 0x0017
92    #GET_SUBSCRIPTION_ATTRIBUTES     = 0x0018
93    #GET_SUBSCRIPTIONS               = 0x0019
94    #RENEW_SUBSCRIPTION              = 0x001a
95    #CANCEL_SUBSCRIPTION             = 0x001b
96
97    # These are defined in RFC 3998, Section 14.3
98    #ENABLE_PRINTER                  = 0x0022
99    #DISABLE_PRINTER                 = 0x0023
100    #PAUSE_PRINTER_AFTER_CURRENT_JOB = 0x0024
101    #HOLD_NEW_JOBS                   = 0x0025
102    #RELEASE_HELD_NEW_JOBS           = 0x0026
103    #DEACTIVATE_PRINTER              = 0x0027
104    #ACTIVATE_PRINTER                = 0x0028
105    #RESTART_PRINTER                 = 0x0029
106    #SHUTDOWN_PRINTER                = 0x002a
107    #STARTUP_PRINTER                 = 0x002b
108    #REPROCESS_JOB                   = 0x002c
109    #CANCEL_CURRENT_JOB              = 0x002d
110    #SUSPEND_CURRENT_JOB             = 0x002e
111    #RESUME_JOB                      = 0x002f
112    PROMOTE_JOB                      = 0x0030
113    #SCHEDULE_JOB_AFTER              = 0x0031
114
115    # These are special CUPS actions, defined in:
116    # http://www.cups.org/documentation.php/spec-ipp.html
117    #PRIVATE               = 0x4000
118    CUPS_GET_DEFAULT       = 0x4001
119    CUPS_GET_PRINTERS      = 0x4002
120    #CUPS_ADD_PRINTER      = 0x4003
121    #CUPS_DELETE_PRINTER   = 0x4004
122    CUPS_GET_CLASSES       = 0x4005
123    #CUPS_ADD_CLASS        = 0x4006
124    #CUPS_DELETE_CLASS     = 0x4007
125    #CUPS_ACCEPT_JOBS      = 0x4008
126    #CUPS_REJECT_JOBS      = 0x4009
127    #CUPS_SET_DEFAULT      = 0x400a
128    #CUPS_GET_DEVICES      = 0x400b
129    #CUPS_GET_PPDS         = 0x400c
130    #CUPS_MOVE_JOB         = 0x400d
131    #CUPS_AUTHENTICATE_JOB = 0x400e
132    #CUPS_GET_PPD          = 0x400f
133    CUPS_GET_DOCUMENT      = 0x4027
134
135    def __init__(self): pass
136
137class SuccessCodes():
138    """Success status codes as defined in RFC 2911, Section 13
139   
140    """
141   
142    OK                           = 0x0000
143    OK_SUBST                     = 0x0001
144    OK_CONFLICT                  = 0x0002
145    OK_IGNORED_SUBSCRIPTIONS     = 0x0003
146    OK_IGNORED_NOTIFICATIONS     = 0x0004
147    OK_TOO_MANY_EVENTS           = 0x0005
148    OK_BUT_CANCEL_SUBSCRIPTION   = 0x0006
149
150    def __init__(self): pass
151
152class ClientErrorCodes():
153    """Client error codes as defined in RFC 2911, Section 13
154   
155    """
156   
157    BAD_REQUEST                  = 0x0400
158    FORBIDDEN                    = 0x0401
159    NOT_AUTHENTICATED            = 0x0402
160    NOT_AUTHORIZED               = 0x0403
161    NOT_POSSIBLE                 = 0x0404
162    TIMEOUT                      = 0x0405
163    NOT_FOUND                    = 0x0406
164    GONE                         = 0x0407
165    REQUEST_ENTITY               = 0x0408
166    REQUEST_VALUE                = 0x0409
167    DOCUMENT_FORMAT              = 0x040a
168    ATTRIBUTES                   = 0x040b
169    URI_SCHEME                   = 0x040c
170    CHARSET                      = 0x040d
171    CONFLICT                     = 0x040e
172    COMPRESSION_NOT_SUPPORTED    = 0x040f
173    COMPRESSION_ERROR            = 0x0410
174    DOCUMENT_FORMAT_ERROR        = 0x0411
175    DOCUMENT_ACCESS_ERROR        = 0x0412
176    ATTRIBUTES_NOT_SETTABLE      = 0x0413
177    IGNORED_ALL_SUBSCRIPTIONS    = 0x0414
178    TOO_MANY_SUBSCRIPTIONS       = 0x0415
179    IGNORED_ALL_NOTIFICATIONS    = 0x0416
180    PRINT_SUPPORT_FILE_NOT_FOUND = 0x0417
181
182    def __init__(self): pass
183
184class ServerErrorCodes():
185    """Server error codes as defined in RFC 2911, Section 13
186   
187    """
188
189    INTERNAL_ERROR              = 0x0500
190    OPERATION_NOT_SUPPORTED     = 0x0501
191    SERVICE_UNAVAILABLE         = 0x0502
192    VERSION_NOT_SUPPORTED       = 0x0503
193    DEVICE_ERROR                = 0x0504
194    TEMPORARY_ERROR             = 0x0505
195    NOT_ACCEPTING               = 0x0506
196    PRINTER_BUSY                = 0x0507
197    ERROR_JOB_CANCELLED         = 0x0508
198    MULTIPLE_JOBS_NOT_SUPPORTED = 0x0509
199    PRINTER_IS_DEACTIVATED      = 0x050a
200
201    def __init__(self): pass
202
203class StatusCodes(SuccessCodes, ClientErrorCodes, ServerErrorCodes):
204    pass
205class ErrorCodes(ClientErrorCodes, ServerErrorCodes):
206    pass
207
208class CUPSPrinterType():
209    """Printer types as defined by cups_ptype_e in the CUPS API
210    specification:
211   
212    http://www.cups.org/documentation.php/doc-1.3/api-cups.html#cups_ptype_e
213   
214    """
215
216    LOCAL         = 0x000000
217    CLASS         = 0x000001
218    REMOTE        = 0x000002
219    BW            = 0x000004
220    COLOR         = 0x000008
221
222    DUPLEX        = 0x000010
223    STAPLE        = 0x000020
224    COPIES        = 0x000040
225    COLLATE       = 0x000080
226
227    PUNCH         = 0x000100
228    COVER         = 0x000200
229    BIND          = 0x000400
230    SORT          = 0x000800
231
232    SMALL         = 0x001000
233    MEDIUM        = 0x002000
234    LARGE         = 0x004000
235    VARIABLE      = 0x008000
236
237    IMPLICIT      = 0x010000
238    DEFAULT       = 0x020000
239    FAX           = 0x040000
240    REJECTING     = 0x080000
241
242    DELETE        = 0x100000
243    NOT_SHARED    = 0x200000
244    AUTHENTICATED = 0x400000
245    COMMANDS      = 0x800000
246
247    OPTIONS       = 0x00e6ff
248
249    def __init__(self): pass
250
251class AttributeTags():
252    """Contains constants for the attribute IPP tags, as defined by
253    RFC 2565.
254   
255    """
256   
257    ZERO_NAME_LENGTH   = 0x00
258    OPERATION          = 0x01
259    JOB                = 0x02
260    END                = 0x03
261    PRINTER            = 0x04
262    UNSUPPORTED        = 0x05
263    SUBSCRIPTION       = 0x06
264    EVENT_NOTIFICATION = 0x07
265
266    def __init__(self): pass
267
268class OutOfBandTags():
269    """Contains constants for the out-of-band value IPP tags, as
270    defined by RFC 2565.
271   
272    """
273   
274    UNSUPPORTED      = 0x10
275    DEFAULT          = 0x11
276    UNKNOWN          = 0x12
277    NO_VALUE         = 0x13
278    NOT_SETTABLE     = 0x15
279    DELETE_ATTRIBUTE = 0x16
280    ADMIN_DEFINE     = 0x17
281
282    def __init__(self): pass
283
284class IntegerTags():
285    """Contains constants for the integer value IPP tags, as defined
286    by RFC 2565.
287   
288    """
289   
290    GENERIC = 0x20
291    INTEGER = 0x21
292    BOOLEAN = 0x22
293    ENUM    = 0x23
294
295    def __init__(self): pass
296
297class OctetStringTags():
298    """Contains constants for the octetString value IPP tags, as
299    defined by RFC 2565.
300   
301    """
302   
303    UNSPECIFIED_OCTETSTRING = 0x30
304    DATETIME                = 0x31
305    RESOLUTION              = 0x32
306    RANGE_OF_INTEGER        = 0x33
307    BEG_COLLECTION          = 0x34
308    TEXT_WITH_LANGUAGE      = 0x35
309    NAME_WITH_LANGUAGE      = 0x36
310    END_COLLECTION          = 0x37
311
312    def __init__(self): pass
313
314class CharacterStringTags():
315    """Contains constants for the character-string value IPP tags, as
316    defined by RFC 2565.
317   
318    """
319   
320    GENERIC               = 0x40
321    TEXT_WITHOUT_LANGUAGE = 0x41
322    NAME_WITHOUT_LANGUAGE = 0x42
323    KEYWORD               = 0x44
324    URI                   = 0x45
325    URI_SCHEME            = 0x46
326    CHARSET               = 0x47
327    NATURAL_LANGUAGE      = 0x48
328    MIME_MEDIA_TYPE       = 0x49                                   
329    MEMBER_ATTR_NAME      = 0x4a
Note: See TracBrowser for help on using the repository browser.