]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blobdiff - src/tlsproxy.h
Intercept TLS connections between client and server.
[tlsproxy/tlsproxy.git] / src / tlsproxy.h
index a0db68fd0726f9674014c1d3f2fd5106e553c445..b2d690e92c5a8206bdb9e82fd666833584802761 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Global variables.
+ * Global variables/defines.
  *
  * Copyright (C) 2011  Simon Ruderich
  *
 #include <stdio.h>
 #include <string.h>
 
+/* GnuTLS */
+#include <gnutls/gnutls.h>
+
+
+/* Log level constants. */
+#define LOG_ERROR   0
+#define LOG_WARNING 1
+#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 *use_proxy_host;
-char *use_proxy_port;
+char *global_proxy_host;
+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