summaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-15 11:34:33 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-15 11:34:33 -0400
commita0bc164af57a3e5828cfc4fdefb9b2191af79ce9 (patch)
tree3845bbf84170303102ff6c69d42105320d9039d4 /src/or/circuitlist.c
parentbba998af65c9a414c56824f5779d2c47cf5a6b44 (diff)
downloadtor-a0bc164af57a3e5828cfc4fdefb9b2191af79ce9.tar.gz
tor-a0bc164af57a3e5828cfc4fdefb9b2191af79ce9.zip
Extract {or,origin}_circuit_t into their own headers
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 1a3f3a2290..7601bc6135 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -94,6 +94,8 @@
#include "dir_connection_st.h"
#include "edge_connection_st.h"
+#include "or_circuit_st.h"
+#include "origin_circuit_st.h"
/********* START VARIABLES **********/
@@ -130,6 +132,31 @@ static int any_opened_circs_cached_val = 0;
/********* END VARIABLES ************/
+or_circuit_t *
+TO_OR_CIRCUIT(circuit_t *x)
+{
+ tor_assert(x->magic == OR_CIRCUIT_MAGIC);
+ return DOWNCAST(or_circuit_t, x);
+}
+const or_circuit_t *
+CONST_TO_OR_CIRCUIT(const circuit_t *x)
+{
+ tor_assert(x->magic == OR_CIRCUIT_MAGIC);
+ return DOWNCAST(or_circuit_t, x);
+}
+origin_circuit_t *
+TO_ORIGIN_CIRCUIT(circuit_t *x)
+{
+ tor_assert(x->magic == ORIGIN_CIRCUIT_MAGIC);
+ return DOWNCAST(origin_circuit_t, x);
+}
+const origin_circuit_t *
+CONST_TO_ORIGIN_CIRCUIT(const circuit_t *x)
+{
+ tor_assert(x->magic == ORIGIN_CIRCUIT_MAGIC);
+ return DOWNCAST(origin_circuit_t, x);
+}
+
/** A map from channel and circuit ID to circuit. (Lookup performance is
* very important here, since we need to do it every time a cell arrives.) */
typedef struct chan_circid_circuit_map_t {