diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-15 10:48:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-15 10:48:50 -0400 |
commit | 19c34b46589492be3fe19bed7e5729c1c7d231f1 (patch) | |
tree | 7b3f18847324e572eae5bf087ae3778dd53e45f8 /src/or/connection_or.c | |
parent | 6c0fe9d07c40ce453b5c9c7a60cbfd13bf3ca6d7 (diff) | |
download | tor-19c34b46589492be3fe19bed7e5729c1c7d231f1.tar.gz tor-19c34b46589492be3fe19bed7e5729c1c7d231f1.zip |
Move or_connection_t to its own header.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 7898fbd42e..c2dd36416e 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -61,6 +61,8 @@ #include "torcert.h" #include "channelpadding.h" +#include "or_connection_st.h" + static int connection_tls_finish_handshake(or_connection_t *conn); static int connection_or_launch_v3_or_handshake(or_connection_t *conn); static int connection_or_process_cells_from_inbuf(or_connection_t *conn); @@ -86,6 +88,15 @@ static void connection_or_check_canonicity(or_connection_t *conn, /**************************************************************/ +/** Convert a connection_t* to an or_connection_t*; assert if the cast is + * invalid. */ +or_connection_t * +TO_OR_CONN(connection_t *c) +{ + tor_assert(c->magic == OR_CONNECTION_MAGIC); + return DOWNCAST(or_connection_t, c); +} + /** Global map between Extended ORPort identifiers and OR * connections. */ static digestmap_t *orconn_ext_or_id_map = NULL; |