summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c1
-rw-r--r--src/or/config.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/control.c1
-rw-r--r--src/or/cpuworker.c1
-rw-r--r--src/or/directory.c1
-rw-r--r--src/or/dns.c1
-rw-r--r--src/or/dnsserv.c1
-rw-r--r--src/or/hibernate.c1
-rw-r--r--src/or/main.c1
-rw-r--r--src/or/main.h67
-rw-r--r--src/or/or.h53
-rw-r--r--src/or/relay.c1
-rw-r--r--src/or/rendclient.c1
-rw-r--r--src/or/router.c1
-rw-r--r--src/or/routerlist.c1
18 files changed, 83 insertions, 53 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 1a189caabd..71eb643791 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -21,6 +21,7 @@
#include "connection_or.h"
#include "control.h"
#include "directory.h"
+#include "main.h"
#include "router.h"
#include "routerlist.h"
#include "crypto.h"
diff --git a/src/or/config.c b/src/or/config.c
index 68710ee8c7..34acc4f8b9 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -24,6 +24,7 @@
#include "dns.h"
#include "geoip.h"
#include "hibernate.h"
+#include "main.h"
#include "rendclient.h"
#include "rendservice.h"
#include "router.h"
diff --git a/src/or/connection.c b/src/or/connection.c
index 51ee9f4724..854a53aafa 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -26,6 +26,7 @@
#include "dns.h"
#include "dnsserv.h"
#include "geoip.h"
+#include "main.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "router.h"
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 28ed9ad629..5dff47958f 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -22,6 +22,7 @@
#include "dnsserv.h"
#include "dirserv.h"
#include "hibernate.h"
+#include "main.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "rendservice.h"
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index b3b3cf013e..0ddd5f14f1 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -20,6 +20,7 @@
#include "control.h"
#include "dirserv.h"
#include "geoip.h"
+#include "main.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/control.c b/src/or/control.c
index f8a3f20ec9..e1073ab431 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -24,6 +24,7 @@
#include "dnsserv.h"
#include "geoip.h"
#include "hibernate.h"
+#include "main.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 58257b7811..4ab6d4164f 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "connection.h"
#include "cpuworker.h"
+#include "main.h"
#include "router.h"
/** The maximum number of cpuworker processes we will keep around. */
diff --git a/src/or/directory.c b/src/or/directory.c
index 69700e8672..8c7bf4fcd8 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -14,6 +14,7 @@
#include "dirserv.h"
#include "dirvote.h"
#include "geoip.h"
+#include "main.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "router.h"
diff --git a/src/or/dns.c b/src/or/dns.c
index d7184f6e96..7bb2d8ea34 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -19,6 +19,7 @@
#include "connection_edge.h"
#include "control.h"
#include "dns.h"
+#include "main.h"
#include "router.h"
#include "ht.h"
#ifdef HAVE_EVENT2_DNS_H
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c
index 317a0afb2c..7f9029424d 100644
--- a/src/or/dnsserv.c
+++ b/src/or/dnsserv.c
@@ -14,6 +14,7 @@
#include "connection.h"
#include "connection_edge.h"
#include "control.h"
+#include "main.h"
#ifdef HAVE_EVENT2_DNS_H
#include <event2/dns.h>
#include <event2/dns_compat.h>
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index a30e25ee9c..d50d05ed5e 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -26,6 +26,7 @@ hibernating, phase 2:
#include "connection.h"
#include "connection_edge.h"
#include "hibernate.h"
+#include "main.h"
#include "router.h"
/** Possible values of hibernate_state */
diff --git a/src/or/main.c b/src/or/main.c
index d33072197c..ccfd1bc6e2 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -30,6 +30,7 @@
#include "dnsserv.h"
#include "geoip.h"
#include "hibernate.h"
+#include "main.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "rendservice.h"
diff --git a/src/or/main.h b/src/or/main.h
new file mode 100644
index 0000000000..6eeb95449a
--- /dev/null
+++ b/src/or/main.h
@@ -0,0 +1,67 @@
+/* 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 main.h
+ * \brief Header file for main.c.
+ **/
+
+#ifndef _TOR_MAIN_H
+#define _TOR_MAIN_H
+
+extern int has_completed_circuit;
+
+int connection_add(connection_t *conn);
+int connection_remove(connection_t *conn);
+void connection_unregister_events(connection_t *conn);
+int connection_in_array(connection_t *conn);
+void add_connection_to_closeable_list(connection_t *conn);
+int connection_is_on_closeable_list(connection_t *conn);
+
+smartlist_t *get_connection_array(void);
+
+typedef enum watchable_events {
+ READ_EVENT=0x02,
+ WRITE_EVENT=0x04
+} watchable_events_t;
+void connection_watch_events(connection_t *conn, watchable_events_t events);
+int connection_is_reading(connection_t *conn);
+void connection_stop_reading(connection_t *conn);
+void connection_start_reading(connection_t *conn);
+
+int connection_is_writing(connection_t *conn);
+void connection_stop_writing(connection_t *conn);
+void connection_start_writing(connection_t *conn);
+
+void connection_stop_reading_from_linked_conn(connection_t *conn);
+
+void directory_all_unreachable(time_t now);
+void directory_info_has_arrived(time_t now, int from_cache);
+
+void ip_address_changed(int at_interface);
+void dns_servers_relaunch_checks(void);
+
+void control_signal_act(int the_signal);
+void handle_signals(int is_parent);
+
+int try_locking(or_options_t *options, int err_if_locked);
+int have_lockfile(void);
+void release_lockfile(void);
+
+void tor_cleanup(void);
+void tor_free_all(int postfork);
+
+int tor_main(int argc, char *argv[]);
+
+#ifdef MAIN_PRIVATE
+int do_main_loop(void);
+int do_list_fingerprint(void);
+void do_hash_password(void);
+int tor_init(int argc, char **argv);
+#endif
+
+#endif
+
diff --git a/src/or/or.h b/src/or/or.h
index 550331fce7..461c55c82a 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3268,59 +3268,6 @@ typedef enum {
DIRREQ_OR_CONN_BUFFER_FLUSHED = 4
} dirreq_state_t;
-/********************************* main.c ***************************/
-
-extern int has_completed_circuit;
-
-int connection_add(connection_t *conn);
-int connection_remove(connection_t *conn);
-void connection_unregister_events(connection_t *conn);
-int connection_in_array(connection_t *conn);
-void add_connection_to_closeable_list(connection_t *conn);
-int connection_is_on_closeable_list(connection_t *conn);
-
-smartlist_t *get_connection_array(void);
-
-typedef enum watchable_events {
- READ_EVENT=0x02,
- WRITE_EVENT=0x04
-} watchable_events_t;
-void connection_watch_events(connection_t *conn, watchable_events_t events);
-int connection_is_reading(connection_t *conn);
-void connection_stop_reading(connection_t *conn);
-void connection_start_reading(connection_t *conn);
-
-int connection_is_writing(connection_t *conn);
-void connection_stop_writing(connection_t *conn);
-void connection_start_writing(connection_t *conn);
-
-void connection_stop_reading_from_linked_conn(connection_t *conn);
-
-void directory_all_unreachable(time_t now);
-void directory_info_has_arrived(time_t now, int from_cache);
-
-void ip_address_changed(int at_interface);
-void dns_servers_relaunch_checks(void);
-
-void control_signal_act(int the_signal);
-void handle_signals(int is_parent);
-
-int try_locking(or_options_t *options, int err_if_locked);
-int have_lockfile(void);
-void release_lockfile(void);
-
-void tor_cleanup(void);
-void tor_free_all(int postfork);
-
-int tor_main(int argc, char *argv[]);
-
-#ifdef MAIN_PRIVATE
-int do_main_loop(void);
-int do_list_fingerprint(void);
-void do_hash_password(void);
-int tor_init(int argc, char **argv);
-#endif
-
/********************************* microdesc.c *************************/
typedef struct microdesc_cache_t microdesc_cache_t;
diff --git a/src/or/relay.c b/src/or/relay.c
index 5db5cfde80..c362bcbfd7 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -21,6 +21,7 @@
#include "connection_or.h"
#include "control.h"
#include "geoip.h"
+#include "main.h"
#include "mempool.h"
#include "rendcommon.h"
#include "routerlist.h"
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 92d43bc182..7f5fcefb52 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -15,6 +15,7 @@
#include "connection.h"
#include "connection_edge.h"
#include "directory.h"
+#include "main.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "routerlist.h"
diff --git a/src/or/router.c b/src/or/router.c
index e4ffc2f21c..c9501d04ef 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -17,6 +17,7 @@
#include "dns.h"
#include "geoip.h"
#include "hibernate.h"
+#include "main.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0e42acfee0..a84ccb853f 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -21,6 +21,7 @@
#include "dirvote.h"
#include "geoip.h"
#include "hibernate.h"
+#include "main.h"
#include "rendcommon.h"
#include "rendservice.h"
#include "router.h"