[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master 17/40] Create connection_or.h



Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Thu, 22 Jul 2010 10:50:34 +0200
Subject: Create connection_or.h
Commit: 0d33120c26cc4e9c7705d003e215a53143b41df7

---
 src/or/buffers.c         |    1 +
 src/or/circuitbuild.c    |    1 +
 src/or/circuitlist.c     |    1 +
 src/or/command.c         |    1 +
 src/or/connection.c      |    1 +
 src/or/connection_edge.c |    1 +
 src/or/connection_or.c   |    1 +
 src/or/connection_or.h   |   59 ++++++++++++++++++++++++++++++++++++++++++++++
 src/or/dirserv.c         |    1 +
 src/or/main.c            |    1 +
 src/or/or.h              |   45 -----------------------------------
 src/or/relay.c           |    1 +
 12 files changed, 69 insertions(+), 45 deletions(-)
 create mode 100644 src/or/connection_or.h

diff --git a/src/or/buffers.c b/src/or/buffers.c
index c9abddc..e0e0901 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 a7b5ee1..d94aa31 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 edcd194..80c3371 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 22f36ff..76b0d87 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 dc68bcf..90f4c55 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 d4f22fa..7fe73e1 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 e8633c1..1d3dc68 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 0000000..8e3723c
--- /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 dc07e80..4a753af 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 7811397..3b4c734 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 31c5700..236c24b 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 21de9e9..b9ba317 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"
-- 
1.7.1