summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-07-22 10:50:34 +0200
committerSebastian Hahn <sebastian@torproject.org>2010-07-27 07:58:15 +0200
commit0d33120c26cc4e9c7705d003e215a53143b41df7 (patch)
treead3273dc44edee17663fe0c65a8e0ba286944026
parent78b6a4650b8ea90d99e49aff2a2c20df461bb127 (diff)
downloadtor-0d33120c26cc4e9c7705d003e215a53143b41df7.tar.gz
tor-0d33120c26cc4e9c7705d003e215a53143b41df7.zip
Create connection_or.h
-rw-r--r--src/or/buffers.c1
-rw-r--r--src/or/circuitbuild.c1
-rw-r--r--src/or/circuitlist.c1
-rw-r--r--src/or/command.c1
-rw-r--r--src/or/connection.c1
-rw-r--r--src/or/connection_edge.c1
-rw-r--r--src/or/connection_or.c1
-rw-r--r--src/or/connection_or.h59
-rw-r--r--src/or/dirserv.c1
-rw-r--r--src/or/main.c1
-rw-r--r--src/or/or.h45
-rw-r--r--src/or/relay.c1
12 files changed, 69 insertions, 45 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index c9abddcd6c..e0e0901b69 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -15,6 +15,7 @@
#include "buffers.h"
#include "config.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "../common/util.h"
#include "../common/torlog.h"
#ifdef HAVE_UNISTD_H
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index a7b5ee1293..d94aa31a0b 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "router.h"
#include "routerlist.h"
#include "crypto.h"
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index edcd194e62..80c3371ed4 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -16,6 +16,7 @@
#include "connection.h"
#include "config.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "routerlist.h"
diff --git a/src/or/command.c b/src/or/command.c
index 22f36fff59..76b0d8771f 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -20,6 +20,7 @@
#include "circuitlist.h"
#include "command.h"
#include "connection.h"
+#include "connection_or.h"
#include "config.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/connection.c b/src/or/connection.c
index dc68bcf1a2..90f4c55c25 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index d4f22fac09..7fe73e1a79 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -16,6 +16,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "dnsserv.h"
#include "rendclient.h"
#include "rendcommon.h"
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index e8633c10c1..1d3dc68781 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -16,6 +16,7 @@
#include "command.h"
#include "config.h"
#include "connection.h"
+#include "connection_or.h"
#include "geoip.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/connection_or.h b/src/or/connection_or.h
new file mode 100644
index 0000000000..8e3723c154
--- /dev/null
+++ b/src/or/connection_or.h
@@ -0,0 +1,59 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2010, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file connection_or.h
+ * \brief Header file for connection_or.c.
+ **/
+
+#ifndef _TOR_CONNECTION_OR_H
+#define _TOR_CONNECTION_OR_H
+
+void connection_or_remove_from_identity_map(or_connection_t *conn);
+void connection_or_clear_identity_map(void);
+or_connection_t *connection_or_get_for_extend(const char *digest,
+ const tor_addr_t *target_addr,
+ const char **msg_out,
+ int *launch_out);
+void connection_or_set_bad_connections(void);
+
+int connection_or_reached_eof(or_connection_t *conn);
+int connection_or_process_inbuf(or_connection_t *conn);
+int connection_or_flushed_some(or_connection_t *conn);
+int connection_or_finished_flushing(or_connection_t *conn);
+int connection_or_finished_connecting(or_connection_t *conn);
+int connection_or_digest_is_known_relay(const char *id_digest);
+
+void connection_or_connect_failed(or_connection_t *conn,
+ int reason, const char *msg);
+or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
+ const char *id_digest);
+
+int connection_tls_start_handshake(or_connection_t *conn, int receiving);
+int connection_tls_continue_handshake(or_connection_t *conn);
+
+void or_handshake_state_free(or_handshake_state_t *state);
+int connection_or_set_state_open(or_connection_t *conn);
+void connection_or_write_cell_to_buf(const cell_t *cell,
+ or_connection_t *conn);
+void connection_or_write_var_cell_to_buf(const var_cell_t *cell,
+ or_connection_t *conn);
+int connection_or_send_destroy(circid_t circ_id, or_connection_t *conn,
+ int reason);
+int connection_or_send_netinfo(or_connection_t *conn);
+int connection_or_send_cert(or_connection_t *conn);
+int connection_or_send_link_auth(or_connection_t *conn);
+int connection_or_compute_link_auth_hmac(or_connection_t *conn,
+ char *hmac_out);
+int is_or_protocol_version_known(uint16_t version);
+
+void cell_pack(packed_cell_t *dest, const cell_t *src);
+void var_cell_pack_header(const var_cell_t *cell, char *hdr_out);
+var_cell_t *var_cell_new(uint16_t payload_len);
+void var_cell_free(var_cell_t *cell);
+
+#endif
+
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index dc07e802f4..4a753af215 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -8,6 +8,7 @@
#include "buffers.h"
#include "config.h"
#include "connection.h"
+#include "connection_or.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/main.c b/src/or/main.c
index 7811397496..3b4c73448f 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -20,6 +20,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"
diff --git a/src/or/or.h b/src/or/or.h
index 31c57000bc..236c24bcb9 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3083,51 +3083,6 @@ typedef enum {
ADDRMAPSRC_DNS,
} addressmap_entry_source_t;
-/********************************* connection_or.c ***************************/
-
-void connection_or_remove_from_identity_map(or_connection_t *conn);
-void connection_or_clear_identity_map(void);
-or_connection_t *connection_or_get_for_extend(const char *digest,
- const tor_addr_t *target_addr,
- const char **msg_out,
- int *launch_out);
-void connection_or_set_bad_connections(void);
-
-int connection_or_reached_eof(or_connection_t *conn);
-int connection_or_process_inbuf(or_connection_t *conn);
-int connection_or_flushed_some(or_connection_t *conn);
-int connection_or_finished_flushing(or_connection_t *conn);
-int connection_or_finished_connecting(or_connection_t *conn);
-int connection_or_digest_is_known_relay(const char *id_digest);
-
-void connection_or_connect_failed(or_connection_t *conn,
- int reason, const char *msg);
-or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
- const char *id_digest);
-
-int connection_tls_start_handshake(or_connection_t *conn, int receiving);
-int connection_tls_continue_handshake(or_connection_t *conn);
-
-void or_handshake_state_free(or_handshake_state_t *state);
-int connection_or_set_state_open(or_connection_t *conn);
-void connection_or_write_cell_to_buf(const cell_t *cell,
- or_connection_t *conn);
-void connection_or_write_var_cell_to_buf(const var_cell_t *cell,
- or_connection_t *conn);
-int connection_or_send_destroy(circid_t circ_id, or_connection_t *conn,
- int reason);
-int connection_or_send_netinfo(or_connection_t *conn);
-int connection_or_send_cert(or_connection_t *conn);
-int connection_or_send_link_auth(or_connection_t *conn);
-int connection_or_compute_link_auth_hmac(or_connection_t *conn,
- char *hmac_out);
-int is_or_protocol_version_known(uint16_t version);
-
-void cell_pack(packed_cell_t *dest, const cell_t *src);
-void var_cell_pack_header(const var_cell_t *cell, char *hdr_out);
-var_cell_t *var_cell_new(uint16_t payload_len);
-void var_cell_free(var_cell_t *cell);
-
/********************************* control.c ***************************/
/** Used to indicate the type of a circuit event passed to the controller.
diff --git a/src/or/relay.c b/src/or/relay.c
index 21de9e9e08..b9ba31775e 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -18,6 +18,7 @@
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "connection_or.h"
#include "geoip.h"
#include "mempool.h"
#include "rendcommon.h"