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