~ubuntu-branches/ubuntu/utopic/cups/utopic

« back to all changes in this revision

Viewing changes to cups/ipp-support.c

  • Committer: Package Import Robot
  • Author(s): Didier Raboud, Till Kamppeter, Steve Langasek, Didier Raboud
  • Date: 2014-01-03 18:42:39 UTC
  • mfrom: (1.3.2)
  • mto: This revision was merged to the branch mainline in revision 142.
  • Revision ID: package-import@ubuntu.com-20140103184239-juzq32ckr7ra49b3
* New 1.7.0 upstream release

[ Till Kamppeter ]
* Refresh most patches with quilt
* Removed usb-backend-do-not-crash-if-usb-disabled-in-bios and
  cupsd-no-crash-on-avahi-threaded-poll-shutdown patches as they got
  applied upstream
* Removed drop-arch-specifics-from-doc patch as it is not needed
  anymore
* Updated drop_unnecessary_dependencies, manpage-hyphen-minus,
  manpage-translations and ppd-poll-with-client-conf patches manually
  to apply to the new CUPS version
* Added error counting exception from
  usb-backend-do-not-crash-if-usb-disabled-in-bios to
  tests-ignore-warnings
* Install the newly added ippfind utility and its manpage in
  cups-client
* Added pwg.h to libcups2-dev package
* Call dh_auto_clean only if the file Makedefs is present, to avoid a
  FTBFS
* Added color management extensions from Joe Simon's GSoC 2013
  project.
