summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-25 17:57:58 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-25 17:57:58 -0400
commit4f0bc0c8f56f4179482c21bf3122b67ee2fe26d1 (patch)
tree9f3063311db1e31e5e457f2854ff03cbcee74623 /src/core
parent3ff58e47d211d8649202c093f00934011effed1b (diff)
downloadtor-4f0bc0c8f56f4179482c21bf3122b67ee2fe26d1.tar.gz
tor-4f0bc0c8f56f4179482c21bf3122b67ee2fe26d1.zip
Revise things that had included router.h before
Make them only include the headers that they needed, and sort their headers while we're at it.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mainloop/connection.c46
-rw-r--r--src/core/mainloop/mainloop.c59
-rw-r--r--src/core/or/circuitbuild.c49
-rw-r--r--src/core/or/circuituse.c28
-rw-r--r--src/core/or/command.c22
-rw-r--r--src/core/or/connection_edge.c45
-rw-r--r--src/core/or/relay.c2
7 files changed, 128 insertions, 123 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 699e7f710a..18863fc04f 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -59,51 +59,53 @@
#include "feature/client/bridges.h"
#include "lib/container/buffers.h"
#include "lib/tls/buffers_tls.h"
+#include "lib/err/backtrace.h"
+
/*
* Define this so we get channel internal functions, since we're implementing
* part of a subclass (channel_tls_t).
*/
#define TOR_CHANNEL_INTERNAL_
#define CONNECTION_PRIVATE
-#include "lib/err/backtrace.h"
+#include "app/config/config.h"
+#include "core/mainloop/connection.h"
+#include "core/mainloop/mainloop.h"
+#include "core/mainloop/netstatus.h"
#include "core/or/channel.h"
#include "core/or/channeltls.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
-#include "app/config/config.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
#include "core/or/connection_or.h"
+#include "core/or/dos.h"
+#include "core/or/policies.h"
+#include "core/or/reasons.h"
+#include "core/or/relay.h"
+#include "core/proto/proto_http.h"
+#include "core/proto/proto_socks.h"
+#include "feature/client/dnsserv.h"
+#include "feature/client/entrynodes.h"
+#include "feature/client/transports.h"
#include "feature/control/control.h"
-#include "lib/crypt_ops/crypto_util.h"
#include "feature/dirauth/authmode.h"
-#include "feature/dircommon/directory.h"
#include "feature/dircache/dirserv.h"
-#include "feature/relay/dns.h"
-#include "feature/relay/routermode.h"
-#include "feature/client/dnsserv.h"
-#include "core/or/dos.h"
-#include "feature/client/entrynodes.h"
-#include "feature/relay/ext_orport.h"
-#include "feature/stats/geoip.h"
-#include "core/mainloop/mainloop.h"
+#include "feature/dircommon/directory.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_common.h"
#include "feature/hs/hs_ident.h"
#include "feature/nodelist/nodelist.h"
-#include "core/proto/proto_http.h"
-#include "core/proto/proto_socks.h"
-#include "core/or/policies.h"
-#include "core/or/reasons.h"
-#include "core/or/relay.h"
+#include "feature/nodelist/routerlist.h"
+#include "feature/nodelist/routerparse.h"
+#include "feature/relay/dns.h"
+#include "feature/relay/ext_orport.h"
+#include "feature/relay/routermode.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
+#include "feature/stats/geoip.h"
#include "feature/stats/rephist.h"
-#include "feature/relay/router.h"
-#include "feature/nodelist/routerlist.h"
-#include "feature/client/transports.h"
-#include "feature/nodelist/routerparse.h"
+#include "lib/crypt_ops/crypto_util.h"
+
#include "lib/sandbox/sandbox.h"
#include "lib/net/buffers_net.h"
#include "lib/tls/tortls.h"
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index fb405817d1..4a9da43c9c 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -49,55 +49,56 @@
#define MAINLOOP_PRIVATE
#include "core/or/or.h"
-#include "feature/client/addressmap.h"
-#include "lib/err/backtrace.h"
-#include "feature/client/bridges.h"
-#include "lib/container/buffers.h"
-#include "lib/tls/buffers_tls.h"
+#include "app/config/config.h"
+#include "app/config/statefile.h"
+#include "app/main/ntmain.h"
+#include "core/mainloop/connection.h"
+#include "core/mainloop/cpuworker.h"
+#include "core/mainloop/mainloop.h"
+#include "core/mainloop/netstatus.h"
+#include "core/mainloop/periodic.h"
#include "core/or/channel.h"
-#include "core/or/channeltls.h"
#include "core/or/channelpadding.h"
+#include "core/or/channeltls.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
-#include "app/config/config.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
#include "core/or/connection_or.h"
-#include "feature/dircache/consdiffmgr.h"
+#include "core/or/dos.h"
+#include "core/or/status.h"
+#include "feature/client/addressmap.h"
+#include "feature/client/bridges.h"
+#include "feature/client/dnsserv.h"
+#include "feature/client/entrynodes.h"
+#include "feature/client/transports.h"
#include "feature/control/control.h"
-#include "core/mainloop/cpuworker.h"
-#include "lib/crypt_ops/crypto_rand.h"
-#include "feature/dircommon/directory.h"
-#include "feature/dircache/dirserv.h"
#include "feature/dirauth/authmode.h"
#include "feature/dirauth/reachability.h"
-#include "feature/relay/dns.h"
-#include "feature/client/dnsserv.h"
-#include "core/or/dos.h"
-#include "feature/client/entrynodes.h"
-#include "feature/stats/geoip.h"
+#include "feature/dircache/consdiffmgr.h"
+#include "feature/dircache/dirserv.h"
+#include "feature/dircommon/directory.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_cache.h"
#include "feature/hs/hs_client.h"
#include "feature/hs/hs_service.h"
-#include "core/mainloop/mainloop.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
-#include "app/main/ntmain.h"
-#include "core/mainloop/periodic.h"
-#include "feature/client/transports.h"
+#include "feature/nodelist/routerlist.h"
+#include "feature/relay/dns.h"
+#include "feature/relay/routerkeys.h"
+#include "feature/relay/routermode.h"
+#include "feature/relay/selftest.h"
#include "feature/rend/rendcache.h"
#include "feature/rend/rendservice.h"
+#include "feature/stats/geoip.h"
#include "feature/stats/rephist.h"
-#include "feature/relay/router.h"
-#include "feature/relay/routermode.h"
-#include "feature/relay/routerkeys.h"
-#include "feature/relay/selftest.h"
-#include "feature/nodelist/routerlist.h"
-#include "app/config/statefile.h"
-#include "core/or/status.h"
+#include "lib/container/buffers.h"
+#include "lib/crypt_ops/crypto_rand.h"
+#include "lib/err/backtrace.h"
+#include "lib/tls/buffers_tls.h"
+
#include "lib/net/buffers_net.h"
#include "lib/evloop/compat_libevent.h"
diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index f4e0776be0..26f0fc4d4f 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -28,46 +28,47 @@
#define CIRCUITBUILD_PRIVATE
#include "core/or/or.h"
-#include "feature/client/bridges.h"
+#include "app/config/config.h"
+#include "app/config/confparse.h"
+#include "core/crypto/hs_ntor.h"
+#include "core/crypto/onion_crypto.h"
+#include "core/crypto/onion_fast.h"
+#include "core/crypto/onion_tap.h"
+#include "core/crypto/relay_crypto.h"
+#include "core/mainloop/connection.h"
+#include "core/mainloop/mainloop.h"
#include "core/or/channel.h"
-#include "feature/client/circpathbias.h"
-#define CIRCUITBUILD_PRIVATE
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuitstats.h"
#include "core/or/circuituse.h"
#include "core/or/command.h"
-#include "app/config/config.h"
-#include "app/config/confparse.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
#include "core/or/connection_or.h"
+#include "core/or/onion.h"
+#include "core/or/policies.h"
+#include "core/or/relay.h"
+#include "feature/client/bridges.h"
+#include "feature/client/circpathbias.h"
+#include "feature/client/entrynodes.h"
+#include "feature/client/transports.h"
#include "feature/control/control.h"
-#include "lib/crypt_ops/crypto_rand.h"
#include "feature/dircommon/directory.h"
-#include "feature/client/entrynodes.h"
-#include "core/crypto/hs_ntor.h"
-#include "core/mainloop/mainloop.h"
+#include "feature/nodelist/describe.h"
#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
-#include "feature/nodelist/nodelist.h"
-#include "core/or/onion.h"
-#include "core/crypto/onion_crypto.h"
-#include "core/crypto/onion_tap.h"
-#include "core/crypto/onion_fast.h"
-#include "core/or/policies.h"
-#include "core/or/relay.h"
-#include "core/crypto/relay_crypto.h"
-#include "feature/rend/rendcommon.h"
-#include "feature/stats/rephist.h"
-#include "feature/relay/router.h"
-#include "feature/relay/routermode.h"
-#include "feature/relay/selftest.h"
+#include "feature/nodelist/nickname.h"
#include "feature/nodelist/node_select.h"
+#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/routerparse.h"
#include "feature/nodelist/routerset.h"
-#include "feature/client/transports.h"
+#include "feature/relay/router.h"
+#include "feature/relay/routermode.h"
+#include "feature/relay/selftest.h"
+#include "feature/rend/rendcommon.h"
+#include "feature/stats/rephist.h"
+#include "lib/crypt_ops/crypto_rand.h"
#include "core/or/cell_st.h"
#include "core/or/cpath_build_state_st.h"
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 34b51a5021..d035d66ea2 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -28,36 +28,36 @@
**/
#include "core/or/or.h"
-#include "feature/client/addressmap.h"
-#include "feature/client/bridges.h"
+#include "app/config/config.h"
+#include "core/mainloop/connection.h"
#include "core/or/channel.h"
-#include "feature/client/circpathbias.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuitstats.h"
#include "core/or/circuituse.h"
-#include "app/config/config.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
+#include "core/or/policies.h"
+#include "feature/client/addressmap.h"
+#include "feature/client/bridges.h"
+#include "feature/client/circpathbias.h"
+#include "feature/client/entrynodes.h"
#include "feature/control/control.h"
#include "feature/dircommon/directory.h"
-#include "feature/client/entrynodes.h"
-#include "feature/hs/hs_common.h"
-#include "feature/hs/hs_client.h"
#include "feature/hs/hs_circuit.h"
+#include "feature/hs/hs_client.h"
+#include "feature/hs/hs_common.h"
#include "feature/hs/hs_ident.h"
#include "feature/hs/hs_stats.h"
-#include "feature/nodelist/nodelist.h"
+#include "feature/nodelist/describe.h"
#include "feature/nodelist/networkstatus.h"
-#include "core/or/policies.h"
+#include "feature/nodelist/nodelist.h"
+#include "feature/nodelist/routerlist.h"
+#include "feature/relay/routermode.h"
+#include "feature/relay/selftest.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
#include "feature/rend/rendservice.h"
#include "feature/stats/rephist.h"
-#include "feature/relay/router.h"
-#include "feature/relay/routermode.h"
-#include "feature/relay/selftest.h"
-#include "feature/nodelist/routerlist.h"
#include "lib/math/fp.h"
#include "lib/time/tvdiff.h"
diff --git a/src/core/or/command.c b/src/core/or/command.c
index 9e19d28c74..cbe7f622e7 100644
--- a/src/core/or/command.c
+++ b/src/core/or/command.c
@@ -37,26 +37,26 @@
* called when channels are created in circuitbuild.c
*/
#include "core/or/or.h"
+#include "app/config/config.h"
+#include "core/crypto/onion_crypto.h"
+#include "core/mainloop/connection.h"
+#include "core/mainloop/cpuworker.h"
#include "core/or/channel.h"
#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/command.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_or.h"
-#include "app/config/config.h"
-#include "feature/control/control.h"
-#include "core/mainloop/cpuworker.h"
-#include "lib/crypt_ops/crypto_util.h"
#include "core/or/dos.h"
-#include "feature/hibernate/hibernate.h"
-#include "feature/nodelist/nodelist.h"
#include "core/or/onion.h"
-#include "core/crypto/onion_crypto.h"
-#include "feature/stats/rephist.h"
#include "core/or/relay.h"
-#include "feature/relay/router.h"
-#include "feature/relay/routermode.h"
+#include "feature/control/control.h"
+#include "feature/hibernate/hibernate.h"
+#include "feature/nodelist/describe.h"
+#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerlist.h"
+#include "feature/relay/routermode.h"
+#include "feature/stats/rephist.h"
+#include "lib/crypt_ops/crypto_util.h"
#include "core/or/cell_st.h"
#include "core/or/or_circuit_st.h"
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c
index 6dc0814b14..d8b45fe350 100644
--- a/src/core/or/connection_edge.c
+++ b/src/core/or/connection_edge.c
@@ -59,44 +59,45 @@
#include "lib/err/backtrace.h"
-#include "feature/client/addressmap.h"
-#include "lib/container/buffers.h"
+#include "app/config/config.h"
+#include "core/mainloop/connection.h"
+#include "core/mainloop/mainloop.h"
#include "core/or/channel.h"
-#include "feature/client/circpathbias.h"
+#include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
-#include "app/config/config.h"
-#include "core/mainloop/connection.h"
#include "core/or/connection_edge.h"
#include "core/or/connection_or.h"
-#include "feature/control/control.h"
-#include "lib/crypt_ops/crypto_util.h"
-#include "feature/relay/dns.h"
+#include "core/or/policies.h"
+#include "core/or/reasons.h"
+#include "core/or/relay.h"
+#include "core/proto/proto_http.h"
+#include "core/proto/proto_socks.h"
+#include "feature/client/addressmap.h"
+#include "feature/client/circpathbias.h"
#include "feature/client/dnsserv.h"
-#include "feature/dircommon/directory.h"
+#include "feature/control/control.h"
#include "feature/dircache/dirserv.h"
+#include "feature/dircommon/directory.h"
#include "feature/hibernate/hibernate.h"
-#include "feature/hs/hs_common.h"
#include "feature/hs/hs_cache.h"
-#include "feature/hs/hs_client.h"
#include "feature/hs/hs_circuit.h"
-#include "core/mainloop/mainloop.h"
+#include "feature/hs/hs_client.h"
+#include "feature/hs/hs_common.h"
+#include "feature/nodelist/describe.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
-#include "core/or/policies.h"
-#include "core/proto/proto_http.h"
-#include "core/proto/proto_socks.h"
-#include "core/or/reasons.h"
-#include "core/or/relay.h"
+#include "feature/nodelist/routerlist.h"
+#include "feature/nodelist/routerset.h"
+#include "feature/relay/dns.h"
+#include "feature/relay/router.h"
+#include "feature/relay/routermode.h"
#include "feature/rend/rendclient.h"
#include "feature/rend/rendcommon.h"
#include "feature/rend/rendservice.h"
#include "feature/stats/rephist.h"
-#include "feature/relay/router.h"
-#include "feature/relay/routermode.h"
-#include "feature/nodelist/routerlist.h"
-#include "feature/nodelist/routerset.h"
-#include "core/or/circuitbuild.h"
+#include "lib/container/buffers.h"
+#include "lib/crypt_ops/crypto_util.h"
#include "core/or/cell_st.h"
#include "core/or/cpath_build_state_st.h"
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 47be0f4039..88bcdf0703 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -77,7 +77,7 @@
#include "core/crypto/relay_crypto.h"
#include "feature/rend/rendcache.h"
#include "feature/rend/rendcommon.h"
-#include "feature/relay/router.h"
+#include "feature/nodelist/describe.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/routerparse.h"
#include "core/or/scheduler.h"