mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Split main.c into main.c and mainloop.c
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
This commit is contained in:
parent
98ef3e82e4
commit
c7ce6b9821
@ -1,4 +1,3 @@
|
||||
|
||||
/* Copyright (c) 2001 Matej Pfajfar.
|
||||
* Copyright (c) 2001-2004, Roger Dingledine.
|
||||
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
||||
@ -96,7 +95,8 @@
|
||||
#include "lib/log/git_revision.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "app/main/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/policies.h"
|
||||
|
@ -33,11 +33,11 @@
|
||||
#include "core/or/circuitstats.h"
|
||||
#include "app/config/config.h"
|
||||
#include "app/config/confparse.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "feature/control/control.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "feature/stats/rephist.h"
|
||||
#include "feature/relay/router.h"
|
||||
#include "lib/sandbox/sandbox.h"
|
||||
|
1515
src/app/main/main.c
Normal file
1515
src/app/main/main.c
Normal file
File diff suppressed because it is too large
Load Diff
29
src/app/main/main.h
Normal file
29
src/app/main/main.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* Copyright (c) 2001 Matej Pfajfar.
|
||||
* Copyright (c) 2001-2004, Roger Dingledine.
|
||||
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
||||
* Copyright (c) 2007-2018, 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
|
||||
|
||||
void handle_signals(void);
|
||||
void activate_signal(int signal_num);
|
||||
|
||||
int try_locking(const or_options_t *options, int err_if_locked);
|
||||
int have_lockfile(void);
|
||||
void release_lockfile(void);
|
||||
|
||||
void tor_remove_file(const char *filename);
|
||||
|
||||
void tor_cleanup(void);
|
||||
void tor_free_all(int postfork);
|
||||
|
||||
int tor_init(int argc, char **argv);
|
||||
|
||||
#endif /* !defined(TOR_MAIN_H) */
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "core/or/or.h"
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "app/main/main.h"
|
||||
#include "app/main/ntmain.h"
|
||||
#include "lib/log/win32err.h"
|
||||
#include "lib/fs/winlib.h"
|
||||
|
@ -10,6 +10,7 @@ LIBTOR_APP_A_SOURCES = \
|
||||
src/app/config/config.c \
|
||||
src/app/config/confparse.c \
|
||||
src/app/config/statefile.c \
|
||||
src/app/main/main.c \
|
||||
src/core/crypto/hs_ntor.c \
|
||||
src/core/crypto/onion_crypto.c \
|
||||
src/core/crypto/onion_fast.c \
|
||||
@ -18,7 +19,7 @@ LIBTOR_APP_A_SOURCES = \
|
||||
src/core/crypto/relay_crypto.c \
|
||||
src/core/mainloop/connection.c \
|
||||
src/core/mainloop/cpuworker.c \
|
||||
src/core/mainloop/main.c \
|
||||
src/core/mainloop/mainloop.c \
|
||||
src/core/mainloop/periodic.c \
|
||||
src/core/or/address_set.c \
|
||||
src/core/or/channel.c \
|
||||
@ -164,6 +165,7 @@ noinst_HEADERS += \
|
||||
src/app/config/or_options_st.h \
|
||||
src/app/config/or_state_st.h \
|
||||
src/app/config/statefile.h \
|
||||
src/app/main/main.h \
|
||||
src/app/main/ntmain.h \
|
||||
src/core/crypto/hs_ntor.h \
|
||||
src/core/crypto/onion_crypto.h \
|
||||
@ -173,7 +175,7 @@ noinst_HEADERS += \
|
||||
src/core/crypto/relay_crypto.h \
|
||||
src/core/mainloop/connection.h \
|
||||
src/core/mainloop/cpuworker.h \
|
||||
src/core/mainloop/main.h \
|
||||
src/core/mainloop/mainloop.h \
|
||||
src/core/mainloop/periodic.h \
|
||||
src/core/or/addr_policy_st.h \
|
||||
src/core/or/address_set.h \
|
||||
|
@ -85,7 +85,7 @@
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "feature/relay/ext_orport.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "feature/hs/hs_ident.h"
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "core/mainloop/cpuworker.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "lib/crypt_ops/crypto_util.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/or/onion.h"
|
||||
#include "feature/relay/onion_queue.h"
|
||||
#include "feature/stats/rephist.h"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,12 @@
|
||||
/* See LICENSE for licensing information */
|
||||
|
||||
/**
|
||||
* \file main.h
|
||||
* \brief Header file for main.c.
|
||||
* \file mainloop.h
|
||||
* \brief Header file for mainloop.c.
|
||||
**/
|
||||
|
||||
#ifndef TOR_MAIN_H
|
||||
#define TOR_MAIN_H
|
||||
#ifndef TOR_MAINLOOP_H
|
||||
#define TOR_MAINLOOP_H
|
||||
|
||||
int have_completed_a_circuit(void);
|
||||
void note_that_we_completed_a_circuit(void);
|
||||
@ -73,20 +73,7 @@ MOCK_DECL(void,reset_uptime,(void));
|
||||
|
||||
unsigned get_signewnym_epoch(void);
|
||||
|
||||
void handle_signals(void);
|
||||
void activate_signal(int signal_num);
|
||||
|
||||
int try_locking(const or_options_t *options, int err_if_locked);
|
||||
int have_lockfile(void);
|
||||
void release_lockfile(void);
|
||||
|
||||
void tor_remove_file(const char *filename);
|
||||
|
||||
void tor_cleanup(void);
|
||||
void tor_free_all(int postfork);
|
||||
|
||||
int do_main_loop(void);
|
||||
int tor_init(int argc, char **argv);
|
||||
|
||||
void reset_main_loop_counters(void);
|
||||
uint64_t get_main_loop_success_count(void);
|
||||
@ -96,6 +83,12 @@ uint64_t get_main_loop_idle_count(void);
|
||||
void periodic_events_on_new_options(const or_options_t *options);
|
||||
void reschedule_per_second_timer(void);
|
||||
|
||||
void do_signewnym(time_t);
|
||||
time_t get_last_signewnym_time(void);
|
||||
|
||||
void tor_init_connection_lists(void);
|
||||
void tor_mainloop_free_all(void);
|
||||
|
||||
struct token_bucket_rw_t;
|
||||
|
||||
extern time_t time_of_process_start;
|
||||
@ -103,13 +96,12 @@ extern int quiet_level;
|
||||
extern struct token_bucket_rw_t global_bucket;
|
||||
extern struct token_bucket_rw_t global_relayed_bucket;
|
||||
|
||||
#ifdef MAIN_PRIVATE
|
||||
STATIC void init_connection_lists(void);
|
||||
#ifdef MAINLOOP_PRIVATE
|
||||
STATIC void initialize_mainloop_events(void);
|
||||
STATIC void close_closeable_connections(void);
|
||||
STATIC void initialize_periodic_events(void);
|
||||
STATIC void teardown_periodic_events(void);
|
||||
STATIC int get_my_roles(const or_options_t *options);
|
||||
STATIC int get_my_roles(const or_options_t *);
|
||||
#ifdef TOR_UNIT_TESTS
|
||||
extern smartlist_t *connection_array;
|
||||
|
||||
@ -119,4 +111,4 @@ extern periodic_event_item_t periodic_events[];
|
||||
#endif
|
||||
#endif /* defined(MAIN_PRIVATE) */
|
||||
|
||||
#endif /* !defined(TOR_MAIN_H) */
|
||||
#endif
|
@ -14,7 +14,7 @@
|
||||
#include "core/or/or.h"
|
||||
#include "lib/evloop/compat_libevent.h"
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/mainloop/periodic.h"
|
||||
#include "lib/evloop/compat_libevent.h"
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
#include "core/or/circuitmux.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/relay.h"
|
||||
#include "feature/stats/rephist.h"
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/or/connection_or.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/stats/rephist.h"
|
||||
#include "feature/relay/router.h"
|
||||
#include "lib/time/compat_time.h"
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "core/crypto/hs_ntor.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -71,7 +71,7 @@
|
||||
#include "lib/crypt_ops/crypto_dh.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/hs/hs_circuit.h"
|
||||
#include "feature/hs/hs_circuitmap.h"
|
||||
#include "feature/hs/hs_ident.h"
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "app/config/confparse.h"
|
||||
#include "feature/control/control.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/rend/rendclient.h"
|
||||
#include "feature/rend/rendservice.h"
|
||||
|
@ -80,7 +80,7 @@
|
||||
#include "feature/hs/hs_cache.h"
|
||||
#include "feature/hs/hs_client.h"
|
||||
#include "feature/hs/hs_circuit.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/policies.h"
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "feature/dirauth/reachability.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "trunnel/link_handshake.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "core/or/connection_or.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/relay.h"
|
||||
|
@ -67,7 +67,7 @@
|
||||
#include "feature/relay/dns.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "feature/hs/hs_cache.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/onion.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define SCHEDULER_PRIVATE_
|
||||
#define SCHEDULER_KIST_PRIVATE
|
||||
#include "core/or/scheduler.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "lib/container/buffers.h"
|
||||
#define TOR_CHANNEL_INTERNAL_
|
||||
#include "core/or/channeltls.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "core/or/relay.h"
|
||||
#include "feature/relay/router.h"
|
||||
#include "core/or/circuitlist.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/stats/rephist.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "app/config/statefile.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/or/connection_edge.h"
|
||||
#include "feature/control/control.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/or/policies.h"
|
||||
|
||||
#include "feature/control/control_connection_st.h"
|
||||
|
@ -127,7 +127,7 @@
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -65,7 +65,8 @@
|
||||
#include "feature/hs/hs_cache.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "feature/hs/hs_control.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "app/main/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "feature/dirauth/voteflags.h"
|
||||
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/or/policies.h"
|
||||
#include "feature/dirauth/bwauth.h"
|
||||
#include "feature/dirauth/reachability.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "feature/hs/hs_control.h"
|
||||
#include "feature/hs/hs_client.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -38,7 +38,7 @@ hibernating, phase 2:
|
||||
#include "feature/control/control.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/relay/router.h"
|
||||
#include "app/config/statefile.h"
|
||||
#include "lib/evloop/compat_libevent.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "lib/crypt_ops/crypto_ope.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/relay.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/or/policies.h"
|
||||
#include "feature/client/bridges.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
|
@ -29,7 +29,7 @@
|
||||
/* #include "feature/dircache/dirserv.h" */
|
||||
/* #include "feature/hibernate/hibernate.h" */
|
||||
/* #include "feature/dirauth/keypin.h" */
|
||||
/* #include "core/mainloop/main.h" */
|
||||
/* #include "core/mainloop/mainloop.h" */
|
||||
/* #include "feature/nodelist/microdesc.h" */
|
||||
/* #include "feature/nodelist/networkstatus.h" */
|
||||
/* #include "feature/nodelist/nodelist.h" */
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include "core/or/dos.h"
|
||||
#include "feature/client/entrynodes.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "feature/hs/hs_client.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/or/policies.h"
|
||||
#include "feature/client/bridges.h"
|
||||
#include "feature/control/control.h"
|
||||
|
@ -58,7 +58,7 @@
|
||||
#include "feature/control/control.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/relay/dns.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/or/policies.h"
|
||||
#include "core/or/relay.h"
|
||||
#include "feature/relay/router.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "lib/crypt_ops/crypto_util.h"
|
||||
#include "feature/relay/ext_orport.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/proto/proto_ext_or.h"
|
||||
|
||||
#include "core/or/or_connection_st.h"
|
||||
|
@ -22,7 +22,8 @@
|
||||
#include "feature/relay/dns.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "app/main/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/policies.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "feature/hs/hs_circuit.h"
|
||||
#include "feature/hs/hs_client.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/relay.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "feature/hs/hs_config.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/policies.h"
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define ROUTER_PRIVATE
|
||||
#define CIRCUITSTATS_PRIVATE
|
||||
#define CIRCUITLIST_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#define STATEFILE_PRIVATE
|
||||
|
||||
#include "core/or/or.h"
|
||||
@ -46,7 +46,7 @@
|
||||
#include "feature/rend/rendcommon.h"
|
||||
#include "feature/rend/rendcache.h"
|
||||
#include "test/test.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "lib/memarea/memarea.h"
|
||||
#include "core/or/onion.h"
|
||||
#include "core/crypto/onion_ntor.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* See LICENSE for licensing information */
|
||||
|
||||
#define TOR_CHANNEL_INTERNAL_
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#define NETWORKSTATUS_PRIVATE
|
||||
#define TOR_TIMERS_PRIVATE
|
||||
#include "core/or/or.h"
|
||||
@ -16,7 +16,7 @@
|
||||
#include "lib/evloop/compat_libevent.h"
|
||||
#include "app/config/config.h"
|
||||
#include "lib/time/compat_time.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "test/log_test_helpers.h"
|
||||
#include "lib/tls/tortls.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "feature/relay/ext_orport.h"
|
||||
#include "feature/stats/geoip.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/policies.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "orconfig.h"
|
||||
|
||||
#define CONNECTION_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#define CONNECTION_OR_PRIVATE
|
||||
|
||||
#include "core/or/or.h"
|
||||
@ -13,7 +13,7 @@
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/or/connection_edge.h"
|
||||
#include "feature/hs/hs_common.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/microdesc.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "feature/nodelist/networkstatus.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#define CONNECTION_PRIVATE
|
||||
#define EXT_ORPORT_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#include "core/or/or.h"
|
||||
#include "lib/container/buffers.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
@ -12,7 +12,7 @@
|
||||
#include "feature/control/control.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "feature/relay/ext_orport.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
|
||||
#include "core/or/or_connection_st.h"
|
||||
|
||||
@ -463,7 +463,7 @@ test_ext_or_handshake(void *arg)
|
||||
memcpy(ext_or_auth_cookie, "Gliding wrapt in a brown mantle," , 32);
|
||||
ext_or_auth_cookie_is_set = 1;
|
||||
|
||||
init_connection_lists();
|
||||
tor_init_connection_lists();
|
||||
|
||||
conn = or_connection_new(CONN_TYPE_EXT_OR, AF_INET);
|
||||
tt_int_op(0, OP_EQ, connection_ext_or_start_auth(conn));
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define ROUTERLIST_PRIVATE
|
||||
#define CONFIG_PRIVATE
|
||||
#define CONNECTION_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
|
||||
#include "orconfig.h"
|
||||
#include "core/or/or.h"
|
||||
@ -19,7 +19,7 @@
|
||||
#include "app/config/confparse.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "lib/crypt_ops/crypto_rand.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "core/or/relay.h"
|
||||
#include "feature/nodelist/routerlist.h"
|
||||
@ -217,7 +217,7 @@ test_conn_get_connection(uint8_t state, uint8_t type, uint8_t purpose)
|
||||
mock_connection_connect_sockaddr);
|
||||
MOCK(tor_close_socket, fake_close_socket);
|
||||
|
||||
init_connection_lists();
|
||||
tor_init_connection_lists();
|
||||
|
||||
conn = connection_new(type, TEST_CONN_FAMILY);
|
||||
tt_assert(conn);
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#define CONFIG_PRIVATE
|
||||
#define CRYPTO_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#define HS_CLIENT_PRIVATE
|
||||
#define TOR_CHANNEL_INTERNAL_
|
||||
#define CIRCUITBUILD_PRIVATE
|
||||
@ -26,7 +26,7 @@
|
||||
#include "lib/crypt_ops/crypto_dh.h"
|
||||
#include "core/or/channeltls.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "feature/nodelist/routerset.h"
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define HS_SERVICE_PRIVATE
|
||||
#define HS_INTROPOINT_PRIVATE
|
||||
#define HS_CIRCUIT_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#define NETWORKSTATUS_PRIVATE
|
||||
#define STATEFILE_PRIVATE
|
||||
#define TOR_CHANNEL_INTERNAL_
|
||||
@ -49,7 +49,7 @@
|
||||
#include "feature/hs/hs_circuitmap.h"
|
||||
#include "feature/hs/hs_service.h"
|
||||
#include "feature/hs/hs_client.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/rend/rendservice.h"
|
||||
#include "app/config/statefile.h"
|
||||
#include "feature/dirauth/shared_random_state.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "test/log_test_helpers.h"
|
||||
|
||||
#include "core/or/or.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
|
||||
static const uint64_t BILLION = 1000000000;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "core/or/connection_or.h"
|
||||
#include "feature/dircache/directory.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "test/test.h"
|
||||
|
||||
#include "feature/dircommon/dir_connection_st.h"
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#define ROUTERSET_PRIVATE
|
||||
#include "feature/nodelist/routerset.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "test/log_test_helpers.h"
|
||||
|
||||
#include "lib/sandbox/sandbox.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define CONFIG_PRIVATE
|
||||
#define HS_SERVICE_PRIVATE
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
|
||||
#include "test/test.h"
|
||||
#include "test/test_helpers.h"
|
||||
@ -18,7 +18,7 @@
|
||||
#include "app/config/config.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "feature/hs/hs_service.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "core/mainloop/periodic.h"
|
||||
|
||||
/** Helper function: This is replaced in some tests for the event callbacks so
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define RELAY_PRIVATE
|
||||
#define CIRCUITLIST_PRIVATE
|
||||
#include "core/or/or.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/connection.h"
|
||||
#include "lib/crypt_ops/crypto_cipher.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "core/or/or.h"
|
||||
#include "app/config/config.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/hibernate/hibernate.h"
|
||||
#include "feature/nodelist/routerinfo_st.h"
|
||||
#include "feature/nodelist/routerlist.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "feature/stats/rephist.h"
|
||||
#include "core/or/relay.h"
|
||||
#include "feature/relay/router.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "feature/nodelist/nodelist.h"
|
||||
#include "app/config/statefile.h"
|
||||
#include "lib/tls/tortls.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
* \brief Common pieces to implement unit tests.
|
||||
**/
|
||||
|
||||
#define MAIN_PRIVATE
|
||||
#define MAINLOOP_PRIVATE
|
||||
#include "orconfig.h"
|
||||
#include "core/or/or.h"
|
||||
#include "feature/control/control.h"
|
||||
@ -20,7 +20,7 @@
|
||||
#include "lib/err/backtrace.h"
|
||||
#include "test/test.h"
|
||||
#include "core/or/channelpadding.h"
|
||||
#include "core/mainloop/main.h"
|
||||
#include "core/mainloop/mainloop.h"
|
||||
#include "lib/compress/compress.h"
|
||||
#include "lib/evloop/compat_libevent.h"
|
||||
#include "lib/crypt_ops/crypto_init.h"
|
||||
|
Loading…
Reference in New Issue
Block a user