aboutsummaryrefslogtreecommitdiff
path: root/src/IO/tls.h
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2015-05-28 18:38:06 +0000
committercorvid <devnull@localhost>2015-05-28 18:38:06 +0000
commitba68c40f16755a32bf70f49bdf1d39d86adc741e (patch)
tree1eb532cbc7425f6d897e513a64b8d03a089b8665 /src/IO/tls.h
parentea14c266b84296761354f63d746a289db0bb4918 (diff)
'ssl' -> 'tls' where reasonable, given that ssl3 is dead and all
I used 'hg rename' and expected (at least hoped) that 'hg diff' would do what I would naturally want, but no.
Diffstat (limited to 'src/IO/tls.h')
-rw-r--r--src/IO/tls.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/IO/tls.h b/src/IO/tls.h
new file mode 100644
index 00000000..e3892cb2
--- /dev/null
+++ b/src/IO/tls.h
@@ -0,0 +1,47 @@
+#ifndef __TLS_H__
+#define __TLS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "../url.h"
+
+#define TLS_CONNECT_NEVER -1
+#define TLS_CONNECT_NOT_YET 0
+#define TLS_CONNECT_READY 1
+
+void a_Tls_init();
+
+
+#ifdef ENABLE_SSL
+int a_Tls_connect_ready(const DilloUrl *url);
+void a_Tls_reset_server_state(const DilloUrl *url);
+
+/* Use to initiate a TLS connection. */
+void a_Tls_handshake(int fd, const DilloUrl *url);
+
+void *a_Tls_connection(int fd);
+
+void a_Tls_freeall();
+
+void a_Tls_close_by_fd(int fd);
+int a_Tls_read(void *conn, void *buf, size_t len);
+int a_Tls_write(void *conn, void *buf, size_t len);
+#else
+
+#define a_Tls_connect_ready(url) TLS_CONNECT_NEVER
+#define a_Tls_reset_server_state(url) ;
+#define a_Tls_handshake(fd, url) ;
+#define a_Tls_connection(fd) NULL
+#define a_Tls_freeall() ;
+#define a_Tls_close_by_fd(fd) ;
+#define a_Tls_read(conn, buf, len) 0
+#define a_Tls_write(conn, buf, len) 0
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TLS_H__ */
+