summaryrefslogtreecommitdiff
path: root/src/or/channeltls.h
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@persephoneslair.org>2012-10-10 18:53:38 -0700
committerAndrea Shepard <andrea@persephoneslair.org>2012-10-10 18:53:38 -0700
commit8b36d4cc2ab95acd4c2c7203afb29a051a38c5c9 (patch)
tree92eabec1394092735e8b6e47f664f0094b76e6be /src/or/channeltls.h
parentec97319464aab204740acb013b504abb0e13d989 (diff)
parentbd28322d3815a03ca04beb6d00052d613dbe226f (diff)
downloadtor-8b36d4cc2ab95acd4c2c7203afb29a051a38c5c9.tar.gz
tor-8b36d4cc2ab95acd4c2c7203afb29a051a38c5c9.zip
Merge branch 'bug6816_squashed_nowarn' of git://git.torproject.org/nickm/tor
Diffstat (limited to 'src/or/channeltls.h')
-rw-r--r--src/or/channeltls.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/or/channeltls.h b/src/or/channeltls.h
new file mode 100644
index 0000000000..ca2fc88940
--- /dev/null
+++ b/src/or/channeltls.h
@@ -0,0 +1,57 @@
+/* * Copyright (c) 2012, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file channeltls.h
+ * \brief Header file for channeltls.c
+ **/
+
+#ifndef _TOR_CHANNEL_TLS_H
+#define _TOR_CHANNEL_TLS_H
+
+#include "or.h"
+#include "channel.h"
+
+#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
+
+struct channel_tls_s {
+ /* Base channel_t struct */
+ channel_t _base;
+ /* or_connection_t pointer */
+ or_connection_t *conn;
+};
+
+#endif /* _TOR_CHANNEL_INTERNAL */
+
+channel_t * channel_tls_connect(const tor_addr_t *addr, uint16_t port,
+ const char *id_digest);
+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);
+void channel_tls_handle_cell(cell_t *cell, or_connection_t *conn);
+void channel_tls_handle_state_change_on_orconn(channel_tls_t *chan,
+ or_connection_t *conn,
+ uint8_t old_state,
+ uint8_t state);
+void channel_tls_handle_var_cell(var_cell_t *var_cell,
+ or_connection_t *conn);
+
+/* Cleanup at shutdown */
+void channel_tls_free_all(void);
+
+#endif
+