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

[or-cvs] [tor/master 12/40] Create circuituse.h



Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Thu, 22 Jul 2010 10:03:40 +0200
Subject: Create circuituse.h
Commit: 01c7b60a8063580fff7ad48adac3d1905df01013

---
 src/or/circuitbuild.c    |    1 +
 src/or/circuitlist.c     |    1 +
 src/or/circuituse.c      |    1 +
 src/or/circuituse.h      |   53 ++++++++++++++++++++++++++++++++++++++++++++++
 src/or/connection.c      |    1 +
 src/or/connection_edge.c |    1 +
 src/or/control.c         |    1 +
 src/or/dns.c             |    1 +
 src/or/main.c            |    1 +
 src/or/or.h              |   39 ---------------------------------
 src/or/rendclient.c      |    1 +
 src/or/rendservice.c     |    1 +
 src/or/rephist.c         |    1 +
 src/or/router.c          |    1 +
 14 files changed, 65 insertions(+), 39 deletions(-)
 create mode 100644 src/or/circuituse.h

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index ee18dc3..9d54dbe 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -14,6 +14,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "router.h"
 #include "routerlist.h"
 #include "crypto.h"
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 4e58dde..dbbe7bf 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -12,6 +12,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "routerlist.h"
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 9e1c186..6ae929e 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -12,6 +12,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
diff --git a/src/or/circuituse.h b/src/or/circuituse.h
new file mode 100644
index 0000000..269b6c5
--- /dev/null
+++ b/src/or/circuituse.h
@@ -0,0 +1,53 @@
+/* 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 circuituse.h
+ * \brief Header file for circuituse.c.
+ **/
+
+#ifndef _TOR_CIRCUITUSE_H
+#define _TOR_CIRCUITUSE_H
+
+void circuit_expire_building(time_t now);
+void circuit_remove_handled_ports(smartlist_t *needed_ports);
+int circuit_stream_is_being_handled(edge_connection_t *conn, uint16_t port,
+                                    int min);
+int circuit_conforms_to_options(const origin_circuit_t *circ,
+                                const or_options_t *options);
+void circuit_build_needed_circs(time_t now);
+void circuit_detach_stream(circuit_t *circ, edge_connection_t *conn);
+
+void circuit_expire_old_circuits_serverside(time_t now);
+
+void reset_bandwidth_test(void);
+int circuit_enough_testing_circs(void);
+
+void circuit_has_opened(origin_circuit_t *circ);
+void circuit_build_failed(origin_circuit_t *circ);
+
+/** Flag to set when a circuit should have only a single hop. */
+#define CIRCLAUNCH_ONEHOP_TUNNEL  (1<<0)
+/** Flag to set when a circuit needs to be built of high-uptime nodes */
+#define CIRCLAUNCH_NEED_UPTIME    (1<<1)
+/** Flag to set when a circuit needs to be built of high-capacity nodes */
+#define CIRCLAUNCH_NEED_CAPACITY  (1<<2)
+/** Flag to set when the last hop of a circuit doesn't need to be an
+ * exit node. */
+#define CIRCLAUNCH_IS_INTERNAL    (1<<3)
+origin_circuit_t *circuit_launch_by_extend_info(uint8_t purpose,
+                                                extend_info_t *info,
+                                                int flags);
+origin_circuit_t *circuit_launch_by_router(uint8_t purpose,
+                                           routerinfo_t *exit, int flags);
+void circuit_reset_failure_count(int timeout);
+int connection_ap_handshake_attach_chosen_circuit(edge_connection_t *conn,
+                                                  origin_circuit_t *circ,
+                                                  crypt_path_t *cpath);
+int connection_ap_handshake_attach_circuit(edge_connection_t *conn);
+
+#endif
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 1ed3e3d..255dccc 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -14,6 +14,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.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 15cd8bf..311c481 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -12,6 +12,7 @@
 #include "or.h"
 #include "buffers.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "dnsserv.h"
 #include "rendclient.h"
 #include "rendcommon.h"
diff --git a/src/or/control.c b/src/or/control.c
index 5e9e9a2..9c2f4f5 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -14,6 +14,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "router.h"
diff --git a/src/or/dns.c b/src/or/dns.c
index a40617c..1313047 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -13,6 +13,7 @@
 
 #include "or.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "router.h"
 #include "ht.h"
 #ifdef HAVE_EVENT2_DNS_H
diff --git a/src/or/main.c b/src/or/main.c
index 97af4f5..d188a50 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -15,6 +15,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "rendclient.h"
diff --git a/src/or/or.h b/src/or/or.h
index 0b09036..2acc918 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3055,45 +3055,6 @@ typedef struct {
   double close_ms;
 } circuit_build_times_t;
 
-/********************************* circuituse.c ************************/
-
-void circuit_expire_building(time_t now);
-void circuit_remove_handled_ports(smartlist_t *needed_ports);
-int circuit_stream_is_being_handled(edge_connection_t *conn, uint16_t port,
-                                    int min);
-int circuit_conforms_to_options(const origin_circuit_t *circ,
-                                const or_options_t *options);
-void circuit_build_needed_circs(time_t now);
-void circuit_detach_stream(circuit_t *circ, edge_connection_t *conn);
-
-void circuit_expire_old_circuits_serverside(time_t now);
-
-void reset_bandwidth_test(void);
-int circuit_enough_testing_circs(void);
-
-void circuit_has_opened(origin_circuit_t *circ);
-void circuit_build_failed(origin_circuit_t *circ);
-
-/** Flag to set when a circuit should have only a single hop. */
-#define CIRCLAUNCH_ONEHOP_TUNNEL  (1<<0)
-/** Flag to set when a circuit needs to be built of high-uptime nodes */
-#define CIRCLAUNCH_NEED_UPTIME    (1<<1)
-/** Flag to set when a circuit needs to be built of high-capacity nodes */
-#define CIRCLAUNCH_NEED_CAPACITY  (1<<2)
-/** Flag to set when the last hop of a circuit doesn't need to be an
- * exit node. */
-#define CIRCLAUNCH_IS_INTERNAL    (1<<3)
-origin_circuit_t *circuit_launch_by_extend_info(uint8_t purpose,
-                                                extend_info_t *info,
-                                                int flags);
-origin_circuit_t *circuit_launch_by_router(uint8_t purpose,
-                                           routerinfo_t *exit, int flags);
-void circuit_reset_failure_count(int timeout);
-int connection_ap_handshake_attach_chosen_circuit(edge_connection_t *conn,
-                                                  origin_circuit_t *circ,
-                                                  crypt_path_t *cpath);
-int connection_ap_handshake_attach_circuit(edge_connection_t *conn);
-
 /********************************* command.c ***************************/
 
 void command_process_cell(cell_t *cell, or_connection_t *conn);
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 472662e..c8e6c0a 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -10,6 +10,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "routerlist.h"
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index a1aa634..fea0b06 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -10,6 +10,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 4ece95e..4fa421e 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -11,6 +11,7 @@
 
 #include "or.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "router.h"
 #include "routerlist.h"
 #include "ht.h"
diff --git a/src/or/router.c b/src/or/router.c
index 12cfc2d..a1af88f 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -8,6 +8,7 @@
 
 #include "or.h"
 #include "circuitlist.h"
+#include "circuituse.h"
 #include "geoip.h"
 #include "router.h"
 #include "routerlist.h"
-- 
1.7.1