]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f2d18633 | 2 | * "$Id$" |
ef416fc2 | 3 | * |
2c85b752 | 4 | * Private HTTP definitions for CUPS. |
ef416fc2 | 5 | * |
25731360 | 6 | * Copyright 2007-2014 by Apple Inc. |
2c85b752 | 7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | * |
2c85b752 MS |
9 | * These coded instructions, statements, and computer programs are the |
10 | * property of Apple Inc. and are protected by Federal copyright | |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | * which should have been included with this file. If this file is | |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | * |
2c85b752 | 15 | * This file is subject to the Apple OS-Developed Software exception. |
ef416fc2 | 16 | */ |
17 | ||
18 | #ifndef _CUPS_HTTP_PRIVATE_H_ | |
19 | # define _CUPS_HTTP_PRIVATE_H_ | |
20 | ||
21 | /* | |
22 | * Include necessary headers... | |
23 | */ | |
24 | ||
71e16022 | 25 | # include "config.h" |
41e6c1f1 | 26 | # include <cups/language.h> |
5180a04c | 27 | # include <stddef.h> |
a74454a7 | 28 | # include <stdlib.h> |
ef416fc2 | 29 | |
30 | # ifdef __sun | |
ef416fc2 | 31 | # include <sys/select.h> |
32 | # endif /* __sun */ | |
33 | ||
34 | # include <limits.h> | |
35 | # ifdef WIN32 | |
36 | # include <io.h> | |
37 | # include <winsock2.h> | |
db8b865d | 38 | # define CUPS_SOCAST (const char *) |
ef416fc2 | 39 | # else |
40 | # include <unistd.h> | |
41 | # include <fcntl.h> | |
42 | # include <sys/socket.h> | |
db8b865d | 43 | # define CUPS_SOCAST |
ef416fc2 | 44 | # endif /* WIN32 */ |
45 | ||
f7deaa1a | 46 | # ifdef HAVE_GSSAPI |
eac3a0a0 MS |
47 | # ifdef HAVE_GSS_GSSAPI_H |
48 | # include <GSS/gssapi.h> | |
eac3a0a0 | 49 | # elif defined(HAVE_GSSAPI_GSSAPI_H) |
f7deaa1a | 50 | # include <gssapi/gssapi.h> |
eac3a0a0 | 51 | # elif defined(HAVE_GSSAPI_H) |
f7deaa1a | 52 | # include <gssapi.h> |
eac3a0a0 | 53 | # endif /* HAVE_GSS_GSSAPI_H */ |
f7deaa1a | 54 | # ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE |
55 | # define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name | |
56 | # endif /* !HAVE_GSS_C_NT_HOSTBASED_SERVICE */ | |
57 | # endif /* HAVE_GSSAPI */ | |
58 | ||
b94498cf | 59 | # ifdef HAVE_AUTHORIZATION_H |
60 | # include <Security/Authorization.h> | |
61 | # endif /* HAVE_AUTHORIZATION_H */ | |
62 | ||
3dd9c340 | 63 | # if defined(__APPLE__) && !defined(_SOCKLEN_T) |
ef416fc2 | 64 | /* |
3dd9c340 | 65 | * MacOS X 10.2.x does not define socklen_t, and in fact uses an int instead of |
ef416fc2 | 66 | * unsigned type for length values... |
67 | */ | |
68 | ||
69 | typedef int socklen_t; | |
3dd9c340 | 70 | # endif /* __APPLE__ && !_SOCKLEN_T */ |
ef416fc2 | 71 | |
71e16022 MS |
72 | # include <cups/http.h> |
73 | # include "md5-private.h" | |
fa73b229 | 74 | # include "ipp-private.h" |
ef416fc2 | 75 | |
724e1819 | 76 | # ifdef HAVE_GNUTLS |
07ed0e9a MS |
77 | # include <gnutls/gnutls.h> |
78 | # include <gnutls/x509.h> | |
07ed0e9a MS |
79 | # elif defined(HAVE_CDSASSL) |
80 | # include <CoreFoundation/CoreFoundation.h> | |
81 | # include <Security/Security.h> | |
82 | # include <Security/SecureTransport.h> | |
eac3a0a0 MS |
83 | # ifdef HAVE_SECURETRANSPORTPRIV_H |
84 | # include <Security/SecureTransportPriv.h> | |
85 | # endif /* HAVE_SECURETRANSPORTPRIV_H */ | |
07ed0e9a MS |
86 | # ifdef HAVE_SECITEM_H |
87 | # include <Security/SecItem.h> | |
88 | # endif /* HAVE_SECITEM_H */ | |
89 | # ifdef HAVE_SECBASEPRIV_H | |
90 | # include <Security/SecBasePriv.h> | |
91 | # endif /* HAVE_SECBASEPRIV_H */ | |
92 | # ifdef HAVE_SECCERTIFICATE_H | |
93 | # include <Security/SecCertificate.h> | |
94 | # include <Security/SecIdentity.h> | |
95 | # endif /* HAVE_SECCERTIFICATE_H */ | |
9653cfdf MS |
96 | # ifdef HAVE_SECCERTIFICATEPRIV_H |
97 | # include <Security/SecCertificatePriv.h> | |
98 | # else | |
99 | # ifdef __cplusplus | |
100 | extern "C" { | |
101 | # endif /* __cplusplus */ | |
102 | extern SecCertificateRef SecCertificateCreateWithBytes(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length); | |
103 | extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime); | |
104 | extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate); | |
9653cfdf MS |
105 | # ifdef __cplusplus |
106 | } | |
107 | # endif /* __cplusplus */ | |
108 | # endif /* HAVE_SECCERTIFICATEPRIV_H */ | |
07ed0e9a MS |
109 | # ifdef HAVE_SECITEMPRIV_H |
110 | # include <Security/SecItemPriv.h> | |
111 | # endif /* HAVE_SECITEMPRIV_H */ | |
112 | # ifdef HAVE_SECIDENTITYSEARCHPRIV_H | |
113 | # include <Security/SecIdentitySearchPriv.h> | |
114 | # endif /* HAVE_SECIDENTITYSEARCHPRIV_H */ | |
115 | # ifdef HAVE_SECPOLICYPRIV_H | |
116 | # include <Security/SecPolicyPriv.h> | |
117 | # endif /* HAVE_SECPOLICYPRIV_H */ | |
118 | # elif defined(HAVE_SSPISSL) | |
2ece34a9 MS |
119 | # include <wincrypt.h> |
120 | # include <wintrust.h> | |
121 | # include <schannel.h> | |
122 | # define SECURITY_WIN32 | |
123 | # include <security.h> | |
124 | # include <sspi.h> | |
724e1819 | 125 | # endif /* HAVE_GNUTLS */ |
07ed0e9a MS |
126 | |
127 | # ifndef WIN32 | |
128 | # include <net/if.h> | |
ed26f50f | 129 | # include <resolv.h> |
07ed0e9a MS |
130 | # ifdef HAVE_GETIFADDRS |
131 | # include <ifaddrs.h> | |
132 | # else | |
133 | # include <sys/ioctl.h> | |
134 | # ifdef HAVE_SYS_SOCKIO_H | |
135 | # include <sys/sockio.h> | |
136 | # endif /* HAVE_SYS_SOCKIO_H */ | |
137 | # endif /* HAVE_GETIFADDRS */ | |
138 | # endif /* !WIN32 */ | |
139 | ||
a469f8a5 MS |
140 | # ifdef HAVE_LIBZ |
141 | # include <zlib.h> | |
142 | # endif /* HAVE_LIBZ */ | |
143 | ||
07ed0e9a MS |
144 | |
145 | /* | |
146 | * C++ magic... | |
147 | */ | |
148 | ||
149 | # ifdef __cplusplus | |
150 | extern "C" { | |
151 | # endif /* __cplusplus */ | |
152 | ||
153 | ||
eac3a0a0 MS |
154 | /* |
155 | * Constants... | |
156 | */ | |
157 | ||
158 | ||
291e4727 | 159 | #define _HTTP_MAX_SBUFFER 65536 /* Size of (de)compression buffer */ |
eac3a0a0 MS |
160 | #define _HTTP_RESOLVE_DEFAULT 0 /* Just resolve with default options */ |
161 | #define _HTTP_RESOLVE_STDERR 1 /* Log resolve progress to stderr */ | |
162 | #define _HTTP_RESOLVE_FQDN 2 /* Resolve to a FQDN */ | |
f3c17241 | 163 | #define _HTTP_RESOLVE_FAXOUT 4 /* Resolve FaxOut service? */ |
eac3a0a0 | 164 | |
63aefcd5 MS |
165 | #define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */ |
166 | #define _HTTP_TLS_ALLOW_SSL3 1 /* Allow SSL 3.0 */ | |
167 | ||
eac3a0a0 | 168 | |
07ed0e9a MS |
169 | /* |
170 | * Types and functions for SSL support... | |
171 | */ | |
172 | ||
724e1819 | 173 | # ifdef HAVE_GNUTLS |
ef416fc2 | 174 | /* |
175 | * The GNU TLS library is more of a "bare metal" SSL/TLS library... | |
176 | */ | |
ef416fc2 | 177 | |
dd332638 | 178 | typedef gnutls_session_t http_tls_t; |
172bdf5d | 179 | typedef gnutls_certificate_credentials_t *http_tls_credentials_t; |
ef416fc2 | 180 | |
181 | # elif defined(HAVE_CDSASSL) | |
182 | /* | |
183 | * Darwin's Security framework provides its own SSL/TLS context structure | |
184 | * for its IO and protocol management... | |
185 | */ | |
186 | ||
07ed0e9a | 187 | # if !defined(HAVE_SECBASEPRIV_H) && defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */ |
7cf5915e | 188 | extern const char *cssmErrorString(int error); |
07ed0e9a MS |
189 | # endif /* !HAVE_SECBASEPRIV_H && HAVE_CSSMERRORSTRING */ |
190 | # ifndef HAVE_SECITEMPRIV_H /* Declare constants from that header... */ | |
7cf5915e MS |
191 | extern const CFTypeRef kSecClassCertificate; |
192 | extern const CFTypeRef kSecClassIdentity; | |
07ed0e9a MS |
193 | # endif /* !HAVE_SECITEMPRIV_H */ |
194 | # if !defined(HAVE_SECIDENTITYSEARCHPRIV_H) && defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */ | |
7cf5915e MS |
195 | extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy, |
196 | CFStringRef idString, CSSM_KEYUSE keyUsage, | |
197 | CFTypeRef keychainOrArray, | |
198 | Boolean returnOnlyValidIdentities, | |
199 | SecIdentitySearchRef* searchRef); | |
07ed0e9a MS |
200 | # endif /* !HAVE_SECIDENTITYSEARCHPRIV_H && HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY */ |
201 | # if !defined(HAVE_SECPOLICYPRIV_H) && defined(HAVE_SECPOLICYSETVALUE) /* Declare prototype for function in that header... */ | |
7cf5915e MS |
202 | extern OSStatus SecPolicySetValue(SecPolicyRef policyRef, |
203 | const CSSM_DATA *value); | |
07ed0e9a | 204 | # endif /* !HAVE_SECPOLICYPRIV_H && HAVE_SECPOLICYSETVALUE */ |
7cf5915e MS |
205 | |
206 | typedef SSLContextRef http_tls_t; | |
207 | typedef CFArrayRef http_tls_credentials_t; | |
ef416fc2 | 208 | |
cc754834 | 209 | # elif defined(HAVE_SSPISSL) |
07ed0e9a MS |
210 | /* |
211 | * Windows' SSPI library gets a CUPS wrapper... | |
212 | */ | |
213 | ||
2ece34a9 MS |
214 | typedef struct _http_sspi_s /**** SSPI/SSL data structure ****/ |
215 | { | |
216 | CredHandle creds; /* Credentials */ | |
217 | CtxtHandle context; /* SSL context */ | |
218 | BOOL contextInitialized; /* Is context init'd? */ | |
219 | SecPkgContext_StreamSizes streamSizes;/* SSL data stream sizes */ | |
220 | BYTE *decryptBuffer; /* Data pre-decryption*/ | |
221 | size_t decryptBufferLength; /* Length of decrypt buffer */ | |
222 | size_t decryptBufferUsed; /* Bytes used in buffer */ | |
223 | BYTE *readBuffer; /* Data post-decryption */ | |
224 | int readBufferLength; /* Length of read buffer */ | |
225 | int readBufferUsed; /* Bytes used in buffer */ | |
226 | BYTE *writeBuffer; /* Data pre-encryption */ | |
227 | int writeBufferLength; /* Length of write buffer */ | |
2ece34a9 MS |
228 | PCCERT_CONTEXT localCert, /* Local certificate */ |
229 | remoteCert; /* Remote (peer's) certificate */ | |
d777d26d | 230 | char error[256]; /* Most recent error message */ |
2ece34a9 MS |
231 | } _http_sspi_t; |
232 | typedef _http_sspi_t *http_tls_t; | |
17eecbf1 | 233 | typedef PCCERT_CONTEXT http_tls_credentials_t; |
07ed0e9a | 234 | |
7cf5915e | 235 | # else |
07ed0e9a MS |
236 | /* |
237 | * Otherwise define stub types since we have no SSL support... | |
238 | */ | |
239 | ||
7cf5915e | 240 | typedef void *http_tls_t; |
07ed0e9a | 241 | typedef void *http_tls_credentials_t; |
724e1819 | 242 | # endif /* HAVE_GNUTLS */ |
ef416fc2 | 243 | |
a469f8a5 MS |
244 | typedef enum _http_coding_e /**** HTTP content coding enumeration ****/ |
245 | { | |
246 | _HTTP_CODING_IDENTITY, /* No content coding */ | |
247 | _HTTP_CODING_GZIP, /* LZ77+gzip decompression */ | |
248 | _HTTP_CODING_DEFLATE, /* LZ77+zlib compression */ | |
249 | _HTTP_CODING_GUNZIP, /* LZ77+gzip decompression */ | |
250 | _HTTP_CODING_INFLATE /* LZ77+zlib decompression */ | |
251 | } _http_coding_t; | |
252 | ||
253 | typedef enum _http_mode_e /**** HTTP mode enumeration ****/ | |
254 | { | |
255 | _HTTP_MODE_CLIENT, /* Client connected to server */ | |
256 | _HTTP_MODE_SERVER /* Server connected (accepted) from client */ | |
257 | } _http_mode_t; | |
258 | ||
5ec1fd3d | 259 | # ifndef _HTTP_NO_PRIVATE |
a469f8a5 | 260 | struct _http_s /**** HTTP connection structure ****/ |
f7deaa1a | 261 | { |
262 | int fd; /* File descriptor for this socket */ | |
263 | int blocking; /* To block or not to block */ | |
264 | int error; /* Last error on read */ | |
265 | time_t activity; /* Time since last read/write */ | |
266 | http_state_t state; /* State of client */ | |
267 | http_status_t status; /* Status of last request */ | |
268 | http_version_t version; /* Protocol version */ | |
269 | http_keepalive_t keep_alive; /* Keep-alive supported? */ | |
85dda01c | 270 | struct sockaddr_in _hostaddr; /* Address of connected host (deprecated) */ |
f7deaa1a | 271 | char hostname[HTTP_MAX_HOST], |
272 | /* Name of connected host */ | |
a469f8a5 MS |
273 | fields[HTTP_FIELD_ACCEPT_ENCODING][HTTP_MAX_VALUE]; |
274 | /* Field values up to Accept-Encoding */ | |
f7deaa1a | 275 | char *data; /* Pointer to data buffer */ |
276 | http_encoding_t data_encoding; /* Chunked or not */ | |
85dda01c | 277 | int _data_remaining;/* Number of bytes left (deprecated) */ |
f7deaa1a | 278 | int used; /* Number of bytes used in buffer */ |
279 | char buffer[HTTP_MAX_BUFFER]; | |
280 | /* Buffer for incoming data */ | |
5ec1fd3d | 281 | int _auth_type; /* Authentication in use (deprecated) */ |
f7deaa1a | 282 | _cups_md5_state_t md5_state; /* MD5 state */ |
283 | char nonce[HTTP_MAX_VALUE]; | |
284 | /* Nonce value */ | |
285 | int nonce_count; /* Nonce count */ | |
7cf5915e | 286 | http_tls_t tls; /* TLS state information */ |
f7deaa1a | 287 | http_encryption_t encryption; /* Encryption requirements */ |
a469f8a5 | 288 | |
f7deaa1a | 289 | /**** New in CUPS 1.1.19 ****/ |
85dda01c MS |
290 | fd_set *input_set; /* select() set for httpWait() (deprecated) */ |
291 | http_status_t expect; /* Expect: header */ | |
292 | char *cookie; /* Cookie value(s) */ | |
a469f8a5 | 293 | |
f7deaa1a | 294 | /**** New in CUPS 1.1.20 ****/ |
295 | char _authstring[HTTP_MAX_VALUE], | |
c1420c87 | 296 | /* Current Authorization value (deprecated) */ |
f7deaa1a | 297 | userpass[HTTP_MAX_VALUE]; |
85dda01c MS |
298 | /* Username:password string */ |
299 | int digest_tries; /* Number of tries for digest auth */ | |
a469f8a5 | 300 | |
f7deaa1a | 301 | /**** New in CUPS 1.2 ****/ |
85dda01c MS |
302 | off_t data_remaining; /* Number of bytes left */ |
303 | http_addr_t *hostaddr; /* Current host address and port */ | |
304 | http_addrlist_t *addrlist; /* List of valid addresses */ | |
f7deaa1a | 305 | char wbuffer[HTTP_MAX_BUFFER]; |
306 | /* Buffer for outgoing data */ | |
85dda01c | 307 | int wused; /* Write buffer bytes used */ |
a469f8a5 | 308 | |
f7deaa1a | 309 | /**** New in CUPS 1.3 ****/ |
310 | char *field_authorization; | |
85dda01c | 311 | /* Authorization field */ |
c1420c87 | 312 | char *authstring; /* Current Authorization field */ |
f7deaa1a | 313 | # ifdef HAVE_GSSAPI |
85dda01c MS |
314 | gss_OID gssmech; /* Authentication mechanism */ |
315 | gss_ctx_id_t gssctx; /* Authentication context */ | |
316 | gss_name_t gssname; /* Authentication server name */ | |
f7deaa1a | 317 | # endif /* HAVE_GSSAPI */ |
b94498cf | 318 | # ifdef HAVE_AUTHORIZATION_H |
85dda01c | 319 | AuthorizationRef auth_ref; /* Authorization ref */ |
b94498cf | 320 | # endif /* HAVE_AUTHORIZATION_H */ |
a469f8a5 | 321 | |
7cf5915e MS |
322 | /**** New in CUPS 1.5 ****/ |
323 | http_tls_credentials_t tls_credentials; | |
85dda01c MS |
324 | /* TLS credentials */ |
325 | http_timeout_cb_t timeout_cb; /* Timeout callback */ | |
326 | void *timeout_data; /* User data pointer */ | |
327 | double timeout_value; /* Timeout in seconds */ | |
328 | int wait_value; /* httpWait value for timeout */ | |
eac3a0a0 MS |
329 | # ifdef HAVE_GSSAPI |
330 | char gsshost[256]; /* Hostname for Kerberos */ | |
331 | # endif /* HAVE_GSSAPI */ | |
a469f8a5 MS |
332 | |
333 | /**** New in CUPS 1.7 ****/ | |
cb7f98ee | 334 | int tls_upgrade; /* Non-zero if we are doing an upgrade */ |
a469f8a5 MS |
335 | _http_mode_t mode; /* _HTTP_MODE_CLIENT or _HTTP_MODE_SERVER */ |
336 | char *accept_encoding, | |
337 | /* Accept-Encoding field */ | |
338 | *allow, /* Allow field */ | |
c1420c87 MS |
339 | *server, /* Server field */ |
340 | *default_accept_encoding, | |
341 | *default_server, | |
342 | *default_user_agent; | |
343 | /* Default field values */ | |
a469f8a5 MS |
344 | # ifdef HAVE_LIBZ |
345 | _http_coding_t coding; /* _HTTP_CODING_xxx */ | |
346 | z_stream stream; /* (De)compression stream */ | |
291e4727 | 347 | Bytef *sbuffer; /* (De)compression buffer */ |
a469f8a5 | 348 | # endif /* HAVE_LIBZ */ |
f7deaa1a | 349 | }; |
5ec1fd3d | 350 | # endif /* !_HTTP_NO_PRIVATE */ |
f7deaa1a | 351 | |
352 | ||
ef416fc2 | 353 | /* |
354 | * Some OS's don't have hstrerror(), most notably Solaris... | |
355 | */ | |
356 | ||
357 | # ifndef HAVE_HSTRERROR | |
358 | extern const char *_cups_hstrerror(int error); | |
359 | # define hstrerror _cups_hstrerror | |
ef416fc2 | 360 | # endif /* !HAVE_HSTRERROR */ |
361 | ||
89d46774 | 362 | |
363 | /* | |
364 | * Some OS's don't have getifaddrs() and freeifaddrs()... | |
365 | */ | |
366 | ||
07ed0e9a MS |
367 | # if !defined(WIN32) && !defined(HAVE_GETIFADDRS) |
368 | # ifdef ifa_dstaddr | |
369 | # undef ifa_dstaddr | |
370 | # endif /* ifa_dstaddr */ | |
371 | # ifndef ifr_netmask | |
372 | # define ifr_netmask ifr_addr | |
373 | # endif /* !ifr_netmask */ | |
89d46774 | 374 | |
375 | struct ifaddrs /**** Interface Structure ****/ | |
376 | { | |
377 | struct ifaddrs *ifa_next; /* Next interface in list */ | |
378 | char *ifa_name; /* Name of interface */ | |
379 | unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */ | |
380 | struct sockaddr *ifa_addr, /* Network address */ | |
f301802f | 381 | *ifa_netmask; /* Address mask */ |
382 | union | |
383 | { | |
384 | struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */ | |
385 | struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */ | |
386 | } ifa_ifu; | |
387 | ||
89d46774 | 388 | void *ifa_data; /* Interface statistics */ |
389 | }; | |
390 | ||
07ed0e9a MS |
391 | # ifndef ifa_broadaddr |
392 | # define ifa_broadaddr ifa_ifu.ifu_broadaddr | |
393 | # endif /* !ifa_broadaddr */ | |
394 | # ifndef ifa_dstaddr | |
395 | # define ifa_dstaddr ifa_ifu.ifu_dstaddr | |
396 | # endif /* !ifa_dstaddr */ | |
f301802f | 397 | |
a74454a7 | 398 | extern int _cups_getifaddrs(struct ifaddrs **addrs); |
07ed0e9a | 399 | # define getifaddrs _cups_getifaddrs |
a74454a7 | 400 | extern void _cups_freeifaddrs(struct ifaddrs *addrs); |
07ed0e9a MS |
401 | # define freeifaddrs _cups_freeifaddrs |
402 | # endif /* !WIN32 && !HAVE_GETIFADDRS */ | |
403 | ||
89d46774 | 404 | |
839a51c8 | 405 | /* |
1ff0402e | 406 | * Prototypes... |
839a51c8 MS |
407 | */ |
408 | ||
22c9029b | 409 | extern void _httpAddrSetPort(http_addr_t *addr, int port); |
85dda01c MS |
410 | extern http_tls_credentials_t |
411 | _httpCreateCredentials(cups_array_t *credentials); | |
1106b00e MS |
412 | extern char *_httpDecodeURI(char *dst, const char *src, |
413 | size_t dstsize); | |
6d2f911b | 414 | extern void _httpDisconnect(http_t *http); |
5eb9da71 MS |
415 | extern char *_httpEncodeURI(char *dst, const char *src, |
416 | size_t dstsize); | |
7cf5915e | 417 | extern void _httpFreeCredentials(http_tls_credentials_t credentials); |
5eb9da71 | 418 | extern const char *_httpResolveURI(const char *uri, char *resolved_uri, |
eac3a0a0 | 419 | size_t resolved_size, int options, |
07ed0e9a MS |
420 | int (*cb)(void *context), |
421 | void *context); | |
41e6c1f1 | 422 | extern const char *_httpStatus(cups_lang_t *lang, http_status_t status); |
25731360 MS |
423 | extern void _httpTLSInitialize(void); |
424 | extern size_t _httpTLSPending(http_t *http); | |
425 | extern int _httpTLSRead(http_t *http, char *buf, int len); | |
426 | extern int _httpTLSSetCredentials(http_t *http); | |
63aefcd5 | 427 | extern void _httpTLSSetOptions(int options); |
25731360 MS |
428 | extern int _httpTLSStart(http_t *http); |
429 | extern void _httpTLSStop(http_t *http); | |
430 | extern int _httpTLSWrite(http_t *http, const char *buf, int len); | |
e60ec91f | 431 | extern int _httpUpdate(http_t *http, http_status_t *status); |
38e73f87 | 432 | extern int _httpWait(http_t *http, int msec, int usessl); |
6d2f911b MS |
433 | |
434 | ||
07ed0e9a MS |
435 | /* |
436 | * C++ magic... | |
437 | */ | |
438 | ||
439 | # ifdef __cplusplus | |
440 | } | |
441 | # endif /* __cplusplus */ | |
442 | ||
ef416fc2 | 443 | #endif /* !_CUPS_HTTP_PRIVATE_H_ */ |
444 | ||
445 | /* | |
f2d18633 | 446 | * End of "$Id$". |
ef416fc2 | 447 | */ |