1 /*
2  * "$Id: http-private.h 148 2006-04-25 16:54:17Z njacobs $"
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 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 #  include "config.h"
39 
40 
41 #  ifdef __sun
42 /*
43  * Define FD_SETSIZE to CUPS_MAX_FDS on Solaris to get the correct version of
44  * select() for large numbers of file descriptors.
45  */
46 
47 #define CUPS_MAX_FDS 1024
48 
49 #    define FD_SETSIZE	CUPS_MAX_FDS
50 #    include <sys/select.h>
51 #  endif /* __sun */
52 
53 #  include "http.h"
54 
55 #  if defined HAVE_LIBSSL
56 /*
57  * The OpenSSL library provides its own SSL/TLS context structure for its
58  * IO and protocol management...
59  */
60 
61 #    include <openssl/err.h>
62 #    include <openssl/rand.h>
63 #    include <openssl/ssl.h>
64 
65 typedef SSL http_tls_t;
66 
67 #  elif defined HAVE_GNUTLS
68 /*
69  * The GNU TLS library is more of a "bare metal" SSL/TLS library...
70  */
71 #    include <gnutls/gnutls.h>
72 
73 typedef struct
74 {
75   gnutls_session	session;	/* GNU TLS session object */
76   void			*credentials;	/* GNU TLS credentials object */
77 } http_tls_t;
78 
79 #  elif defined(HAVE_CDSASSL)
80 /*
81  * Darwin's Security framework provides its own SSL/TLS context structure
82  * for its IO and protocol management...
83  */
84 
85 #    include <Security/SecureTransport.h>
86 
87 typedef SSLConnectionRef http_tls_t;
88 
89 #  endif /* HAVE_LIBSSL */
90 
91 /*
92  * Some OS's don't have hstrerror(), most notably Solaris...
93  */
94 
95 #  ifndef HAVE_HSTRERROR
96 extern const char *cups_hstrerror(int error);
97 #    define hstrerror cups_hstrerror
98 #  elif defined(_AIX) || defined(__osf__)
99 /*
100  * AIX and Tru64 UNIX don't provide a prototype but do provide the function...
101  */
102 extern const char *hstrerror(int error);
103 #  endif /* !HAVE_HSTRERROR */
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* !_CUPS_HTTP_PRIVATE_H_ */
110 
111 /*
112  * End of "$Id: http-private.h 148 2006-04-25 16:54:17Z njacobs $"
113  */
114