/*
* "$Id: http.h 7026 2007-10-19 00:57:45Z mike $"
*
- * Hyper-Text Transport Protocol definitions for the Common UNIX Printing
- * System (CUPS).
+ * Hyper-Text Transport Protocol definitions for CUPS.
*
- * Copyright 2007-2009 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*/
# include "versioning.h"
+# include "array.h"
# include <string.h>
# include <time.h>
# include <sys/types.h>
#if defined(AF_INET6) && !defined(s6_addr32)
# if defined(__sun)
# define s6_addr32 _S6_un._S6_u32
-# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
# define s6_addr32 __u6_addr.__u6_addr32
# elif defined(__osf__)
# define s6_addr32 s6_un.sa6_laddr
HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */
HTTP_NOT_SUPPORTED, /* HTTP version not supported */
- HTTP_AUTHORIZATION_CANCELED = 1000 /* User cancelled authorization */
-
+ HTTP_AUTHORIZATION_CANCELED = 1000, /* User canceled authorization @since CUPS 1.4@ */
+ HTTP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
+ HTTP_WEBIF_DISABLED /* Web interface is disabled @private@ */
} http_status_t;
-typedef enum http_uri_status_e /**** URI separation status @since CUPS1.2@ ****/
+typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/
{
HTTP_URI_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */
HTTP_URI_BAD_ARGUMENTS = -7, /* Bad arguments to function (error) */
typedef struct _http_s http_t; /**** HTTP connection type ****/
+typedef struct http_credential_s /**** HTTP credential data @since CUPS 1.5/Mac OS X 10.7@ ****/
+{
+ void *data; /* Pointer to credential data */
+ size_t datalen; /* Credential length */
+} http_credential_t;
+
+typedef int (*http_timeout_cb_t)(http_t *http, void *user_data);
+ /**** HTTP timeout callback @since CUPS 1.5/Mac OS X 10.7@ ****/
+
+
/*
* Prototypes...
extern int httpOptions(http_t *http, const char *uri);
extern int httpPost(http_t *http, const char *uri);
extern int httpPrintf(http_t *http, const char *format, ...)
-# ifdef __GNUC__
-__attribute__ ((__format__ (__printf__, 2, 3)))
-# endif /* __GNUC__ */
-;
+ __attribute__ ((__format__ (__printf__, 2, 3)));
extern int httpPut(http_t *http, const char *uri);
extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
extern int httpReconnect(http_t *http);
extern void httpSetAuthString(http_t *http, const char *scheme,
const char *data) _CUPS_API_1_3;
+/**** New in CUPS 1.5/Mac OS X 10.7 ****/
+extern int httpAddCredential(cups_array_t *credentials,
+ const void *data, size_t datalen)
+ _CUPS_API_1_5;
+extern int httpCopyCredentials(http_t *http,
+ cups_array_t **credentials)
+ _CUPS_API_1_5;
+extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
+extern int httpSetCredentials(http_t *http, cups_array_t *certs)
+ _CUPS_API_1_5;
+extern void httpSetTimeout(http_t *http, double timeout,
+ http_timeout_cb_t cb, void *user_data);
+
+
/*
* C++ magic...
*/