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