summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-15 10:17:27 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-15 10:17:27 -0400
commit3b917b2408748efb2ce84c2725e2e81ee0217e03 (patch)
treed16bcb1c6393d70e05300d5fd8f95601cffc00ae /src/or/control.c
parent5d5c442e6ad726382c7b8efc0e999825a783bd9e (diff)
downloadtor-3b917b2408748efb2ce84c2725e2e81ee0217e03.tar.gz
tor-3b917b2408748efb2ce84c2725e2e81ee0217e03.zip
Split control_connection_t into its own header.
This one was actually fairly simple.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 7efa6d73bd..ba9f26c6bb 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -81,6 +81,7 @@
#include "routerparse.h"
#include "shared_random_client.h"
+#include "control_connection_st.h"
#include "entry_connection_st.h"
#ifndef _WIN32
@@ -228,6 +229,15 @@ static void flush_queued_events_cb(mainloop_event_t *event, void *arg);
static char * download_status_to_string(const download_status_t *dl);
static void control_get_bytes_rw_last_sec(uint64_t *r, uint64_t *w);
+/** Convert a connection_t* to an control_connection_t*; assert if the cast is
+ * invalid. */
+control_connection_t *
+TO_CONTROL_CONN(connection_t *c)
+{
+ tor_assert(c->magic == CONTROL_CONNECTION_MAGIC);
+ return DOWNCAST(control_connection_t, c);
+}
+
/** Given a control event code for a message event, return the corresponding
* log severity. */
static inline int