diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-20 15:19:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-21 09:14:06 -0400 |
commit | c7ce6b9821be22e734b79e07e318f2bfba32722d (patch) | |
tree | 0582d70285c6fcd33f9804af6684f8de27273c36 /src/test | |
parent | 98ef3e82e48c2d57c09d5f551b72e7d6bfe5347a (diff) | |
download | tor-c7ce6b9821be22e734b79e07e318f2bfba32722d.tar.gz tor-c7ce6b9821be22e734b79e07e318f2bfba32722d.zip |
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.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test.c | 4 | ||||
-rw-r--r-- | src/test/test_channelpadding.c | 4 | ||||
-rw-r--r-- | src/test/test_config.c | 2 | ||||
-rw-r--r-- | src/test/test_connection.c | 4 | ||||
-rw-r--r-- | src/test/test_extorport.c | 6 | ||||
-rw-r--r-- | src/test/test_helpers.c | 6 | ||||
-rw-r--r-- | src/test/test_hs_client.c | 4 | ||||
-rw-r--r-- | src/test/test_hs_service.c | 4 | ||||
-rw-r--r-- | src/test/test_mainloop.c | 2 | ||||
-rw-r--r-- | src/test/test_oos.c | 2 | ||||
-rw-r--r-- | src/test/test_options.c | 2 | ||||
-rw-r--r-- | src/test/test_periodic_event.c | 4 | ||||
-rw-r--r-- | src/test/test_relaycell.c | 2 | ||||
-rw-r--r-- | src/test/test_router.c | 2 | ||||
-rw-r--r-- | src/test/test_status.c | 2 | ||||
-rw-r--r-- | src/test/testing_common.c | 4 |
16 files changed, 27 insertions, 27 deletions
diff --git a/src/test/test.c b/src/test/test.c index e3d1b1c67a..fff87a2b56 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -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" diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c index de673de543..0fd60d0a92 100644 --- a/src/test/test_channelpadding.c +++ b/src/test/test_channelpadding.c @@ -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" diff --git a/src/test/test_config.c b/src/test/test_config.c index f224ddde33..4dc1b8c0ec 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -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" diff --git a/src/test/test_connection.c b/src/test/test_connection.c index e716c83fe1..d85ede61b1 100644 --- a/src/test/test_connection.c +++ b/src/test/test_connection.c @@ -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" diff --git a/src/test/test_extorport.c b/src/test/test_extorport.c index ff987563c6..1ac1c68d7e 100644 --- a/src/test/test_extorport.c +++ b/src/test/test_extorport.c @@ -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)); diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c index c9138611d8..0a2da100ba 100644 --- a/src/test/test_helpers.c +++ b/src/test/test_helpers.c @@ -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); diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c index a115997c7f..31a2816c12 100644 --- a/src/test/test_hs_client.c +++ b/src/test/test_hs_client.c @@ -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" diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index bceeafd149..41ad25d171 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -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" diff --git a/src/test/test_mainloop.c b/src/test/test_mainloop.c index f85c224ae9..92ce2e9918 100644 --- a/src/test/test_mainloop.c +++ b/src/test/test_mainloop.c @@ -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; diff --git a/src/test/test_oos.c b/src/test/test_oos.c index 5f9942d8ae..b8ff3030a2 100644 --- a/src/test/test_oos.c +++ b/src/test/test_oos.c @@ -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" diff --git a/src/test/test_options.c b/src/test/test_options.c index 56b7f3cf0f..a4de0e992a 100644 --- a/src/test/test_options.c +++ b/src/test/test_options.c @@ -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" diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c index b447ae8888..7804a9d8fb 100644 --- a/src/test/test_periodic_event.c +++ b/src/test/test_periodic_event.c @@ -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 diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c index 2d020ec472..0f72a575ab 100644 --- a/src/test/test_relaycell.c +++ b/src/test/test_relaycell.c @@ -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" diff --git a/src/test/test_router.c b/src/test/test_router.c index 533135669f..921ec42904 100644 --- a/src/test/test_router.c +++ b/src/test/test_router.c @@ -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" diff --git a/src/test/test_status.c b/src/test/test_status.c index 15c406d2ff..46dbd9dcd1 100644 --- a/src/test/test_status.c +++ b/src/test/test_status.c @@ -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" diff --git a/src/test/testing_common.c b/src/test/testing_common.c index 5d4c2f15af..2d00ecb651 100644 --- a/src/test/testing_common.c +++ b/src/test/testing_common.c @@ -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" |