From 2e1222695cd6c9b6d9a797bd5383e7618c3eea85 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Mon, 27 Sep 2004 20:00:52 +0000 Subject: rename structures. properly prefix all non-static functions with mod_gnutls_ fix build for GnuTLS 1.0.X. (redefine the changed structure names) --- include/mod_gnutls.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/mod_gnutls.h b/include/mod_gnutls.h index 70e641f..b1abd52 100644 --- a/include/mod_gnutls.h +++ b/include/mod_gnutls.h @@ -40,6 +40,21 @@ module AP_MODULE_DECLARE_DATA gnutls_module; #define GNUTLS_ENABLED_TRUE 1 +/** + * GnuTLS changed the names of several structures between 1.0.X and 1.1.X + * This is just a simple hack so we can compile with both versions. + * There is a full list in , But I am just + * doing this for a few types we use. + */ +#ifndef gnutls_certificate_credentials_t +#define gnutls_certificate_credentials_t gnutls_certificate_credentials +#define gnutls_anon_server_credentials_t gnutls_anon_server_credentials +#define gnutls_session_t gnutls_session +#define gnutls_transport_ptr_t gnutls_transport_ptr +#define gnutls_dh_params_t gnutls_dh_params +#define gnutls_rsa_params_t gnutls_rsa_params +#endif + typedef struct { gnutls_certificate_credentials_t certs; @@ -52,19 +67,18 @@ typedef struct int macs[16]; int protocol[16]; int compression[16]; -} gnutls_srvconf_rec; +} mod_gnutls_srvconf_rec; -typedef struct gnutls_handle_t gnutls_handle_t; -struct gnutls_handle_t +typedef struct { - gnutls_srvconf_rec *sc; + mod_gnutls_srvconf_rec *sc; gnutls_session_t session; ap_filter_t *input_filter; apr_bucket_brigade *input_bb; apr_read_type_e input_block; int status; int non_https; -}; +} mod_gnutls_handle_t; /** Functions in gnutls_io.c **/ @@ -79,9 +93,10 @@ struct gnutls_handle_t * @return result status */ apr_status_t mod_gnutls_filter_input(ap_filter_t * f, - apr_bucket_brigade * bb, - ap_input_mode_t mode, - apr_read_type_e block, apr_off_t readbytes); + apr_bucket_brigade * bb, + ap_input_mode_t mode, + apr_read_type_e block, + apr_off_t readbytes); /** * mod_gnutls_filter_output will filter the encrypt @@ -91,7 +106,8 @@ apr_status_t mod_gnutls_filter_input(ap_filter_t * f, * @param bb the bucket brigade, where to store the result to * @return result status */ -apr_status_t mod_gnutls_filter_output(ap_filter_t * f, apr_bucket_brigade * bb); +apr_status_t mod_gnutls_filter_output(ap_filter_t * f, + apr_bucket_brigade * bb); /** @@ -104,7 +120,7 @@ apr_status_t mod_gnutls_filter_output(ap_filter_t * f, apr_bucket_brigade * bb); * @return size length of the data stored in buffer */ ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, - void *buffer, size_t len); + void *buffer, size_t len); /** * mod_gnutls_transport_write is called from GnuTLS to @@ -116,7 +132,7 @@ ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, * @return size length of the data written */ ssize_t mod_gnutls_transport_write(gnutls_transport_ptr_t ptr, - const void *buffer, size_t len); + const void *buffer, size_t len); #endif /* __mod_gnutls_h_inc */ -- cgit