]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/http-private.h
Final bits of STR #1313 - fixes for CDSA.
[thirdparty/cups.git] / cups / http-private.h
1 /*
2 * "$Id$"
3 *
4 * Private HTTP definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * This file is subject to the Apple OS-Developed Software exception.
25 */
26
27 #ifndef _CUPS_HTTP_PRIVATE_H_
28 # define _CUPS_HTTP_PRIVATE_H_
29
30 /*
31 * Include necessary headers...
32 */
33
34 # include "config.h"
35
36 # ifdef WIN32
37 # include <io.h>
38 # include <winsock2.h>
39 # else
40 # include <unistd.h>
41 # include <fcntl.h>
42 # include <sys/socket.h>
43 # define closesocket(f) close(f)
44 # endif /* WIN32 */
45
46 # ifdef __sun
47 /*
48 * Define FD_SETSIZE to CUPS_MAX_FDS on Solaris to get the correct version of
49 * select() for large numbers of file descriptors.
50 */
51
52 # define FD_SETSIZE CUPS_MAX_FDS
53 # include <sys/select.h>
54 # endif /* __sun */
55
56 # ifdef __sgi
57 /*
58 * IRIX does not define socklen_t, and in fact uses an int instead of
59 * unsigned type for length values...
60 */
61
62 typedef int socklen_t;
63 # endif /* __sgi */
64
65 # include "http.h"
66
67 # if defined HAVE_LIBSSL
68 /*
69 * The OpenSSL library provides its own SSL/TLS context structure for its
70 * IO and protocol management...
71 */
72
73 # include <openssl/err.h>
74 # include <openssl/rand.h>
75 # include <openssl/ssl.h>
76
77 typedef SSL http_tls_t;
78
79 # elif defined HAVE_GNUTLS
80 /*
81 * The GNU TLS library is more of a "bare metal" SSL/TLS library...
82 */
83 # include <gnutls/gnutls.h>
84
85 typedef struct
86 {
87 gnutls_session session; /* GNU TLS session object */
88 void *credentials; /* GNU TLS credentials object */
89 } http_tls_t;
90
91 # elif defined(HAVE_CDSASSL)
92 /*
93 * Darwin's Security framework provides its own SSL/TLS context structure
94 * for its IO and protocol management...
95 */
96
97 # include <Security/SecureTransport.h>
98
99 typedef SSLConnectionRef http_tls_t;
100
101 extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data,
102 size_t *dataLength);
103 extern OSStatus _httpWriteCDSA(SSLConnectionRef connection, const void *data,
104 size_t *dataLength);
105 # endif /* HAVE_LIBSSL */
106
107 /*
108 * Some OS's don't have hstrerror(), most notably Solaris...
109 */
110
111 # ifndef HAVE_HSTRERROR
112 extern const char *_cups_hstrerror(int error);
113 # define hstrerror _cups_hstrerror
114 # elif defined(_AIX) || defined(__osf__)
115 /*
116 * AIX and Tru64 UNIX don't provide a prototype but do provide the function...
117 */
118 extern const char *hstrerror(int error);
119 # endif /* !HAVE_HSTRERROR */
120
121 #endif /* !_CUPS_HTTP_PRIVATE_H_ */
122
123 /*
124 * End of "$Id$".
125 */