1*355b4669Sjacobs /* 2*355b4669Sjacobs * CDDL HEADER START 3*355b4669Sjacobs * 4*355b4669Sjacobs * The contents of this file are subject to the terms of the 5*355b4669Sjacobs * Common Development and Distribution License (the "License"). 6*355b4669Sjacobs * You may not use this file except in compliance with the License. 7*355b4669Sjacobs * 8*355b4669Sjacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*355b4669Sjacobs * or http://www.opensolaris.org/os/licensing. 10*355b4669Sjacobs * See the License for the specific language governing permissions 11*355b4669Sjacobs * and limitations under the License. 12*355b4669Sjacobs * 13*355b4669Sjacobs * When distributing Covered Code, include this CDDL HEADER in each 14*355b4669Sjacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*355b4669Sjacobs * If applicable, add the following below this CDDL HEADER, with the 16*355b4669Sjacobs * fields enclosed by brackets "[]" replaced with your own identifying 17*355b4669Sjacobs * information: Portions Copyright [yyyy] [name of copyright owner] 18*355b4669Sjacobs * 19*355b4669Sjacobs * CDDL HEADER END 20*355b4669Sjacobs */ 21*355b4669Sjacobs 22*355b4669Sjacobs /* 23*355b4669Sjacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*355b4669Sjacobs * Use is subject to license terms. 25*355b4669Sjacobs * 26*355b4669Sjacobs */ 27*355b4669Sjacobs 28*355b4669Sjacobs #ifndef _IPP_H 29*355b4669Sjacobs #define _IPP_H 30*355b4669Sjacobs 31*355b4669Sjacobs /* $Id: ipp.h 146 2006-03-24 00:26:54Z njacobs $ */ 32*355b4669Sjacobs 33*355b4669Sjacobs #ifdef __cplusplus 34*355b4669Sjacobs extern "C" { 35*355b4669Sjacobs #endif 36*355b4669Sjacobs 37*355b4669Sjacobs #include <stdarg.h> 38*355b4669Sjacobs #include <sys/time.h> 39*355b4669Sjacobs #include <papi.h> 40*355b4669Sjacobs #include <inttypes.h> 41*355b4669Sjacobs 42*355b4669Sjacobs 43*355b4669Sjacobs typedef ssize_t (*ipp_reader_t)(void *fd, void *buffer, size_t buffer_size); 44*355b4669Sjacobs typedef ssize_t (*ipp_writer_t)(void *fd, void *buffer, size_t buffer_size); 45*355b4669Sjacobs 46*355b4669Sjacobs enum { 47*355b4669Sjacobs IPP_TYPE_UNKNOWN = 0, 48*355b4669Sjacobs IPP_TYPE_REQUEST = 1, 49*355b4669Sjacobs IPP_TYPE_RESPONSE = 2 50*355b4669Sjacobs }; 51*355b4669Sjacobs 52*355b4669Sjacobs /* 53*355b4669Sjacobs * How closely do we conform to the spec when parsing? Do we 54*355b4669Sjacobs * a) Stop parsing only when we encounter an error that prevents us from 55*355b4669Sjacobs * continuing parsing (a server error or ridiculously malformed request)? 56*355b4669Sjacobs * b) Stop parsing when we know the server wouldn't be able to act on the 57*355b4669Sjacobs * response correctly, even if we can make sense of some of the data? 58*355b4669Sjacobs * c) Jawohl, Mein IPP Spec! 59*355b4669Sjacobs * The answer will usually be b, though a will be useful for debugging. 60*355b4669Sjacobs */ 61*355b4669Sjacobs enum { 62*355b4669Sjacobs IPP_PARSE_CONFORMANCE_RASH = 0, 63*355b4669Sjacobs IPP_PARSE_CONFORMANCE_LOOSE = 1, 64*355b4669Sjacobs IPP_PARSE_CONFORMANCE_STRICT = 2 65*355b4669Sjacobs }; 66*355b4669Sjacobs 67*355b4669Sjacobs 68*355b4669Sjacobs /* Operation IDs */ 69*355b4669Sjacobs enum { 70*355b4669Sjacobs OPID_MIN = 0x0000, /* 0x0000 */ 71*355b4669Sjacobs OPID_RESERVED_0000 = 0x0000, /* 0x0000 */ 72*355b4669Sjacobs OPID_RESERVED_0001, /* 0x0001 */ 73*355b4669Sjacobs OPID_PRINT_JOB, /* 0x0002 */ 74*355b4669Sjacobs OPID_PRINT_URI, /* 0x0003 */ 75*355b4669Sjacobs OPID_VALIDATE_JOB, /* 0x0004 */ 76*355b4669Sjacobs OPID_CREATE_JOB, /* 0x0005 */ 77*355b4669Sjacobs OPID_SEND_DOCUMENT, /* 0x0006 */ 78*355b4669Sjacobs OPID_SEND_URI, /* 0x0007 */ 79*355b4669Sjacobs OPID_CANCEL_JOB, /* 0x0008 */ 80*355b4669Sjacobs OPID_GET_JOB_ATTRIBUTES, /* 0x0009 */ 81*355b4669Sjacobs OPID_GET_JOBS, /* 0x000a */ 82*355b4669Sjacobs OPID_GET_PRINTER_ATTRIBUTES, /* 0x000b */ 83*355b4669Sjacobs OPID_HOLD_JOB, /* 0x000c */ 84*355b4669Sjacobs OPID_RELEASE_JOB, /* 0x000d */ 85*355b4669Sjacobs OPID_RESTART_JOB, /* 0x000e */ 86*355b4669Sjacobs OPID_RESERVED_000F, /* 0x000f */ 87*355b4669Sjacobs OPID_PAUSE_PRINTER, /* 0x0010 */ 88*355b4669Sjacobs OPID_RESUME_PRINTER, /* 0x0011 */ 89*355b4669Sjacobs OPID_PURGE_JOBS, /* 0x0012 */ 90*355b4669Sjacobs OPID_SET_PRINTER_ATTRIBUTES, /* 0x0013 */ 91*355b4669Sjacobs OPID_SET_JOB_ATTRIBUTES, /* 0x0014 */ 92*355b4669Sjacobs OPID_GET_PRINTER_SUPPORTED_VALUES, /* 0x0015 */ 93*355b4669Sjacobs OPID_CREATE_PRINTER_SUBSCRIPTION, /* 0x0016 */ 94*355b4669Sjacobs OPID_CREATE_JOB_SUBSCRIPTION, /* 0x0017 */ 95*355b4669Sjacobs OPID_GET_SUBSCRIPTION_ATTRIBUTES, /* 0x0018 */ 96*355b4669Sjacobs OPID_GET_SUBSCRIPTIONS, /* 0x0019 */ 97*355b4669Sjacobs OPID_RENEW_SUBSCRIPTION, /* 0x001a */ 98*355b4669Sjacobs OPID_CANCEL_SUBSCRIPTION, /* 0x001b */ 99*355b4669Sjacobs OPID_GET_NOTIFICATIONS, /* 0x001c */ 100*355b4669Sjacobs OPID_SEND_NOTIFICATIONS, /* 0x001d */ 101*355b4669Sjacobs OPID_GET_RESOURCE_ATTRIBUTES, /* 0x001e */ 102*355b4669Sjacobs OPID_GET_RESOURCE_DATA, /* 0x001f */ 103*355b4669Sjacobs OPID_GET_RESOURCES, /* 0x0020 */ 104*355b4669Sjacobs OPID_GET_PRINT_SUPPORT_FILES, /* 0x0021 */ 105*355b4669Sjacobs OPID_ENABLE_PRINTER, /* 0x0022 */ 106*355b4669Sjacobs OPID_DISABLE_PRINTER, /* 0x0023 */ 107*355b4669Sjacobs OPID_PAUSE_PRINTER_AFTER_CURRENT_JOB, /* 0x0024 */ 108*355b4669Sjacobs OPID_HOLD_NEW_JOBS, /* 0x0025 */ 109*355b4669Sjacobs OPID_RELEASE_HELD_NEW_JOBS, /* 0x0026 */ 110*355b4669Sjacobs OPID_DEACTIVATE_PRINTER, /* 0x0027 */ 111*355b4669Sjacobs OPID_ACTIVATE_PRINTER, /* 0x0028 */ 112*355b4669Sjacobs OPID_RESTART_PRINTER, /* 0x0029 */ 113*355b4669Sjacobs OPID_SHUTDOWN_PRINTER, /* 0x002a */ 114*355b4669Sjacobs OPID_STARTUP_PRINTER, /* 0x002b */ 115*355b4669Sjacobs OPID_REPROCESS_JOB, /* 0x002c */ 116*355b4669Sjacobs OPID_CANCEL_CURRENT_JOB, /* 0x002d */ 117*355b4669Sjacobs OPID_SUSPEND_CURRENT_JOB, /* 0x002e */ 118*355b4669Sjacobs OPID_RESUME_JOB, /* 0x002f */ 119*355b4669Sjacobs OPID_PROMOTE_JOB, /* 0x0030 */ 120*355b4669Sjacobs OPID_SCHEDULE_JOB_AFTER, /* 0x0031 */ 121*355b4669Sjacobs OPID_RESERVED_MIN, /* 0x0032 */ 122*355b4669Sjacobs OPID_RESERVED_0032 = 0x0032, /* 0x0032 */ 123*355b4669Sjacobs /* ... */ 124*355b4669Sjacobs OPID_RESERVED_3FFF = 0x3fff, /* 0x3fff */ 125*355b4669Sjacobs OPID_RESERVED_MAX = 0x3fff, /* 0x3fff */ 126*355b4669Sjacobs OPID_RESERVED_VENDOR_MIN = 0x4000, /* 0x4000 */ 127*355b4669Sjacobs OPID_RESERVED_VENDOR_4000 = 0x4000, /* 0x4000 */ 128*355b4669Sjacobs /* ... */ 129*355b4669Sjacobs OPID_RESERVED_VENDOR_8FFF = 0x8fff, /* 0x8fff */ 130*355b4669Sjacobs OPID_RESERVED_VENDOR_MAX = 0x8fff, /* 0x8fff */ 131*355b4669Sjacobs OPID_MAX = 0x8fff /* 0x8fff */ 132*355b4669Sjacobs }; 133*355b4669Sjacobs 134*355b4669Sjacobs enum { 135*355b4669Sjacobs /* Delimiter Tags */ 136*355b4669Sjacobs DTAG_MIN = 0x00, /* 0x00 */ 137*355b4669Sjacobs DTAG_RESERVED_DELIMITER_00 = 0x00, /* 0x00 */ 138*355b4669Sjacobs DTAG_OPERATION_ATTRIBUTES, /* 0x01 */ 139*355b4669Sjacobs DTAG_JOB_ATTRIBUTES, /* 0x02 */ 140*355b4669Sjacobs DTAG_END_OF_ATTRIBUTES, /* 0x03 */ 141*355b4669Sjacobs DTAG_PRINTER_ATTRIBUTES, /* 0x04 */ 142*355b4669Sjacobs DTAG_UNSUPPORTED_ATTRIBUTES, /* 0x05 */ 143*355b4669Sjacobs DTAG_SUBSCRIPTION_ATTRIBUTES, /* 0x06 */ 144*355b4669Sjacobs DTAG_EVENT_NOTIFICATION_ATTRIBUTES, /* 0x07 */ 145*355b4669Sjacobs DTAG_RESERVED_DELIMITER_08, /* 0x08 */ 146*355b4669Sjacobs DTAG_RESERVED_DELIMITER_09, /* 0x09 */ 147*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0A, /* 0x0a */ 148*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0B, /* 0x0b */ 149*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0C, /* 0x0c */ 150*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0D, /* 0x0d */ 151*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0E, /* 0x0e */ 152*355b4669Sjacobs DTAG_RESERVED_DELIMITER_0F, /* 0x0f */ 153*355b4669Sjacobs DTAG_MAX = 0x0f, /* 0x0f */ 154*355b4669Sjacobs 155*355b4669Sjacobs /* Value Tags */ 156*355b4669Sjacobs VTAG_MIN = 0x10, /* 0x10 */ 157*355b4669Sjacobs VTAG_UNSUPPORTED = 0x10, /* 0x10 */ 158*355b4669Sjacobs VTAG_RESERVED_DEFAULT, /* 0x11 */ 159*355b4669Sjacobs VTAG_UNKNOWN, /* 0x12 */ 160*355b4669Sjacobs VTAG_NOVALUE, /* 0x13 */ 161*355b4669Sjacobs VTAG_RESERVED_OOB_14, /* 0x14 */ 162*355b4669Sjacobs VTAG_NOT_SETTABLE, /* 0x15 */ 163*355b4669Sjacobs VTAG_DELETE_ATTRIBUTE, /* 0x16 */ 164*355b4669Sjacobs VTAG_ADMIN_DEFINE, /* 0x17 */ 165*355b4669Sjacobs VTAG_RESERVED_OOB_18, /* 0x18 */ 166*355b4669Sjacobs VTAG_RESERVED_OOB_19, /* 0x19 */ 167*355b4669Sjacobs VTAG_RESERVED_OOB_1A, /* 0x1a */ 168*355b4669Sjacobs VTAG_RESERVED_OOB_1B, /* 0x1b */ 169*355b4669Sjacobs VTAG_RESERVED_OOB_1C, /* 0x1c */ 170*355b4669Sjacobs VTAG_RESERVED_OOB_1D, /* 0x1d */ 171*355b4669Sjacobs VTAG_RESERVED_OOB_1E, /* 0x1e */ 172*355b4669Sjacobs VTAG_RESERVED_OOB_1F, /* 0x1f */ 173*355b4669Sjacobs VTAG_RESERVED_INT_GEN, /* 0x20 */ 174*355b4669Sjacobs VTAG_INTEGER, /* 0x21 */ 175*355b4669Sjacobs VTAG_BOOLEAN, /* 0x22 */ 176*355b4669Sjacobs VTAG_ENUM, /* 0x23 */ 177*355b4669Sjacobs VTAG_RESERVED_INT_24, /* 0x24 */ 178*355b4669Sjacobs VTAG_RESERVED_INT_25, /* 0x25 */ 179*355b4669Sjacobs VTAG_RESERVED_INT_26, /* 0x26 */ 180*355b4669Sjacobs VTAG_RESERVED_INT_27, /* 0x27 */ 181*355b4669Sjacobs VTAG_RESERVED_INT_28, /* 0x28 */ 182*355b4669Sjacobs VTAG_RESERVED_INT_29, /* 0x29 */ 183*355b4669Sjacobs VTAG_RESERVED_INT_2A, /* 0x2a */ 184*355b4669Sjacobs VTAG_RESERVED_INT_2B, /* 0x2b */ 185*355b4669Sjacobs VTAG_RESERVED_INT_2C, /* 0x2c */ 186*355b4669Sjacobs VTAG_RESERVED_INT_2D, /* 0x2d */ 187*355b4669Sjacobs VTAG_RESERVED_INT_2E, /* 0x2e */ 188*355b4669Sjacobs VTAG_RESERVED_INT_2F, /* 0x2f */ 189*355b4669Sjacobs VTAG_OCTET_STRING, /* 0x30 */ 190*355b4669Sjacobs VTAG_DATE_TIME, /* 0x31 */ 191*355b4669Sjacobs VTAG_RESOLUTION, /* 0x32 */ 192*355b4669Sjacobs VTAG_RANGE_OF_INTEGER, /* 0x33 */ 193*355b4669Sjacobs VTAG_BEGIN_COLLECTION, /* 0x34 */ 194*355b4669Sjacobs VTAG_TEXT_WITH_LANGUAGE, /* 0x35 */ 195*355b4669Sjacobs VTAG_NAME_WITH_LANGUAGE, /* 0x36 */ 196*355b4669Sjacobs VTAG_END_COLLECTION, /* 0x37 */ 197*355b4669Sjacobs VTAG_RESERVED_STRING_38, /* 0x38 */ 198*355b4669Sjacobs VTAG_RESERVED_STRING_39, /* 0x39 */ 199*355b4669Sjacobs VTAG_RESERVED_STRING_3A, /* 0x3a */ 200*355b4669Sjacobs VTAG_RESERVED_STRING_3B, /* 0x3b */ 201*355b4669Sjacobs VTAG_RESERVED_STRING_3C, /* 0x3c */ 202*355b4669Sjacobs VTAG_RESERVED_STRING_3D, /* 0x3d */ 203*355b4669Sjacobs VTAG_RESERVED_STRING_3E, /* 0x3e */ 204*355b4669Sjacobs VTAG_RESERVED_STRING_3F, /* 0x3f */ 205*355b4669Sjacobs VTAG_RESERVED_CHAR_GEN, /* 0x40 */ 206*355b4669Sjacobs VTAG_TEXT_WITHOUT_LANGUAGE, /* 0x41 */ 207*355b4669Sjacobs VTAG_NAME_WITHOUT_LANGUAGE, /* 0x42 */ 208*355b4669Sjacobs VTAG_RESERVED_43, /* 0x43 */ 209*355b4669Sjacobs VTAG_KEYWORD, /* 0x44 */ 210*355b4669Sjacobs VTAG_URI, /* 0x45 */ 211*355b4669Sjacobs VTAG_URI_SCHEME, /* 0x46 */ 212*355b4669Sjacobs VTAG_CHARSET, /* 0x47 */ 213*355b4669Sjacobs VTAG_NATURAL_LANGUAGE, /* 0x48 */ 214*355b4669Sjacobs VTAG_MIME_MEDIA_TYPE, /* 0x49 */ 215*355b4669Sjacobs VTAG_MEMBER_ATTR_NAME, /* 0x4a */ 216*355b4669Sjacobs VTAG_RESERVED_STRING_4B, /* 0x4b */ 217*355b4669Sjacobs VTAG_RESERVED_STRING_4C, /* 0x4c */ 218*355b4669Sjacobs VTAG_RESERVED_STRING_4D, /* 0x4d */ 219*355b4669Sjacobs VTAG_RESERVED_STRING_4E, /* 0x4e */ 220*355b4669Sjacobs VTAG_RESERVED_STRING_4F, /* 0x4f */ 221*355b4669Sjacobs VTAG_RESERVED_STRING_50, /* 0x50 */ 222*355b4669Sjacobs VTAG_RESERVED_STRING_51, /* 0x51 */ 223*355b4669Sjacobs VTAG_RESERVED_STRING_52, /* 0x52 */ 224*355b4669Sjacobs VTAG_RESERVED_STRING_53, /* 0x53 */ 225*355b4669Sjacobs VTAG_RESERVED_STRING_54, /* 0x54 */ 226*355b4669Sjacobs VTAG_RESERVED_STRING_55, /* 0x55 */ 227*355b4669Sjacobs VTAG_RESERVED_STRING_56, /* 0x56 */ 228*355b4669Sjacobs VTAG_RESERVED_STRING_57, /* 0x57 */ 229*355b4669Sjacobs VTAG_RESERVED_STRING_58, /* 0x58 */ 230*355b4669Sjacobs VTAG_RESERVED_STRING_59, /* 0x59 */ 231*355b4669Sjacobs VTAG_RESERVED_STRING_5A, /* 0x5a */ 232*355b4669Sjacobs VTAG_RESERVED_STRING_5B, /* 0x5b */ 233*355b4669Sjacobs VTAG_RESERVED_STRING_5C, /* 0x5c */ 234*355b4669Sjacobs VTAG_RESERVED_STRING_5D, /* 0x5d */ 235*355b4669Sjacobs VTAG_RESERVED_STRING_5E, /* 0x5e */ 236*355b4669Sjacobs VTAG_RESERVED_STRING_5F, /* 0x5f */ 237*355b4669Sjacobs VTAG_RESERVED_MAX = 0x5f, /* 0x5f */ 238*355b4669Sjacobs VTAG_MAX = 0x5f, /* 0x5f */ 239*355b4669Sjacobs VTAG_EXTEND = 0x7f /* 0x7f */ 240*355b4669Sjacobs }; 241*355b4669Sjacobs 242*355b4669Sjacobs /* Response codes */ 243*355b4669Sjacobs enum { 244*355b4669Sjacobs IPP_OK_MIN = 0x0000, 245*355b4669Sjacobs IPP_OK = 0x0000, /* 0x0000 */ 246*355b4669Sjacobs IPP_OK_IGNORED_ATTRIBUTES, /* 0x0001 */ 247*355b4669Sjacobs IPP_OK_CONFLICTING_ATTRIBUTES, /* 0x0002 */ 248*355b4669Sjacobs IPP_OK_IGNORED_SUBSCRIPTIONS, /* 0x0003 */ 249*355b4669Sjacobs IPP_OK_IGNORED_NOTIFICATIONS, /* 0x0004 */ 250*355b4669Sjacobs IPP_OK_TOO_MANY_EVENTS, /* 0x0005 */ 251*355b4669Sjacobs IPP_OK_BUT_CANCEL_SUBSCRIPTION, /* 0x0006 */ 252*355b4669Sjacobs IPP_OK_MAX = IPP_OK_BUT_CANCEL_SUBSCRIPTION, 253*355b4669Sjacobs 254*355b4669Sjacobs IPP_REDIR_MIN = 0x0300, 255*355b4669Sjacobs IPP_REDIR_OTHER_SIZE = 0x0300, /* 0x0300 */ 256*355b4669Sjacobs IPP_REDIR_MAX = 0x0300, 257*355b4669Sjacobs 258*355b4669Sjacobs IPP_CERR_MIN = 0x0400, 259*355b4669Sjacobs IPP_CERR_BAD_REQUEST = 0x0400, /* 0x0400 */ 260*355b4669Sjacobs IPP_CERR_FORBIDDEN, /* 0x0401 */ 261*355b4669Sjacobs IPP_CERR_NOT_AUTHENTICATED, /* 0x0402 */ 262*355b4669Sjacobs IPP_CERR_NOT_AUTHORIZED, /* 0x0403 */ 263*355b4669Sjacobs IPP_CERR_NOT_POSSIBLE, /* 0x0404 */ 264*355b4669Sjacobs IPP_CERR_TIMEOUT, /* 0x0405 */ 265*355b4669Sjacobs IPP_CERR_NOT_FOUND, /* 0x0406 */ 266*355b4669Sjacobs IPP_CERR_GONE, /* 0x0407 */ 267*355b4669Sjacobs IPP_CERR_REQUEST_ENTITY, /* 0x0408 */ 268*355b4669Sjacobs IPP_CERR_REQUEST_VALUE, /* 0x0409 */ 269*355b4669Sjacobs IPP_CERR_DOCUMENT_FORMAT, /* 0x040a */ 270*355b4669Sjacobs IPP_CERR_ATTRIBUTES, /* 0x040b */ 271*355b4669Sjacobs IPP_CERR_URI_SCHEME, /* 0x040c */ 272*355b4669Sjacobs IPP_CERR_CHARSET, /* 0x040d */ 273*355b4669Sjacobs IPP_CERR_CONFLICT, /* 0x040e */ 274*355b4669Sjacobs IPP_CERR_COMPRESSION_NOT_SUPPORTED, /* 0x040f */ 275*355b4669Sjacobs IPP_CERR_COMPRESSION_ERROR, /* 0x0410 */ 276*355b4669Sjacobs IPP_CERR_DOCUMENT_FORMAT_ERROR, /* 0x0411 */ 277*355b4669Sjacobs IPP_CERR_DOCUMENT_ACCESS_ERROR, /* 0x0412 */ 278*355b4669Sjacobs IPP_CERR_ATTRIBUTES_NOT_SETTABLE, /* 0x0413 */ 279*355b4669Sjacobs IPP_CERR_IGNORED_ALL_SUBSCRIPTIONS, /* 0x0414 */ 280*355b4669Sjacobs IPP_CERR_TOO_MANY_SUBSCRIPTIONS, /* 0x0415 */ 281*355b4669Sjacobs IPP_CERR_IGNORED_ALL_NOTIFICATIONS, /* 0x0416 */ 282*355b4669Sjacobs IPP_CERR_PRINT_SUPPORT_FILE_NOT_FOUND, /* 0x0417 */ 283*355b4669Sjacobs IPP_CERR_MAX = IPP_CERR_PRINT_SUPPORT_FILE_NOT_FOUND, 284*355b4669Sjacobs 285*355b4669Sjacobs IPP_SERR_MIN = 0x0500, 286*355b4669Sjacobs IPP_SERR_INTERNAL = 0x0500, /* 0x0500 */ 287*355b4669Sjacobs IPP_SERR_OPERATION_NOT_SUPPORTED, /* 0x0501 */ 288*355b4669Sjacobs IPP_SERR_SERVICE_UNAVAILABLE, /* 0x0502 */ 289*355b4669Sjacobs IPP_SERR_VERSION_NOT_SUPPORTED, /* 0x0503 */ 290*355b4669Sjacobs IPP_SERR_DEVICE_ERROR, /* 0x0504 */ 291*355b4669Sjacobs IPP_SERR_TEMPORARY_ERROR, /* 0x0505 */ 292*355b4669Sjacobs IPP_SERR_NOT_ACCEPTING, /* 0x0506 */ 293*355b4669Sjacobs IPP_SERR_BUSY, /* 0x0507 */ 294*355b4669Sjacobs IPP_SERR_CANCELLED, /* 0x0508 */ 295*355b4669Sjacobs IPP_SERR_MULTIPLE_DOCS_NOT_SUPPORTED, /* 0x0509 */ 296*355b4669Sjacobs IPP_SERR_PRINTER_IS_DEACTIVATED, /* 0x050a */ 297*355b4669Sjacobs IPP_SERR_MAX = IPP_SERR_PRINTER_IS_DEACTIVATED 298*355b4669Sjacobs }; 299*355b4669Sjacobs 300*355b4669Sjacobs /* Job state codes */ 301*355b4669Sjacobs enum { 302*355b4669Sjacobs IPP_JOB_STATE_PENDING = 3, 303*355b4669Sjacobs IPP_JOB_STATE_PENDING_HELD = 4, 304*355b4669Sjacobs IPP_JOB_STATE_PROCESSING = 5, 305*355b4669Sjacobs IPP_JOB_STATE_PROCESSING_STOPPED = 6, 306*355b4669Sjacobs IPP_JOB_STATE_CANCELED = 7, 307*355b4669Sjacobs IPP_JOB_STATE_ABORTED = 8, 308*355b4669Sjacobs IPP_JOB_STATE_COMPLETED = 9 309*355b4669Sjacobs }; 310*355b4669Sjacobs 311*355b4669Sjacobs /* exported functions */ 312*355b4669Sjacobs extern papi_status_t ipp_read_message(ipp_reader_t iread, void *fd, 313*355b4669Sjacobs papi_attribute_t ***message, char type); 314*355b4669Sjacobs 315*355b4669Sjacobs extern papi_status_t ipp_write_message(ipp_writer_t iwrite, void *fd, 316*355b4669Sjacobs papi_attribute_t **message); 317*355b4669Sjacobs 318*355b4669Sjacobs /* internal functions shared between modules */ 319*355b4669Sjacobs extern void ipp_set_status(papi_attribute_t ***message, papi_status_t status, 320*355b4669Sjacobs char *format, ...); 321*355b4669Sjacobs extern papi_status_t ipp_validate_request(papi_attribute_t **request, 322*355b4669Sjacobs papi_attribute_t ***response); 323*355b4669Sjacobs 324*355b4669Sjacobs extern int ipp_severity(int16_t status); 325*355b4669Sjacobs 326*355b4669Sjacobs extern int16_t ipp_charset_supported(char *charset); 327*355b4669Sjacobs 328*355b4669Sjacobs extern void *string_to_ipp_attr_value(int8_t type, char *value); 329*355b4669Sjacobs 330*355b4669Sjacobs extern char *ipp_uri_to_printer(char *uri); 331*355b4669Sjacobs extern void *papi_attribute_to_ipp_attr(int8_t type, papi_attribute_t *attr); 332*355b4669Sjacobs 333*355b4669Sjacobs extern int8_t name_to_ipp_type(char *name); 334*355b4669Sjacobs extern char *job_template[]; 335*355b4669Sjacobs extern char *job_description[]; 336*355b4669Sjacobs extern char *printer_description[]; 337*355b4669Sjacobs extern char *ipp_tag_string(int8_t tag, char *buf, size_t bufsiz); 338*355b4669Sjacobs extern size_t min_val_len(int8_t type, char *name); 339*355b4669Sjacobs extern size_t max_val_len(int8_t type, char *name); 340*355b4669Sjacobs extern int is_keyword(char *value); 341*355b4669Sjacobs 342*355b4669Sjacobs #ifdef __cplusplus 343*355b4669Sjacobs } 344*355b4669Sjacobs #endif 345*355b4669Sjacobs 346*355b4669Sjacobs #endif /* _IPP_H */ 347