X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Ftlsproxy.h;h=b2d690e92c5a8206bdb9e82fd666833584802761;hb=14106ea40a55acbba0d14a6f66350221ade044ab;hp=8b6f4fc5d5e71ac4c1d0967dd8a08bdace086c4f;hpb=396fd6126020e409a21ed0d8bb327d6ee0211e04;p=tlsproxy%2Ftlsproxy.git diff --git a/src/tlsproxy.h b/src/tlsproxy.h index 8b6f4fc..b2d690e 100644 --- a/src/tlsproxy.h +++ b/src/tlsproxy.h @@ -1,5 +1,5 @@ /* - * Global variables. + * Global variables/defines. * * Copyright (C) 2011 Simon Ruderich * @@ -26,6 +26,9 @@ #include #include +/* GnuTLS */ +#include + /* Log level constants. */ #define LOG_ERROR 0 @@ -33,6 +36,14 @@ #define LOG_DEBUG 2 +/* Macros for shorter error handling. */ +#define GNUTLS_ERROR_EXIT(error, message) \ + if (GNUTLS_E_SUCCESS != error) { \ + fprintf(stderr, "%s: %s\n", message, gnutls_strerror(error)); \ + exit(EXIT_FAILURE); \ + } + + /* Proxy hostname and port if specified on the command line. */ char *global_proxy_host; char *global_proxy_port; @@ -40,4 +51,8 @@ char *global_proxy_port; /* Log level, command line option. */ int global_log_level; +/* "Global" GnuTLS data used by all threads, read only. */ +gnutls_priority_t tls_priority_cache; +gnutls_dh_params_t tls_dh_params; + #endif