* Patch cups-files.conf to activate CUPS daemon syncing of files when
  closing, so that config files (like printers.conf) do not
  mysteriously disappear (LP: #1157972)
* In the AppArmor profile, allow execution of programs in
  /etc/cups/interfaces/, needed to make CUPS working with queues based
  on System V interface scripts, especially PPD-less queues
  auto-generated by cups-browsed from cups-filters 1.0.41 on.
* Silenced AppArmor noise from udev.conf in syslog (LP: #1229766)

[ Steve Langasek ]
* Add cups-filters (>= 1.0.42) as alternative to foomatic-filters
  (which is deprecated) in package relationships

[ Didier Raboud ]
* Remove Roger Leigh from uploaders on his request with thanks for his
  past work!
* Switch avahi LSB Should-Start dependency to be avahi-daemon; also
  bump package relationship to >= 0.6.31-3~ (Closes: #731608)
* Refresh the manpage translation files
* Move the USB backend quirk rules file to cups-server-common
* Add 38 new 1.7.0 libcups2 symbols
* Mark one C++ libcupsppdc1 symbol as optional as it isn't exported in
  1.7.0 anymore
* Import Fedora patches:
  - to avoid sign-extending CRCs in gz decompression
  - to build with full read-only relocations
  - to fix job history logging (upstream patch)
  - to set the internal default for SyncOnClose to Yes, instead of
    only configuring it to Yes
  - to fix a stringpool corruption issue
  - to prevent USB timeouts causing incorrect print output
* Import Fedora patch updates:
  - to dont-use-dbus-from-two-threads patch so it removes a call to
    avahi_threaded_poll_stop()
  - to avoid_stale_lockfile_in_dbus_notifier patch to call _exit when
    handling SIGTERM
* Move manpage-translations patch at the very end of the patch series
  to have it include all our patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: ipp-support.c 11173 2013-07-23 12:31:34Z msweet $"
 
2
 * "$Id: ipp-support.c 11085 2013-07-03 13:53:05Z msweet $"
3
3
 *
4
4
 *   Internet Printing Protocol support functions for CUPS.
5
5
 *
6
 
 *   Copyright 2007-2012 by Apple Inc.
 
6
 *   Copyright 2007-2013 by Apple Inc.
7
7
 *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
8
8
 *
9
9
 *   These coded instructions, statements, and computer programs are the
16
16
 *
17
17
 * Contents:
18
18
 *
19
 
 *   ippAttributeString() - Convert the attribute's value to a string.
20
 
 *   ippEnumString()      - Return a string corresponding to the enum value.
21
 
 *   ippEnumValue()       - Return the value associated with a given enum
22
 
 *                          string.
23
 
 *   ippErrorString()     - Return a name for the given status code.
24
 
 *   ippErrorValue()      - Return a status code for the given name.
25
 
 *   ippOpString()        - Return a name for the given operation id.
26
 
 *   ippOpValue()         - Return an operation id for the given name.
27
 
 *   ippPort()            - Return the default IPP port number.
28
 
 *   ippSetPort()         - Set the default port number.
29
 
 *   ippTagString()       - Return the tag name corresponding to a tag value.
30
 
 *   ippTagValue()        - Return the tag value corresponding to a tag name.
31
 
 *   ipp_col_string()     - Convert a collection to a string.
 
19
 *   ippAttributeString()      - Convert the attribute's value to a string.
 
20
 *   ippCreateRequestedArray() - Create a CUPS array of attribute names from
 
21
 *                               the given requested-attributes attribute.
 
22
 *   ippEnumString()           - Return a string corresponding to the enum
 
23
 *                               value.
 
24
 *   ippEnumValue()            - Return the value associated with a given enum
 
25
 *                               string.
 
26
 *   ippErrorString()          - Return a name for the given status code.
 
27
 *   ippErrorValue()           - Return a status code for the given name.
 
28
 *   ippOpString()             - Return a name for the given operation id.
 
29
 *   ippOpValue()              - Return an operation id for the given name.
 
30
 *   ippPort()                 - Return the default IPP port number.
 
31
 *   ippSetPort()              - Set the default port number.
 
32
 *   ippTagString()            - Return the tag name corresponding to a tag
 
33
 *                               value.
 
34
 *   ippTagValue()             - Return the tag value corresponding to a tag
 
35
 *                               name.
 
36
 *   ipp_col_string()          - Convert a collection to a string.
32
37
 */
33
38
 
34
39
/*
84
89
                  "client-error-document-security-error",
85
90
                  "client-error-document-unprintable-error"
86
91
                },
 
92
                * const ipp_status_480s[] =     /* Vendor client errors */
 
93
                {
 
94
                  /* 0x0480 - 0x048F */
 
95
                  "0x0480",
 
96
                  "0x0481",
 
97
                  "0x0482",
 
98
                  "0x0483",
 
99
                  "0x0484",
 
100
                  "0x0485",
 
101
                  "0x0486",
 
102
                  "0x0487",
 
103
                  "0x0488",
 
104
                  "0x0489",
 
105
                  "0x048A",
 
106
                  "0x048B",
 
107
                  "0x048C",
 
108
                  "0x048D",
 
109
                  "0x048E",
 
110
                  "0x048F",
 
111
                  /* 0x0490 - 0x049F */
 
112
                  "0x0490",
 
113
                  "0x0491",
 
114
                  "0x0492",
 
115
                  "0x0493",
 
116
                  "0x0494",
 
117
                  "0x0495",
 
118
                  "0x0496",
 
119
                  "0x0497",
 
120
                  "0x0498",
 
121
                  "0x0499",
 
122
                  "0x049A",
 
123
                  "0x049B",
 
124
                  "cups-error-account-info-needed",
 
125
                  "cups-error-account-closed",
 
126
                  "cups-error-account-limit-reached",
 
127
                  "cups-error-account-authorization-failed"
 
128
                },
87
129
                * const ipp_status_500s[] =             /* Server errors */
88
130
                {
89
131
                  "server-error-internal-error",
102
144
                },
103
145
                * const ipp_status_1000s[] =            /* CUPS internal */
104
146
                {
105
 
                  "cups-authorization-canceled",
 
147
                  "cups-authentication-canceled",
106
148
                  "cups-pki-error",
107
149
                  "cups-upgrade-required"
108
150
                };
109
151
static const char * const ipp_std_ops[] =
110
152
                {
111
153
                  /* 0x0000 - 0x000f */
112
 
                  "0x00",
113
 
                  "0x01",
 
154
                  "0x0000",
 
155
                  "0x0001",
114
156
                  "Print-Job",
115
157
                  "Print-URI",
116
158
                  "Validate-Job",
124
166
                  "Hold-Job",
125
167
                  "Release-Job",
126
168
                  "Restart-Job",
127
 
                  "0x0f",
 
169
                  "0x000f",
128
170
 
129
171
                  /* 0x0010 - 0x001f */
130
172
                  "Pause-Printer",
162
204
                  "Suspend-Current-Job",
163
205
                  "Resume-Job",
164
206
 
165
 
                  /* 0x0030 - 0x003d */
 
207
                  /* 0x0030 - 0x003e */
166
208
                  "Promote-Job",
167
209
                  "Schedule-Job-After",
168
 
                  "0x32",
 
210
                  "0x0032",
169
211
                  "Cancel-Document",
170
212
                  "Get-Document-Attributes",
171
213
                  "Get-Documents",
176
218
                  "Resubmit-Job",
177
219
                  "Close-Job",
178
220
                  "Identify-Printer",
179
 
                  "Validate-Document"
 
221
                  "Validate-Document",
 
222
                  "Send-Hardcopy-Document"
180
223
                },
181
224
                * const ipp_cups_ops[] =
182
225
                {
358
401
                  "trim-after-pages",
359
402
                  "trim-after-documents",
360
403
                  "trim-after-copies",
361
 
                  "trim-after-job"
 
404
                  "trim-after-job",
 
405
                  "64",
 
406
                  "65",
 
407
                  "66",
 
408
                  "67",
 
409
                  "68",
 
410
                  "69",
 
411
                  "punch-top-left",
 
412
                  "punch-bottom-left",
 
413
                  "punch-top-right",
 
414
                  "punch-bottom-right",
 
415
                  "punch-dual-left",
 
416
                  "punch-dual-top",
 
417
                  "punch-dual-right",
 
418
                  "punch-dual-bottom",
 
419
                  "punch-triple-left",
 
420
                  "punch-triple-top",
 
421
                  "punch-triple-right",
 
422
                  "punch-triple-bottom",
 
423
                  "punch-quad-left",
 
424
                  "punch-quad-top",
 
425
                  "punch-quad-right",
 
426
                  "punch-quad-bottom",
 
427
                  "86",
 
428
                  "87",
 
429
                  "88",
 
430
                  "89",
 
431
                  "fold-accordian",
 
432
                  "fold-double-gate",
 
433
                  "fold-gate",
 
434
                  "fold-half",
 
435
                  "fold-half-z",
 
436
                  "fold-left-gate",
 
437
                  "fold-letter",
 
438
                  "fold-parallel",
 
439
                  "fold-poster",
 
440
                  "fold-right-gate",
 
441
                  "fold-z"
 
442
                },
 
443
                * const ipp_finishings_vendor[] =
 
444
                {
 
445
                  /* 0x40000000 to 0x4000000F */
 
446
                  "0x40000000",
 
447
                  "0x40000001",
 
448
                  "0x40000002",
 
449
                  "0x40000003",
 
450
                  "0x40000004",
 
451
                  "0x40000005",
 
452
                  "0x40000006",
 
453
                  "0x40000007",
 
454
                  "0x40000008",
 
455
                  "0x40000009",
 
456
                  "0x4000000A",
 
457
                  "0x4000000B",
 
458
                  "0x4000000C",
 
459
                  "0x4000000D",
 
460
                  "0x4000000E",
 
461
                  "0x4000000F",
 
462
                  /* 0x40000010 to 0x4000001F */
 
463
                  "0x40000010",
 
464
                  "0x40000011",
 
465
                  "0x40000012",
 
466
                  "0x40000013",
 
467
                  "0x40000014",
 
468
                  "0x40000015",
 
469
                  "0x40000016",
 
470
                  "0x40000017",
 
471
                  "0x40000018",
 
472
                  "0x40000019",
 
473
                  "0x4000001A",
 
474
                  "0x4000001B",
 
475
                  "0x4000001C",
 
476
                  "0x4000001D",
 
477
                  "0x4000001E",
 
478
                  "0x4000001F",
 
479
                  /* 0x40000020 to 0x4000002F */
 
480
                  "0x40000020",
 
481
                  "0x40000021",
 
482
                  "0x40000022",
 
483
                  "0x40000023",
 
484
                  "0x40000024",
 
485
                  "0x40000025",
 
486
                  "0x40000026",
 
487
                  "0x40000027",
 
488
                  "0x40000028",
 
489
                  "0x40000029",
 
490
                  "0x4000002A",
 
491
                  "0x4000002B",
 
492
                  "0x4000002C",
 
493
                  "0x4000002D",
 
494
                  "0x4000002E",
 
495
                  "0x4000002F",
 
496
                  /* 0x40000030 to 0x4000003F */
 
497
                  "0x40000030",
 
498
                  "0x40000031",
 
499
                  "0x40000032",
 
500
                  "0x40000033",
 
501
                  "0x40000034",
 
502
                  "0x40000035",
 
503
                  "0x40000036",
 
504
                  "0x40000037",
 
505
                  "0x40000038",
 
506
                  "0x40000039",
 
507
                  "0x4000003A",
 
508
                  "0x4000003B",
 
509
                  "0x4000003C",
 
510
                  "0x4000003D",
 
511
                  "0x4000003E",
 
512
                  "0x4000003F",
 
513
                  /* 0x40000040 - 0x4000004F */
 
514
                  "0x40000040",
 
515
                  "0x40000041",
 
516
                  "0x40000042",
 
517
                  "0x40000043",
 
518
                  "0x40000044",
 
519
                  "0x40000045",
 
520
                  "cups-punch-top-left",
 
521
                  "cups-punch-bottom-left",
 
522
                  "cups-punch-top-right",
 
523
                  "cups-punch-bottom-right",
 
524
                  "cups-punch-dual-left",
 
525
                  "cups-punch-dual-top",
 
526
                  "cups-punch-dual-right",
 
527
                  "cups-punch-dual-bottom",
 
528
                  "cups-punch-triple-left",
 
529
                  "cups-punch-triple-top",
 
530
                  /* 0x40000050 - 0x4000005F */
 
531
                  "cups-punch-triple-right",
 
532
                  "cups-punch-triple-bottom",
 
533
                  "cups-punch-quad-left",
 
534
                  "cups-punch-quad-top",
 
535
                  "cups-punch-quad-right",
 
536
                  "cups-punch-quad-bottom",
 
537
                  "0x40000056",
 
538
                  "0x40000057",
 
539
                  "0x40000058",
 
540
                  "0x40000059",
 
541
                  "cups-fold-accordian",
 
542
                  "cups-fold-double-gate",
 
543
                  "cups-fold-gate",
 
544
                  "cups-fold-half",
 
545
                  "cups-fold-half-z",
 
546
                  "cups-fold-left-gate",
 
547
                  /* 0x40000060 - 0x40000064 */
 
548
                  "cups-fold-letter",
 
549
                  "cups-fold-parallel",
 
550
                  "cups-fold-poster",
 
551
                  "cups-fold-right-gate",
 
552
                  "cups-fold-z"
362
553
                },
363
554
                * const ipp_job_collation_types[] =
364
555
                {                       /* job-collation-type enums */
424
615
  char          *bufptr,                /* Pointer into buffer */
425
616
                *bufend,                /* End of buffer */
426
617
                temp[256];              /* Temporary string */
427
 
  const char    *ptr;                   /* Pointer into string */
 
618
  const char    *ptr,                   /* Pointer into string */
 
619
                *end;                   /* Pointer to end of string */
428
620
  _ipp_value_t  *val;                   /* Current value */
429
621
 
430
622
 
452
644
        bufptr ++;
453
645
    }
454
646
 
455
 
    switch (attr->value_tag & ~IPP_TAG_COPY)
 
647
    switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
456
648
    {
457
649
      case IPP_TAG_ENUM :
458
650
          ptr = ippEnumString(attr->name, val->integer);
580
772
          break;
581
773
 
582
774
      case IPP_TAG_STRING :
583
 
          for (ptr = val->string.text; *ptr; ptr ++)
 
775
          for (ptr = val->unknown.data, end = ptr + val->unknown.length;
 
776
               ptr < end; ptr ++)
584
777
          {
585
778
            if (*ptr == '\\' || _cups_isspace(*ptr))
586
779
            {
629
822
 
630
823
 
631
824
/*
 
825
 * 'ippCreateRequestedArray()' - Create a CUPS array of attribute names from the
 
826
 *                               given requested-attributes attribute.
 
827
 *
 
828
 * This function creates a (sorted) CUPS array of attribute names matching the
 
829
 * list of "requested-attribute" values supplied in an IPP request.  All IANA-
 
830
 * registered values are supported in addition to the CUPS IPP extension
 
831
 * attributes.
 
832
 *
 
833
 * The @code request@ parameter specifies the request message that was read from
 
834
 * the client.
 
835
 *
 
836
 * @code NULL@ is returned if all attributes should be returned.  Otherwise, the
 
837
 * result is a sorted array of attribute names, where @code cupsArrayFind(array,
 
838
 * "attribute-name")@ will return a non-NULL pointer.  The array must be freed
 
839
 * using the @code cupsArrayDelete@ function.
 
840
 *
 
841
 * @since CUPS 1.7/OS X 10.9@
 
842
 */
 
843
 
 
844
cups_array_t *                          /* O - CUPS array or @code NULL@ if all */
 
845
ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
 
846
{
 
847
  int                   i, j,           /* Looping vars */
 
848
                        count,          /* Number of values */
 
849
                        added;          /* Was name added? */
 
850
  ipp_attribute_t       *requested;     /* requested-attributes attribute */
 
851
  cups_array_t          *ra;            /* Requested attributes array */
 
852
  const char            *value;         /* Current value */
 
853
  /* The following lists come from the current IANA IPP registry of attributes */
 
854
  static const char * const document_description[] =
 
855
  {                                     /* document-description group */
 
856
    "compression",
 
857
    "copies-actual",
 
858
    "cover-back-actual",
 
859
    "cover-front-actual",
 
860
    "current-page-order",
 
861
    "date-time-at-completed",
 
862
    "date-time-at-creation",
 
863
    "date-time-at-processing",
 
864
    "detailed-status-messages",
 
865
    "document-access-errors",
 
866
    "document-charset",
 
867
    "document-digital-signature",
 
868
    "document-format",
 
869
    "document-format-details",
 
870
    "document-format-detected",
 
871
    "document-format-version",
 
872
    "document-format-version-detected",
 
873
    "document-job-id",
 
874
    "document-job-uri",
 
875
    "document-message",
 
876
    "document-metadata",
 
877
    "document-name",
 
878
    "document-natural-language",
 
879
    "document-number",
 
880
    "document-printer-uri",
 
881
    "document-state",
 
882
    "document-state-message",
 
883
    "document-state-reasons",
 
884
    "document-uri",
 
885
    "document-uuid",
 
886
    "errors-count",
 
887
    "finishings-actual",
 
888
    "finishings-col-actual",
 
889
    "force-front-side-actual",
 
890
    "imposition-template-actual",
 
891
    "impressions",
 
892
    "impressions-completed",
 
893
    "impressions-completed-current-copy",
 
894
    "insert-sheet-actual",
 
895
    "k-octets",
 
896
    "k-octets-processed",
 
897
    "last-document",
 
898
    "media-actual",
 
899
    "media-col-actual",
 
900
    "media-input-tray-check-actual",
 
901
    "media-sheets",
 
902
    "media-sheets-completed",
 
903
    "more-info",
 
904
    "number-up-actual",
 
905
    "orientation-requested-actual",
 
906
    "output-bin-actual",
 
907
    "output-device-assigned",
 
908
    "overrides-actual",
 
909
    "page-delivery-actual",
 
910
    "page-order-received-actual",
 
911
    "page-ranges-actual",
 
912
    "pages",
 
913
    "pages-completed",
 
914
    "pages-completed-current-copy",
 
915
    "presentation-direction-number-up-actual",
 
916
    "print-color-mode-actual",
 
917
    "print-content-optimize-actual",
 
918
    "print-quality-actual",
 
919
    "print-rendering-intent-actual",
 
920
    "print-scaling-actual",             /* IPP Paid Printing */
 
921
    "printer-resolution-actual",
 
922
    "printer-up-time",
 
923
    "separator-sheets-actual",
 
924
    "sheet-completed-copy-number",
 
925
    "sides-actual",
 
926
    "time-at-completed",
 
927
    "time-at-creation",
 
928
    "time-at-processing",
 
929
    "x-image-position-actual",
 
930
    "x-image-shift-actual",
 
931
    "x-side1-image-shift-actual",
 
932
    "x-side2-image-shift-actual",
 
933
    "y-image-position-actual",
 
934
    "y-image-shift-actual",
 
935
    "y-side1-image-shift-actual",
 
936
    "y-side2-image-shift-actual"
 
937
  };
 
938
  static const char * const document_template[] =
 
939
  {                                     /* document-template group */
 
940
    "copies",
 
941
    "copies-default",
 
942
    "copies-supported",
 
943
    "cover-back",
 
944
    "cover-back-default",
 
945
    "cover-back-supported",
 
946
    "cover-front",
 
947
    "cover-front-default",
 
948
    "cover-front-supported",
 
949
    "feed-orientation",
 
950
    "feed-orientation-default",
 
951
    "feed-orientation-supported",
 
952
    "finishings",
 
953
    "finishings-col",
 
954
    "finishings-col-default",
 
955
    "finishings-col-supported",
 
956
    "finishings-default",
 
957
    "finishings-supported",
 
958
    "font-name-requested",
 
959
    "font-name-requested-default",
 
960
    "font-name-requested-supported",
 
961
    "font-size-requested",
 
962
    "font-size-requested-default",
 
963
    "font-size-requested-supported",
 
964
    "force-front-side",
 
965
    "force-front-side-default",
 
966
    "force-front-side-supported",
 
967
    "imposition-template",
 
968
    "imposition-template-default",
 
969
    "imposition-template-supported",
 
970
    "insert-after-page-number-supported",
 
971
    "insert-count-supported",
 
972
    "insert-sheet",
 
973
    "insert-sheet-default",
 
974
    "insert-sheet-supported",
 
975
    "max-stitching-locations-supported",
 
976
    "media",
 
977
    "media-back-coating-supported",
 
978
    "media-bottom-margin-supported",
 
979
    "media-col",
 
980
    "media-col-default",
 
981
    "media-col-supported",
 
982
    "media-color-supported",
 
983
    "media-default",
 
984
    "media-front-coating-supported",
 
985
    "media-grain-supported",
 
986
    "media-hole-count-supported",
 
987
    "media-info-supported",
 
988
    "media-input-tray-check",
 
989
    "media-input-tray-check-default",
 
990
    "media-input-tray-check-supported",
 
991
    "media-key-supported",
 
992
    "media-left-margin-supported",
 
993
    "media-order-count-supported",
 
994
    "media-pre-printed-supported",
 
995
    "media-recycled-supported",
 
996
    "media-right-margin-supported",
 
997
    "media-size-supported",
 
998
    "media-source-supported",
 
999
    "media-supported",
 
1000
    "media-thickness-supported",
 
1001
    "media-top-margin-supported",
 
1002
    "media-type-supported",
 
1003
    "media-weight-metric-supported",
 
1004
    "multiple-document-handling",
 
1005
    "multiple-document-handling-default",
 
1006
    "multiple-document-handling-supported",
 
1007
    "number-up",
 
1008
    "number-up-default",
 
1009
    "number-up-supported",
 
1010
    "orientation-requested",
 
1011
    "orientation-requested-default",
 
1012
    "orientation-requested-supported",
 
1013
    "output-mode",                      /* CUPS extension */
 
1014
    "output-mode-default",              /* CUPS extension */
 
1015
    "output-mode-supported",            /* CUPS extension */
 
1016
    "overrides",
 
1017
    "overrides-supported",
 
1018
    "page-delivery",
 
1019
    "page-delivery-default",
 
1020
    "page-delivery-supported",
 
1021
    "page-order-received",
 
1022
    "page-order-received-default",
 
1023
    "page-order-received-supported",
 
1024
    "page-ranges",
 
1025
    "page-ranges-supported",
 
1026
    "pages-per-subset",
 
1027
    "pages-per-subset-supported",
 
1028
    "pdl-init-file",
 
1029
    "pdl-init-file-default",
 
1030
    "pdl-init-file-entry-supported",
 
1031
    "pdl-init-file-location-supported",
 
1032
    "pdl-init-file-name-subdirectory-supported",
 
1033
    "pdl-init-file-name-supported",
 
1034
    "pdl-init-file-supported",
 
1035
    "presentation-direction-number-up",
 
1036
    "presentation-direction-number-up-default",
 
1037
    "presentation-direction-number-up-supported",
 
1038
    "print-color-mode",
 
1039
    "print-color-mode-default",
 
1040
    "print-color-mode-supported",
 
1041
    "print-content-optimize",
 
1042
    "print-content-optimize-default",
 
1043
    "print-content-optimize-supported",
 
1044
    "print-quality",
 
1045
    "print-quality-default",
 
1046
    "print-quality-supported",
 
1047
    "print-rendering-intent",
 
1048
    "print-rendering-intent-default",
 
1049
    "print-rendering-intent-supported",
 
1050
    "print-scaling",                    /* IPP Paid Printing */
 
1051
    "print-scaling-default",            /* IPP Paid Printing */
 
1052
    "print-scaling-supported",          /* IPP Paid Printing */
 
1053
    "printer-resolution",
 
1054
    "printer-resolution-default",
 
1055
    "printer-resolution-supported",
 
1056
    "separator-sheets",
 
1057
    "separator-sheets-default",
 
1058
    "separator-sheets-supported",
 
1059
    "sheet-collate",
 
1060
    "sheet-collate-default",
 
1061
    "sheet-collate-supported",
 
1062
    "sides",
 
1063
    "sides-default",
 
1064
    "sides-supported",
 
1065
    "stitching-locations-supported",
 
1066
    "stitching-offset-supported",
 
1067
    "x-image-position",
 
1068
    "x-image-position-default",
 
1069
    "x-image-position-supported",
 
1070
    "x-image-shift",
 
1071
    "x-image-shift-default",
 
1072
    "x-image-shift-supported",
 
1073
    "x-side1-image-shift",
 
1074
    "x-side1-image-shift-default",
 
1075
    "x-side1-image-shift-supported",
 
1076
    "x-side2-image-shift",
 
1077
    "x-side2-image-shift-default",
 
1078
    "x-side2-image-shift-supported",
 
1079
    "y-image-position",
 
1080
    "y-image-position-default",
 
1081
    "y-image-position-supported",
 
1082
    "y-image-shift",
 
1083
    "y-image-shift-default",
 
1084
    "y-image-shift-supported",
 
1085
    "y-side1-image-shift",
 
1086
    "y-side1-image-shift-default",
 
1087
    "y-side1-image-shift-supported",
 
1088
    "y-side2-image-shift",
 
1089
    "y-side2-image-shift-default",
 
1090
    "y-side2-image-shift-supported"
 
1091
  };
 
1092
  static const char * const job_description[] =
 
1093
  {                                     /* job-description group */
 
1094
    "compression-supplied",
 
1095
    "copies-actual",
 
1096
    "cover-back-actual",
 
1097
    "cover-front-actual",
 
1098
    "current-page-order",
 
1099
    "date-time-at-completed",
 
1100
    "date-time-at-creation",
 
1101
    "date-time-at-processing",
 
1102
    "destination-statuses",
 
1103
    "document-charset-supplied",
 
1104
    "document-digital-signature-supplied",
 
1105
    "document-format-details-supplied",
 
1106
    "document-format-supplied",
 
1107
    "document-message-supplied",
 
1108
    "document-metadata",
 
1109
    "document-name-supplied",
 
1110
    "document-natural-language-supplied",
 
1111
    "document-overrides-actual",
 
1112
    "errors-count",
 
1113
    "finishings-actual",
 
1114
    "finishings-col-actual",
 
1115
    "force-front-side-actual",
 
1116
    "imposition-template-actual",
 
1117
    "impressions-completed-current-copy",
 
1118
    "insert-sheet-actual",
 
1119
    "job-account-id-actual",
 
1120
    "job-accounting-sheets-actual",
 
1121
    "job-accounting-user-id-actual",
 
1122
    "job-attribute-fidelity",
 
1123
    "job-charge-info",                  /* CUPS extension */
 
1124
    "job-collation-type",
 
1125
    "job-collation-type-actual",
 
1126
    "job-copies-actual",
 
1127
    "job-cover-back-actual",
 
1128
    "job-cover-front-actual",
 
1129
    "job-detailed-status-message",
 
1130
    "job-document-access-errors",
 
1131
    "job-error-sheet-actual",
 
1132
    "job-finishings-actual",
 
1133
    "job-finishings-col-actual",
 
1134
    "job-hold-until-actual",
 
1135
    "job-id",
 
1136
    "job-impressions",
 
1137
    "job-impressions-completed",
 
1138
    "job-k-octets",
 
1139
    "job-k-octets-processed",
 
1140
    "job-mandatory-attributes",
 
1141
    "job-media-progress",               /* CUPS extension */
 
1142
    "job-media-sheets",
 
1143
    "job-media-sheets-completed",
 
1144
    "job-message-from-operator",
 
1145
    "job-more-info",
 
1146
    "job-name",
 
1147
    "job-originating-host-name",        /* CUPS extension */
 
1148
    "job-originating-user-name",
 
1149
    "job-originating-user-uri",
 
1150
    "job-pages",
 
1151
    "job-pages-completed",
 
1152
    "job-pages-completed-current-copy",
 
1153
    "job-printer-state-message",        /* CUPS extension */
 
1154
    "job-printer-state-reasons",        /* CUPS extension */
 
1155
    "job-printer-up-time",
 
1156
    "job-printer-uri",
 
1157
    "job-priority-actual",
 
1158
    "job-save-printer-make-and-model",
 
1159
    "job-sheet-message-actual",
 
1160
    "job-sheets-actual",
 
1161
    "job-sheets-col-actual",
 
1162
    "job-state",
 
1163
    "job-state-message",
 
1164
    "job-state-reasons",
 
1165
    "job-uri",
 
1166
    "job-uuid",
 
1167
    "media-actual",
 
1168
    "media-col-actual",
 
1169
    "media-check-input-tray-actual",
 
1170
    "multiple-document-handling-actual",
 
1171
    "number-of-documents",
 
1172
    "number-of-intervening-jobs",
 
1173
    "number-up-actual",
 
1174
    "orientation-requested-actual",
 
1175
    "original-requesting-user-name",
 
1176
    "output-bin-actual",
 
1177
    "output-device-assigned",
 
1178
    "overrides-actual",
 
1179
    "page-delivery-actual",
 
1180
    "page-order-received-actual",
 
1181
    "page-ranges-actual",
 
1182
    "presentation-direction-number-up-actual",
 
1183
    "print-color-mode-actual",
 
1184
    "print-content-optimize-actual",
 
1185
    "print-quality-actual",
 
1186
    "print-rendering-intent-actual",
 
1187
    "print-scaling-actual",             /* IPP Paid Printing */
 
1188
    "printer-resolution-actual",
 
1189
    "separator-sheets-actual",
 
1190
    "sheet-collate-actual",
 
1191
    "sheet-completed-copy-number",
 
1192
    "sheet-completed-document-number",
 
1193
    "sides-actual",
 
1194
    "time-at-completed",
 
1195
    "time-at-creation",
 
1196
    "time-at-processing",
 
1197
    "warnings-count",
 
1198
    "x-image-position-actual",
 
1199
    "x-image-shift-actual",
 
1200
    "x-side1-image-shift-actual",
 
1201
    "x-side2-image-shift-actual",
 
1202
    "y-image-position-actual",
 
1203
    "y-image-shift-actual",
 
1204
    "y-side1-image-shift-actual",
 
1205
    "y-side2-image-shift-actual"
 
1206
  };
 
1207
  static const char * const job_template[] =
 
1208
  {                                     /* job-template group */
 
1209
    "confirmation-sheet-print",         /* IPP FaxOut */
 
1210
    "confirmation-sheet-print-default",
 
1211
    "copies",
 
1212
    "copies-default",
 
1213
    "copies-supported",
 
1214
    "cover-back",
 
1215
    "cover-back-default",
 
1216
    "cover-back-supported",
 
1217
    "cover-front",
 
1218
    "cover-front-default",
 
1219
    "cover-front-supported",
 
1220
    "cover-sheet-info",                 /* IPP FaxOut */
 
1221
    "cover-sheet-info-default",
 
1222
    "cover-sheet-info-supported",
 
1223
    "destination-uri-schemes-supported",/* IPP FaxOut */
 
1224
    "destination-uris",                 /* IPP FaxOut */
 
1225
    "destination-uris-supported",
 
1226
    "feed-orientation",
 
1227
    "feed-orientation-default",
 
1228
    "feed-orientation-supported",
 
1229
    "finishings",
 
1230
    "finishings-col",
 
1231
    "finishings-col-default",
 
1232
    "finishings-col-supported",
 
1233
    "finishings-default",
 
1234
    "finishings-supported",
 
1235
    "font-name-requested",
 
1236
    "font-name-requested-default",
 
1237
    "font-name-requested-supported",
 
1238
    "font-size-requested",
 
1239
    "font-size-requested-default",
 
1240
    "font-size-requested-supported",
 
1241
    "force-front-side",
 
1242
    "force-front-side-default",
 
1243
    "force-front-side-supported",
 
1244
    "imposition-template",
 
1245
    "imposition-template-default",
 
1246
    "imposition-template-supported",
 
1247
    "insert-after-page-number-supported",
 
1248
    "insert-count-supported",
 
1249
    "insert-sheet",
 
1250
    "insert-sheet-default",
 
1251
    "insert-sheet-supported",
 
1252
    "job-account-id",
 
1253
    "job-account-id-default",
 
1254
    "job-account-id-supported",
 
1255
    "job-accounting-sheets"
 
1256
    "job-accounting-sheets-default"
 
1257
    "job-accounting-sheets-supported"
 
1258
    "job-accounting-user-id",
 
1259
    "job-accounting-user-id-default",
 
1260
    "job-accounting-user-id-supported",
 
1261
    "job-copies",
 
1262
    "job-copies-default",
 
1263
    "job-copies-supported",
 
1264
    "job-cover-back",
 
1265
    "job-cover-back-default",
 
1266
    "job-cover-back-supported",
 
1267
    "job-cover-front",
 
1268
    "job-cover-front-default",
 
1269
    "job-cover-front-supported",
 
1270
    "job-delay-output-until",
 
1271
    "job-delay-output-until-default",
 
1272
    "job-delay-output-until-supported",
 
1273
    "job-delay-output-until-time",
 
1274
    "job-delay-output-until-time-default",
 
1275
    "job-delay-output-until-time-supported",
 
1276
    "job-error-action",
 
1277
    "job-error-action-default",
 
1278
    "job-error-action-supported",
 
1279
    "job-error-sheet",
 
1280
    "job-error-sheet-default",
 
1281
    "job-error-sheet-supported",
 
1282
    "job-finishings",
 
1283
    "job-finishings-col",
 
1284
    "job-finishings-col-default",
 
1285
    "job-finishings-col-supported",
 
1286
    "job-finishings-default",
 
1287
    "job-finishings-supported",
 
1288
    "job-hold-until",
 
1289
    "job-hold-until-default",
 
1290
    "job-hold-until-supported",
 
1291
    "job-hold-until-time",
 
1292
    "job-hold-until-time-default",
 
1293
    "job-hold-until-time-supported",
 
1294
    "job-message-to-operator",
 
1295
    "job-message-to-operator-default",
 
1296
    "job-message-to-operator-supported",
 
1297
    "job-phone-number",
 
1298
    "job-phone-number-default",
 
1299
    "job-phone-number-supported",
 
1300
    "job-priority",
 
1301
    "job-priority-default",
 
1302
    "job-priority-supported",
 
1303
    "job-recipient-name",
 
1304
    "job-recipient-name-default",
 
1305
    "job-recipient-name-supported",
 
1306
    "job-save-disposition",
 
1307
    "job-save-disposition-default",
 
1308
    "job-save-disposition-supported",
 
1309
    "job-sheets",
 
1310
    "job-sheets-col",
 
1311
    "job-sheets-col-default",
 
1312
    "job-sheets-col-supported",
 
1313
    "job-sheets-default",
 
1314
    "job-sheets-supported",
 
1315
    "logo-uri-schemes-supported",
 
1316
    "max-save-info-supported",
 
1317
    "max-stitching-locations-supported",
 
1318
    "media",
 
1319
    "media-back-coating-supported",
 
1320
    "media-bottom-margin-supported",
 
1321
    "media-col",
 
1322
    "media-col-default",
 
1323
    "media-col-supported",
 
1324
    "media-color-supported",
 
1325
    "media-default",
 
1326
    "media-front-coating-supported",
 
1327
    "media-grain-supported",
 
1328
    "media-hole-count-supported",
 
1329
    "media-info-supported",
 
1330
    "media-input-tray-check",
 
1331
    "media-input-tray-check-default",
 
1332
    "media-input-tray-check-supported",
 
1333
    "media-key-supported",
 
1334
    "media-left-margin-supported",
 
1335
    "media-order-count-supported",
 
1336
    "media-pre-printed-supported",
 
1337
    "media-recycled-supported",
 
1338
    "media-right-margin-supported",
 
1339
    "media-size-supported",
 
1340
    "media-source-supported",
 
1341
    "media-supported",
 
1342
    "media-thickness-supported",
 
1343
    "media-top-margin-supported",
 
1344
    "media-type-supported",
 
1345
    "media-weight-metric-supported",
 
1346
    "multiple-document-handling",
 
1347
    "multiple-document-handling-default",
 
1348
    "multiple-document-handling-supported",
 
1349
    "number-of-retries",                /* IPP FaxOut */
 
1350
    "number-of-retries-default",
 
1351
    "number-of-retries-supported",
 
1352
    "number-up",
 
1353
    "number-up-default",
 
1354
    "number-up-supported",
 
1355
    "orientation-requested",
 
1356
    "orientation-requested-default",
 
1357
    "orientation-requested-supported",
 
1358
    "output-bin",
 
1359
    "output-bin-default",
 
1360
    "output-bin-supported",
 
1361
    "output-device",
 
1362
    "output-device-default",
 
1363
    "output-device-supported",
 
1364
    "output-mode",                      /* CUPS extension */
 
1365
    "output-mode-default",              /* CUPS extension */
 
1366
    "output-mode-supported",            /* CUPS extension */
 
1367
    "overrides",
 
1368
    "overrides-supported",
 
1369
    "page-delivery",
 
1370
    "page-delivery-default",
 
1371
    "page-delivery-supported",
 
1372
    "page-order-received",
 
1373
    "page-order-received-default",
 
1374
    "page-order-received-supported",
 
1375
    "page-ranges",
 
1376
    "page-ranges-supported",
 
1377
    "pages-per-subset",
 
1378
    "pages-per-subset-supported",
 
1379
    "pdl-init-file",
 
1380
    "pdl-init-file-default",
 
1381
    "pdl-init-file-entry-supported",
 
1382
    "pdl-init-file-location-supported",
 
1383
    "pdl-init-file-name-subdirectory-supported",
 
1384
    "pdl-init-file-name-supported",
 
1385
    "pdl-init-file-supported",
 
1386
    "presentation-direction-number-up",
 
1387
    "presentation-direction-number-up-default",
 
1388
    "presentation-direction-number-up-supported",
 
1389
    "print-color-mode",
 
1390
    "print-color-mode-default",
 
1391
    "print-color-mode-supported",
 
1392
    "print-content-optimize",
 
1393
    "print-content-optimize-default",
 
1394
    "print-content-optimize-supported",
 
1395
    "print-quality",
 
1396
    "print-quality-default",
 
1397
    "print-quality-supported",
 
1398
    "print-rendering-intent",
 
1399
    "print-rendering-intent-default",
 
1400
    "print-rendering-intent-supported",
 
1401
    "print-scaling",                    /* IPP Paid Printing */
 
1402
    "print-scaling-default",            /* IPP Paid Printing */
 
1403
    "print-scaling-supported",          /* IPP Paid Printing */
 
1404
    "printer-resolution",
 
1405
    "printer-resolution-default",
 
1406
    "printer-resolution-supported",
 
1407
    "proof-print",
 
1408
    "proof-print-default",
 
1409
    "proof-print-supported",
 
1410
    "retry-interval",                   /* IPP FaxOut */
 
1411
    "retry-interval-default",
 
1412
    "retry-interval-supported",
 
1413
    "retry-timeout",                    /* IPP FaxOut */
 
1414
    "retry-timeout-default",
 
1415
    "retry-timeout-supported",
 
1416
    "save-disposition-supported",
 
1417
    "save-document-format-default",
 
1418
    "save-document-format-supported",
 
1419
    "save-location-default",
 
1420
    "save-location-supported",
 
1421
    "save-name-subdirectory-supported",
 
1422
    "save-name-supported",
 
1423
    "separator-sheets",
 
1424
    "separator-sheets-default",
 
1425
    "separator-sheets-supported",
 
1426
    "sheet-collate",
 
1427
    "sheet-collate-default",
 
1428
    "sheet-collate-supported",
 
1429
    "sides",
 
1430
    "sides-default",
 
1431
    "sides-supported",
 
1432
    "stitching-locations-supported",
 
1433
    "stitching-offset-supported",
 
1434
    "x-image-position",
 
1435
    "x-image-position-default",
 
1436
    "x-image-position-supported",
 
1437
    "x-image-shift",
 
1438
    "x-image-shift-default",
 
1439
    "x-image-shift-supported",
 
1440
    "x-side1-image-shift",
 
1441
    "x-side1-image-shift-default",
 
1442
    "x-side1-image-shift-supported",
 
1443
    "x-side2-image-shift",
 
1444
    "x-side2-image-shift-default",
 
1445
    "x-side2-image-shift-supported",
 
1446
    "y-image-position",
 
1447
    "y-image-position-default",
 
1448
    "y-image-position-supported",
 
1449
    "y-image-shift",
 
1450
    "y-image-shift-default",
 
1451
    "y-image-shift-supported",
 
1452
    "y-side1-image-shift",
 
1453
    "y-side1-image-shift-default",
 
1454
    "y-side1-image-shift-supported",
 
1455
    "y-side2-image-shift",
 
1456
    "y-side2-image-shift-default",
 
1457
    "y-side2-image-shift-supported"
 
1458
  };
 
1459
  static const char * const printer_description[] =
 
1460
  {                                     /* printer-description group */
 
1461
    "auth-info-required",               /* CUPS extension */
 
1462
    "charset-configured",
 
1463
    "charset-supported",
 
1464
    "color-supported",
 
1465
    "compression-supported",
 
1466
    "device-service-count",
 
1467
    "device-uri",                       /* CUPS extension */
 
1468
    "device-uuid",
 
1469
    "document-charset-default",
 
1470
    "document-charset-supported",
 
1471
    "document-creation-attributes-supported",
 
1472
    "document-digital-signature-default",
 
1473
    "document-digital-signature-supported",
 
1474
    "document-format-default",
 
1475
    "document-format-details-default",
 
1476
    "document-format-details-supported",
 
1477
    "document-format-supported",
 
1478
    "document-format-varying-attributes",
 
1479
    "document-format-version-default",
 
1480
    "document-format-version-supported",
 
1481
    "document-natural-language-default",
 
1482
    "document-natural-language-supported",
 
1483
    "document-password-supported",
 
1484
    "generated-natural-language-supported",
 
1485
    "identify-actions-default",
 
1486
    "identify-actions-supported",
 
1487
    "input-source-supported",
 
1488
    "ipp-features-supported",
 
1489
    "ipp-versions-supported",
 
1490
    "ippget-event-life",
 
1491
    "job-authorization-uri-supported",  /* CUPS extension */
 
1492
    "job-constraints-supported",
 
1493
    "job-creation-attributes-supported",
 
1494
    "job-finishings-col-ready",
 
1495
    "job-finishings-ready",
 
1496
    "job-ids-supported",
 
1497
    "job-impressions-supported",
 
1498
    "job-k-limit",                      /* CUPS extension */
 
1499
    "job-k-octets-supported",
 
1500
    "job-media-sheets-supported",
 
1501
    "job-page-limit",                   /* CUPS extension */
 
1502
    "job-password-encryption-supported",
 
1503
    "job-password-supported",
 
1504
    "job-quota-period",                 /* CUPS extension */
 
1505
    "job-resolvers-supported",
 
1506
    "job-settable-attributes-supported",
 
1507
    "job-spooling-supported",
 
1508
    "jpeg-k-octets-supported",          /* CUPS extension */
 
1509
    "jpeg-x-dimension-supported",       /* CUPS extension */
 
1510
    "jpeg-y-dimension-supported",       /* CUPS extension */
 
1511
    "landscape-orientation-requested-preferred",
 
1512
                                        /* CUPS extension */
 
1513
    "marker-change-time",               /* CUPS extension */
 
1514
    "marker-colors",                    /* CUPS extension */
 
1515
    "marker-high-levels",               /* CUPS extension */
 
1516
    "marker-levels",                    /* CUPS extension */
 
1517
    "marker-low-levels",                /* CUPS extension */
 
1518
    "marker-message",                   /* CUPS extension */
 
1519
    "marker-names",                     /* CUPS extension */
 
1520
    "marker-types",                     /* CUPS extension */
 
1521
    "media-col-ready",
 
1522
    "media-ready",
 
1523
    "member-names",                     /* CUPS extension */
 
1524
    "member-uris",                      /* CUPS extension */
 
1525
    "multiple-destination-uris-supported",/* IPP FaxOut */
 
1526
    "multiple-document-jobs-supported",
 
1527
    "multiple-operation-time-out",
 
1528
    "multiple-operation-time-out-action",
 
1529
    "natural-language-configured",
 
1530
    "operations-supported",
 
1531
    "pages-per-minute",
 
1532
    "pages-per-minute-color",
 
1533
    "pdf-k-octets-supported",           /* CUPS extension */
 
1534
    "pdf-versions-supported",           /* CUPS extension */
 
1535
    "pdl-override-supported",
 
1536
    "ppd-timestamp",
 
1537
    "port-monitor",                     /* CUPS extension */
 
1538
    "port-monitor-supported",           /* CUPS extension */
 
1539
    "preferred-attributes-supported",
 
1540
    "printer-alert",
 
1541
    "printer-alert-description",
 
1542
    "printer-charge-info",
 
1543
    "printer-charge-info-uri",
 
1544
    "printer-commands",                 /* CUPS extension */
 
1545
    "printer-current-time",
 
1546
    "printer-detailed-status-messages",
 
1547
    "printer-device-id",
 
1548
    "printer-dns-sd-name",              /* CUPS extension */
 
1549
    "printer-driver-installer",
 
1550
    "printer-fax-log-uri",              /* IPP FaxOut */
 
1551
    "printer-fax-modem-info",           /* IPP FaxOut */
 
1552
    "printer-fax-modem-name",           /* IPP FaxOut */
 
1553
    "printer-fax-modem-number",         /* IPP FaxOut */
 
1554
    "printer-geo-location",
 
1555
    "printer-get-attributes-supported",
 
1556
    "printer-icc-profiles",
 
1557
    "printer-icons",
 
1558
    "printer-info",
 
1559
    "printer-is-accepting-jobs",
 
1560
    "printer-is-colormanaged",
 
1561
    "printer-is-shared",                /* CUPS extension */
 
1562
    "printer-kind",                     /* IPP Paid Printing */
 
1563
    "printer-location",
 
1564
    "printer-make-and-model",
 
1565
    "printer-mandatory-job-attributes",
 
1566
    "printer-message-date-time",
 
1567
    "printer-message-from-operator",
 
1568
    "printer-message-time",
 
1569
    "printer-more-info",
 
1570
    "printer-more-info-manufacturer",
 
1571
    "printer-name",
 
1572
    "printer-native-formats",
 
1573
    "printer-organization",
 
1574
    "printer-organizational-unit",
 
1575
    "printer-settable-attributes-supported",
 
1576
    "printer-state",
 
1577
    "printer-state-change-date-time",
 
1578
    "printer-state-change-time",
 
1579
    "printer-state-message",
 
1580
    "printer-state-reasons",
 
1581
    "printer-supply",
 
1582
    "printer-supply-description",
 
1583
    "printer-supply-info-uri",
 
1584
    "printer-type",                     /* CUPS extension */
 
1585
    "printer-up-time",
 
1586
    "printer-uri-supported",
 
1587
    "printer-uuid",
 
1588
    "printer-xri-supported",
 
1589
    "pwg-raster-document-resolution-supported",
 
1590
    "pwg-raster-document-sheet-back",
 
1591
    "pwg-raster-document-type-supported",
 
1592
    "queued-job-count",
 
1593
    "reference-uri-schemes-supported",
 
1594
    "repertoire-supported",
 
1595
    "requesting-user-name-allowed",     /* CUPS extension */
 
1596
    "requesting-user-name-denied",      /* CUPS extension */
 
1597
    "requesting-user-uri-supported",
 
1598
    "subordinate-printers-supported",
 
1599
    "urf-supported",                    /* CUPS extension */
 
1600
    "uri-authentication-supported",
 
1601
    "uri-security-supported",
 
1602
    "user-defined-value-supported",
 
1603
    "which-jobs-supported",
 
1604
    "xri-authentication-supported",
 
1605
    "xri-security-supported",
 
1606
    "xri-uri-scheme-supported"
 
1607
  };
 
1608
  static const char * const subscription_description[] =
 
1609
  {                                     /* subscription-description group */
 
1610
    "notify-job-id",
 
1611
    "notify-lease-expiration-time",
 
1612
    "notify-printer-up-time",
 
1613
    "notify-printer-uri",
 
1614
    "notify-sequence-number",
 
1615
    "notify-subscriber-user-name",
 
1616
    "notify-subscriber-user-uri",
 
1617
    "notify-subscription-id",
 
1618
    "subscriptions-uuid"
 
1619
  };
 
1620
  static const char * const subscription_template[] =
 
1621
  {                                     /* subscription-template group */
 
1622
    "notify-attributes",
 
1623
    "notify-attributes-supported",
 
1624
    "notify-charset",
 
1625
    "notify-events",
 
1626
    "notify-events-default",
 
1627
    "notify-events-supported",
 
1628
    "notify-lease-duration",
 
1629
    "notify-lease-duration-default",
 
1630
    "notify-lease-duration-supported",
 
1631
    "notify-max-events-supported",
 
1632
    "notify-natural-language",
 
1633
    "notify-pull-method",
 
1634
    "notify-pull-method-supported",
 
1635
    "notify-recipient-uri",
 
1636
    "notify-schemes-supported",
 
1637
    "notify-time-interval",
 
1638
    "notify-user-data"
 
1639
  };
 
1640
 
 
1641
 
 
1642
 /*
 
1643
  * Get the requested-attributes attribute...
 
1644
  */
 
1645
 
 
1646
  if ((requested = ippFindAttribute(request, "requested-attributes",
 
1647
                                    IPP_TAG_KEYWORD)) == NULL)
 
1648
  {
 
1649
   /*
 
1650
    * The Get-Jobs operation defaults to "job-id" and "job-uri", all others
 
1651
    * default to "all"...
 
1652
    */
 
1653
 
 
1654
    if (ippGetOperation(request) == IPP_OP_GET_JOBS)
 
1655
    {
 
1656
      ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
 
1657
      cupsArrayAdd(ra, "job-id");
 
1658
      cupsArrayAdd(ra, "job-uri");
 
1659
 
 
1660
      return (ra);
 
1661
    }
 
1662
    else
 
1663
      return (NULL);
 
1664
  }
 
1665
 
 
1666
 /*
 
1667
  * If the attribute contains a single "all" keyword, return NULL...
 
1668
  */
 
1669
 
 
1670
  count = ippGetCount(requested);
 
1671
  if (count == 1 && !strcmp(ippGetString(requested, 0, NULL), "all"))
 
1672
    return (NULL);
 
1673
 
 
1674
 /*
 
1675
  * Create an array using "strcmp" as the comparison function...
 
1676
  */
 
1677
 
 
1678
  ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
 
1679
 
 
1680
  for (i = 0; i < count; i ++)
 
1681
  {
 
1682
    added = 0;
 
1683
    value = ippGetString(requested, i, NULL);
 
1684
 
 
1685
    if (!strcmp(value, "document-description") || !strcmp(value, "all"))
 
1686
    {
 
1687
      for (j = 0;
 
1688
           j < (int)(sizeof(document_description) /
 
1689
                     sizeof(document_description[0]));
 
1690
           j ++)
 
1691
        cupsArrayAdd(ra, (void *)document_description[j]);
 
1692
 
 
1693
      added = 1;
 
1694
    }
 
1695
 
 
1696
    if (!strcmp(value, "document-template") || !strcmp(value, "all"))
 
1697
    {
 
1698
      for (j = 0;
 
1699
           j < (int)(sizeof(document_template) / sizeof(document_template[0]));
 
1700
           j ++)
 
1701
        cupsArrayAdd(ra, (void *)document_template[j]);
 
1702
 
 
1703
      added = 1;
 
1704
    }
 
1705
 
 
1706
    if (!strcmp(value, "job-description") || !strcmp(value, "all"))
 
1707
    {
 
1708
      for (j = 0;
 
1709
           j < (int)(sizeof(job_description) / sizeof(job_description[0]));
 
1710
           j ++)
 
1711
        cupsArrayAdd(ra, (void *)job_description[j]);
 
1712
 
 
1713
      added = 1;
 
1714
    }
 
1715
 
 
1716
    if (!strcmp(value, "job-template") || !strcmp(value, "all"))
 
1717
    {
 
1718
      for (j = 0;
 
1719
           j < (int)(sizeof(job_template) / sizeof(job_template[0]));
 
1720
           j ++)
 
1721
        cupsArrayAdd(ra, (void *)job_template[j]);
 
1722
 
 
1723
      added = 1;
 
1724
    }
 
1725
 
 
1726
    if (!strcmp(value, "printer-description") || !strcmp(value, "all"))
 
1727
    {
 
1728
      for (j = 0;
 
1729
           j < (int)(sizeof(printer_description) /
 
1730
                     sizeof(printer_description[0]));
 
1731
           j ++)
 
1732
        cupsArrayAdd(ra, (void *)printer_description[j]);
 
1733
 
 
1734
      added = 1;
 
1735
    }
 
1736
 
 
1737
    if (!strcmp(value, "subscription-description") || !strcmp(value, "all"))
 
1738
    {
 
1739
      for (j = 0;
 
1740
           j < (int)(sizeof(subscription_description) /
 
1741
                     sizeof(subscription_description[0]));
 
1742
           j ++)
 
1743
        cupsArrayAdd(ra, (void *)subscription_description[j]);
 
1744
 
 
1745
      added = 1;
 
1746
    }
 
1747
 
 
1748
    if (!strcmp(value, "subscription-template") || !strcmp(value, "all"))
 
1749
    {
 
1750
      for (j = 0;
 
1751
           j < (int)(sizeof(subscription_template) /
 
1752
                     sizeof(subscription_template[0]));
 
1753
           j ++)
 
1754
        cupsArrayAdd(ra, (void *)subscription_template[j]);
 
1755
 
 
1756
      added = 1;
 
1757
    }
 
1758
 
 
1759
    if (!added)
 
1760
      cupsArrayAdd(ra, (void *)value);
 
1761
  }
 
1762
 
 
1763
  return (ra);
 
1764
}
 
1765
 
 
1766
 
 
1767
/*
632
1768
 * 'ippEnumString()' - Return a string corresponding to the enum value.
633
1769
 */
634
1770
 
648
1784
      enumvalue < (3 + (int)(sizeof(ipp_document_states) /
649
1785
                             sizeof(ipp_document_states[0]))))
650
1786
    return (ipp_document_states[enumvalue - 3]);
651
 
  else if ((!strcmp(attrname, "finishings") ||
652
 
            !strcmp(attrname, "finishings-actual") ||
653
 
            !strcmp(attrname, "finishings-default") ||
654
 
            !strcmp(attrname, "finishings-ready") ||
655
 
            !strcmp(attrname, "finishings-supported")) &&
656
 
           enumvalue >= 3 &&
657
 
           enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
658
 
    return (ipp_finishings[enumvalue - 3]);
 
1787
  else if (!strcmp(attrname, "finishings") ||
 
1788
           !strcmp(attrname, "finishings-actual") ||
 
1789
           !strcmp(attrname, "finishings-default") ||
 
1790
           !strcmp(attrname, "finishings-ready") ||
 
1791
           !strcmp(attrname, "finishings-supported") ||
 
1792
           !strcmp(attrname, "job-finishings") ||
 
1793
           !strcmp(attrname, "job-finishings-default") ||
 
1794
           !strcmp(attrname, "job-finishings-supported"))
 
1795
  {
 
1796
    if (enumvalue >= 3 &&
 
1797
        enumvalue < (3 + (int)(sizeof(ipp_finishings) /
 
1798
                               sizeof(ipp_finishings[0]))))
 
1799
      return (ipp_finishings[enumvalue - 3]);
 
1800
    else if (enumvalue >= 0x40000000 &&
 
1801
             enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) /
 
1802
                                              sizeof(ipp_finishings_vendor[0]))))
 
1803
      return (ipp_finishings_vendor[enumvalue - 0x40000000]);
 
1804
  }
659
1805
  else if ((!strcmp(attrname, "job-collation-type") ||
660
1806
            !strcmp(attrname, "job-collation-type-actual")) &&
661
1807
           enumvalue >= 3 &&
663
1809
                                  sizeof(ipp_job_collation_types[0]))))
664
1810
    return (ipp_job_collation_types[enumvalue - 3]);
665
1811
  else if (!strcmp(attrname, "job-state") &&
666
 
           enumvalue >= IPP_JOB_PENDING && enumvalue <= IPP_JOB_COMPLETED)
667
 
    return (ipp_job_states[enumvalue - IPP_JOB_PENDING]);
 
1812
           enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
 
1813
    return (ipp_job_states[enumvalue - IPP_JSTATE_PENDING]);
668
1814
  else if (!strcmp(attrname, "operations-supported"))
669
1815
    return (ippOpString((ipp_op_t)enumvalue));
670
1816
  else if ((!strcmp(attrname, "orientation-requested") ||
684
1830
                                  sizeof(ipp_print_qualities[0]))))
