2 * "$Id: http-private.h 5504 2006-05-10 18:57:46Z mike $"
4 * Private HTTP definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
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
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
27 #ifndef _CUPS_HTTP_PRIVATE_H_
28 # define _CUPS_HTTP_PRIVATE_H_
31 * Include necessary headers...
39 * Define FD_SETSIZE to CUPS_MAX_FDS on Solaris to get the correct version of
40 * select() for large numbers of file descriptors.
43 # define FD_SETSIZE CUPS_MAX_FDS
44 # include <sys/select.h>
50 # include <winsock2.h>
54 # include <sys/socket.h>
55 # define closesocket(f) close(f)
58 # if defined(__sgi) || (defined(__APPLE__) && !defined(_SOCKLEN_T))
60 * IRIX and MacOS X 10.2.x do not define socklen_t, and in fact use an int instead of
61 * unsigned type for length values...
64 typedef int socklen_t
;
65 # endif /* __sgi || (__APPLE__ && !_SOCKLEN_T) */
68 # include "ipp-private.h"
70 # if defined HAVE_LIBSSL
72 * The OpenSSL library provides its own SSL/TLS context structure for its
73 * IO and protocol management...
76 # include <openssl/err.h>
77 # include <openssl/rand.h>
78 # include <openssl/ssl.h>
80 typedef SSL http_tls_t
;
82 # elif defined HAVE_GNUTLS
84 * The GNU TLS library is more of a "bare metal" SSL/TLS library...
86 # include <gnutls/gnutls.h>
90 gnutls_session session
; /* GNU TLS session object */
91 void *credentials
; /* GNU TLS credentials object */
94 # elif defined(HAVE_CDSASSL)
96 * Darwin's Security framework provides its own SSL/TLS context structure
97 * for its IO and protocol management...
100 # include <Security/SecureTransport.h>
102 typedef struct /**** CDSA connection information ****/
104 SSLContextRef session
; /* CDSA session object */
105 CFArrayRef certsArray
; /* Certificates array */
108 typedef union _cdsa_conn_ref_u
/**** CDSA Connection reference union
109 **** used to resolve 64-bit casting
113 SSLConnectionRef connection
; /* SSL connection pointer */
114 int sock
; /* Socket */
117 extern OSStatus
_httpReadCDSA(SSLConnectionRef connection
, void *data
,
119 extern OSStatus
_httpWriteCDSA(SSLConnectionRef connection
, const void *data
,
121 # endif /* HAVE_LIBSSL */
124 * Some OS's don't have hstrerror(), most notably Solaris...
127 # ifndef HAVE_HSTRERROR
128 extern const char *_cups_hstrerror(int error
);
129 # define hstrerror _cups_hstrerror
130 # elif defined(_AIX) || defined(__osf__)
132 * AIX and Tru64 UNIX don't provide a prototype but do provide the function...
134 extern const char *hstrerror(int error
);
135 # endif /* !HAVE_HSTRERROR */
139 * Some OS's don't have getifaddrs() and freeifaddrs()...
143 # ifdef HAVE_GETIFADDRS
144 # include <ifaddrs.h>
146 # include <sys/ioctl.h>
147 # ifdef HAVE_SYS_SOCKIO_H
148 # include <sys/sockio.h>
149 # endif /* HAVE_SYS_SOCKIO_H */
153 # endif /* ifa_dstaddr */
155 # define ifr_netmask ifr_addr
156 # endif /* !ifr_netmask */
158 struct ifaddrs
/**** Interface Structure ****/
160 struct ifaddrs
*ifa_next
; /* Next interface in list */
161 char *ifa_name
; /* Name of interface */
162 unsigned int ifa_flags
; /* Flags (up, point-to-point, etc.) */
163 struct sockaddr
*ifa_addr
, /* Network address */
164 *ifa_netmask
; /* Address mask */
167 struct sockaddr
*ifu_broadaddr
; /* Broadcast address of this interface. */
168 struct sockaddr
*ifu_dstaddr
; /* Point-to-point destination address. */
171 void *ifa_data
; /* Interface statistics */
174 # ifndef ifa_broadaddr
175 # define ifa_broadaddr ifa_ifu.ifu_broadaddr
176 # endif /* !ifa_broadaddr */
178 # define ifa_dstaddr ifa_ifu.ifu_dstaddr
179 # endif /* !ifa_dstaddr */
181 extern int _cups_getifaddrs(struct ifaddrs
**addrs
);
182 # define getifaddrs _cups_getifaddrs
183 extern void _cups_freeifaddrs(struct ifaddrs
*addrs
);
184 # define freeifaddrs _cups_freeifaddrs
185 # endif /* HAVE_GETIFADDRS */
187 #endif /* !_CUPS_HTTP_PRIVATE_H_ */
190 * End of "$Id: http-private.h 5504 2006-05-10 18:57:46Z mike $".