Changeset 35b7466


Ignore:
Timestamp:
Mar 5, 2011, 10:21:56 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
e97c37d
Parents:
16055f9
git-author:
Jessica B. Hamrick <jhamrick@…> (03/05/11 22:21:56)
git-committer:
Jessica B. Hamrick <jhamrick@…> (03/05/11 22:21:56)
Message:

Define all constants in IPP constants, as well as where they are defined in various RFCs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/ippconstants.py

    r574aee4 r35b7466  
    1 IPP_RES_PER_INCH = 3
    2 IPP_RES_PER_CM = 4
    3 
    4 IPP_FINISHINGS_NONE = 3
    5 IPP_FINISHINGS_STAPLE = 4
    6 IPP_FINISHINGS_PUNCH = 5
    7 IPP_FINISHINGS_COVER = 6
    8 IPP_FINISHINGS_BIND = 7
    9 IPP_FINISHINGS_SADDLE_STITCH = 8
    10 IPP_FINISHINGS_EDGE_STITCH = 9
    11 IPP_FINISHINGS_FOLD = 10
    12 IPP_FINISHINGS_TRIM = 11
    13 IPP_FINISHINGS_BALE = 12
    14 IPP_FINISHINGS_BOOKLET_MAKER = 13
    15 IPP_FINISHINGS_JOB_OFFSET = 14
    16 IPP_FINISHINGS_STAPLE_TOP_LEFT = 20
    17 IPP_FINISHINGS_STAPLE_BOTTOM_LEFT = 21
    18 IPP_FINISHINGS_STAPLE_TOP_RIGHT = 22
    19 IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT = 23
    20 IPP_FINISHINGS_EDGE_STITCH_LEFT = 24
    21 IPP_FINISHINGS_EDGE_STITCH_TOP = 25
    22 IPP_FINISHINGS_EDGE_STITCH_RIGHT = 26
    23 IPP_FINISHINGS_EDGE_STITCH_BOTTOM = 27
    24 IPP_FINISHINGS_STAPLE_DUAL_LEFT = 28
    25 IPP_FINISHINGS_STAPLE_DUAL_TOP = 29
    26 IPP_FINISHINGS_STAPLE_DUAL_RIGHT = 30
    27 IPP_FINISHINGS_STAPLE_DUAL_BOTTOM = 31
    28 IPP_FINISHINGS_BIND_LEFT = 50
    29 IPP_FINISHINGS_BIND_TOP = 51
    30 IPP_FINISHINGS_BIND_RIGHT = 52
    31 IPP_FINISHINGS_BIND_BOTTO = 53
    32 
    33 IPP_PORTRAIT = 3
    34 IPP_LANDSCAPE = 4
    35 IPP_REVERSE_LANDSCAPE = 5
    36 IPP_REVERSE_PORTRAIT = 6
    37 
    38 IPP_QUALITY_DRAFT = 3
    39 IPP_QUALITY_NORMAL = 4
    40 IPP_QUALITY_HIGH = 5
    41 
    42 IPP_JOB_PENDING = 3
    43 IPP_JOB_HELD = 4
    44 IPP_JOB_PROCESSING = 5
    45 IPP_JOB_STOPPED = 6
    46 IPP_JOB_CANCELLED = 7
    47 IPP_JOB_ABORTED = 8
    48 IPP_JOB_COMPLETE = 9
    49 
    50 IPP_PRINTER_IDLE = 3
    51 IPP_PRINTER_PROCESSING = 4
    52 IPP_PRINTER_STOPPED = 5
    53 
    54 IPP_ERROR = -1
    55 IPP_IDLE = 0
    56 IPP_HEADER = 1
    57 IPP_ATTRIBUTE = 2
    58 IPP_DATA = 3
    59 
    60 IPP_PRINT_JOB = 0x0002
    61 IPP_PRINT_URI = 0x0003
    62 IPP_VALIDATE_JOB = 0x0004
    63 IPP_CREATE_JOB = 0x0005
    64 IPP_SEND_DOCUMENT = 0x0006
    65 IPP_SEND_URI = 0x0007
    66 IPP_CANCEL_JOB = 0x0008
    67 IPP_GET_JOB_ATTRIBUTES = 0x0009
    68 IPP_GET_JOBS = 0x000a
    69 IPP_GET_PRINTER_ATTRIBUTES = 0x000b
    70 IPP_HOLD_JOB = 0x000c
    71 IPP_RELEASE_JOB = 0x000d
    72 IPP_RESTART_JOB = 0x000e
    73 IPP_PAUSE_PRINTER = 0x0010
    74 IPP_RESUME_PRINTER = 0x0011
    75 IPP_PURGE_JOBS = 0x0012
    76 IPP_SET_PRINTER_ATTRIBUTES = 0x0013
    77 IPP_SET_JOB_ATTRIBUTES = 0x0014
    78 IPP_GET_PRINTER_SUPPORTED_VALUES = 0x0015
    79 IPP_CREATE_PRINTER_SUBSCRIPTION = 0x0016
    80 IPP_CREATE_JOB_SUBSCRIPTION = 0x0017
    81 IPP_GET_SUBSCRIPTION_ATTRIBUTES = 0x0018
    82 IPP_GET_SUBSCRIPTIONS = 0x0019
    83 IPP_RENEW_SUBSCRIPTION = 0x001a
    84 IPP_CANCEL_SUBSCRIPTION = 0x001b
    85 IPP_GET_NOTIFICATIONS = 0x001c
    86 IPP_SEND_NOTIFICATIONS = 0x001d
    87 IPP_GET_PRINT_SUPPORT_FILES = 0x0021
    88 IPP_ENABLE_PRINTER = 0x0022
    89 IPP_DISABLE_PRINTER = 0x0023
    90 IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB = 0x0024
    91 IPP_HOLD_NEW_JOBS = 0x0025
    92 IPP_RELEASE_HELD_NEW_JOBS = 0x0026
    93 IPP_DEACTIVATE_PRINTER = 0x0027
    94 IPP_ACTIVATE_PRINTER = 0x0028
    95 IPP_RESTART_PRINTER = 0x0029
    96 IPP_SHUTDOWN_PRINTER = 0x002a
    97 IPP_STARTUP_PRINTER = 0x002b
    98 IPP_REPROCESS_JOB = 0x002c
    99 IPP_CANCEL_CURRENT_JOB = 0x002d
    100 IPP_SUSPEND_CURRENT_JOB = 0x002e
    101 IPP_RESUME_JOB = 0x002f
    102 IPP_PROMOTE_JOB = 0x0030
    103 IPP_SCHEDULE_JOB_AFTER = 0x0031
    104 IPP_PRIVATE = 0x4000
    105 CUPS_GET_DEFAULT = 0x4001
    106 CUPS_GET_PRINTERS = 0x4002
    107 CUPS_ADD_PRINTER = 0x4003
    108 CUPS_DELETE_PRINTER = 0x4004
    109 CUPS_GET_CLASSES = 0x4005
    110 CUPS_ADD_CLASS = 0x4006
    111 CUPS_DELETE_CLASS = 0x4007
    112 CUPS_ACCEPT_JOBS = 0x4008
    113 CUPS_REJECT_JOBS = 0x4009
    114 CUPS_SET_DEFAULT = 0x400a
    115 CUPS_GET_DEVICES = 0x400b
    116 CUPS_GET_PPDS = 0x400c
    117 CUPS_MOVE_JOB = 0x400d
    118 CUPS_AUTHENTICATE_JOB = 0x400e
    119 
    120 IPP_OK = 0x0000
    121 IPP_OK_SUBST = 0x0001
    122 IPP_OK_CONFLICT = 0x0002
    123 IPP_OK_IGNORED_SUBSCRIPTIONS = 0x0003
    124 IPP_OK_IGNORED_NOTIFICATIONS = 0x0004
    125 IPP_OK_TOO_MANY_EVENTS = 0x0005
    126 IPP_OK_BUT_CANCEL_SUBSCRIPTION = 0x0006
    127 IPP_REDIRECTION_OTHER_SITE = 0x0300
    128 IPP_BAD_REQUEST = 0x0400
    129 IPP_FORBIDDEN = 0x0401
    130 IPP_NOT_AUTHENTICATED = 0x0402
    131 IPP_NOT_AUTHORIZED = 0x0403
    132 IPP_NOT_POSSIBLE = 0x0404
    133 IPP_TIMEOUT = 0x0405
    134 IPP_NOT_FOUND = 0x0406
    135 IPP_GONE = 0x0407
    136 IPP_REQUEST_ENTITY = 0x0408
    137 IPP_REQUEST_VALUE = 0x0409
    138 IPP_DOCUMENT_FORMAT = 0x040a
    139 IPP_ATTRIBUTES = 0x040b
    140 IPP_URI_SCHEME = 0x040c
    141 IPP_CHARSET = 0x040d
    142 IPP_CONFLICT = 0x040e
    143 IPP_COMPRESSION_NOT_SUPPORTED = 0x040f
    144 IPP_COMPRESSION_ERROR = 0x0410
    145 IPP_DOCUMENT_FORMAT_ERROR = 0x0411
    146 IPP_DOCUMENT_ACCESS_ERROR = 0x0412
    147 IPP_ATTRIBUTES_NOT_SETTABLE = 0x0413
    148 IPP_IGNORED_ALL_SUBSCRIPTIONS = 0x0414
    149 IPP_TOO_MANY_SUBSCRIPTIONS = 0x0415
    150 IPP_IGNORED_ALL_NOTIFICATIONS = 0x0416
    151 IPP_PRINT_SUPPORT_FILE_NOT_FOUND = 0x0417
    152 
    153 IPP_INTERNAL_ERROR = 0x0500
    154 IPP_OPERATION_NOT_SUPPORTED = 0x0501
    155 IPP_SERVICE_UNAVAILABLE = 0x0502
    156 IPP_VERSION_NOT_SUPPORTED = 0x0503
    157 IPP_DEVICE_ERROR = 0x0504
    158 IPP_TEMPORARY_ERROR = 0x0505
    159 IPP_NOT_ACCEPTING = 0x0506
    160 IPP_PRINTER_BUSY = 0x0507
    161 IPP_ERROR_JOB_CANCELLED = 0x0508
    162 IPP_MULTIPLE_JOBS_NOT_SUPPORTED = 0x0509
    163 IPP_PRINTER_IS_DEACTIVATED = 0x50a
    164  
    165 CUPS_PRINTER_LOCAL = 0x0000
    166 CUPS_PRINTER_CLASS = 0x0001
    167 CUPS_PRINTER_REMOTE = 0x0002
    168 CUPS_PRINTER_BW = 0x0004
    169 CUPS_PRINTER_COLOR = 0x0008
    170 CUPS_PRINTER_DUPLEX = 0x0010
    171 CUPS_PRINTER_STAPLE = 0x0020
    172 CUPS_PRINTER_COPIES = 0x0040
    173 CUPS_PRINTER_COLLATE = 0x0080
    174 CUPS_PRINTER_PUNCH = 0x0100
    175 CUPS_PRINTER_COVER = 0x0200
    176 CUPS_PRINTER_BIND = 0x0400
    177 CUPS_PRINTER_SORT = 0x0800
    178 CUPS_PRINTER_SMALL = 0x1000
    179 CUPS_PRINTER_MEDIUM = 0x2000
    180 CUPS_PRINTER_LARGE = 0x4000
    181 CUPS_PRINTER_VARIABLE = 0x8000
    182 CUPS_PRINTER_IMPLICIT = 0x10000
    183 CUPS_PRINTER_DEFAULT = 0x20000
    184 CUPS_PRINTER_FAX = 0x40000
    185 CUPS_PRINTER_REJECTING = 0x80000
    186 CUPS_PRINTER_DELETE = 0x100000
    187 CUPS_PRINTER_NOT_SHARED = 0x200000
    188 CUPS_PRINTER_AUTHENTICATED = 0x400000
    189 CUPS_PRINTER_COMMANDS = 0x800000
    190 CUPS_PRINTER_OPTIONS = 0xe6ff
     1class Misc():
     2    """
     3    Miscellaneous config options for the IPP server.
     4    """
     5   
     6    IPP_VERSION = "1.1"
     7    IPP_PORT = 8000
     8
     9class JobStates():
     10    """
     11    Job state codes, as defined by RFC 2911, Section 4.3.7
     12    """
     13   
     14    PENDING    = 3
     15    HELD       = 4
     16    PROCESSING = 5
     17    STOPPED    = 6
     18    CANCELLED  = 7
     19    ABORTED    = 8
     20    COMPLETE   = 9
     21
     22class PrinterStates():
     23    """
     24    Printer state codes, as defined by RFC 2911, Section 4.4.11
     25    """
     26
     27    IDLE       = 3
     28    PROCESSING = 4
     29    STOPPED    = 5
     30
     31class Operations():
     32    """
     33    IPP and CUPS IPP Operations, as defined in various RFCs:
     34
     35        0x0002 - 0x0012      RFC 2911
     36        0x0013 - 0x0015      RFC 3380
     37        0x0016 - 0x001b      RFC 3995
     38        0x0022 - 0x0031      RFC 3998
     39        0x4000 - 0x4027      CUPS IPP Actions
     40    """
     41
     42    # These are defined in RFC 2911, Section 4.4.15
     43    PRINT_JOB              = 0x0002
     44    PRINT_URI              = 0x0003
     45    VALIDATE_JOB           = 0x0004
     46    CREATE_JOB             = 0x0005
     47    SEND_DOCUMENT          = 0x0006
     48    SEND_URI               = 0x0007
     49    CANCEL_JOB             = 0x0008
     50    GET_JOB_ATTRIBUTES     = 0x0009
     51    GET_JOBS               = 0x000a
     52    GET_PRINTER_ATTRIBUTES = 0x000b
     53    #HOLD_JOB              = 0x000c
     54    #RELEASE_JOB           = 0x000d
     55    #RESTART_JOB           = 0x000e
     56    PAUSE_PRINTER          = 0x0010
     57    RESUME_PRINTER         = 0x0011
     58    #PURGE_JOBS            = 0x0012
     59
     60    # These are defined in RFC 3380, Section 4
     61    SET_PRINTER_ATTRIBUTES           = 0x0013
     62    SET_JOB_ATTRIBUTES               = 0x0014
     63    #GET_PRINTER_SUPPORTED_VALUES    = 0x0015
     64
     65    # These are defined in RFC 3995, Section 7.1
     66    #CREATE_PRINTER_SUBSCRIPTION     = 0x0016
     67    #CREATE_JOB_SUBSCRIPTION         = 0x0017
     68    #GET_SUBSCRIPTION_ATTRIBUTES     = 0x0018
     69    #GET_SUBSCRIPTIONS               = 0x0019
     70    #RENEW_SUBSCRIPTION              = 0x001a
     71    #CANCEL_SUBSCRIPTION             = 0x001b
     72
     73    # These are defined in RFC 3998, Section 14.3
     74    #ENABLE_PRINTER                  = 0x0022
     75    #DISABLE_PRINTER                 = 0x0023
     76    #PAUSE_PRINTER_AFTER_CURRENT_JOB = 0x0024
     77    #HOLD_NEW_JOBS                   = 0x0025
     78    #RELEASE_HELD_NEW_JOBS           = 0x0026
     79    #DEACTIVATE_PRINTER              = 0x0027
     80    #ACTIVATE_PRINTER                = 0x0028
     81    #RESTART_PRINTER                 = 0x0029
     82    #SHUTDOWN_PRINTER                = 0x002a
     83    #STARTUP_PRINTER                 = 0x002b
     84    #REPROCESS_JOB                   = 0x002c
     85    #CANCEL_CURRENT_JOB              = 0x002d
     86    #SUSPEND_CURRENT_JOB             = 0x002e
     87    #RESUME_JOB                      = 0x002f
     88    PROMOTE_JOB                      = 0x0030
     89    #SCHEDULE_JOB_AFTER              = 0x0031
     90
     91    # These are special CUPS actions, defined in:
     92    # http://www.cups.org/documentation.php/spec-ipp.html
     93    #PRIVATE               = 0x4000
     94    CUPS_GET_DEFAULT       = 0x4001
     95    CUPS_GET_PRINTERS      = 0x4002
     96    #CUPS_ADD_PRINTER      = 0x4003
     97    #CUPS_DELETE_PRINTER   = 0x4004
     98    #CUPS_GET_CLASSES      = 0x4005
     99    #CUPS_ADD_CLASS        = 0x4006
     100    #CUPS_DELETE_CLASS     = 0x4007
     101    #CUPS_ACCEPT_JOBS      = 0x4008
     102    #CUPS_REJECT_JOBS      = 0x4009
     103    #CUPS_SET_DEFAULT      = 0x400a
     104    #CUPS_GET_DEVICES      = 0x400b
     105    #CUPS_GET_PPDS         = 0x400c
     106    #CUPS_MOVE_JOB         = 0x400d
     107    #CUPS_AUTHENTICATE_JOB = 0x400e
     108    #CUPS_GET_PPD          = 0x400f
     109    CUPS_GET_DOCUMENT      = 0x4027
     110
     111class SuccessCodes():
     112    """
     113    Success status codes as defined in RFC 2911, Section 13
     114    """
     115   
     116    OK                           = 0x0000
     117    OK_SUBST                     = 0x0001
     118    OK_CONFLICT                  = 0x0002
     119    OK_IGNORED_SUBSCRIPTIONS     = 0x0003
     120    OK_IGNORED_NOTIFICATIONS     = 0x0004
     121    OK_TOO_MANY_EVENTS           = 0x0005
     122    OK_BUT_CANCEL_SUBSCRIPTION   = 0x0006
     123
     124class ClientErrorCodes():
     125    """
     126    Client error codes as defined in RFC 2911, Section 13
     127    """
     128   
     129    BAD_REQUEST                  = 0x0400
     130    FORBIDDEN                    = 0x0401
     131    NOT_AUTHENTICATED            = 0x0402
     132    NOT_AUTHORIZED               = 0x0403
     133    NOT_POSSIBLE                 = 0x0404
     134    TIMEOUT                      = 0x0405
     135    NOT_FOUND                    = 0x0406
     136    GONE                         = 0x0407
     137    REQUEST_ENTITY               = 0x0408
     138    REQUEST_VALUE                = 0x0409
     139    DOCUMENT_FORMAT              = 0x040a
     140    ATTRIBUTES                   = 0x040b
     141    URI_SCHEME                   = 0x040c
     142    CHARSET                      = 0x040d
     143    CONFLICT                     = 0x040e
     144    COMPRESSION_NOT_SUPPORTED    = 0x040f
     145    COMPRESSION_ERROR            = 0x0410
     146    DOCUMENT_FORMAT_ERROR        = 0x0411
     147    DOCUMENT_ACCESS_ERROR        = 0x0412
     148    ATTRIBUTES_NOT_SETTABLE      = 0x0413
     149    IGNORED_ALL_SUBSCRIPTIONS    = 0x0414
     150    TOO_MANY_SUBSCRIPTIONS       = 0x0415
     151    IGNORED_ALL_NOTIFICATIONS    = 0x0416
     152    PRINT_SUPPORT_FILE_NOT_FOUND = 0x0417
     153
     154class ServerErrorCodes():
     155    """
     156    Server error codes as defined in RFC 2911, Section 13
     157    """
     158
     159    INTERNAL_ERROR              = 0x0500
     160    OPERATION_NOT_SUPPORTED     = 0x0501
     161    SERVICE_UNAVAILABLE         = 0x0502
     162    VERSION_NOT_SUPPORTED       = 0x0503
     163    DEVICE_ERROR                = 0x0504
     164    TEMPORARY_ERROR             = 0x0505
     165    NOT_ACCEPTING               = 0x0506
     166    PRINTER_BUSY                = 0x0507
     167    ERROR_JOB_CANCELLED         = 0x0508
     168    MULTIPLE_JOBS_NOT_SUPPORTED = 0x0509
     169    PRINTER_IS_DEACTIVATED      = 0x050a
     170
     171class CUPSPrinterType():
     172    """
     173    Printer types as defined by cups_ptype_e in the CUPS API
     174    specification:
     175   
     176    http://www.cups.org/documentation.php/doc-1.3/api-cups.html#cups_ptype_e
     177    """
     178
     179    LOCAL         = 0x000000
     180    CLASS         = 0x000001
     181    REMOTE        = 0x000002
     182    BW            = 0x000004
     183    COLOR         = 0x000008
     184
     185    DUPLEX        = 0x000010
     186    STAPLE        = 0x000020
     187    COPIES        = 0x000040
     188    COLLATE       = 0x000080
     189
     190    PUNCH         = 0x000100
     191    COVER         = 0x000200
     192    BIND          = 0x000400
     193    SORT          = 0x000800
     194
     195    SMALL         = 0x001000
     196    MEDIUM        = 0x002000
     197    LARGE         = 0x004000
     198    VARIABLE      = 0x008000
     199
     200    IMPLICIT      = 0x010000
     201    DEFAULT       = 0x020000
     202    FAX           = 0x040000
     203    REJECTING     = 0x080000
     204
     205    DELETE        = 0x100000
     206    NOT_SHARED    = 0x200000
     207    AUTHENTICATED = 0x400000
     208    COMMANDS      = 0x800000
     209
     210    OPTIONS       = 0x00e6ff
     211
     212class AttributeTags():
     213    """
     214    Contains constants for the attribute IPP tags, as defined by RFC
     215    2565.
     216    """
     217   
     218    ZERO_NAME_LENGTH   = 0x00
     219    OPERATION          = 0x01
     220    JOB                = 0x02
     221    END                = 0x03
     222    PRINTER            = 0x04
     223    UNSUPPORTED        = 0x05
     224    SUBSCRIPTION       = 0x06
     225    EVENT_NOTIFICATION = 0x07
     226
     227class OutOfBandTags():
     228    """
     229    Contains constants for the out-of-band value IPP tags, as defined
     230    by RFC 2565.
     231    """
     232   
     233    UNSUPPORTED      = 0x10
     234    DEFAULT          = 0x11
     235    UNKNOWN          = 0x12
     236    NO_VALUE         = 0x13
     237    NOT_SETTABLE     = 0x15
     238    DELETE_ATTRIBUTE = 0x16
     239    ADMIN_DEFINE     = 0x17
     240
     241class IntegerTags():
     242    """
     243    Contains constants for the integer value IPP tags, as defined by
     244    RFC 2565.
     245    """
     246   
     247    GENERIC = 0x20
     248    INTEGER = 0x21
     249    BOOLEAN = 0x22
     250    ENUM    = 0x23
     251
     252class OctetStringTags():
     253    """
     254    Contains constants for the octetString value IPP tags, as defined
     255    by RFC 2565.
     256    """
     257   
     258    UNSPECIFIED_OCTETSTRING = 0x30
     259    DATETIME                = 0x31
     260    RESOLUTION              = 0x32
     261    RANGE_OF_INTEGER        = 0x33
     262    BEG_COLLECTION          = 0x34
     263    TEXT_WITH_LANGUAGE      = 0x35
     264    NAME_WITH_LANGUAGE      = 0x36
     265    END_COLLECTION          = 0x37
     266
     267class CharacterStringTags():
     268    """
     269    Contains constants for the character-string value IPP tags, as
     270    defined by RFC 2565.
     271    """
     272   
     273    GENERIC               = 0x40
     274    TEXT_WITHOUT_LANGUAGE = 0x41
     275    NAME_WITHOUT_LANGUAGE = 0x42
     276    KEYWORD               = 0x44
     277    URI                   = 0x45
     278    URI_SCHEME            = 0x46
     279    CHARSET               = 0x47
     280    NATURAL_LANGUAGE      = 0x48
     281    MIME_MEDIA_TYPE       = 0x49                                   
     282    MEMBER_ATTR_NAME      = 0x4a
Note: See TracChangeset for help on using the changeset viewer.