685
1831
    return (ipp_print_qualities[enumvalue - 3]);
686
1832
  else if (!strcmp(attrname, "printer-state") &&
687
 
           enumvalue >= IPP_PRINTER_IDLE && enumvalue <= IPP_PRINTER_STOPPED)
688
 
    return (ipp_printer_states[enumvalue - IPP_PRINTER_IDLE]);
 
1833
           enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
 
1834
    return (ipp_printer_states[enumvalue - IPP_PSTATE_IDLE]);
689
1835
 
690
1836
 /*
691
1837
  * Not a standard enum value, just return the decimal equivalent...
731
1877
           !strcmp(attrname, "finishings-ready") ||
732
1878
           !strcmp(attrname, "finishings-supported"))
733
1879
  {
 
1880
    for (i = 0;
 
1881
         i < (int)(sizeof(ipp_finishings_vendor) /
 
1882
                   sizeof(ipp_finishings_vendor[0]));
 
1883
         i ++)
 
1884
      if (!strcmp(enumstring, ipp_finishings_vendor[i]))
 
1885
        return (i + 0x40000000);
 
1886
 
734
1887
    num_strings = (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]));
735
1888
    strings     = ipp_finishings;
736
1889
  }
795
1948
  * See if the error code is a known value...
796
1949
  */
