summaryrefslogtreecommitdiff
path: root/src/or/channeltls.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/channeltls.h')
-rw-r--r--src/or/channeltls.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/channeltls.h b/src/or/channeltls.h
index b38e12adcc..ca2fc88940 100644
--- a/src/or/channeltls.h
+++ b/src/or/channeltls.h
@@ -12,8 +12,10 @@
#include "or.h"
#include "channel.h"
-#define BASE_CHAN_TO_TLS(c) ((channel_tls_t *)(c))
-#define TLS_CHAN_TO_BASE(c) ((channel_t *)(c))
+#define BASE_CHAN_TO_TLS(c) (channel_tls_from_base((c)))
+#define TLS_CHAN_TO_BASE(c) (channel_tls_to_base((c)))
+
+#define TLS_CHAN_MAGIC 0x8a192427U
#ifdef _TOR_CHANNEL_INTERNAL
@@ -32,6 +34,11 @@ channel_listener_t * channel_tls_get_listener(void);
channel_listener_t * channel_tls_start_listener(void);
channel_t * channel_tls_handle_incoming(or_connection_t *orconn);
+/* Casts */
+
+channel_t * channel_tls_to_base(channel_tls_t *tlschan);
+channel_tls_t * channel_tls_from_base(channel_t *chan);
+
/* Things for connection_or.c to call back into */
ssize_t channel_tls_flush_some_cells(channel_tls_t *chan, ssize_t num_cells);
int channel_tls_more_to_flush(channel_tls_t *chan);