summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/channel.c2
-rw-r--r--src/or/channel.h4
-rw-r--r--src/or/channeltls.c3
-rw-r--r--src/or/channeltls.h8
-rw-r--r--src/or/circuitlist.c2
-rw-r--r--src/or/circuitmux_ewma.h5
-rw-r--r--src/or/config.c3
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/dirserv.c5
-rw-r--r--src/or/hibernate.c2
-rw-r--r--src/or/main.c3
-rw-r--r--src/or/main.h8
-rw-r--r--src/or/onion.c2
-rw-r--r--src/or/onion_ntor.c2
-rw-r--r--src/or/rendcache.h7
-rw-r--r--src/or/rephist.h7
-rw-r--r--src/or/router.c2
-rw-r--r--src/or/scheduler.h7
-rw-r--r--src/or/tor_main.c2
19 files changed, 50 insertions, 26 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 78a2fb9ab1..87fa721089 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -122,7 +122,7 @@ STATIC uint64_t estimated_total_queue_size = 0;
* If more than one channel exists, follow the next_with_same_id pointer
* as a linked list.
*/
-HT_HEAD(channel_idmap, channel_idmap_entry_s) channel_identity_map =
+static HT_HEAD(channel_idmap, channel_idmap_entry_s) channel_identity_map =
HT_INITIALIZER();
typedef struct channel_idmap_entry_s {
diff --git a/src/or/channel.h b/src/or/channel.h
index a8c337e107..78e1b71014 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -469,6 +469,10 @@ void channel_notify_flushed(channel_t *chan);
/* Handle stuff we need to do on open like notifying circuits */
void channel_do_open_actions(channel_t *chan);
+#ifdef TOR_UNIT_TESTS
+extern uint64_t estimated_total_queue_size;
+#endif
+
#endif
/* Helper functions to perform operations on channels */
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 5833b2ae63..2bb88dd505 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -22,6 +22,7 @@
#include "channeltls.h"
#include "circuitmux.h"
#include "circuitmux_ewma.h"
+#include "command.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
@@ -51,7 +52,7 @@ uint64_t stats_n_authenticate_cells_processed = 0;
uint64_t stats_n_authorize_cells_processed = 0;
/** Active listener, if any */
-channel_listener_t *channel_tls_listener = NULL;
+static channel_listener_t *channel_tls_listener = NULL;
/* channel_tls_t method declarations */
diff --git a/src/or/channeltls.h b/src/or/channeltls.h
index a4d9c7a095..8b5863a461 100644
--- a/src/or/channeltls.h
+++ b/src/or/channeltls.h
@@ -52,6 +52,14 @@ void channel_tls_update_marks(or_connection_t *conn);
/* Cleanup at shutdown */
void channel_tls_free_all(void);
+extern uint64_t stats_n_authorize_cells_processed;
+extern uint64_t stats_n_authenticate_cells_processed;
+extern uint64_t stats_n_versions_cells_processed;
+extern uint64_t stats_n_netinfo_cells_processed;
+extern uint64_t stats_n_vpadding_cells_processed;
+extern uint64_t stats_n_certs_cells_processed;
+extern uint64_t stats_n_auth_challenge_cells_processed;
+
#ifdef CHANNELTLS_PRIVATE
STATIC void channel_tls_process_certs_cell(var_cell_t *cell,
channel_tls_t *tlschan);
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 1efb7ef4d0..d2ba7d4781 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -109,7 +109,7 @@ HT_GENERATE2(chan_circid_map, chan_circid_circuit_map_t, node,
* used to improve performance when many cells arrive in a row from the
* same circuit.
*/
-chan_circid_circuit_map_t *_last_circid_chan_ent = NULL;
+static chan_circid_circuit_map_t *_last_circid_chan_ent = NULL;
/** Implementation helper for circuit_set_{p,n}_circid_channel: A circuit ID
* and/or channel for circ has just changed from <b>old_chan, old_id</b>
diff --git a/src/or/circuitmux_ewma.h b/src/or/circuitmux_ewma.h
index 58aac1e196..a7b8961ac6 100644
--- a/src/or/circuitmux_ewma.h
+++ b/src/or/circuitmux_ewma.h
@@ -12,13 +12,8 @@
#include "or.h"
#include "circuitmux.h"
-/* Everything but circuitmux_ewma.c should see this extern */
-#ifndef TOR_CIRCUITMUX_EWMA_C_
-
extern circuitmux_policy_t ewma_policy;
-#endif /* !(TOR_CIRCUITMUX_EWMA_C_) */
-
/* Externally visible EWMA functions */
int cell_ewma_enabled(void);
unsigned int cell_ewma_get_tick(void);
diff --git a/src/or/config.c b/src/or/config.c
index ca1e17c4af..a863fdb55a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -65,9 +65,6 @@
#include <systemd/sd-daemon.h>
#endif
-/* From main.c */
-extern int quiet_level;
-
/* Prefix used to indicate a Unix socket in a FooPort configuration. */
static const char unix_socket_prefix[] = "unix:";
diff --git a/src/or/connection.c b/src/or/connection.c
index 86ed2fbccf..f713bbbe65 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2697,8 +2697,6 @@ connection_is_rate_limited(connection_t *conn)
#ifdef USE_BUFFEREVENTS
static struct bufferevent_rate_limit_group *global_rate_limit = NULL;
#else
-extern int global_read_bucket, global_write_bucket;
-extern int global_relayed_read_bucket, global_relayed_write_bucket;
/** Did either global write bucket run dry last second? If so,
* we are likely to run dry again this second, so be stingy with the
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index d1ea5dffd8..80c73501cb 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -19,6 +19,7 @@
#include "dirvote.h"
#include "hibernate.h"
#include "keypin.h"
+#include "main.h"
#include "microdesc.h"
#include "networkstatus.h"
#include "nodelist.h"
@@ -44,10 +45,6 @@
* directory authorities. */
#define MAX_UNTRUSTED_NETWORKSTATUSES 16
-extern time_t time_of_process_start; /* from main.c */
-
-extern long stats_n_seconds_working; /* from main.c */
-
/** Total number of routers with measured bandwidth; this is set by
* dirserv_count_measured_bws() before the loop in
* dirserv_generate_networkstatus_vote_obj() and checked by
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 3666abbcf4..209aae01cf 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -34,8 +34,6 @@ hibernating, phase 2:
#include "router.h"
#include "statefile.h"
-extern long stats_n_seconds_working; /* published uptime */
-
/** Are we currently awake, asleep, running out of bandwidth, or shutting
* down? */
static hibernate_state_t hibernate_state = HIBERNATE_STATE_INITIAL;
diff --git a/src/or/main.c b/src/or/main.c
index 1b161336c6..77d9f3ff91 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2683,9 +2683,6 @@ get_uptime,(void))
return stats_n_seconds_working;
}
-extern uint64_t rephist_total_alloc;
-extern uint32_t rephist_total_num;
-
/**
* Write current memory usage information to the log.
*/
diff --git a/src/or/main.h b/src/or/main.h
index ad865b8124..31a22de424 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -75,6 +75,14 @@ int tor_main(int argc, char *argv[]);
int do_main_loop(void);
int tor_init(int argc, char **argv);
+extern time_t time_of_process_start;
+extern long stats_n_seconds_working;
+extern int quiet_level;
+extern int global_read_bucket;
+extern int global_write_bucket;
+extern int global_relayed_read_bucket;
+extern int global_relayed_write_bucket;
+
#ifdef MAIN_PRIVATE
STATIC void init_connection_lists(void);
STATIC void close_closeable_connections(void);
diff --git a/src/or/onion.c b/src/or/onion.c
index 4bed7ae226..26a4f857e9 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -38,7 +38,7 @@ typedef struct onion_queue_t {
/** Array of queues of circuits waiting for CPU workers. An element is NULL
* if that queue is empty.*/
-TOR_TAILQ_HEAD(onion_queue_head_t, onion_queue_t)
+static TOR_TAILQ_HEAD(onion_queue_head_t, onion_queue_t)
ol_list[MAX_ONION_HANDSHAKE_TYPE+1] = {
TOR_TAILQ_HEAD_INITIALIZER(ol_list[0]), /* tap */
TOR_TAILQ_HEAD_INITIALIZER(ol_list[1]), /* fast */
diff --git a/src/or/onion_ntor.c b/src/or/onion_ntor.c
index 9f97a4cfbe..33afc27895 100644
--- a/src/or/onion_ntor.c
+++ b/src/or/onion_ntor.c
@@ -47,7 +47,7 @@ typedef struct tweakset_t {
} tweakset_t;
/** The tweaks to be used with our handshake. */
-const tweakset_t proto1_tweaks = {
+static const tweakset_t proto1_tweaks = {
#define PROTOID "ntor-curve25519-sha256-1"
#define PROTOID_LEN 24
PROTOID ":mac",
diff --git a/src/or/rendcache.h b/src/or/rendcache.h
index 0e8b918753..270b614c38 100644
--- a/src/or/rendcache.h
+++ b/src/or/rendcache.h
@@ -102,6 +102,13 @@ STATIC void validate_intro_point_failure(const rend_service_descriptor_t *desc,
const char *service_id);
STATIC void rend_cache_failure_entry_free_(void *entry);
+
+#ifdef TOR_UNIT_TESTS
+extern strmap_t *rend_cache;
+extern strmap_t *rend_cache_failure;
+extern digestmap_t *rend_cache_v2_dir;
+extern size_t rend_cache_total_allocation;
+#endif
#endif
#endif /* TOR_RENDCACHE_H */
diff --git a/src/or/rephist.h b/src/or/rephist.h
index 145da97d02..ff4810a56d 100644
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@ -112,5 +112,12 @@ void rep_hist_note_negotiated_link_proto(unsigned link_proto,
int started_here);
void rep_hist_log_link_protocol_counts(void);
+extern uint64_t rephist_total_alloc;
+extern uint32_t rephist_total_num;
+#ifdef TOR_UNIT_TESTS
+extern int onion_handshakes_requested[MAX_ONION_HANDSHAKE_TYPE+1];
+extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1];
+#endif
+
#endif
diff --git a/src/or/router.c b/src/or/router.c
index 43157a9070..cfc003996b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -40,8 +40,6 @@
* and uploading server descriptors, retrying OR connections.
**/
-extern long stats_n_seconds_working;
-
/************************************************************/
/*****
diff --git a/src/or/scheduler.h b/src/or/scheduler.h
index 94a44a0aa3..3dcfd2faca 100644
--- a/src/or/scheduler.h
+++ b/src/or/scheduler.h
@@ -44,6 +44,13 @@ MOCK_DECL(STATIC int, scheduler_compare_channels,
(const void *c1_v, const void *c2_v));
STATIC uint64_t scheduler_get_queue_heuristic(void);
STATIC void scheduler_update_queue_heuristic(time_t now);
+
+#ifdef TOR_UNIT_TESTS
+extern smartlist_t *channels_pending;
+extern struct event *run_sched_ev;
+extern uint64_t queue_heuristic;
+extern time_t queue_heuristic_timestamp;
+#endif
#endif
#endif /* !defined(TOR_SCHEDULER_H) */
diff --git a/src/or/tor_main.c b/src/or/tor_main.c
index ac32eef559..21fbe3efb5 100644
--- a/src/or/tor_main.c
+++ b/src/or/tor_main.c
@@ -3,6 +3,8 @@
* Copyright (c) 2007-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
+extern const char tor_git_revision[];
+
/** String describing which Tor Git repository version the source was
* built from. This string is generated by a bit of shell kludging in
* src/or/include.am, and is usually right.