797
1950
 
798
 
  if (error >= IPP_OK && error <= IPP_OK_EVENTS_COMPLETE)
 
1951
  if (error >= IPP_STATUS_OK && error <= IPP_STATUS_OK_EVENTS_COMPLETE)
799
1952
    return (ipp_status_oks[error]);
800
 
  else if (error == IPP_REDIRECTION_OTHER_SITE)
 
1953
  else if (error == IPP_STATUS_REDIRECTION_OTHER_SITE)
801
1954
    return ("redirection-other-site");
802
 
  else if (error == CUPS_SEE_OTHER)
 
1955
  else if (error == IPP_STATUS_CUPS_SEE_OTHER)
803
1956
    return ("cups-see-other");
804
 
  else if (error >= IPP_BAD_REQUEST && error <= IPP_PRINT_SUPPORT_FILE_NOT_FOUND)
805
 
    return (ipp_status_400s[error - IPP_BAD_REQUEST]);
806
 
  else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
807
 
    return (ipp_status_500s[error - IPP_INTERNAL_ERROR]);
808
 
  else if (error >= IPP_AUTHENTICATION_CANCELED && error <= IPP_UPGRADE_REQUIRED)
809
 
    return (ipp_status_1000s[error - IPP_AUTHENTICATION_CANCELED]);
 
