The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP protocols and CUPS scheduler. They are typically used by monitoring and administration programs to perform specific functions not supported by the high-level CUPS API functions.
The <cups/cups.h> header file must be included to use the HTTP and IPP functions.
Programs using these functions must be linked to the CUPS library: libcups.a, libcups.so.2, libcups.2.dylib, libcups_s.a, or libcups2.lib depending on the platform. The following command compiles myprogram.c using GCC and the CUPS library:
gcc -o myprogram myprogram.c -lcups
Unless otherwise specified, the HTTP and IPP API functions require CUPS 1.1 or higher.
HTTP authentication types
Name | Description |
---|---|
HTTP_AUTH_BASIC | Basic authentication in use |
HTTP_AUTH_MD5 | Digest authentication in use |
HTTP_AUTH_MD5_INT | Digest authentication in use for body |
HTTP_AUTH_MD5_SESS | MD5-session authentication in use |
HTTP_AUTH_MD5_SESS_INT | MD5-session authentication in use for body |
HTTP_AUTH_NEGOTIATE CUPS 1.3 | GSSAPI authentication in use |
HTTP_AUTH_NONE | No authentication in use |
HTTP transfer encoding values
Name | Description |
---|---|
HTTP_ENCODE_CHUNKED | Data is chunked |
HTTP_ENCODE_FIELDS | Sending HTTP fields |
HTTP_ENCODE_LENGTH | Data is sent with Content-Length |
HTTP encryption values
Name | Description |
---|---|
HTTP_ENCRYPT_ALWAYS | Always encrypt (SSL) |
HTTP_ENCRYPT_IF_REQUESTED | Encrypt if requested (TLS upgrade) |
HTTP_ENCRYPT_NEVER | Never encrypt |
HTTP_ENCRYPT_REQUIRED | Encryption is required (TLS upgrade) |
HTTP field names
Name | Description |
---|---|
HTTP_FIELD_ACCEPT_LANGUAGE | Accept-Language field |
HTTP_FIELD_ACCEPT_RANGES | Accept-Ranges field |
HTTP_FIELD_AUTHORIZATION | Authorization field |
HTTP_FIELD_CONNECTION | Connection field |
HTTP_FIELD_CONTENT_ENCODING | Content-Encoding field |
HTTP_FIELD_CONTENT_LANGUAGE | Content-Language field |
HTTP_FIELD_CONTENT_LENGTH | Content-Length field |
HTTP_FIELD_CONTENT_LOCATION | Content-Location field |
HTTP_FIELD_CONTENT_MD5 | Content-MD5 field |
HTTP_FIELD_CONTENT_RANGE | Content-Range field |
HTTP_FIELD_CONTENT_TYPE | Content-Type field |
HTTP_FIELD_CONTENT_VERSION | Content-Version field |
HTTP_FIELD_DATE | Date field |
HTTP_FIELD_HOST | Host field |
HTTP_FIELD_IF_MODIFIED_SINCE | If-Modified-Since field |
HTTP_FIELD_IF_UNMODIFIED_SINCE | If-Unmodified-Since field |
HTTP_FIELD_KEEP_ALIVE | Keep-Alive field |
HTTP_FIELD_LAST_MODIFIED | Last-Modified field |
HTTP_FIELD_LINK | Link field |
HTTP_FIELD_LOCATION | Location field |
HTTP_FIELD_MAX | Maximum field index |
HTTP_FIELD_RANGE | Range field |
HTTP_FIELD_REFERER | Referer field |
HTTP_FIELD_RETRY_AFTER | Retry-After field |
HTTP_FIELD_TRANSFER_ENCODING | Transfer-Encoding field |
HTTP_FIELD_UNKNOWN | Unknown field |
HTTP_FIELD_UPGRADE | Upgrade field |
HTTP_FIELD_USER_AGENT | User-Agent field |
HTTP_FIELD_WWW_AUTHENTICATE | WWW-Authenticate field |
Types and structures...
Name | Description |
---|---|
HTTP_KEEPALIVE_OFF | No keep alive support |
HTTP_KEEPALIVE_ON | Use keep alive |
Name | Description |
---|---|
HTTP_CLOSE | CLOSE command, waiting for blank line |
HTTP_DELETE | DELETE command, waiting for blank line |
HTTP_GET | GET command, waiting for blank line |
HTTP_GET_SEND | GET command, sending data |
HTTP_HEAD | HEAD command, waiting for blank line |
HTTP_OPTIONS | OPTIONS command, waiting for blank line |
HTTP_POST | POST command, waiting for blank line |
HTTP_POST_RECV | POST command, receiving data |
HTTP_POST_SEND | POST command, sending data |
HTTP_PUT | PUT command, waiting for blank line |
HTTP_PUT_RECV | PUT command, receiving data |
HTTP_STATUS | Command complete, sending status |
HTTP_TRACE | TRACE command, waiting for blank line |
HTTP_WAITING | Waiting for command |
HTTP status codes
Name | Description |
---|---|
HTTP_ACCEPTED | DELETE command was successful |
HTTP_BAD_GATEWAY | Bad gateway |
HTTP_BAD_REQUEST | Bad request |
HTTP_CONFLICT | Request is self-conflicting |
HTTP_CONTINUE | Everything OK, keep going... |
HTTP_CREATED | PUT command was successful |
HTTP_ERROR | An error response from httpXxxx() |
HTTP_EXPECTATION_FAILED | The expectation given in an Expect header field was not met |
HTTP_FORBIDDEN | Forbidden to access this URI |
HTTP_GATEWAY_TIMEOUT | Gateway connection timed out |
HTTP_GONE | Server has gone away |
HTTP_LENGTH_REQUIRED | A content length or encoding is required |
HTTP_METHOD_NOT_ALLOWED | Method is not allowed |
HTTP_MOVED_PERMANENTLY | Document has moved permanently |
HTTP_MOVED_TEMPORARILY | Document has moved temporarily |
HTTP_MULTIPLE_CHOICES | Multiple files match request |
HTTP_NOT_ACCEPTABLE | Not Acceptable |
HTTP_NOT_AUTHORITATIVE | Information isn't authoritative |
HTTP_NOT_FOUND | URI was not found |
HTTP_NOT_IMPLEMENTED | Feature not implemented |
HTTP_NOT_MODIFIED | File not modified |
HTTP_NOT_SUPPORTED | HTTP version not supported |
HTTP_NO_CONTENT | Successful command, no new data |
HTTP_OK | OPTIONS/GET/HEAD/POST/TRACE command was successful |
HTTP_PARTIAL_CONTENT | Only a partial file was recieved/sent |
HTTP_PAYMENT_REQUIRED | Payment required |
HTTP_PRECONDITION | Precondition failed |
HTTP_PROXY_AUTHENTICATION | Proxy Authentication is Required |
HTTP_REQUESTED_RANGE | The requested range is not satisfiable |
HTTP_REQUEST_TIMEOUT | Request timed out |
HTTP_REQUEST_TOO_LARGE | Request entity too large |
HTTP_RESET_CONTENT | Content was reset/recreated |
HTTP_SEE_OTHER | See this other link... |
HTTP_SERVER_ERROR | Internal server error |
HTTP_SERVICE_UNAVAILABLE | Service is unavailable |
HTTP_SWITCHING_PROTOCOLS | HTTP upgrade to TLS/SSL |
HTTP_UNAUTHORIZED | Unauthorized to access host |
HTTP_UNSUPPORTED_MEDIATYPE | The requested media type is unsupported |
HTTP_UPGRADE_REQUIRED | Upgrade to SSL/TLS required |
HTTP_URI_TOO_LONG | URI too long |
HTTP_USE_PROXY | Must use a proxy to access this URI |
Name | Description |
---|---|
HTTP_URI_CODING_ALL | En/decode everything |
HTTP_URI_CODING_HOSTNAME | En/decode the hostname portion |
HTTP_URI_CODING_MOST | En/decode all but the query |
HTTP_URI_CODING_NONE | Don't en/decode anything |
HTTP_URI_CODING_QUERY | En/decode the query portion |
HTTP_URI_CODING_RESOURCE | En/decode the resource portion |
HTTP_URI_CODING_USERNAME | En/decode the username portion |
Name | Description |
---|---|
HTTP_URI_BAD_ARGUMENTS | Bad arguments to function (error) |
HTTP_URI_BAD_HOSTNAME | Bad hostname in URI (error) |
HTTP_URI_BAD_PORT | Bad port number in URI (error) |
HTTP_URI_BAD_RESOURCE | Bad resource in URI (error) |
HTTP_URI_BAD_SCHEME | Bad scheme in URI (error) |
HTTP_URI_BAD_URI | Bad/empty URI (error) |
HTTP_URI_BAD_USERNAME | Bad username in URI (error) |
HTTP_URI_MISSING_RESOURCE | Missing resource in URI (warning) |
HTTP_URI_MISSING_SCHEME | Missing scheme in URI (warning) |
HTTP_URI_OK | URI decoded OK |
HTTP_URI_OVERFLOW | URI buffer for httpAssembleURI is too small |
HTTP_URI_UNKNOWN_SCHEME | Unknown scheme in URI (warning) |
Name | Description |
---|---|
HTTP_0_9 | HTTP/0.9 |
HTTP_1_0 | HTTP/1.0 |
HTTP_1_1 | HTTP/1.1 |
Name | Description |
---|---|
IPP_FINISHINGS_BALE | Bale (any type) |
IPP_FINISHINGS_BIND | Bind |
IPP_FINISHINGS_BIND_BOTTOM | Bind on bottom |
IPP_FINISHINGS_BIND_LEFT | Bind on left |
IPP_FINISHINGS_BIND_RIGHT | Bind on right |
IPP_FINISHINGS_BIND_TOP | Bind on top |
IPP_FINISHINGS_BOOKLET_MAKER | Fold to make booklet |
IPP_FINISHINGS_COVER | Add cover |
IPP_FINISHINGS_EDGE_STITCH | Stitch along any side |
IPP_FINISHINGS_EDGE_STITCH_BOTTOM | Stitch along bottom edge |
IPP_FINISHINGS_EDGE_STITCH_LEFT | Stitch along left side |
IPP_FINISHINGS_EDGE_STITCH_RIGHT | Stitch along right side |
IPP_FINISHINGS_EDGE_STITCH_TOP | Stitch along top edge |
IPP_FINISHINGS_FOLD | Fold (any type) |
IPP_FINISHINGS_JOB_OFFSET | Offset for binding (any type) |
IPP_FINISHINGS_NONE | No finishing |
IPP_FINISHINGS_PUNCH | Punch (any location/count) |
IPP_FINISHINGS_SADDLE_STITCH | Staple interior |
IPP_FINISHINGS_STAPLE | Staple (any location) |
IPP_FINISHINGS_STAPLE_BOTTOM_LEFT | Staple bottom left corner |
IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT | Staple bottom right corner |
IPP_FINISHINGS_STAPLE_DUAL_BOTTOM | Two staples on bottom |
IPP_FINISHINGS_STAPLE_DUAL_LEFT | Two staples on left |
IPP_FINISHINGS_STAPLE_DUAL_RIGHT | Two staples on right |
IPP_FINISHINGS_STAPLE_DUAL_TOP | Two staples on top |
IPP_FINISHINGS_STAPLE_TOP_LEFT | Staple top left corner |
IPP_FINISHINGS_STAPLE_TOP_RIGHT | Staple top right corner |
IPP_FINISHINGS_TRIM | Trim (any type) |
Name | Description |
---|---|
IPP_JOB_ABORTED | Job has aborted due to error |
IPP_JOB_CANCELED | Job has been canceled |
IPP_JOB_COMPLETED | Job has completed successfully |
IPP_JOB_HELD | Job is held for printing |
IPP_JOB_PENDING | Job is waiting to be printed |
IPP_JOB_PROCESSING | Job is currently printing |
IPP_JOB_STOPPED | Job has been stopped |
Name | Description |
---|---|
CUPS_ACCEPT_JOBS | Accept new jobs on a printer |
CUPS_ADD_MODIFY_CLASS | Add or modify a class |
CUPS_ADD_MODIFY_PRINTER | Add or modify a printer |
CUPS_AUTHENTICATE_JOB CUPS 1.2 | Authenticate a job |
CUPS_DELETE_CLASS | Delete a class |
CUPS_DELETE_PRINTER | Delete a printer |
CUPS_GET_CLASSES DEPRECATED | Get a list of classes |
CUPS_GET_DEFAULT | Get the default printer |
CUPS_GET_DEVICES | Get a list of supported devices |
CUPS_GET_PPD CUPS 1.3 | Get a PPD file |
CUPS_GET_PPDS | Get a list of supported drivers |
CUPS_GET_PRINTERS | Get a list of printers and/or classes |
CUPS_MOVE_JOB | Move a job to a different printer |
CUPS_REJECT_JOBS | Reject new jobs on a printer |
CUPS_SET_DEFAULT | Set the default printer |
IPP_ACTIVATE_PRINTER | Start a printer @private@ |
IPP_CANCEL_CURRENT_JOB | Cancel the current job @private@ |
IPP_CANCEL_JOB | Cancel a job |
IPP_CANCEL_SUBSCRIPTION CUPS 1.2 | Cancel a subscription |
IPP_CREATE_JOB | Create an empty print job |
IPP_CREATE_JOB_SUBSCRIPTION CUPS 1.2 | Create a job subscription |
IPP_CREATE_PRINTER_SUBSCRIPTION CUPS 1.2 | Create a printer subscription |
IPP_DEACTIVATE_PRINTER | Stop a printer @private@ |
IPP_DISABLE_PRINTER | Stop a printer |
IPP_ENABLE_PRINTER | Start a printer |
IPP_GET_JOBS | Get a list of jobs |
IPP_GET_JOB_ATTRIBUTES | Get job attributes |
IPP_GET_NOTIFICATIONS CUPS 1.2 | Get notification events |
IPP_GET_PRINTER_ATTRIBUTES | Get printer attributes |
IPP_GET_PRINTER_SUPPORTED_VALUES | Get supported attribute values |
IPP_GET_PRINT_SUPPORT_FILES | Get printer support files @private@ |
IPP_GET_SUBSCRIPTIONS CUPS 1.2 | Get list of subscriptions |
IPP_GET_SUBSCRIPTION_ATTRIBUTES CUPS 1.2 | Get subscription attributes |
IPP_HOLD_JOB | Hold a job for printing |
IPP_HOLD_NEW_JOBS | Hold new jobs @private@ |
IPP_PAUSE_PRINTER | Stop a printer |
IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB | Stop printer after the current job @private@ |
IPP_PRINT_JOB | Print a single file |
IPP_PRINT_URI | Print a single URL @private@ |
IPP_PRIVATE | Reserved @private@ |
IPP_PROMOTE_JOB | Promote a job to print sooner @private@ |
IPP_PURGE_JOBS | Cancel all jobs |
IPP_RELEASE_HELD_NEW_JOBS | Release new jobs @private@ |
IPP_RELEASE_JOB | Release a job for printing |
IPP_RENEW_SUBSCRIPTION CUPS 1.2 | Renew a printer subscription |
IPP_REPROCESS_JOB | Reprint a job @private@ |
IPP_RESTART_JOB | Reprint a job |
IPP_RESTART_PRINTER | Restart a printer @private@ |
IPP_RESUME_JOB | Resume the current job @private@ |
IPP_RESUME_PRINTER | Start a printer |
IPP_SCHEDULE_JOB_AFTER | Schedule a job to print after another @private@ |
IPP_SEND_DOCUMENT | Add a file to a job |
IPP_SEND_NOTIFICATIONS | Send notification events @private@ |
IPP_SEND_URI | Add a URL to a job @private@ |
IPP_SET_JOB_ATTRIBUTES | Set job attributes |
IPP_SET_PRINTER_ATTRIBUTES | Set printer attributes @private@ |
IPP_SHUTDOWN_PRINTER | Turn a printer off @private@ |
IPP_STARTUP_PRINTER | Turn a printer on @private@ |
IPP_SUSPEND_CURRENT_JOB | Suspend the current job @private@ |
IPP_VALIDATE_JOB | Validate job options |
Name | Description |
---|---|
IPP_LANDSCAPE | 90 degrees counter-clockwise |
IPP_PORTRAIT | No rotation |
IPP_REVERSE_LANDSCAPE | 90 degrees clockwise |
IPP_REVERSE_PORTRAIT | 180 degrees |
Name | Description |
---|---|
IPP_PRINTER_IDLE | Printer is idle |
IPP_PRINTER_PROCESSING | Printer is working |
IPP_PRINTER_STOPPED | Printer is stopped |
Name | Description |
---|---|
IPP_QUALITY_DRAFT | Draft quality |
IPP_QUALITY_HIGH | High quality |
IPP_QUALITY_NORMAL | Normal quality |
Types and structures...
Name | Description |
---|---|
IPP_RES_PER_CM | Pixels per centimeter |
IPP_RES_PER_INCH | Pixels per inch |
Name | Description |
---|---|
IPP_ATTRIBUTE | One or more attributes need to be sent/received |
IPP_DATA | IPP request data needs to be sent/received |
IPP_ERROR | An error occurred |
IPP_HEADER | The request header needs to be sent/received |
IPP_IDLE | Nothing is happening/request completed |
IPP status codes...
Name | Description |
---|---|
CUPS_SEE_OTHER | cups-see-other |
IPP_ATTRIBUTES | client-error-attributes-or-values-not-supported |
IPP_ATTRIBUTES_NOT_SETTABLE | client-error-attributes-not-settable |
IPP_BAD_REQUEST | client-error-bad-request |
IPP_CHARSET | client-error-charset-not-supported |
IPP_COMPRESSION_ERROR | client-error-compression-error |
IPP_COMPRESSION_NOT_SUPPORTED | client-error-compression-not-supported |
IPP_CONFLICT | client-error-conflicting-attributes |
IPP_DEVICE_ERROR | server-error-device-error |
IPP_DOCUMENT_ACCESS_ERROR | client-error-document-access-error |
IPP_DOCUMENT_FORMAT | client-error-document-format-not-supported |
IPP_DOCUMENT_FORMAT_ERROR | client-error-document-format-error |
IPP_ERROR_JOB_CANCELED | server-error-job-canceled |
IPP_FORBIDDEN | client-error-forbidden |
IPP_GONE | client-error-gone |
IPP_IGNORED_ALL_NOTIFICATIONS | client-error-ignored-all-notifications |
IPP_IGNORED_ALL_SUBSCRIPTIONS | client-error-ignored-all-subscriptions |
IPP_INTERNAL_ERROR | server-error-internal-error |
IPP_MULTIPLE_JOBS_NOT_SUPPORTED | server-error-multiple-document-jobs-not-supported |
IPP_NOT_ACCEPTING | server-error-not-accepting-jobs |
IPP_NOT_AUTHENTICATED | client-error-not-authenticated |
IPP_NOT_AUTHORIZED | client-error-not-authorized |
IPP_NOT_FOUND | client-error-not-found |
IPP_NOT_POSSIBLE | client-error-not-possible |
IPP_OK | successful-ok |
IPP_OK_BUT_CANCEL_SUBSCRIPTION | successful-ok-but-cancel-subscription |
IPP_OK_CONFLICT | successful-ok-conflicting-attributes |
IPP_OK_EVENTS_COMPLETE | successful-ok-events-complete |
IPP_OK_IGNORED_NOTIFICATIONS | successful-ok-ignored-notifications |
IPP_OK_IGNORED_SUBSCRIPTIONS | successful-ok-ignored-subscriptions |
IPP_OK_SUBST | successful-ok-ignored-or-substituted-attributes |
IPP_OK_TOO_MANY_EVENTS | successful-ok-too-many-events |
IPP_OPERATION_NOT_SUPPORTED | server-error-operation-not-supported |
IPP_PRINTER_BUSY | server-error-busy |
IPP_PRINTER_IS_DEACTIVATED | server-error-printer-is-deactivated |
IPP_PRINT_SUPPORT_FILE_NOT_FOUND | client-error-print-support-file-not-found |
IPP_REDIRECTION_OTHER_SITE | |
IPP_REQUEST_ENTITY | client-error-request-entity-too-large |
IPP_REQUEST_VALUE | client-error-request-value-too-long |
IPP_SERVICE_UNAVAILABLE | server-error-service-unavailable |
IPP_TEMPORARY_ERROR | server-error-temporary-error |
IPP_TIMEOUT | client-error-timeout |
IPP_TOO_MANY_SUBSCRIPTIONS | client-error-too-many-subscriptions |
IPP_URI_SCHEME | client-error-uri-scheme-not-supported |
IPP_VERSION_NOT_SUPPORTED | server-error-version-not-supported |
Format tags for attributes...
Name | Description |
---|---|
IPP_TAG_ADMINDEFINE | Admin-defined value |
IPP_TAG_BEGIN_COLLECTION | Beginning of collection value |
IPP_TAG_BOOLEAN | Boolean value |
IPP_TAG_CHARSET | Character set value |
IPP_TAG_COPY | Bitflag for copied attribute values |
IPP_TAG_DATE | Date/time value |
IPP_TAG_DEFAULT | Default value |
IPP_TAG_DELETEATTR | Delete-attribute value |
IPP_TAG_END | End-of-attributes |
IPP_TAG_END_COLLECTION | End of collection value |
IPP_TAG_ENUM | Enumeration value |
IPP_TAG_EVENT_NOTIFICATION | Event group |
IPP_TAG_INTEGER | Integer value |
IPP_TAG_JOB | Job group |
IPP_TAG_KEYWORD | Keyword value |
IPP_TAG_LANGUAGE | Language value |
IPP_TAG_MASK | Mask for copied attribute values |
IPP_TAG_MEMBERNAME | Collection member name value |
IPP_TAG_MIMETYPE | MIME media type value |
IPP_TAG_NAME | Name value |
IPP_TAG_NAMELANG | Name-with-language value |
IPP_TAG_NOTSETTABLE | Not-settable value |
IPP_TAG_NOVALUE | No-value value |
IPP_TAG_OPERATION | Operation group |
IPP_TAG_PRINTER | Printer group |
IPP_TAG_RANGE | Range value |
IPP_TAG_RESOLUTION | Resolution value |
IPP_TAG_STRING | Octet string value |
IPP_TAG_SUBSCRIPTION | Subscription group |
IPP_TAG_TEXT | Text value |
IPP_TAG_TEXTLANG | Text-with-language value |
IPP_TAG_UNKNOWN | Unknown value |
IPP_TAG_UNSUPPORTED_GROUP | Unsupported attributes group |
IPP_TAG_UNSUPPORTED_VALUE | Unsupported value |
IPP_TAG_URI | URI value |
IPP_TAG_URISCHEME | URI scheme value |
IPP_TAG_ZERO | Zero tag - used for separators |
Authenticate a request.
This function should be called in response to a HTTP_UNAUTHORIZED status, prior to resubmitting your request.
int
cupsDoAuthentication(
http_t * http,
const char * method,
const char * resource);
Name | Description |
---|---|
http | HTTP connection to server |
method | Request method (GET, POST, PUT) |
resource | Resource path |
0 on success, -1 on error
Do an IPP request with a file.
This function sends the IPP request to the specified server, retrying and authenticating as necessary. The request is freed with ippDelete() after receiving a valid IPP response.
ipp_t *
cupsDoFileRequest(
http_t * http,
ipp_t * request,
const char * resource,
const char * filename);
Name | Description |
---|---|
http | HTTP connection to server |
request | IPP request |
resource | HTTP resource for POST |
filename | File to send or NULL for none |
Response data
Do an IPP request with file descriptors.
This function sends the IPP request to the specified server, retrying and authenticating as necessary. The request is freed with ippDelete() after receiving a valid IPP response.
If "infile" is a valid file descriptor, cupsDoIORequest() copies all of the data from the file after the IPP request message.
If "outfile" is a valid file descriptor, cupsDoIORequest() copies all of the data after the IPP response message to the file.
ipp_t *
cupsDoIORequest(
http_t * http,
ipp_t * request,
const char * resource,
int infile,
int outfile);
Name | Description |
---|---|
http | HTTP connection to server |
request | IPP request |
resource | HTTP resource for POST |
infile | File to read from or -1 for none |
outfile | File to write to or -1 for none |
Response data
Do an IPP request.
This function sends the IPP request to the specified server, retrying and authenticating as necessary. The request is freed with ippDelete() after receiving a valid IPP response.
ipp_t *
cupsDoRequest(
http_t * http,
ipp_t * request,
const char * resource);
Name | Description |
---|---|
http | HTTP connection to server |
request | IPP request |
resource | HTTP resource for POST |
Response data
Encode printer options into IPP attributes.
This function adds operation, job, and then subscription attributes, in that order. Use the cupsEncodeOptions2() function to add attributes for a single group.
void
cupsEncodeOptions(
ipp_t * ipp,
int num_options,
cups_option_t * options);
Name | Description |
---|---|
ipp | Request to add to |
num_options | Number of options |
options | Options |
Nothing.
Encode printer options into IPP attributes for a group.
This function only adds attributes for a single group. Call this function multiple times for each group, or use cupsEncodeOptions() to add the standard groups.
void
cupsEncodeOptions2(
ipp_t * ipp,
int num_options,
cups_option_t * options,
ipp_tag_t group_tag);
Name | Description |
---|---|
ipp | Request to add to |
num_options | Number of options |
options | Options |
group_tag | Group to encode |
Nothing.
Check for the "any" address.
int
httpAddrAny(
const http_addr_t * addr);
Name | Description |
---|---|
addr | Address to check |
1 if "any", 0 otherwise
Compare two addresses.
int
httpAddrEqual(
const http_addr_t * addr1,
const http_addr_t * addr2);
Name | Description |
---|---|
addr1 | First address |
addr2 | Second address |
1 if equal, 0 if not
Return the length of the address in bytes.
int
httpAddrLength(
const http_addr_t * addr);
Name | Description |
---|---|
addr | Address |
Length in bytes
Check for the local loopback address.
int
httpAddrLocalhost(
const http_addr_t * addr);
Name | Description |
---|---|
addr | Address to check |
1 if local host, 0 otherwise
Lookup the hostname associated with the address.
char *
httpAddrLookup(
const http_addr_t * addr,
char * name,
int namelen);
Name | Description |
---|---|
addr | Address to lookup |
name | Host name buffer |
namelen | Size of name buffer |
Host name
Convert an address to a numeric string.
char *
httpAddrString(
const http_addr_t * addr,
char * s,
int slen);
Name | Description |
---|---|
addr | Address to convert |
s | String buffer |
slen | Length of string |
Numeric address string
Assemble a uniform resource identifier from its components.
This function escapes reserved characters in the URI depending on the value of the "encoding" argument. You should use this function in place of traditional string functions whenever you need to create a URI string.
http_uri_status_t
httpAssembleURI(
http_uri_coding_t encoding,
char * uri,
int urilen,
const char * scheme,
const char * username,
const char * host,
int port,
const char * resource);
Name | Description |
---|---|
encoding | Encoding flags |
uri | URI buffer |
urilen | Size of URI buffer |
scheme | Scheme name |
username | Username |
host | Hostname or address |
port | Port number |
resource | Resource |
URI status
Assemble a uniform resource identifier from its components with a formatted resource.
This function creates a formatted version of the resource string argument "resourcef" and escapes reserved characters in the URI depending on the value of the "encoding" argument. You should use this function in place of traditional string functions whenever you need to create a URI string.
http_uri_status_t
httpAssembleURIf(
http_uri_coding_t encoding,
char * uri,
int urilen,
const char * scheme,
const char * username,
const char * host,
int port,
const char * resourcef,
...);
Name | Description |
---|---|
encoding | Encoding flags |
uri | URI buffer |
urilen | Size of URI buffer |
scheme | Scheme name |
username | Username |
host | Hostname or address |
port | Port number |
resourcef | Printf-style resource |
... | Additional arguments as needed |
URI status
Set blocking/non-blocking behavior on a connection.
void
httpBlocking(
http_t * http,
int b);
Name | Description |
---|---|
http | HTTP connection |
b | 1 = blocking, 0 = non-blocking |
Nothing.
Check to see if there is a pending response from the server.
int
httpCheck(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
0 = no data, 1 = data available
Clear the cookie value(s).
void
httpClearCookie(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Nothing.
Clear HTTP request fields.
void
httpClearFields(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Nothing.
Close an HTTP connection...
void
httpClose(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Nothing.
Connect to a HTTP server.
http_t *
httpConnect(
const char * host,
int port);
Name | Description |
---|---|
host | Host to connect to |
port | Port number |
New HTTP connection
Connect to a HTTP server using encryption.
http_t *
httpConnectEncrypt(
const char * host,
int port,
http_encryption_t encryption);
Name | Description |
---|---|
host | Host to connect to |
port | Port number |
encryption | Type of encryption to use |
New HTTP connection
Base64-decode a string.
This function is deprecated. Use the httpDecode64_2() function instead which provides buffer length arguments.
char *
httpDecode64(
char * out,
const char * in);
Name | Description |
---|---|
out | String to write to |
in | String to read from |
Decoded string
Base64-decode a string.
char *
httpDecode64_2(
char * out,
int * outlen,
const char * in);
Name | Description |
---|---|
out | String to write to |
outlen | Size of output string |
in | String to read from |
Decoded string
Send a DELETE request to the server.
int
httpDelete(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI to delete |
Status of call (0 = success)
Base64-encode a string.
This function is deprecated. Use the httpEncode64_2() function instead which provides buffer length arguments.
char *
httpEncode64(
char * out,
const char * in);
Name | Description |
---|---|
out | String to write to |
in | String to read from |
Encoded string
Base64-encode a string.
char *
httpEncode64_2(
char * out,
int outlen,
const char * in,
int inlen);
Name | Description |
---|---|
out | String to write to |
outlen | Size of output string |
in | String to read from |
inlen | Size of input string |
Encoded string
Set the required encryption on the link.
int
httpEncryption(
http_t * http,
http_encryption_t e);
Name | Description |
---|---|
http | HTTP connection |
e | New encryption preference |
-1 on error, 0 on success
Get the last error on a connection.
int
httpError(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Error code (errno) value
Flush data from a HTTP connection.
void
httpFlush(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Nothing.
Flush data in write buffer.
int
httpFlushWrite(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Bytes written or -1 on error
Send a GET request to the server.
int
httpGet(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI to get |
Status of call (0 = success)
Get the current authorization string.
The authorization string is set by cupsDoAuthentication() and httpSetAuthString(). Use httpGetAuthString() to retrieve the string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION value.
char *
httpGetAuthString(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Authorization string
Get the blocking/non-block state of a connection.
int
httpGetBlocking(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
1 if blocking, 0 if non-blocking
Get any cookie data from the response.
const char *
httpGetCookie(
http_t * http);
Name | Description |
---|---|
http | HTTP connecion |
Cookie data or NULL
Get a formatted date/time string from a time value.
const char *
httpGetDateString(
time_t t);
Name | Description |
---|---|
t | UNIX time |
Date/time string
Get a formatted date/time string from a time value.
const char *
httpGetDateString2(
time_t t,
char * s,
int slen);
Name | Description |
---|---|
t | UNIX time |
s | String buffer |
slen | Size of string buffer |
Date/time string
Get a time value from a formatted date/time string.
time_t
httpGetDateTime(
const char * s);
Name | Description |
---|---|
s | Date/time string |
UNIX time
Get the file descriptor associated with a connection.
int
httpGetFd(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
File descriptor or -1 if none
Get a field value from a request/response.
const char *
httpGetField(
http_t * http,
http_field_t field);
Name | Description |
---|---|
http | HTTP connection |
field | Field to get |
Field value
Lookup a hostname or IPv4 address, and return address records for the specified name.
struct hostent *
httpGetHostByName(
const char * name);
Name | Description |
---|---|
name | Hostname or IP address |
Host entry
Get the FQDN for the connection or local system.
When "http" points to a connected socket, return the hostname or address that was used in the call to httpConnect() or httpConnectEncrypt(). Otherwise, return the FQDN for the local system using both gethostname() and gethostbyname() to get the local hostname with domain.
const char *
httpGetHostname(
http_t * http,
char * s,
int slen);
Name | Description |
---|---|
http | HTTP connection or NULL |
s | String buffer for name |
slen | Size of buffer |
FQDN for connection or system
Get the amount of data remaining from the content-length or transfer-encoding fields.
This function is deprecated and will not return lengths larger than 2^31 - 1; use httpGetLength2() instead.
int
httpGetLength(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Content length
Get the amount of data remaining from the content-length or transfer-encoding fields.
This function returns the complete content length, even for content larger than 2^31 - 1.
off_t
httpGetLength2(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
Content length
Get the status of the last HTTP request.
http_status_t
httpGetStatus(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
HTTP status
Get a sub-field value.
char *
httpGetSubField(
http_t * http,
http_field_t field,
const char * name,
char * value);
Name | Description |
---|---|
http | HTTP connection |
field | Field index |
name | Name of sub-field |
value | Value string |
Value or NULL
Get a sub-field value.
char *
httpGetSubField2(
http_t * http,
http_field_t field,
const char * name,
char * value,
int valuelen);
Name | Description |
---|---|
http | HTTP connection |
field | Field index |
name | Name of sub-field |
value | Value string |
valuelen | Size of value buffer |
Value or NULL
Get a line of text from a HTTP connection.
char *
httpGets(
char * line,
int length,
http_t * http);
Name | Description |
---|---|
line | Line to read into |
length | Max length of buffer |
http | HTTP connection |
Line or NULL
Send a HEAD request to the server.
int
httpHead(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI for head |
Status of call (0 = success)
Initialize the HTTP interface library and set the default HTTP proxy (if any).
void
httpInitialize(void);
None.
Nothing.
Compute the MD5 sum of the username:group:password.
char *
httpMD5(
const char * username,
const char * realm,
const char * passwd,
char md5[33]);
Name | Description |
---|---|
username | User name |
realm | Realm name |
passwd | Password string |
md5[33] | MD5 string |
MD5 sum
Combine the MD5 sum of the username, group, and password with the server-supplied nonce value, method, and request-uri.
char *
httpMD5Final(
const char * nonce,
const char * method,
const char * resource,
char md5[33]);
Name | Description |
---|---|
nonce | Server nonce value |
method | METHOD (GET, POST, etc.) |
resource | Resource path |
md5[33] | MD5 sum |
New sum
Convert an MD5 sum to a character string.
char *
httpMD5String(
const unsigned char * sum,
char md5[33]);
Name | Description |
---|---|
sum | MD5 sum data |
md5[33] | MD5 sum in hex |
MD5 sum in hex
Send an OPTIONS request to the server.
int
httpOptions(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI for options |
Status of call (0 = success)
Send a POST request to the server.
int
httpPost(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI for post |
Status of call (0 = success)
Send a PUT request to the server.
int
httpPut(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI to put |
Status of call (0 = success)
Read data from a HTTP connection.
This function is deprecated. Use the httpRead2() function which can read more than 2GB of data.
int
httpRead(
http_t * http,
char * buffer,
int length);
Name | Description |
---|---|
http | HTTP connection |
buffer | Buffer for data |
length | Maximum number of bytes |
Number of bytes read
Read data from a HTTP connection.
ssize_t
httpRead2(
http_t * http,
char * buffer,
size_t length);
Name | Description |
---|---|
http | HTTP connection |
buffer | Buffer for data |
length | Maximum number of bytes |
Number of bytes read
Reconnect to a HTTP server.
int
httpReconnect(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
0 on success, non-zero on failure
Separate a Universal Resource Identifier into its components.
This function is deprecated; use the httpSeparateURI() function instead.
void
httpSeparate(
const char * uri,
char * scheme,
char * username,
char * host,
int * port,
char * resource);
Name | Description |
---|---|
uri | Universal Resource Identifier |
scheme | Scheme [32] (http, https, etc.) |
username | Username [1024] |
host | Hostname [1024] |
port | Port number to use |
resource | Resource/filename [1024] |
Nothing.
Separate a Universal Resource Identifier into its components.
This function is deprecated; use the httpSeparateURI() function instead.
void
httpSeparate2(
const char * uri,
char * scheme,
int schemelen,
char * username,
int usernamelen,
char * host,
int hostlen,
int * port,
char * resource,
int resourcelen);
Name | Description |
---|---|
uri | Universal Resource Identifier |
scheme | Scheme (http, https, etc.) |
schemelen | Size of scheme buffer |
username | Username |
usernamelen | Size of username buffer |
host | Hostname |
hostlen | Size of hostname buffer |
port | Port number to use |
resource | Resource/filename |
resourcelen | Size of resource buffer |
Nothing.
Separate a Universal Resource Identifier into its components.
http_uri_status_t
httpSeparateURI(
http_uri_coding_t decoding,
const char * uri,
char * scheme,
int schemelen,
char * username,
int usernamelen,
char * host,
int hostlen,
int * port,
char * resource,
int resourcelen);
Name | Description |
---|---|
decoding | Decoding flags |
uri | Universal Resource Identifier |
scheme | Scheme (http, https, etc.) |
schemelen | Size of scheme buffer |
username | Username |
usernamelen | Size of username buffer |
host | Hostname |
hostlen | Size of hostname buffer |
port | Port number to use |
resource | Resource/filename |
resourcelen | Size of resource buffer |
Result of separation
Set the current authorization string.
This function just stores a copy of the current authorization string in the HTTP connection object. You must still call httpSetField() to set HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(), httpHead(), httpOptions(), httpPost, or httpPut().
void
httpSetAuthString(
http_t * http,
const char * scheme,
const char * data);
Name | Description |
---|---|
http | HTTP connection |
scheme | Auth scheme (NULL to clear it) |
data | Auth data (NULL for none) |
Nothing.
Set the cookie value(s)...
void
httpSetCookie(
http_t * http,
const char * cookie);
Name | Description |
---|---|
http | Connection |
cookie | Cookie string |
Nothing.
Set the Expect: header in a request.
Currently only HTTP_CONTINUE is supported for the "expect" argument.
void
httpSetExpect(
http_t * http,
http_status_t expect);
Name | Description |
---|---|
http | HTTP connection |
expect | HTTP status to expect (HTTP_CONTINUE) |
Nothing.
Set the value of an HTTP header.
void
httpSetField(
http_t * http,
http_field_t field,
const char * value);
Name | Description |
---|---|
http | HTTP connection |
field | Field index |
value | Value |
Nothing.
Set the content-length and content-encoding.
void
httpSetLength(
http_t * http,
size_t length);
Name | Description |
---|---|
http | HTTP connection |
length | Length (0 for chunked) |
Nothing.
Return a short string describing a HTTP status code.
const char *
httpStatus(
http_status_t status);
Name | Description |
---|---|
status | HTTP status code |
String or NULL
Send an TRACE request to the server.
int
httpTrace(
http_t * http,
const char * uri);
Name | Description |
---|---|
http | HTTP connection |
uri | URI for trace |
Status of call (0 = success)
Update the current HTTP state for incoming data.
http_status_t
httpUpdate(
http_t * http);
Name | Description |
---|---|
http | HTTP connection |
HTTP status
Wait for data available on a connection.
int
httpWait(
http_t * http,
int msec);
Name | Description |
---|---|
http | HTTP connection |
msec | Milliseconds to wait |
1 if data is available, 0 otherwise
Write data to a HTTP connection.
This function is deprecated. Use the httpWrite2() function which can write more than 2GB of data.
int
httpWrite(
http_t * http,
const char * buffer,
int length);
Name | Description |
---|---|
http | HTTP connection |
buffer | Buffer for data |
length | Number of bytes to write |
Number of bytes written
Write data to a HTTP connection.
ssize_t
httpWrite2(
http_t * http,
const char * buffer,
size_t length);
Name | Description |
---|---|
http | HTTP connection |
buffer | Buffer for data |
length | Number of bytes to write |
Number of bytes written
Add a boolean attribute to an IPP message.
ipp_attribute_t *
ippAddBoolean(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
char value);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
value | Value of attribute |
New attribute
Add an array of boolean values.
ipp_attribute_t *
ippAddBooleans(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
int num_values,
const char * values);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
num_values | Number of values |
values | Values |
New attribute
Add a collection value.
ipp_attribute_t *
ippAddCollection(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
ipp_t * value);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
value | Value |
New attribute
Add an array of collection values.
ipp_attribute_t *
ippAddCollections(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
int num_values,
const ipp_t ** values);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
num_values | Number of values |
values | Values |
New attribute
Add a date attribute to an IPP message.
ipp_attribute_t *
ippAddDate(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
const ipp_uchar_t * value);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
value | Value |
New attribute
Add a integer attribute to an IPP message.
ipp_attribute_t *
ippAddInteger(
ipp_t * ipp,
ipp_tag_t group,
ipp_tag_t type,
const char * name,
int value);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
type | Type of attribute |
name | Name of attribute |
value | Value of attribute |
New attribute
Add an array of integer values.
ipp_attribute_t *
ippAddIntegers(
ipp_t * ipp,
ipp_tag_t group,
ipp_tag_t type,
const char * name,
int num_values,
const int * values);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
type | Type of attribute |
name | Name of attribute |
num_values | Number of values |
values | Values |
New attribute
Add an octetString value to an IPP message.
ipp_attribute_t *
ippAddOctetString(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
const void * data,
int datalen);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
data | octetString data |
datalen | Length of data in bytes |
New attribute
Add a range of values to an IPP message.
ipp_attribute_t *
ippAddRange(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
int lower,
int upper);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
lower | Lower value |
upper | Upper value |
New attribute
Add ranges of values to an IPP message.
ipp_attribute_t *
ippAddRanges(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
int num_values,
const int * lower,
const int * upper);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
num_values | Number of values |
lower | Lower values |
upper | Upper values |
New attribute
Add a resolution value to an IPP message.
ipp_attribute_t *
ippAddResolution(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
ipp_res_t units,
int xres,
int yres);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
units | Units for resolution |
xres | X resolution |
yres | Y resolution |
New attribute
Add resolution values to an IPP message.
ipp_attribute_t *
ippAddResolutions(
ipp_t * ipp,
ipp_tag_t group,
const char * name,
int num_values,
ipp_res_t units,
const int * xres,
const int * yres);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
name | Name of attribute |
num_values | Number of values |
units | Units for resolution |
xres | X resolutions |
yres | Y resolutions |
New attribute
Add a group separator to an IPP message.
ipp_attribute_t *
ippAddSeparator(
ipp_t * ipp);
Name | Description |
---|---|
ipp | IPP message |
New attribute
Add a language-encoded string to an IPP message.
ipp_attribute_t *
ippAddString(
ipp_t * ipp,
ipp_tag_t group,
ipp_tag_t type,
const char * name,
const char * charset,
const char * value);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
type | Type of attribute |
name | Name of attribute |
charset | Character set |
value | Value |
New attribute
Add language-encoded strings to an IPP message.
ipp_attribute_t *
ippAddStrings(
ipp_t * ipp,
ipp_tag_t group,
ipp_tag_t type,
const char * name,
int num_values,
const char * charset,
const char *const * values);
Name | Description |
---|---|
ipp | IPP message |
group | IPP group |
type | Type of attribute |
name | Name of attribute |
num_values | Number of values |
charset | Character set |
values | Values |
New attribute
Convert from RFC 1903 Date/Time format to UNIX time in seconds.
time_t
ippDateToTime(
const ipp_uchar_t * date);
Name | Description |
---|---|
date | RFC 1903 date info |
UNIX time value
Delete an IPP message.
void
ippDelete(
ipp_t * ipp);
Name | Description |
---|---|
ipp | IPP message |
Nothing.
Delete a single attribute in an IPP message.
void
ippDeleteAttribute(
ipp_t * ipp,
ipp_attribute_t * attr);
Name | Description |
---|---|
ipp | IPP message |
attr | Attribute to delete |
Nothing.
Return a name for the given status code.
const char *
ippErrorString(
ipp_status_t error);
Name | Description |
---|---|
error | Error status |
Text string
Return a status code for the given name.
ipp_status_t
ippErrorValue(
const char * name);
Name | Description |
---|---|
name | Name |
IPP status code
Find a named attribute in a request...
ipp_attribute_t *
ippFindAttribute(
ipp_t * ipp,
const char * name,
ipp_tag_t type);
Name | Description |
---|---|
ipp | IPP message |
name | Name of attribute |
type | Type of attribute |
Matching attribute
Find the next named attribute in a request...
ipp_attribute_t *
ippFindNextAttribute(
ipp_t * ipp,
const char * name,
ipp_tag_t type);
Name | Description |
---|---|
ipp | IPP message |
name | Name of attribute |
type | Type of attribute |
Matching attribute
Compute the length of an IPP message.
size_t
ippLength(
ipp_t * ipp);
Name | Description |
---|---|
ipp | IPP message |
Size of IPP message
Allocate a new IPP message.
ipp_t *
ippNew(void);
None.
New IPP message
Allocate a new IPP request message.
The new request message is initialized with the attributes-charset and attributes-natural-language attributes added. The attributes-natural-language value is derived from the current locale.
ipp_t *
ippNewRequest(
ipp_op_t op);
Name | Description |
---|---|
op | Operation code |
IPP request message
Return a name for the given operation id.
const char *
ippOpString(
ipp_op_t op);
Name | Description |
---|---|
op | Operation ID |
Name
Return an operation id for the given name.
ipp_op_t
ippOpValue(
const char * name);
Name | Description |
---|---|
name | Textual name |
Operation ID
Return the default IPP port number.
int
ippPort(void);
None.
Port number
Read data for an IPP message from a HTTP connection.
ipp_state_t
ippRead(
http_t * http,
ipp_t * ipp);
Name | Description |
---|---|
http | HTTP connection |
ipp | IPP data |
Current state
Read data for an IPP message from a file.
ipp_state_t
ippReadFile(
int fd,
ipp_t * ipp);
Name | Description |
---|---|
fd | HTTP data |
ipp | IPP data |
Current state
Read data for an IPP message.
ipp_state_t
ippReadIO(
void * src,
ipp_iocb_t cb,
int blocking,
ipp_t * parent,
ipp_t * ipp);
Name | Description |
---|---|
src | Data source |
cb | Read callback function |
blocking | Use blocking IO? |
parent | Parent request, if any |
ipp | IPP data |
Current state
Set the default port number.
void
ippSetPort(
int p);
Name | Description |
---|---|
p | Port number to use |
Nothing.
Convert from UNIX time to RFC 1903 format.
const ipp_uchar_t *
ippTimeToDate(
time_t t);
Name | Description |
---|---|
t | UNIX time value |
RFC-1903 date/time data
Write data for an IPP message to a HTTP connection.
ipp_state_t
ippWrite(
http_t * http,
ipp_t * ipp);
Name | Description |
---|---|
http | HTTP connection |
ipp | IPP data |
Current state
Write data for an IPP message to a file.
ipp_state_t
ippWriteFile(
int fd,
ipp_t * ipp);
Name | Description |
---|---|
fd | HTTP data |
ipp | IPP data |
Current state
Write data for an IPP message.
ipp_state_t
ippWriteIO(
void * dst,
ipp_iocb_t cb,
int blocking,
ipp_t * parent,
ipp_t * ipp);
Name | Description |
---|---|
dst | Destination |
cb | Write callback function |
blocking | Use blocking IO? |
parent | Parent IPP message |
ipp | IPP data |
Current state
Socket address list, which is used to enumerate all of the addresses that are associated with a hostname.
struct http_addrlist_s
{
http_addr_t addr;
struct http_addrlist_s * next;
};
Name | Description |
---|---|
addr | Address |
next | Pointer to next address in list |
Attribute
struct ipp_attribute_s
{
char * name;
struct ipp_attribute_s * next;
int num_values;
ipp_tag_t group_tag, value_tag;
ipp_value_t values[1];
};
Name | Description |
---|---|
name | Name of attribute |
next | Next attribute in list |
num_values | Number of values |
value_tag | What type of value is it? |
values[1] | Values |
IPP Request/Response/Notification
struct ipp_s
{
ipp_attribute_t * attrs;
ipp_attribute_t * current;
ipp_tag_t curtag;
ipp_attribute_t * last;
ipp_attribute_t * prev;
ipp_request_t request;
ipp_state_t state;
};
Name | Description |
---|---|
attrs | Attributes |
current | Current attribute (for read/write) |
curtag | Current attribute group tag |
last | Last attribute in list |
prev | Previous attribute (for read) |
request | Request header |
state | State of request |
Socket address list, which is used to enumerate all of the addresses that are associated with a hostname.
typedef struct http_addrlist_s / http_addrlist_t;
HTTP authentication types
typedef enum http_auth_e http_auth_t;
HTTP transfer encoding values
typedef enum http_encoding_e http_encoding_t;
HTTP encryption values
typedef enum http_encryption_e http_encryption_t;
HTTP connection type
typedef struct _http_s http_t;
Attribute
typedef struct ipp_attribute_s ipp_attribute_t;
IPP IO Callback Function
typedef ssize_t (*ipp_iocb_t)(void *, ipp_uchar_t *, size_t);
Request Header
typedef union ipp_request_u ipp_request_t;
Attribute Value
typedef struct ipp_s ipp_t;
IPP status codes...
typedef typedef unsigned char ipp_uchar_t;
New in CUPS 1.1.19
typedef union ipp_value_u ipp_value_t;
Request Header
union ipp_request_u
{
};
Name | Description |
---|
New in CUPS 1.1.19
union ipp_value_u
{
char boolean;
ipp_t * collection;
ipp_uchar_t date[11];
int integer;
};
Name | Description |
---|---|
boolean | Boolean value |
collection | Collection value |
date[11] | Date/time value |
integer | Integer/enumerated value |