1957
  else if (error >= IPP_STATUS_ERROR_BAD_REQUEST &&
 
1958
           error <= IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE)
 
1959
    return (ipp_status_400s[error - IPP_STATUS_ERROR_BAD_REQUEST]);
 
1960
  else if (error >= 0x480 &&
 
1961
           error <= IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
 
1962
    return (ipp_status_480s[error - 0x0480]);
 
1963
  else if (error >= IPP_STATUS_ERROR_INTERNAL &&
 
1964
           error <= IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS)
 
1965
    return (ipp_status_500s[error - IPP_STATUS_ERROR_INTERNAL]);
 
1966
  else if (error >= IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED &&
 
1967
           error <= IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED)
 
1968
    return (ipp_status_1000s[error -
 
1969
                             IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED]);
810
1970
 
811
1971
 /*
812
1972
  * No, build an "0xxxxx" error string...
835
1995
      return ((ipp_status_t)i);
836
1996
 
837
1997
  if (!_cups_strcasecmp(name, "redirection-other-site"))
838
 
    return (IPP_REDIRECTION_OTHER_SITE);
 
1998
    return (IPP_STATUS_REDIRECTION_OTHER_SITE);
839
1999
 
840
2000
  if (!_cups_strcasecmp(name, "cups-see-other"))
841
 
    return (CUPS_SEE_OTHER);
 
2001
    return (IPP_STATUS_CUPS_SEE_OTHER);
842
2002
 
843
2003
  for (i = 0; i < (sizeof(ipp_status_400s) / sizeof(ipp_status_400s[0])); i ++)
844
2004
    if (!_cups_strcasecmp(name, ipp_status_400s[i]))
845
2005
      return ((ipp_status_t)(i + 0x400));
846
2006
 
 
2007
  for (i = 0; i < (sizeof(ipp_status_480s) / sizeof(ipp_status_480s[0])); i ++)
 
2008
    if (!_cups_strcasecmp(name, ipp_status_480s[i]))
 
2009
      return ((ipp_status_t)(i + 0x480));
 
2010
 
847
2011
  for (i = 0; i < (sizeof(ipp_status_500s) / sizeof(ipp_status_500s[0])); i ++)
848
2012
    if (!_cups_strcasecmp(name, ipp_status_500s[i]))
849
2013
      return ((ipp_status_t)(i + 0x500));
872
2036
  * See if the operation ID is a known value...
873
2037
  */
874
2038
 
875
 
  if (op >= IPP_PRINT_JOB && op <= IPP_CLOSE_JOB)
 
2039
  if (op >= IPP_OP_PRINT_JOB && op <= IPP_OP_VALIDATE_DOCUMENT)
876
2040
    return (ipp_std_ops[op]);
877
 
  else if (op == IPP_PRIVATE)
 
2041
  else if (op == IPP_OP_PRIVATE)
878
2042
    return ("windows-ext");
879
 
  else if (op >= CUPS_GET_DEFAULT && op <= CUPS_GET_PPD)
880
 
    return (ipp_cups_ops[op - CUPS_GET_DEFAULT]);
881
 
  else if (op == CUPS_GET_DOCUMENT)
 
2043
  else if (op >= IPP_OP_CUPS_GET_DEFAULT && op <= IPP_OP_CUPS_GET_PPD)
 
2044
    return (ipp_cups_ops[op - IPP_OP_CUPS_GET_DEFAULT]);
 
2045
  else if (op == IPP_OP_CUPS_GET_DOCUMENT)
882
2046
    return (ipp_cups_ops2[0]);
883
2047
 
884
2048
 /*
911
2075
      return ((ipp_op_t)i);
912
2076
 
913
2077
  if (!_cups_strcasecmp(name, "windows-ext"))
914
 
    return (IPP_PRIVATE);
 
2078
    return (IPP_OP_PRIVATE);
915
2079
 
916
2080
  for (i = 0; i < (sizeof(ipp_cups_ops) / sizeof(ipp_cups_ops[0])); i ++)
917
2081
    if (!_cups_strcasecmp(name, ipp_cups_ops[i]))
922
2086
      return ((ipp_op_t)(i + 0x4027));
923
2087
 
924
2088
  if (!_cups_strcasecmp(name, "CUPS-Add-Class"))
925
 
    return (CUPS_ADD_MODIFY_CLASS);
 
2089
    return (IPP_OP_CUPS_ADD_MODIFY_CLASS);
926
2090
 
927
2091
  if (!_cups_strcasecmp(name, "CUPS-Add-Printer"))
928
 
    return (CUPS_ADD_MODIFY_PRINTER);
 
2092
    return (IPP_OP_CUPS_ADD_MODIFY_PRINTER);
929
2093
 
930
 
  return ((ipp_op_t)-1);
 
2094
  return (IPP_OP_CUPS_INVALID);
931
2095
}
932
2096
 
933
2097
 
976
2140
const char *                            /* O - Tag name */
977
2141
ippTagString(ipp_tag_t tag)             /* I - Tag value */
978
2142
{
979
 
  tag &= IPP_TAG_MASK;
 
2143
  tag &= IPP_TAG_CUPS_MASK;
980
2144
 
981
2145
  if (tag < (ipp_tag_t)(sizeof(ipp_tag_names) / sizeof(ipp_tag_names[0])))
982
2146
    return (ipp_tag_names[tag]);
1086
2250
 
1087
2251
 
1088
2252
/*
1089
 
 * End of "$Id: ipp-support.c 11173 2013-07-23 12:31:34Z msweet $".
 
2253
 * End of "$Id: ipp-support.c 11085 2013-07-03 13:53:05Z msweet $".
1090
2254
 */