aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xscripts/maint/rectify_include_paths.py2
-rw-r--r--src/common/address.c14
-rw-r--r--src/common/address.h6
-rw-r--r--src/common/address_set.c12
-rw-r--r--src/common/address_set.h2
-rw-r--r--src/common/aes.c14
-rw-r--r--src/common/backtrace.c8
-rw-r--r--src/common/buffers.c12
-rw-r--r--src/common/buffers.h6
-rw-r--r--src/common/buffers_tls.c16
-rw-r--r--src/common/compat.c12
-rw-r--r--src/common/compat.h8
-rw-r--r--src/common/compat_libevent.c10
-rw-r--r--src/common/compat_libevent.h2
-rw-r--r--src/common/compat_openssl.h2
-rw-r--r--src/common/compat_pthreads.c6
-rw-r--r--src/common/compat_threads.c8
-rw-r--r--src/common/compat_threads.h4
-rw-r--r--src/common/compat_time.c8
-rw-r--r--src/common/compat_winthreads.c8
-rw-r--r--src/common/compress.c16
-rw-r--r--src/common/compress_lzma.c8
-rw-r--r--src/common/compress_none.c8
-rw-r--r--src/common/compress_zlib.c8
-rw-r--r--src/common/compress_zstd.c8
-rw-r--r--src/common/confline.c10
-rw-r--r--src/common/confline.h2
-rw-r--r--src/common/container.c10
-rw-r--r--src/common/container.h2
-rw-r--r--src/common/crypto.c36
-rw-r--r--src/common/crypto.h8
-rw-r--r--src/common/crypto_curve25519.c16
-rw-r--r--src/common/crypto_curve25519.h8
-rw-r--r--src/common/crypto_dh.c12
-rw-r--r--src/common/crypto_dh.h2
-rw-r--r--src/common/crypto_digest.c10
-rw-r--r--src/common/crypto_digest.h4
-rw-r--r--src/common/crypto_ed25519.c18
-rw-r--r--src/common/crypto_ed25519.h8
-rw-r--r--src/common/crypto_format.c18
-rw-r--r--src/common/crypto_format.h6
-rw-r--r--src/common/crypto_hkdf.c6
-rw-r--r--src/common/crypto_hkdf.h2
-rw-r--r--src/common/crypto_openssl_mgt.c4
-rw-r--r--src/common/crypto_openssl_mgt.h2
-rw-r--r--src/common/crypto_pwbox.c18
-rw-r--r--src/common/crypto_pwbox.h2
-rw-r--r--src/common/crypto_rand.c20
-rw-r--r--src/common/crypto_rand.h4
-rw-r--r--src/common/crypto_rsa.c22
-rw-r--r--src/common/crypto_rsa.h12
-rw-r--r--src/common/crypto_s2k.c16
-rw-r--r--src/common/crypto_s2k.h2
-rw-r--r--src/common/crypto_util.c6
-rw-r--r--src/common/crypto_util.h2
-rw-r--r--src/common/di_ops.c6
-rw-r--r--src/common/di_ops.h2
-rw-r--r--src/common/handles.h2
-rw-r--r--src/common/log.c8
-rw-r--r--src/common/memarea.c10
-rw-r--r--src/common/procmon.c4
-rw-r--r--src/common/procmon.h6
-rw-r--r--src/common/pubsub.c4
-rw-r--r--src/common/pubsub.h2
-rw-r--r--src/common/sandbox.c12
-rw-r--r--src/common/sandbox.h2
-rw-r--r--src/common/storagedir.c16
-rw-r--r--src/common/timers.c10
-rw-r--r--src/common/timers.h2
-rw-r--r--src/common/token_bucket.c4
-rw-r--r--src/common/token_bucket.h4
-rw-r--r--src/common/torlog.h4
-rw-r--r--src/common/tortls.c18
-rw-r--r--src/common/tortls.h8
-rw-r--r--src/common/util.c20
-rw-r--r--src/common/util.h10
-rw-r--r--src/common/util_bug.c8
-rw-r--r--src/common/util_bug.h4
-rw-r--r--src/common/util_format.c8
-rw-r--r--src/common/util_format.h4
-rw-r--r--src/common/util_process.c8
-rw-r--r--src/common/workqueue.c14
-rw-r--r--src/common/workqueue.h2
-rw-r--r--src/ext/OpenBSD_malloc_Linux.c2
-rw-r--r--src/ext/csiphash.c4
-rw-r--r--src/ext/curve25519_donna/curve25519-donna-c64.c2
-rw-r--r--src/ext/curve25519_donna/curve25519-donna.c2
-rw-r--r--src/ext/ed25519/donna/ed25519-hash-custom.h2
-rw-r--r--src/ext/ed25519/donna/ed25519-randombytes-custom.h2
-rw-r--r--src/ext/ed25519/donna/ed25519_donna_tor.h2
-rw-r--r--src/ext/ed25519/donna/ed25519_tor.c2
-rw-r--r--src/ext/ed25519/ref10/blinding.c2
-rw-r--r--src/ext/ed25519/ref10/crypto_hash_sha512.h2
-rw-r--r--src/ext/ed25519/ref10/crypto_int32.h2
-rw-r--r--src/ext/ed25519/ref10/crypto_int64.h2
-rw-r--r--src/ext/ed25519/ref10/crypto_uint32.h2
-rw-r--r--src/ext/ed25519/ref10/crypto_uint64.h2
-rw-r--r--src/ext/ed25519/ref10/crypto_verify_32.h3
-rw-r--r--src/ext/ed25519/ref10/ed25519_ref10.h2
-rw-r--r--src/ext/ed25519/ref10/keypair.c5
-rw-r--r--src/ext/ed25519/ref10/randombytes.h2
-rw-r--r--src/ext/keccak-tiny/keccak-tiny-unrolled.c2
-rw-r--r--src/ext/keccak-tiny/keccak-tiny.h2
-rw-r--r--src/ext/mulodi/mulodi4.c2
-rw-r--r--src/or/addressmap.c24
-rw-r--r--src/or/addressmap.h2
-rw-r--r--src/or/authority_cert_st.h2
-rw-r--r--src/or/bridges.c36
-rw-r--r--src/or/channel.c48
-rw-r--r--src/or/channel.h8
-rw-r--r--src/or/channelpadding.c34
-rw-r--r--src/or/channelpadding.h2
-rw-r--r--src/or/channeltls.c60
-rw-r--r--src/or/channeltls.h4
-rw-r--r--src/or/circpathbias.c38
-rw-r--r--src/or/circuit_st.h4
-rw-r--r--src/or/circuitbuild.c94
-rw-r--r--src/or/circuitlist.c90
-rw-r--r--src/or/circuitlist.h4
-rw-r--r--src/or/circuitmux.c18
-rw-r--r--src/or/circuitmux.h4
-rw-r--r--src/or/circuitmux_ewma.c10
-rw-r--r--src/or/circuitmux_ewma.h4
-rw-r--r--src/or/circuitstats.c36
-rw-r--r--src/or/circuituse.c74
-rw-r--r--src/or/command.c48
-rw-r--r--src/or/command.h2
-rw-r--r--src/or/config.c104
-rw-r--r--src/or/config.h2
-rw-r--r--src/or/confparse.c6
-rw-r--r--src/or/connection.c100
-rw-r--r--src/or/connection.h2
-rw-r--r--src/or/connection_edge.c102
-rw-r--r--src/or/connection_edge.h2
-rw-r--r--src/or/connection_or.c84
-rw-r--r--src/or/conscache.c10
-rw-r--r--src/or/conscache.h2
-rw-r--r--src/or/consdiff.c8
-rw-r--r--src/or/consdiff.h2
-rw-r--r--src/or/consdiffmgr.c24
-rw-r--r--src/or/control.c130
-rw-r--r--src/or/control_connection_st.h4
-rw-r--r--src/or/cpuworker.c32
-rw-r--r--src/or/crypt_path_st.h2
-rw-r--r--src/or/dir_connection_st.h2
-rw-r--r--src/or/dir_server_st.h6
-rw-r--r--src/or/dirauth/dircollate.c8
-rw-r--r--src/or/dirauth/dircollate.h4
-rw-r--r--src/or/dirauth/dirvote.c76
-rw-r--r--src/or/dirauth/mode.h2
-rw-r--r--src/or/dirauth/shared_random.c40
-rw-r--r--src/or/dirauth/shared_random.h2
-rw-r--r--src/or/dirauth/shared_random_state.c22
-rw-r--r--src/or/dirauth/shared_random_state.h2
-rw-r--r--src/or/directory.c102
-rw-r--r--src/or/directory.h2
-rw-r--r--src/or/dirserv.c82
-rw-r--r--src/or/dirserv.h2
-rw-r--r--src/or/dns.c32
-rw-r--r--src/or/dns.h2
-rw-r--r--src/or/dnsserv.c26
-rw-r--r--src/or/dos.c30
-rw-r--r--src/or/edge_connection_st.h4
-rw-r--r--src/or/entry_connection_st.h2
-rw-r--r--src/or/entry_port_cfg_st.h4
-rw-r--r--src/or/entrynodes.c58
-rw-r--r--src/or/entrynodes.h2
-rw-r--r--src/or/ext_orport.c26
-rw-r--r--src/or/extrainfo_st.h2
-rw-r--r--src/or/fp_pair.c4
-rw-r--r--src/or/geoip.c16
-rw-r--r--src/or/geoip.h4
-rw-r--r--src/or/git_revision.c2
-rw-r--r--src/or/hibernate.c30
-rw-r--r--src/or/hibernate.h2
-rw-r--r--src/or/hs_cache.c26
-rw-r--r--src/or/hs_cache.h10
-rw-r--r--src/or/hs_cell.c28
-rw-r--r--src/or/hs_cell.h4
-rw-r--r--src/or/hs_circuit.c56
-rw-r--r--src/or/hs_circuit.h6
-rw-r--r--src/or/hs_circuitmap.c12
-rw-r--r--src/or/hs_client.c64
-rw-r--r--src/or/hs_client.h6
-rw-r--r--src/or/hs_common.c56
-rw-r--r--src/or/hs_common.h4
-rw-r--r--src/or/hs_config.c8
-rw-r--r--src/or/hs_config.h2
-rw-r--r--src/or/hs_control.c22
-rw-r--r--src/or/hs_control.h2
-rw-r--r--src/or/hs_descriptor.c26
-rw-r--r--src/or/hs_descriptor.h14
-rw-r--r--src/or/hs_ident.c4
-rw-r--r--src/or/hs_ident.h4
-rw-r--r--src/or/hs_intropoint.c32
-rw-r--r--src/or/hs_intropoint.h8
-rw-r--r--src/or/hs_ntor.c6
-rw-r--r--src/or/hs_ntor.h2
-rw-r--r--src/or/hs_service.c82
-rw-r--r--src/or/hs_service.h16
-rw-r--r--src/or/hs_stats.c6
-rw-r--r--src/or/keypin.c18
-rw-r--r--src/or/keypin.h2
-rw-r--r--src/or/listener_connection_st.h2
-rw-r--r--src/or/main.c152
-rw-r--r--src/or/main.h2
-rw-r--r--src/or/microdesc.c36
-rw-r--r--src/or/networkstatus.c98
-rw-r--r--src/or/networkstatus.h2
-rw-r--r--src/or/networkstatus_st.h2
-rw-r--r--src/or/node_st.h2
-rw-r--r--src/or/nodelist.c62
-rw-r--r--src/or/ntmain.c8
-rw-r--r--src/or/onion.c38
-rw-r--r--src/or/onion_fast.c8
-rw-r--r--src/or/onion_ntor.c14
-rw-r--r--src/or/onion_ntor.h6
-rw-r--r--src/or/onion_tap.c12
-rw-r--r--src/or/or.h38
-rw-r--r--src/or/or_circuit_st.h6
-rw-r--r--src/or/or_connection_st.h2
-rw-r--r--src/or/origin_circuit_st.h4
-rw-r--r--src/or/parsecommon.c6
-rw-r--r--src/or/parsecommon.h6
-rw-r--r--src/or/periodic.c10
-rw-r--r--src/or/policies.c34
-rw-r--r--src/or/port_cfg_st.h4
-rw-r--r--src/or/proto_cell.c10
-rw-r--r--src/or/proto_control0.c6
-rw-r--r--src/or/proto_ext_or.c8
-rw-r--r--src/or/proto_http.c6
-rw-r--r--src/or/proto_socks.c22
-rw-r--r--src/or/protover.c6
-rw-r--r--src/or/protover.h2
-rw-r--r--src/or/protover_rust.c4
-rw-r--r--src/or/reasons.c6
-rw-r--r--src/or/relay.c94
-rw-r--r--src/or/relay_crypto.c22
-rw-r--r--src/or/rendcache.c18
-rw-r--r--src/or/rendcache.h4
-rw-r--r--src/or/rendclient.c70
-rw-r--r--src/or/rendclient.h2
-rw-r--r--src/or/rendcommon.c60
-rw-r--r--src/or/rendmid.c28
-rw-r--r--src/or/rendservice.c78
-rw-r--r--src/or/rendservice.h4
-rw-r--r--src/or/rephist.c30
-rw-r--r--src/or/replaycache.c4
-rw-r--r--src/or/router.c86
-rw-r--r--src/or/router.h2
-rw-r--r--src/or/routerinfo_st.h2
-rw-r--r--src/or/routerkeys.c14
-rw-r--r--src/or/routerkeys.h2
-rw-r--r--src/or/routerlist.c90
-rw-r--r--src/or/routerlist.h2
-rw-r--r--src/or/routerlist_st.h2
-rw-r--r--src/or/routerparse.c84
-rw-r--r--src/or/routerset.c26
-rw-r--r--src/or/routerstatus_st.h2
-rw-r--r--src/or/scheduler.c16
-rw-r--r--src/or/scheduler.h6
-rw-r--r--src/or/scheduler_kist.c18
-rw-r--r--src/or/scheduler_vanilla.c8
-rw-r--r--src/or/shared_random_client.c14
-rw-r--r--src/or/shared_random_client.h2
-rw-r--r--src/or/signed_descriptor_st.h2
-rw-r--r--src/or/statefile.c26
-rw-r--r--src/or/status.c36
-rw-r--r--src/or/status.h2
-rw-r--r--src/or/tor_api.c4
-rw-r--r--src/or/torcert.c22
-rw-r--r--src/or/torcert.h2
-rw-r--r--src/or/transports.c22
-rw-r--r--src/or/vote_routerstatus_st.h2
-rw-r--r--src/or/voting_schedule.c10
-rw-r--r--src/or/voting_schedule.h2
-rw-r--r--src/test/bench.c22
-rw-r--r--src/test/fuzz/fuzz_consensus.c8
-rw-r--r--src/test/fuzz/fuzz_descriptor.c10
-rw-r--r--src/test/fuzz/fuzz_diff.c6
-rw-r--r--src/test/fuzz/fuzz_diff_apply.c6
-rw-r--r--src/test/fuzz/fuzz_extrainfo.c10
-rw-r--r--src/test/fuzz/fuzz_hsdescv2.c8
-rw-r--r--src/test/fuzz/fuzz_hsdescv3.c14
-rw-r--r--src/test/fuzz/fuzz_http.c18
-rw-r--r--src/test/fuzz/fuzz_http_connect.c26
-rw-r--r--src/test/fuzz/fuzz_iptsv2.c10
-rw-r--r--src/test/fuzz/fuzz_microdesc.c8
-rw-r--r--src/test/fuzz/fuzz_vrs.c16
-rw-r--r--src/test/fuzz/fuzzing_common.c12
-rw-r--r--src/test/hs_test_helpers.c12
-rw-r--r--src/test/hs_test_helpers.h4
-rw-r--r--src/test/log_test_helpers.c4
-rw-r--r--src/test/log_test_helpers.h2
-rw-r--r--src/test/rend_test_helpers.c16
-rw-r--r--src/test/rend_test_helpers.h2
-rw-r--r--src/test/test-memwipe.c6
-rw-r--r--src/test/test-timers.c10
-rw-r--r--src/test/test.c58
-rw-r--r--src/test/test.h2
-rw-r--r--src/test/test_accounting.c10
-rw-r--r--src/test/test_addr.c10
-rw-r--r--src/test/test_address.c8
-rw-r--r--src/test/test_address_set.c30
-rw-r--r--src/test/test_bridges.c16
-rw-r--r--src/test/test_bt_cl.c8
-rw-r--r--src/test/test_buffers.c14
-rw-r--r--src/test/test_bwmgt.c6
-rw-r--r--src/test/test_cell_formats.c34
-rw-r--r--src/test/test_cell_queue.c18
-rw-r--r--src/test/test_channel.c36
-rw-r--r--src/test/test_channelpadding.c38
-rw-r--r--src/test/test_channeltls.c24
-rw-r--r--src/test/test_checkdir.c8
-rw-r--r--src/test/test_circuitbuild.c16
-rw-r--r--src/test/test_circuitlist.c22
-rw-r--r--src/test/test_circuitmux.c18
-rw-r--r--src/test/test_circuitstats.c30
-rw-r--r--src/test/test_circuituse.c22
-rw-r--r--src/test/test_compat_libevent.c8
-rw-r--r--src/test/test_config.c78
-rw-r--r--src/test/test_connection.c46
-rw-r--r--src/test/test_conscache.c8
-rw-r--r--src/test/test_consdiff.c10
-rw-r--r--src/test/test_consdiffmgr.c30
-rw-r--r--src/test/test_containers.c8
-rw-r--r--src/test/test_controller.c32
-rw-r--r--src/test/test_controller_events.c18
-rw-r--r--src/test/test_crypto.c14
-rw-r--r--src/test/test_crypto_openssl.c12
-rw-r--r--src/test/test_crypto_slow.c10
-rw-r--r--src/test/test_data.c2
-rw-r--r--src/test/test_dir.c80
-rw-r--r--src/test/test_dir_common.c28
-rw-r--r--src/test/test_dir_common.h6
-rw-r--r--src/test/test_dir_handle_get.c62
-rw-r--r--src/test/test_dns.c14
-rw-r--r--src/test/test_dos.c34
-rw-r--r--src/test/test_entryconn.c24
-rw-r--r--src/test/test_entrynodes.c64
-rw-r--r--src/test/test_extorport.c26
-rw-r--r--src/test/test_geoip.c8
-rw-r--r--src/test/test_guardfraction.c32
-rw-r--r--src/test/test_handles.c6
-rw-r--r--src/test/test_helpers.c44
-rw-r--r--src/test/test_helpers.h2
-rw-r--r--src/test/test_hs.c32
-rw-r--r--src/test/test_hs_cache.c28
-rw-r--r--src/test/test_hs_cell.c18
-rw-r--r--src/test/test_hs_client.c62
-rw-r--r--src/test/test_hs_common.c54
-rw-r--r--src/test/test_hs_config.c18
-rw-r--r--src/test/test_hs_control.c24
-rw-r--r--src/test/test_hs_descriptor.c24
-rw-r--r--src/test/test_hs_intropoint.c34
-rw-r--r--src/test/test_hs_ntor.c8
-rw-r--r--src/test/test_hs_ntor_cl.c14
-rw-r--r--src/test/test_hs_service.c76
-rw-r--r--src/test/test_introduce.c8
-rw-r--r--src/test/test_keypin.c8
-rw-r--r--src/test/test_link_handshake.c40
-rw-r--r--src/test/test_logging.c6
-rw-r--r--src/test/test_mainloop.c8
-rw-r--r--src/test/test_microdesc.c30
-rw-r--r--src/test/test_nodelist.c26
-rw-r--r--src/test/test_ntor_cl.c12
-rw-r--r--src/test/test_oom.c30
-rw-r--r--src/test/test_oos.c18
-rw-r--r--src/test/test_options.c26
-rw-r--r--src/test/test_periodic_event.c18
-rw-r--r--src/test/test_policy.c20
-rw-r--r--src/test/test_procmon.c8
-rw-r--r--src/test/test_proto_http.c10
-rw-r--r--src/test/test_proto_misc.c18
-rw-r--r--src/test/test_protover.c8
-rw-r--r--src/test/test_pt.c18
-rw-r--r--src/test/test_pubsub.c6
-rw-r--r--src/test/test_relay.c16
-rw-r--r--src/test/test_relaycell.c32
-rw-r--r--src/test/test_relaycrypt.c20
-rw-r--r--src/test/test_rendcache.c32
-rw-r--r--src/test/test_replay.c6
-rw-r--r--src/test/test_router.c16
-rw-r--r--src/test/test_routerkeys.c16
-rw-r--r--src/test/test_routerlist.c60
-rw-r--r--src/test/test_routerset.c26
-rw-r--r--src/test/test_scheduler.c20
-rw-r--r--src/test/test_shared_random.c36
-rw-r--r--src/test/test_slow.c4
-rw-r--r--src/test/test_socks.c14
-rw-r--r--src/test/test_status.c34
-rw-r--r--src/test/test_storagedir.c8
-rw-r--r--src/test/test_switch_id.c2
-rw-r--r--src/test/test_threads.c6
-rw-r--r--src/test/test_tortls.c14
-rw-r--r--src/test/test_util.c20
-rw-r--r--src/test/test_util_format.c8
-rw-r--r--src/test/test_util_process.c8
-rw-r--r--src/test/test_util_slow.c10
-rw-r--r--src/test/test_voting_schedule.c6
-rw-r--r--src/test/test_workqueue.c14
-rw-r--r--src/test/testing_common.c20
-rw-r--r--src/test/testing_rsakeys.c6
-rw-r--r--src/tools/tor-gencert.c18
-rw-r--r--src/tools/tor-resolve.c10
-rw-r--r--src/tools/tor_runner.c4
-rw-r--r--src/trace/debug.h2
-rw-r--r--src/trace/trace.c2
-rw-r--r--src/trunnel/trunnel-local.h6
410 files changed, 3624 insertions, 3625 deletions
diff --git a/Makefile.am b/Makefile.am
index cc89c72640..3c10c7f952 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,8 @@ bin_SCRIPTS=
AM_CPPFLAGS=\
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/ext \
- -I$(top_srcdir)/src/ext/trunnel
+ -I$(top_srcdir)/src/ext/trunnel \
+ -I$(top_srcdir)/src/trunnel
AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLAGS@
SHELL=@SHELL@
diff --git a/scripts/maint/rectify_include_paths.py b/scripts/maint/rectify_include_paths.py
index dc91634455..401fadae6d 100755
--- a/scripts/maint/rectify_include_paths.py
+++ b/scripts/maint/rectify_include_paths.py
@@ -46,7 +46,7 @@ def fix_includes(inp, out, mapping):
incs = get_include_map()
for dirpath,dirnames,fnames in os.walk("src"):
- exclude(["ext", "trunnel"], dirnames)
+ exclude(["trunnel"], dirnames)
for fname in fnames:
if fname.endswith(".c") or fname.endswith(".h"):
diff --git a/src/common/address.c b/src/common/address.c
index 0ccf73d48e..2e8b5fc9f5 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -35,13 +35,13 @@
#include <iphlpapi.h>
#endif /* defined(_WIN32) */
-#include "compat.h"
-#include "util.h"
-#include "util_format.h"
-#include "address.h"
-#include "torlog.h"
-#include "container.h"
-#include "sandbox.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/util_format.h"
+#include "common/address.h"
+#include "common/torlog.h"
+#include "common/container.h"
+#include "common/sandbox.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
diff --git a/src/common/address.h b/src/common/address.h
index 8e9e251753..2c9c620c2a 100644
--- a/src/common/address.h
+++ b/src/common/address.h
@@ -13,9 +13,9 @@
//#include <sys/sockio.h>
#include "orconfig.h"
-#include "torint.h"
-#include "compat.h"
-#include "container.h"
+#include "common/torint.h"
+#include "common/compat.h"
+#include "common/container.h"
#ifdef ADDRESS_PRIVATE
diff --git a/src/common/address_set.c b/src/common/address_set.c
index 16ae394035..763db64280 100644
--- a/src/common/address_set.c
+++ b/src/common/address_set.c
@@ -11,12 +11,12 @@
**/
#include "orconfig.h"
-#include "address_set.h"
-#include "address.h"
-#include "compat.h"
-#include "container.h"
-#include "crypto_rand.h"
-#include "util.h"
+#include "common/address_set.h"
+#include "common/address.h"
+#include "common/compat.h"
+#include "common/container.h"
+#include "common/crypto_rand.h"
+#include "common/util.h"
#include "siphash.h"
/** How many 64-bit siphash values to extract per address */
diff --git a/src/common/address_set.h b/src/common/address_set.h
index dc16cfe5f0..f4986c9b02 100644
--- a/src/common/address_set.h
+++ b/src/common/address_set.h
@@ -14,7 +14,7 @@
#define TOR_ADDRESS_SET_H
#include "orconfig.h"
-#include "torint.h"
+#include "common/torint.h"
/**
* An address_set_t represents a set of tor_addr_t values. The implementation
diff --git a/src/common/aes.c b/src/common/aes.c
index 5217ad250f..c0851c5421 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -16,9 +16,9 @@
#include <ws2tcpip.h>
#endif
-#include "compat_openssl.h"
+#include "common/compat_openssl.h"
#include <openssl/opensslv.h>
-#include "crypto_openssl_mgt.h"
+#include "common/crypto_openssl_mgt.h"
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0)
#error "We require OpenSSL >= 1.0.0"
@@ -36,11 +36,11 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "compat.h"
-#include "aes.h"
-#include "util.h"
-#include "torlog.h"
-#include "di_ops.h"
+#include "common/compat.h"
+#include "common/aes.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/di_ops.h"
#ifdef ANDROID
/* Android's OpenSSL seems to have removed all of its Engine support. */
diff --git a/src/common/backtrace.c b/src/common/backtrace.c
index e33c02ea4e..c3c0b77ab2 100644
--- a/src/common/backtrace.c
+++ b/src/common/backtrace.c
@@ -14,9 +14,9 @@
*/
#include "orconfig.h"
-#include "compat.h"
-#include "util.h"
-#include "torlog.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/torlog.h"
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
@@ -40,7 +40,7 @@
#endif /* defined(HAVE_CYGWIN_SIGNAL_H) || ... */
#define EXPOSE_CLEAN_BACKTRACE
-#include "backtrace.h"
+#include "common/backtrace.h"
#if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \
defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)
diff --git a/src/common/buffers.c b/src/common/buffers.c
index d21a0db75d..997bbdcccb 100644
--- a/src/common/buffers.c
+++ b/src/common/buffers.c
@@ -21,12 +21,12 @@
#define BUFFERS_PRIVATE
#include "orconfig.h"
#include <stddef.h>
-#include "buffers.h"
-#include "compat.h"
-#include "compress.h"
-#include "util.h"
-#include "torint.h"
-#include "torlog.h"
+#include "common/buffers.h"
+#include "common/compat.h"
+#include "common/compress.h"
+#include "common/util.h"
+#include "common/torint.h"
+#include "common/torlog.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/common/buffers.h b/src/common/buffers.h
index f78f7b2895..5cd9d3ec67 100644
--- a/src/common/buffers.h
+++ b/src/common/buffers.h
@@ -12,9 +12,9 @@
#ifndef TOR_BUFFERS_H
#define TOR_BUFFERS_H
-#include "compat.h"
-#include "torint.h"
-#include "testsupport.h"
+#include "common/compat.h"
+#include "common/torint.h"
+#include "common/testsupport.h"
typedef struct buf_t buf_t;
diff --git a/src/common/buffers_tls.c b/src/common/buffers_tls.c
index c947b79ee8..dfc8e44b98 100644
--- a/src/common/buffers_tls.c
+++ b/src/common/buffers_tls.c
@@ -7,14 +7,14 @@
#define BUFFERS_PRIVATE
#include "orconfig.h"
#include <stddef.h>
-#include "buffers.h"
-#include "buffers_tls.h"
-#include "compat.h"
-#include "compress.h"
-#include "util.h"
-#include "torint.h"
-#include "torlog.h"
-#include "tortls.h"
+#include "common/buffers.h"
+#include "common/buffers_tls.h"
+#include "common/compat.h"
+#include "common/compress.h"
+#include "common/util.h"
+#include "common/torint.h"
+#include "common/torlog.h"
+#include "common/tortls.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/common/compat.c b/src/common/compat.c
index 9f412e8fa6..9b1a4d860f 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -13,7 +13,7 @@
**/
#define COMPAT_PRIVATE
-#include "compat.h"
+#include "common/compat.h"
#ifdef _WIN32
#include <winsock2.h>
@@ -125,11 +125,11 @@ SecureZeroMemory(PVOID ptr, SIZE_T cnt)
#include <sys/file.h>
#endif
-#include "torlog.h"
-#include "util.h"
-#include "container.h"
-#include "address.h"
-#include "sandbox.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/container.h"
+#include "common/address.h"
+#include "common/sandbox.h"
/* Inline the strl functions if the platform doesn't have them. */
#ifndef HAVE_STRLCPY
diff --git a/src/common/compat.h b/src/common/compat.h
index fc0ce052c4..3b451dd10b 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -14,8 +14,8 @@
#define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747b
#endif
#endif
-#include "torint.h"
-#include "testsupport.h"
+#include "common/torint.h"
+#include "common/testsupport.h"
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -45,7 +45,7 @@
#include <netinet6/in6.h>
#endif
-#include "compat_time.h"
+#include "common/compat_time.h"
#if defined(__has_feature)
# if __has_feature(address_sanitizer)
@@ -751,7 +751,7 @@ STATIC int tor_ersatz_socketpair(int family, int type, int protocol,
ssize_t tor_getpass(const char *prompt, char *output, size_t buflen);
/* This needs some of the declarations above so we include it here. */
-#include "compat_threads.h"
+#include "common/compat_threads.h"
#endif /* !defined(TOR_COMPAT_H) */
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 4262f58e87..c99de1ac34 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -7,14 +7,14 @@
*/
#include "orconfig.h"
-#include "compat.h"
+#include "common/compat.h"
#define COMPAT_LIBEVENT_PRIVATE
-#include "compat_libevent.h"
+#include "common/compat_libevent.h"
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
-#include "util.h"
-#include "torlog.h"
+#include "common/util.h"
+#include "common/torlog.h"
#include <event2/event.h>
#include <event2/thread.h>
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index b28acda3b6..76a074d93a 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -5,7 +5,7 @@
#define TOR_COMPAT_LIBEVENT_H
#include "orconfig.h"
-#include "testsupport.h"
+#include "common/testsupport.h"
void configure_libevent_logging(void);
void suppress_libevent_log_msg(const char *msg);
diff --git a/src/common/compat_openssl.h b/src/common/compat_openssl.h
index c7f51173bf..a94b264927 100644
--- a/src/common/compat_openssl.h
+++ b/src/common/compat_openssl.h
@@ -8,7 +8,7 @@
#define TOR_COMPAT_OPENSSL_H
#include <openssl/opensslv.h>
-#include "crypto_openssl_mgt.h"
+#include "common/crypto_openssl_mgt.h"
/**
* \file compat_openssl.h
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index 2e7d3d54c9..6d5f846778 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -15,9 +15,9 @@
#include <signal.h>
#include <time.h>
-#include "compat.h"
-#include "torlog.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/torlog.h"
+#include "common/util.h"
/** Wraps a void (*)(void*) function and its argument so we can
* invoke them in a way pthreads would expect.
diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c
index 6d33d3e244..250ac48c0f 100644
--- a/src/common/compat_threads.c
+++ b/src/common/compat_threads.c
@@ -13,11 +13,11 @@
#include "orconfig.h"
#include <stdlib.h>
-#include "compat.h"
-#include "compat_threads.h"
+#include "common/compat.h"
+#include "common/compat_threads.h"
-#include "util.h"
-#include "torlog.h"
+#include "common/util.h"
+#include "common/torlog.h"
#ifdef HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
diff --git a/src/common/compat_threads.h b/src/common/compat_threads.h
index 2d70cf7a3a..5d3883043d 100644
--- a/src/common/compat_threads.h
+++ b/src/common/compat_threads.h
@@ -7,8 +7,8 @@
#define TOR_COMPAT_THREADS_H
#include "orconfig.h"
-#include "torint.h"
-#include "testsupport.h"
+#include "common/torint.h"
+#include "common/testsupport.h"
#if defined(HAVE_PTHREAD_H) && !defined(_WIN32)
#include <pthread.h>
diff --git a/src/common/compat_time.c b/src/common/compat_time.c
index ef72003de1..ed0a1550fa 100644
--- a/src/common/compat_time.c
+++ b/src/common/compat_time.c
@@ -10,7 +10,7 @@
**/
#define COMPAT_TIME_PRIVATE
-#include "compat.h"
+#include "common/compat.h"
#ifdef _WIN32
#include <winsock2.h>
@@ -34,9 +34,9 @@
#include <mach/mach_time.h>
#endif
-#include "torlog.h"
-#include "util.h"
-#include "container.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/container.h"
#ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_FTIME
diff --git a/src/common/compat_winthreads.c b/src/common/compat_winthreads.c
index 6908f0ddfe..9d07e1798f 100644
--- a/src/common/compat_winthreads.c
+++ b/src/common/compat_winthreads.c
@@ -12,12 +12,12 @@
#ifdef _WIN32
-#include "compat.h"
+#include "common/compat.h"
#include <windows.h>
#include <process.h>
-#include "util.h"
-#include "container.h"
-#include "torlog.h"
+#include "common/util.h"
+#include "common/container.h"
+#include "common/torlog.h"
/* This value is more or less total cargo-cult */
#define SPIN_COUNT 2000
diff --git a/src/common/compress.c b/src/common/compress.c
index 8164448253..204529a54d 100644
--- a/src/common/compress.c
+++ b/src/common/compress.c
@@ -14,19 +14,19 @@
#include <stdio.h>
#include <assert.h>
#include <string.h>
-#include "torint.h"
+#include "common/torint.h"
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#include "util.h"
-#include "torlog.h"
-#include "compress.h"
-#include "compress_lzma.h"
-#include "compress_none.h"
-#include "compress_zlib.h"
-#include "compress_zstd.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/compress.h"
+#include "common/compress_lzma.h"
+#include "common/compress_none.h"
+#include "common/compress_zlib.h"
+#include "common/compress_zstd.h"
/** Total number of bytes allocated for compression state overhead. */
static atomic_counter_t total_compress_allocation;
diff --git a/src/common/compress_lzma.c b/src/common/compress_lzma.c
index e9d0e9e51b..363dc1fb92 100644
--- a/src/common/compress_lzma.c
+++ b/src/common/compress_lzma.c
@@ -13,10 +13,10 @@
#include "orconfig.h"
-#include "util.h"
-#include "torlog.h"
-#include "compress.h"
-#include "compress_lzma.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/compress.h"
+#include "common/compress_lzma.h"
#ifdef HAVE_LZMA
#include <lzma.h>
diff --git a/src/common/compress_none.c b/src/common/compress_none.c
index 5240a686cc..7e67046d34 100644
--- a/src/common/compress_none.c
+++ b/src/common/compress_none.c
@@ -16,10 +16,10 @@
#include "orconfig.h"
-#include "util.h"
-#include "torlog.h"
-#include "compress.h"
-#include "compress_none.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/compress.h"
+#include "common/compress_none.h"
/** Transfer some bytes using the identity transformation. Read up to
* *<b>in_len</b> bytes from *<b>in</b>, and write up to *<b>out_len</b> bytes
diff --git a/src/common/compress_zlib.c b/src/common/compress_zlib.c
index d79cc41ad1..663e27f794 100644
--- a/src/common/compress_zlib.c
+++ b/src/common/compress_zlib.c
@@ -13,10 +13,10 @@
#include "orconfig.h"
-#include "util.h"
-#include "torlog.h"
-#include "compress.h"
-#include "compress_zlib.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/compress.h"
+#include "common/compress_zlib.h"
/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of
saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory
diff --git a/src/common/compress_zstd.c b/src/common/compress_zstd.c
index f1fb18408a..dc0dcdec93 100644
--- a/src/common/compress_zstd.c
+++ b/src/common/compress_zstd.c
@@ -13,10 +13,10 @@
#include "orconfig.h"
-#include "util.h"
-#include "torlog.h"
-#include "compress.h"
-#include "compress_zstd.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/compress.h"
+#include "common/compress_zstd.h"
#ifdef ENABLE_ZSTD_ADVANCED_APIS
/* This is a lie, but we make sure it doesn't get us in trouble by wrapping
diff --git a/src/common/confline.c b/src/common/confline.c
index 3ba2a288f9..2ea2e9c3b8 100644
--- a/src/common/confline.c
+++ b/src/common/confline.c
@@ -4,11 +4,11 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "compat.h"
-#include "confline.h"
-#include "torlog.h"
-#include "util.h"
-#include "container.h"
+#include "common/compat.h"
+#include "common/confline.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/container.h"
static int config_get_lines_aux(const char *string, config_line_t **result,
int extended, int allow_include,
diff --git a/src/common/confline.h b/src/common/confline.h
index 57585792d6..4cc8286fc3 100644
--- a/src/common/confline.h
+++ b/src/common/confline.h
@@ -7,7 +7,7 @@
#ifndef TOR_CONFLINE_H
#define TOR_CONFLINE_H
-#include "container.h"
+#include "common/container.h"
/** Ordinary configuration line. */
#define CONFIG_LINE_NORMAL 0
diff --git a/src/common/container.c b/src/common/container.c
index fa9315eec3..03324c8730 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -11,11 +11,11 @@
* a digest-to-void* map.
**/
-#include "compat.h"
-#include "util.h"
-#include "torlog.h"
-#include "container.h"
-#include "crypto_digest.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/container.h"
+#include "common/crypto_digest.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/common/container.h b/src/common/container.h
index 68c270c43c..372fa6640c 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -6,7 +6,7 @@
#ifndef TOR_CONTAINER_H
#define TOR_CONTAINER_H
-#include "util.h"
+#include "common/util.h"
#include "siphash.h"
/** A resizeable list of pointers, with associated helpful functionality.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index f343285875..14129086eb 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -23,16 +23,16 @@
#endif /* defined(_WIN32) */
#define CRYPTO_PRIVATE
-#include "compat_openssl.h"
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "crypto_digest.h"
-#include "crypto_dh.h"
-#include "crypto_ed25519.h"
-#include "crypto_format.h"
-#include "crypto_rand.h"
-#include "crypto_rsa.h"
-#include "crypto_util.h"
+#include "common/compat_openssl.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_dh.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_format.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_rsa.h"
+#include "common/crypto_util.h"
DISABLE_GCC_WARNING(redundant-decls)
@@ -62,14 +62,14 @@ ENABLE_GCC_WARNING(redundant-decls)
#include <unistd.h>
#endif
-#include "torlog.h"
-#include "torint.h"
-#include "aes.h"
-#include "util.h"
-#include "container.h"
-#include "compat.h"
-#include "sandbox.h"
-#include "util_format.h"
+#include "common/torlog.h"
+#include "common/torint.h"
+#include "common/aes.h"
+#include "common/util.h"
+#include "common/container.h"
+#include "common/compat.h"
+#include "common/sandbox.h"
+#include "common/util_format.h"
#include "keccak-tiny/keccak-tiny.h"
diff --git a/src/common/crypto.h b/src/common/crypto.h
index 7ff11f394c..1a88a3d2f6 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -16,10 +16,10 @@
#include "orconfig.h"
#include <stdio.h>
-#include "torint.h"
-#include "compat.h"
-#include "util.h"
-#include "crypto_rsa.h"
+#include "common/torint.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/crypto_rsa.h"
/** Length of our symmetric cipher's keys of 128-bit. */
#define CIPHER_KEY_LEN 16
diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c
index d4d9609f62..f28cebb887 100644
--- a/src/common/crypto_curve25519.c
+++ b/src/common/crypto_curve25519.c
@@ -20,14 +20,14 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#include "container.h"
-#include "crypto_curve25519.h"
-#include "crypto_digest.h"
-#include "crypto_format.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "util.h"
-#include "torlog.h"
+#include "common/container.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_format.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "common/util.h"
+#include "common/torlog.h"
#include "ed25519/donna/ed25519_donna_tor.h"
diff --git a/src/common/crypto_curve25519.h b/src/common/crypto_curve25519.h
index 462ec85f9d..96d2e0e072 100644
--- a/src/common/crypto_curve25519.h
+++ b/src/common/crypto_curve25519.h
@@ -4,10 +4,10 @@
#ifndef TOR_CRYPTO_CURVE25519_H
#define TOR_CRYPTO_CURVE25519_H
-#include "testsupport.h"
-#include "torint.h"
-#include "crypto_digest.h"
-#include "crypto_openssl_mgt.h"
+#include "common/testsupport.h"
+#include "common/torint.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_openssl_mgt.h"
/** Length of a curve25519 public key when encoded. */
#define CURVE25519_PUBKEY_LEN 32
diff --git a/src/common/crypto_dh.c b/src/common/crypto_dh.c
index 0dcdfa205b..4c6b03cee8 100644
--- a/src/common/crypto_dh.c
+++ b/src/common/crypto_dh.c
@@ -9,11 +9,11 @@
* \brief Block of functions related with DH utilities and operations.
**/
-#include "compat_openssl.h"
-#include "crypto_dh.h"
-#include "crypto_digest.h"
-#include "crypto_hkdf.h"
-#include "crypto_util.h"
+#include "common/compat_openssl.h"
+#include "common/crypto_dh.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_hkdf.h"
+#include "common/crypto_util.h"
DISABLE_GCC_WARNING(redundant-decls)
@@ -21,7 +21,7 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "torlog.h"
+#include "common/torlog.h"
/** A structure to hold the first half (x, g^x) of a Diffie-Hellman handshake
* while we're waiting for the second.*/
diff --git a/src/common/crypto_dh.h b/src/common/crypto_dh.h
index 540ec6ce12..1e77acc011 100644
--- a/src/common/crypto_dh.h
+++ b/src/common/crypto_dh.h
@@ -13,7 +13,7 @@
#ifndef TOR_CRYPTO_DH_H
#define TOR_CRYPTO_DH_H
-#include "util.h"
+#include "common/util.h"
/** Length of our DH keys. */
#define DH_BYTES (1024/8)
diff --git a/src/common/crypto_digest.c b/src/common/crypto_digest.c
index 41f3691a3d..708fbf9be6 100644
--- a/src/common/crypto_digest.c
+++ b/src/common/crypto_digest.c
@@ -10,11 +10,11 @@
* operations.
**/
-#include "container.h"
-#include "crypto_digest.h"
-#include "crypto_openssl_mgt.h"
-#include "crypto_util.h"
-#include "torlog.h"
+#include "common/container.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_openssl_mgt.h"
+#include "common/crypto_util.h"
+#include "common/torlog.h"
#include "keccak-tiny/keccak-tiny.h"
diff --git a/src/common/crypto_digest.h b/src/common/crypto_digest.h
index 631e6e589a..25ca5ceda7 100644
--- a/src/common/crypto_digest.h
+++ b/src/common/crypto_digest.h
@@ -15,8 +15,8 @@
#include <stdio.h>
-#include "container.h"
-#include "torint.h"
+#include "common/container.h"
+#include "common/torint.h"
/** Length of the output of our message digest. */
#define DIGEST_LEN 20
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c
index 9859d5f347..b0b954796c 100644
--- a/src/common/crypto_ed25519.c
+++ b/src/common/crypto_ed25519.c
@@ -21,15 +21,15 @@
#include <sys/stat.h>
#endif
-#include "crypto_curve25519.h"
-#include "crypto_digest.h"
-#include "crypto_ed25519.h"
-#include "crypto_format.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "torlog.h"
-#include "util.h"
-#include "util_format.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_format.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/util_format.h"
#include "ed25519/ref10/ed25519_ref10.h"
#include "ed25519/donna/ed25519_donna_tor.h"
diff --git a/src/common/crypto_ed25519.h b/src/common/crypto_ed25519.h
index 7573044b87..20c04226e3 100644
--- a/src/common/crypto_ed25519.h
+++ b/src/common/crypto_ed25519.h
@@ -4,10 +4,10 @@
#ifndef TOR_CRYPTO_ED25519_H
#define TOR_CRYPTO_ED25519_H
-#include "testsupport.h"
-#include "torint.h"
-#include "crypto_curve25519.h"
-#include "util.h"
+#include "common/testsupport.h"
+#include "common/torint.h"
+#include "common/crypto_curve25519.h"
+#include "common/util.h"
#define ED25519_PUBKEY_LEN 32
#define ED25519_SECKEY_LEN 64
diff --git a/src/common/crypto_format.c b/src/common/crypto_format.c
index eb7f81d177..6245b70ccb 100644
--- a/src/common/crypto_format.c
+++ b/src/common/crypto_format.c
@@ -14,15 +14,15 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#include "container.h"
-#include "crypto_curve25519.h"
-#include "crypto_digest.h"
-#include "crypto_ed25519.h"
-#include "crypto_format.h"
-#include "crypto_util.h"
-#include "util.h"
-#include "util_format.h"
-#include "torlog.h"
+#include "common/container.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_format.h"
+#include "common/crypto_util.h"
+#include "common/util.h"
+#include "common/util_format.h"
+#include "common/torlog.h"
/** Write the <b>datalen</b> bytes from <b>data</b> to the file named
* <b>fname</b> in the tagged-data format. This format contains a
diff --git a/src/common/crypto_format.h b/src/common/crypto_format.h
index 4df89c05bc..325b1ef44d 100644
--- a/src/common/crypto_format.h
+++ b/src/common/crypto_format.h
@@ -7,9 +7,9 @@
#ifndef TOR_CRYPTO_FORMAT_H
#define TOR_CRYPTO_FORMAT_H
-#include "testsupport.h"
-#include "torint.h"
-#include "crypto_ed25519.h"
+#include "common/testsupport.h"
+#include "common/torint.h"
+#include "common/crypto_ed25519.h"
int crypto_write_tagged_contents_to_file(const char *fname,
const char *typestring,
diff --git a/src/common/crypto_hkdf.c b/src/common/crypto_hkdf.c
index acadf8ab2a..46c30bc72b 100644
--- a/src/common/crypto_hkdf.c
+++ b/src/common/crypto_hkdf.c
@@ -9,9 +9,9 @@
* \brief Block of functions related with HKDF utilities and operations.
**/
-#include "crypto_hkdf.h"
-#include "crypto_util.h"
-#include "crypto_digest.h"
+#include "common/crypto_hkdf.h"
+#include "common/crypto_util.h"
+#include "common/crypto_digest.h"
/** Given <b>key_in_len</b> bytes of negotiated randomness in <b>key_in</b>
* ("K"), expand it into <b>key_out_len</b> bytes of negotiated key material in
diff --git a/src/common/crypto_hkdf.h b/src/common/crypto_hkdf.h
index af697b2341..784f4bbbe4 100644
--- a/src/common/crypto_hkdf.h
+++ b/src/common/crypto_hkdf.h
@@ -13,7 +13,7 @@
#ifndef TOR_CRYPTO_HKDF_H
#define TOR_CRYPTO_HKDF_H
-#include "util.h"
+#include "common/util.h"
int crypto_expand_key_material_TAP(const uint8_t *key_in,
size_t key_in_len,
diff --git a/src/common/crypto_openssl_mgt.c b/src/common/crypto_openssl_mgt.c
index e568b7aed6..8acb9cdf1c 100644
--- a/src/common/crypto_openssl_mgt.c
+++ b/src/common/crypto_openssl_mgt.c
@@ -10,8 +10,8 @@
* \brief Block of functions related to operations from OpenSSL.
**/
-#include "compat_openssl.h"
-#include "crypto_openssl_mgt.h"
+#include "common/compat_openssl.h"
+#include "common/crypto_openssl_mgt.h"
DISABLE_GCC_WARNING(redundant-decls)
diff --git a/src/common/crypto_openssl_mgt.h b/src/common/crypto_openssl_mgt.h
index b892dea0e1..e3f5531b7d 100644
--- a/src/common/crypto_openssl_mgt.h
+++ b/src/common/crypto_openssl_mgt.h
@@ -14,7 +14,7 @@
#define TOR_CRYPTO_OPENSSL_H
#include <stdio.h>
-#include "util.h"
+#include "common/util.h"
#include <openssl/engine.h>
diff --git a/src/common/crypto_pwbox.c b/src/common/crypto_pwbox.c
index 14ede1bd61..5ffe138ee2 100644
--- a/src/common/crypto_pwbox.c
+++ b/src/common/crypto_pwbox.c
@@ -8,15 +8,15 @@
* them to disk.
*/
-#include "crypto.h"
-#include "crypto_digest.h"
-#include "crypto_pwbox.h"
-#include "crypto_rand.h"
-#include "crypto_s2k.h"
-#include "crypto_util.h"
-#include "di_ops.h"
-#include "util.h"
-#include "pwbox.h"
+#include "common/crypto.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_pwbox.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_s2k.h"
+#include "common/crypto_util.h"
+#include "common/di_ops.h"
+#include "common/util.h"
+#include "trunnel/pwbox.h"
/* 8 bytes "TORBOX00"
1 byte: header len (H)
diff --git a/src/common/crypto_pwbox.h b/src/common/crypto_pwbox.h
index f368697660..2c73c700eb 100644
--- a/src/common/crypto_pwbox.h
+++ b/src/common/crypto_pwbox.h
@@ -4,7 +4,7 @@
#ifndef CRYPTO_PWBOX_H_INCLUDED_
#define CRYPTO_PWBOX_H_INCLUDED_
-#include "torint.h"
+#include "common/torint.h"
#define UNPWBOX_OKAY 0
#define UNPWBOX_BAD_SECRET -1
diff --git a/src/common/crypto_rand.c b/src/common/crypto_rand.c
index df2e2f65d3..6c88e28d88 100644
--- a/src/common/crypto_rand.c
+++ b/src/common/crypto_rand.c
@@ -14,22 +14,22 @@
#ifndef CRYPTO_RAND_PRIVATE
#define CRYPTO_RAND_PRIVATE
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#ifdef _WIN32
#include <windows.h>
#include <wincrypt.h>
#endif /* defined(_WIN32) */
-#include "container.h"
-#include "compat.h"
-#include "compat_openssl.h"
-#include "crypto_util.h"
-#include "sandbox.h"
-#include "testsupport.h"
-#include "torlog.h"
-#include "util.h"
-#include "util_format.h"
+#include "common/container.h"
+#include "common/compat.h"
+#include "common/compat_openssl.h"
+#include "common/crypto_util.h"
+#include "common/sandbox.h"
+#include "common/testsupport.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/util_format.h"
DISABLE_GCC_WARNING(redundant-decls)
#include <openssl/rand.h>
diff --git a/src/common/crypto_rand.h b/src/common/crypto_rand.h
index bb02e51001..2e05adc93d 100644
--- a/src/common/crypto_rand.h
+++ b/src/common/crypto_rand.h
@@ -13,8 +13,8 @@
#ifndef TOR_CRYPTO_RAND_H
#define TOR_CRYPTO_RAND_H
-#include "torint.h"
-#include "util.h"
+#include "common/torint.h"
+#include "common/util.h"
/* random numbers */
int crypto_seed_rng(void) ATTR_WUR;
diff --git a/src/common/crypto_rsa.c b/src/common/crypto_rsa.c
index f365c3193f..3128983435 100644
--- a/src/common/crypto_rsa.c
+++ b/src/common/crypto_rsa.c
@@ -9,14 +9,14 @@
* \brief Block of functions related with RSA utilities and operations.
**/
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "crypto_digest.h"
-#include "crypto_format.h"
-#include "compat_openssl.h"
-#include "crypto_rand.h"
-#include "crypto_rsa.h"
-#include "crypto_util.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_format.h"
+#include "common/compat_openssl.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_rsa.h"
+#include "common/crypto_util.h"
DISABLE_GCC_WARNING(redundant-decls)
@@ -33,9 +33,9 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "torlog.h"
-#include "util.h"
-#include "util_format.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/util_format.h"
/** Declaration for crypto_pk_t structure. */
struct crypto_pk_t
diff --git a/src/common/crypto_rsa.h b/src/common/crypto_rsa.h
index 3c09d5c626..c56eab319a 100644
--- a/src/common/crypto_rsa.h
+++ b/src/common/crypto_rsa.h
@@ -15,13 +15,13 @@
#include "orconfig.h"
-#include "crypto_digest.h"
+#include "common/crypto_digest.h"
#include <stdio.h>
-#include "torint.h"
-#include "testsupport.h"
-#include "compat.h"
-#include "util.h"
-#include "torlog.h"
+#include "common/torint.h"
+#include "common/testsupport.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/torlog.h"
/** Length of our public keys. */
#define PK_BYTES (1024/8)
diff --git a/src/common/crypto_s2k.c b/src/common/crypto_s2k.c
index 14bd5c28bb..db57691f60 100644
--- a/src/common/crypto_s2k.c
+++ b/src/common/crypto_s2k.c
@@ -12,14 +12,14 @@
#define CRYPTO_S2K_PRIVATE
-#include "compat.h"
-#include "crypto.h"
-#include "crypto_digest.h"
-#include "crypto_hkdf.h"
-#include "crypto_rand.h"
-#include "crypto_s2k.h"
-#include "crypto_util.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/crypto.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_hkdf.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_s2k.h"
+#include "common/crypto_util.h"
+#include "common/util.h"
#include <openssl/evp.h>
diff --git a/src/common/crypto_s2k.h b/src/common/crypto_s2k.h
index 1609a20d2c..bc7224e8ea 100644
--- a/src/common/crypto_s2k.h
+++ b/src/common/crypto_s2k.h
@@ -8,7 +8,7 @@
#define TOR_CRYPTO_S2K_H_INCLUDED
#include <stdio.h>
-#include "torint.h"
+#include "common/torint.h"
/** Length of RFC2440-style S2K specifier: the first 8 bytes are a salt, the
* 9th describes how much iteration to do. */
diff --git a/src/common/crypto_util.c b/src/common/crypto_util.c
index 2933579cf9..71707d4bfb 100644
--- a/src/common/crypto_util.c
+++ b/src/common/crypto_util.c
@@ -13,7 +13,7 @@
#ifndef CRYPTO_UTIL_PRIVATE
#define CRYPTO_UTIL_PRIVATE
-#include "crypto_util.h"
+#include "common/crypto_util.h"
#include <string.h>
@@ -23,7 +23,7 @@
#include <wincrypt.h>
#endif /* defined(_WIN32) */
-#include "util.h"
+#include "common/util.h"
DISABLE_GCC_WARNING(redundant-decls)
@@ -32,7 +32,7 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "torlog.h"
+#include "common/torlog.h"
/**
* Destroy the <b>sz</b> bytes of data stored at <b>mem</b>, setting them to
diff --git a/src/common/crypto_util.h b/src/common/crypto_util.h
index 31af52bffc..53d9027fbc 100644
--- a/src/common/crypto_util.h
+++ b/src/common/crypto_util.h
@@ -13,7 +13,7 @@
#ifndef TOR_CRYPTO_UTIL_H
#define TOR_CRYPTO_UTIL_H
-#include "torint.h"
+#include "common/torint.h"
/** OpenSSL-based utility functions. */
void memwipe(void *mem, uint8_t byte, size_t sz);
diff --git a/src/common/di_ops.c b/src/common/di_ops.c
index c09f97ef6f..1ff1988b10 100644
--- a/src/common/di_ops.c
+++ b/src/common/di_ops.c
@@ -7,9 +7,9 @@
**/
#include "orconfig.h"
-#include "di_ops.h"
-#include "torlog.h"
-#include "util.h"
+#include "common/di_ops.h"
+#include "common/torlog.h"
+#include "common/util.h"
/**
* Timing-safe version of memcmp. As memcmp, compare the <b>sz</b> bytes at
diff --git a/src/common/di_ops.h b/src/common/di_ops.h
index d54a0cc444..8298bfa73a 100644
--- a/src/common/di_ops.h
+++ b/src/common/di_ops.h
@@ -12,7 +12,7 @@
#define TOR_DI_OPS_H
#include "orconfig.h"
-#include "torint.h"
+#include "common/torint.h"
int tor_memcmp(const void *a, const void *b, size_t sz);
int tor_memeq(const void *a, const void *b, size_t sz);
diff --git a/src/common/handles.h b/src/common/handles.h
index 591464366d..ca345b0bcb 100644
--- a/src/common/handles.h
+++ b/src/common/handles.h
@@ -51,7 +51,7 @@
#include "orconfig.h"
#include "tor_queue.h"
-#include "util.h"
+#include "common/util.h"
#define HANDLE_ENTRY(name, structname) \
struct name ## _handle_head_t *handle_head
diff --git a/src/common/log.c b/src/common/log.c
index d7c0a898bb..7ba669818f 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -30,11 +30,11 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#include "compat.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/util.h"
#define LOG_PRIVATE
-#include "torlog.h"
-#include "container.h"
+#include "common/torlog.h"
+#include "common/container.h"
#ifdef HAVE_ANDROID_LOG_H
#include <android/log.h>
#endif // HAVE_ANDROID_LOG_H.
diff --git a/src/common/memarea.c b/src/common/memarea.c
index e0fe471619..12ad9c511c 100644
--- a/src/common/memarea.c
+++ b/src/common/memarea.c
@@ -9,11 +9,11 @@
#include "orconfig.h"
#include <stddef.h>
#include <stdlib.h>
-#include "memarea.h"
-#include "util.h"
-#include "compat.h"
-#include "torlog.h"
-#include "container.h"
+#include "common/memarea.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/torlog.h"
+#include "common/container.h"
#ifndef DISABLE_MEMORY_SENTINELS
diff --git a/src/common/procmon.c b/src/common/procmon.c
index ac286abd11..7703b88afd 100644
--- a/src/common/procmon.c
+++ b/src/common/procmon.c
@@ -6,9 +6,9 @@
* \brief Process-termination monitor functions
**/
-#include "procmon.h"
+#include "common/procmon.h"
-#include "util.h"
+#include "common/util.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>
diff --git a/src/common/procmon.h b/src/common/procmon.h
index 80a2bf9636..46b6435af6 100644
--- a/src/common/procmon.h
+++ b/src/common/procmon.h
@@ -9,10 +9,10 @@
#ifndef TOR_PROCMON_H
#define TOR_PROCMON_H
-#include "compat.h"
-#include "compat_libevent.h"
+#include "common/compat.h"
+#include "common/compat_libevent.h"
-#include "torlog.h"
+#include "common/torlog.h"
typedef struct tor_process_monitor_t tor_process_monitor_t;
diff --git a/src/common/pubsub.c b/src/common/pubsub.c
index 744ee83458..93e8b5e6ef 100644
--- a/src/common/pubsub.c
+++ b/src/common/pubsub.c
@@ -8,8 +8,8 @@
*/
#include "orconfig.h"
-#include "pubsub.h"
-#include "container.h"
+#include "common/pubsub.h"
+#include "common/container.h"
/** Helper: insert <b>s</b> into <b>topic's</b> list of subscribers, keeping
* them sorted in priority order. */
diff --git a/src/common/pubsub.h b/src/common/pubsub.h
index 759b2e1747..628732b67f 100644
--- a/src/common/pubsub.h
+++ b/src/common/pubsub.h
@@ -42,7 +42,7 @@
#ifndef TOR_PUBSUB_H
#define TOR_PUBSUB_H
-#include "torint.h"
+#include "common/torint.h"
/**
* Flag for T_subscribe: die with an assertion failure if the event
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 964dc07656..cba63e04f8 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -32,11 +32,11 @@
#include <string.h>
#include <stdlib.h>
-#include "sandbox.h"
-#include "container.h"
-#include "torlog.h"
-#include "torint.h"
-#include "util.h"
+#include "common/sandbox.h"
+#include "common/container.h"
+#include "common/torlog.h"
+#include "common/torint.h"
+#include "common/util.h"
#include "tor_queue.h"
#include "ht.h"
@@ -79,7 +79,7 @@
defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)
#define USE_BACKTRACE
#define EXPOSE_CLEAN_BACKTRACE
-#include "backtrace.h"
+#include "common/backtrace.h"
#endif /* defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && ... */
#ifdef USE_BACKTRACE
diff --git a/src/common/sandbox.h b/src/common/sandbox.h
index a25886ccb1..945d57df7e 100644
--- a/src/common/sandbox.h
+++ b/src/common/sandbox.h
@@ -13,7 +13,7 @@
#define SANDBOX_H_
#include "orconfig.h"
-#include "torint.h"
+#include "common/torint.h"
#ifndef SYS_SECCOMP
diff --git a/src/common/storagedir.c b/src/common/storagedir.c
index 4c3d7238e0..ee80bcc530 100644
--- a/src/common/storagedir.c
+++ b/src/common/storagedir.c
@@ -1,14 +1,14 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "container.h"
-#include "compat.h"
-#include "confline.h"
-#include "memarea.h"
-#include "sandbox.h"
-#include "storagedir.h"
-#include "torlog.h"
-#include "util.h"
+#include "common/container.h"
+#include "common/compat.h"
+#include "common/confline.h"
+#include "common/memarea.h"
+#include "common/sandbox.h"
+#include "common/storagedir.h"
+#include "common/torlog.h"
+#include "common/util.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/src/common/timers.c b/src/common/timers.c
index cadbe7ff6c..2c39cf74b2 100644
--- a/src/common/timers.c
+++ b/src/common/timers.c
@@ -31,11 +31,11 @@
#define TOR_TIMERS_PRIVATE
-#include "compat.h"
-#include "compat_libevent.h"
-#include "timers.h"
-#include "torlog.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/compat_libevent.h"
+#include "common/timers.h"
+#include "common/torlog.h"
+#include "common/util.h"
struct timeout_cb {
timer_cb_fn_t cb;
diff --git a/src/common/timers.h b/src/common/timers.h
index c8abaae106..6b6179ca7c 100644
--- a/src/common/timers.h
+++ b/src/common/timers.h
@@ -5,7 +5,7 @@
#define TOR_TIMERS_H
#include "orconfig.h"
-#include "testsupport.h"
+#include "common/testsupport.h"
struct monotime_t;
typedef struct timeout tor_timer_t;
diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c
index 62b5b7829d..a028b08a0b 100644
--- a/src/common/token_bucket.c
+++ b/src/common/token_bucket.c
@@ -18,8 +18,8 @@
#define TOKEN_BUCKET_PRIVATE
-#include "token_bucket.h"
-#include "util_bug.h"
+#include "common/token_bucket.h"
+#include "common/util_bug.h"
/**
* Set the <b>rate</b> and <b>burst</b> value in a token_bucket_cfg.
diff --git a/src/common/token_bucket.h b/src/common/token_bucket.h
index 6a8efeaaae..645c90c624 100644
--- a/src/common/token_bucket.h
+++ b/src/common/token_bucket.h
@@ -9,8 +9,8 @@
#ifndef TOR_TOKEN_BUCKET_H
#define TOR_TOKEN_BUCKET_H
-#include "torint.h"
-#include "testsupport.h"
+#include "common/torint.h"
+#include "common/testsupport.h"
/** Largest allowable burst value for a token buffer. */
#define TOKEN_BUCKET_MAX_BURST INT32_MAX
diff --git a/src/common/torlog.h b/src/common/torlog.h
index 9b4df60806..65921c7b0a 100644
--- a/src/common/torlog.h
+++ b/src/common/torlog.h
@@ -12,8 +12,8 @@
#ifndef TOR_TORLOG_H
-#include "compat.h"
-#include "testsupport.h"
+#include "common/compat.h"
+#include "common/testsupport.h"
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 9e509a4b4c..b22a5aa7c9 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -25,11 +25,11 @@
#include <ws2tcpip.h>
#endif
-#include "crypto.h"
-#include "crypto_rand.h"
-#include "crypto_dh.h"
-#include "crypto_util.h"
-#include "compat.h"
+#include "common/crypto.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_dh.h"
+#include "common/crypto_util.h"
+#include "common/compat.h"
/* Some versions of OpenSSL declare SSL_get_selected_srtp_profile twice in
* srtp.h. Suppress the GCC warning so we can build with -Wredundant-decl. */
@@ -53,10 +53,10 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
#define TORTLS_PRIVATE
-#include "tortls.h"
-#include "util.h"
-#include "torlog.h"
-#include "container.h"
+#include "common/tortls.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/container.h"
#include <string.h>
#ifdef OPENSSL_1_1_API
diff --git a/src/common/tortls.h b/src/common/tortls.h
index c86b98885a..c7b319761d 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -11,10 +11,10 @@
* \brief Headers for tortls.c
**/
-#include "crypto_rsa.h"
-#include "compat_openssl.h"
-#include "compat.h"
-#include "testsupport.h"
+#include "common/crypto_rsa.h"
+#include "common/compat_openssl.h"
+#include "common/compat.h"
+#include "common/testsupport.h"
/* Opaque structure to hold a TLS connection. */
typedef struct tor_tls_t tor_tls_t;
diff --git a/src/common/util.c b/src/common/util.c
index a0b672f0df..b3fdc8a43a 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -14,16 +14,16 @@
#include <fcntl.h>
#endif
#define UTIL_PRIVATE
-#include "util.h"
-#include "torlog.h"
-#include "crypto_digest.h"
-#include "torint.h"
-#include "container.h"
-#include "address.h"
-#include "sandbox.h"
-#include "backtrace.h"
-#include "util_process.h"
-#include "util_format.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/crypto_digest.h"
+#include "common/torint.h"
+#include "common/container.h"
+#include "common/address.h"
+#include "common/sandbox.h"
+#include "common/backtrace.h"
+#include "common/util_process.h"
+#include "common/util_format.h"
#ifdef _WIN32
#include <io.h>
diff --git a/src/common/util.h b/src/common/util.h
index 504ba322fe..dcfa55f8fe 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -12,17 +12,17 @@
#define TOR_UTIL_H
#include "orconfig.h"
-#include "torint.h"
-#include "compat.h"
-#include "di_ops.h"
-#include "testsupport.h"
+#include "common/torint.h"
+#include "common/compat.h"
+#include "common/di_ops.h"
+#include "common/testsupport.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
/* for the correct alias to struct stat */
#include <sys/stat.h>
#endif
-#include "util_bug.h"
+#include "common/util_bug.h"
#ifndef O_BINARY
#define O_BINARY 0
diff --git a/src/common/util_bug.c b/src/common/util_bug.c
index 0fa085acbe..da34201c1e 100644
--- a/src/common/util_bug.c
+++ b/src/common/util_bug.c
@@ -8,10 +8,10 @@
**/
#include "orconfig.h"
-#include "util_bug.h"
-#include "torlog.h"
-#include "backtrace.h"
-#include "container.h"
+#include "common/util_bug.h"
+#include "common/torlog.h"
+#include "common/backtrace.h"
+#include "common/container.h"
#ifdef __COVERITY__
int bug_macro_deadcode_dummy__ = 0;
diff --git a/src/common/util_bug.h b/src/common/util_bug.h
index 1bd2e81c30..70a28eb156 100644
--- a/src/common/util_bug.h
+++ b/src/common/util_bug.h
@@ -37,8 +37,8 @@
#define TOR_UTIL_BUG_H
#include "orconfig.h"
-#include "compat.h"
-#include "testsupport.h"
+#include "common/compat.h"
+#include "common/testsupport.h"
/* Replace assert() with a variant that sends failures to the log before
* calling assert() normally.
diff --git a/src/common/util_format.c b/src/common/util_format.c
index b226c538f2..cab2572343 100644
--- a/src/common/util_format.c
+++ b/src/common/util_format.c
@@ -12,10 +12,10 @@
*/
#include "orconfig.h"
-#include "torlog.h"
-#include "util.h"
-#include "util_format.h"
-#include "torint.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/util_format.h"
+#include "common/torint.h"
#include <stddef.h>
#include <string.h>
diff --git a/src/common/util_format.h b/src/common/util_format.h
index ce55b95af1..7dd5ae5bd8 100644
--- a/src/common/util_format.h
+++ b/src/common/util_format.h
@@ -7,8 +7,8 @@
#ifndef TOR_UTIL_FORMAT_H
#define TOR_UTIL_FORMAT_H
-#include "testsupport.h"
-#include "torint.h"
+#include "common/testsupport.h"
+#include "common/torint.h"
/** @{ */
/** These macros don't check for overflow. Use them only for constant inputs
diff --git a/src/common/util_process.c b/src/common/util_process.c
index de218700ba..6eee659b27 100644
--- a/src/common/util_process.c
+++ b/src/common/util_process.c
@@ -19,10 +19,10 @@
#include <sys/wait.h>
#endif
-#include "compat.h"
-#include "util.h"
-#include "torlog.h"
-#include "util_process.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/util_process.h"
#include "ht.h"
/* ================================================== */
diff --git a/src/common/workqueue.c b/src/common/workqueue.c
index 563a98af96..0d31a2ecca 100644
--- a/src/common/workqueue.c
+++ b/src/common/workqueue.c
@@ -24,14 +24,14 @@
*/
#include "orconfig.h"
-#include "compat.h"
-#include "compat_libevent.h"
-#include "compat_threads.h"
-#include "crypto_rand.h"
-#include "util.h"
-#include "workqueue.h"
+#include "common/compat.h"
+#include "common/compat_libevent.h"
+#include "common/compat_threads.h"
+#include "common/crypto_rand.h"
+#include "common/util.h"
+#include "common/workqueue.h"
#include "tor_queue.h"
-#include "torlog.h"
+#include "common/torlog.h"
#include <event2/event.h>
diff --git a/src/common/workqueue.h b/src/common/workqueue.h
index 4e76fd86ea..1e0efcb1a2 100644
--- a/src/common/workqueue.h
+++ b/src/common/workqueue.h
@@ -4,7 +4,7 @@
#ifndef TOR_WORKQUEUE_H
#define TOR_WORKQUEUE_H
-#include "compat.h"
+#include "common/compat.h"
/** A replyqueue is used to tell the main thread about the outcome of
* work that we queued for the workers. */
diff --git a/src/ext/OpenBSD_malloc_Linux.c b/src/ext/OpenBSD_malloc_Linux.c
index 855c912310..157462b9ac 100644
--- a/src/ext/OpenBSD_malloc_Linux.c
+++ b/src/ext/OpenBSD_malloc_Linux.c
@@ -59,7 +59,7 @@
#include <errno.h>
#include <err.h>
/* For SIZE_MAX */
-#include "torint.h"
+#include "common/torint.h"
//#include "thread_private.h"
diff --git a/src/ext/csiphash.c b/src/ext/csiphash.c
index 0427c87950..36c3dee76e 100644
--- a/src/ext/csiphash.c
+++ b/src/ext/csiphash.c
@@ -29,10 +29,10 @@
Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)
*/
-#include "torint.h"
+#include "common/torint.h"
#include "siphash.h"
/* for tor_assert */
-#include "util.h"
+#include "common/util.h"
/* for memcpy */
#include <string.h>
#include "byteorder.h"
diff --git a/src/ext/curve25519_donna/curve25519-donna-c64.c b/src/ext/curve25519_donna/curve25519-donna-c64.c
index b68ff3695a..d2d7fb434a 100644
--- a/src/ext/curve25519_donna/curve25519-donna-c64.c
+++ b/src/ext/curve25519_donna/curve25519-donna-c64.c
@@ -25,7 +25,7 @@
#include "orconfig.h"
#include <string.h>
-#include "torint.h"
+#include "common/torint.h"
typedef uint8_t u8;
typedef uint64_t limb;
diff --git a/src/ext/curve25519_donna/curve25519-donna.c b/src/ext/curve25519_donna/curve25519-donna.c
index 1c5a27ab8a..573e6e26a9 100644
--- a/src/ext/curve25519_donna/curve25519-donna.c
+++ b/src/ext/curve25519_donna/curve25519-donna.c
@@ -48,7 +48,7 @@
#include "orconfig.h"
#include <string.h>
-#include "torint.h"
+#include "common/torint.h"
typedef uint8_t u8;
typedef int32_t s32;
diff --git a/src/ext/ed25519/donna/ed25519-hash-custom.h b/src/ext/ed25519/donna/ed25519-hash-custom.h
index cdeab3e45b..c176499911 100644
--- a/src/ext/ed25519/donna/ed25519-hash-custom.h
+++ b/src/ext/ed25519/donna/ed25519-hash-custom.h
@@ -9,7 +9,7 @@
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
*/
-#include "crypto_digest.h"
+#include "common/crypto_digest.h"
typedef struct ed25519_hash_context {
crypto_digest_t *ctx;
diff --git a/src/ext/ed25519/donna/ed25519-randombytes-custom.h b/src/ext/ed25519/donna/ed25519-randombytes-custom.h
index 27eade4f95..ea7a649cdd 100644
--- a/src/ext/ed25519/donna/ed25519-randombytes-custom.h
+++ b/src/ext/ed25519/donna/ed25519-randombytes-custom.h
@@ -8,7 +8,7 @@
*/
/* Tor: Instead of calling OpenSSL's CSPRNG directly, call the wrapper. */
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
static void
ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len)
diff --git a/src/ext/ed25519/donna/ed25519_donna_tor.h b/src/ext/ed25519/donna/ed25519_donna_tor.h
index 7d7b8c0625..dfaefc8658 100644
--- a/src/ext/ed25519/donna/ed25519_donna_tor.h
+++ b/src/ext/ed25519/donna/ed25519_donna_tor.h
@@ -1,7 +1,7 @@
/* Added for Tor. */
#ifndef SRC_EXT_ED25519_DONNA_H_INCLUDED_
#define SRC_EXT_ED25519_DONNA_H_INCLUDED_
-#include <torint.h>
+#include "common/torint.h"
typedef unsigned char curved25519_key[32];
diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c
index 43de9faaea..c3d4e09cd5 100644
--- a/src/ext/ed25519/donna/ed25519_tor.c
+++ b/src/ext/ed25519/donna/ed25519_tor.c
@@ -40,7 +40,7 @@
#include "ed25519-randombytes.h"
#include "ed25519-hash.h"
-#include "crypto_util.h"
+#include "common/crypto_util.h"
typedef unsigned char ed25519_signature[64];
typedef unsigned char ed25519_public_key[32];
diff --git a/src/ext/ed25519/ref10/blinding.c b/src/ext/ed25519/ref10/blinding.c
index 88e84cac20..6408491fa5 100644
--- a/src/ext/ed25519/ref10/blinding.c
+++ b/src/ext/ed25519/ref10/blinding.c
@@ -7,7 +7,7 @@
#include "ed25519_ref10.h"
#include <string.h>
-#include "crypto_util.h"
+#include "common/crypto_util.h"
static void
ed25519_ref10_gettweak(unsigned char *out, const unsigned char *param)
diff --git a/src/ext/ed25519/ref10/crypto_hash_sha512.h b/src/ext/ed25519/ref10/crypto_hash_sha512.h
index 7faddb1597..8ab0b45652 100644
--- a/src/ext/ed25519/ref10/crypto_hash_sha512.h
+++ b/src/ext/ed25519/ref10/crypto_hash_sha512.h
@@ -1,5 +1,5 @@
/* Added for Tor. */
-#include "crypto_digest.h"
+#include "common/crypto_digest.h"
/* Set 'out' to the 512-bit SHA512 hash of the 'len'-byte string in 'inp' */
#define crypto_hash_sha512(out, inp, len) \
diff --git a/src/ext/ed25519/ref10/crypto_int32.h b/src/ext/ed25519/ref10/crypto_int32.h
index dd13c91bd0..59311a6201 100644
--- a/src/ext/ed25519/ref10/crypto_int32.h
+++ b/src/ext/ed25519/ref10/crypto_int32.h
@@ -3,7 +3,7 @@
#ifndef CRYPTO_INT32_H
#define CRYPTO_INT32_H
-#include "torint.h"
+#include "common/torint.h"
#define crypto_int32 int32_t
#define crypto_uint32 uint32_t
diff --git a/src/ext/ed25519/ref10/crypto_int64.h b/src/ext/ed25519/ref10/crypto_int64.h
index 46e8852ed0..6dda30f2ed 100644
--- a/src/ext/ed25519/ref10/crypto_int64.h
+++ b/src/ext/ed25519/ref10/crypto_int64.h
@@ -3,7 +3,7 @@
#ifndef CRYPTO_INT64_H
#define CRYPTO_INT64_H
-#include "torint.h"
+#include "common/torint.h"
#define crypto_int64 int64_t
#define crypto_uint64 uint64_t
diff --git a/src/ext/ed25519/ref10/crypto_uint32.h b/src/ext/ed25519/ref10/crypto_uint32.h
index 62655a5b66..b12a595a10 100644
--- a/src/ext/ed25519/ref10/crypto_uint32.h
+++ b/src/ext/ed25519/ref10/crypto_uint32.h
@@ -1,3 +1,3 @@
/* Added for Tor. */
-#include "torint.h"
+#include "common/torint.h"
#define crypto_uint32 uint32_t
diff --git a/src/ext/ed25519/ref10/crypto_uint64.h b/src/ext/ed25519/ref10/crypto_uint64.h
index cbda882a6a..73edfd1b5e 100644
--- a/src/ext/ed25519/ref10/crypto_uint64.h
+++ b/src/ext/ed25519/ref10/crypto_uint64.h
@@ -1,3 +1,3 @@
/* Added for Tor. */
-#include "torint.h"
+#include "common/torint.h"
#define crypto_uint64 uint64_t
diff --git a/src/ext/ed25519/ref10/crypto_verify_32.h b/src/ext/ed25519/ref10/crypto_verify_32.h
index 0f63efc7a3..f2000a321d 100644
--- a/src/ext/ed25519/ref10/crypto_verify_32.h
+++ b/src/ext/ed25519/ref10/crypto_verify_32.h
@@ -1,5 +1,4 @@
/* Added for Tor. */
-#include "di_ops.h"
+#include "common/di_ops.h"
#define crypto_verify_32(a,b) \
(! tor_memeq((a), (b), 32))
-
diff --git a/src/ext/ed25519/ref10/ed25519_ref10.h b/src/ext/ed25519/ref10/ed25519_ref10.h
index 5965694977..15ac07e241 100644
--- a/src/ext/ed25519/ref10/ed25519_ref10.h
+++ b/src/ext/ed25519/ref10/ed25519_ref10.h
@@ -1,7 +1,7 @@
/* Added for Tor */
#ifndef SRC_EXT_ED25519_REF10_H_INCLUDED_
#define SRC_EXT_ED25519_REF10_H_INCLUDED_
-#include <torint.h>
+#include "common/torint.h"
int ed25519_ref10_seckey(unsigned char *sk);
int ed25519_ref10_seckey_expand(unsigned char *sk, const unsigned char *sk_seed);
diff --git a/src/ext/ed25519/ref10/keypair.c b/src/ext/ed25519/ref10/keypair.c
index c437f0a4f2..8ed0a4a8f5 100644
--- a/src/ext/ed25519/ref10/keypair.c
+++ b/src/ext/ed25519/ref10/keypair.c
@@ -6,8 +6,8 @@
#include "crypto_hash_sha512.h"
#include "ge.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
int
crypto_sign_seckey(unsigned char *sk)
@@ -52,4 +52,3 @@ int crypto_sign_keypair(unsigned char *pk,unsigned char *sk)
return 0;
}
-
diff --git a/src/ext/ed25519/ref10/randombytes.h b/src/ext/ed25519/ref10/randombytes.h
index a21dde8540..f5bc3b228d 100644
--- a/src/ext/ed25519/ref10/randombytes.h
+++ b/src/ext/ed25519/ref10/randombytes.h
@@ -1,4 +1,4 @@
/* Added for Tor. */
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#define randombytes(b, n) \
(crypto_strongest_rand((b), (n)), 0)
diff --git a/src/ext/keccak-tiny/keccak-tiny-unrolled.c b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
index 07e8c95bcf..233a73331c 100644
--- a/src/ext/keccak-tiny/keccak-tiny-unrolled.c
+++ b/src/ext/keccak-tiny/keccak-tiny-unrolled.c
@@ -9,7 +9,7 @@
#include "keccak-tiny.h"
#include <string.h>
-#include "crypto_util.h"
+#include "common/crypto_util.h"
#include "byteorder.h"
/******** Endianness conversion helpers ********/
diff --git a/src/ext/keccak-tiny/keccak-tiny.h b/src/ext/keccak-tiny/keccak-tiny.h
index 7efea2319e..58e1d45342 100644
--- a/src/ext/keccak-tiny/keccak-tiny.h
+++ b/src/ext/keccak-tiny/keccak-tiny.h
@@ -2,7 +2,7 @@
#define KECCAK_FIPS202_H
#include <stddef.h>
-#include "torint.h"
+#include "common/torint.h"
#define KECCAK_MAX_RATE 200
diff --git a/src/ext/mulodi/mulodi4.c b/src/ext/mulodi/mulodi4.c
index 9891bbf1af..ddd17cd1dd 100644
--- a/src/ext/mulodi/mulodi4.c
+++ b/src/ext/mulodi/mulodi4.c
@@ -18,7 +18,7 @@
#define COMPILER_RT_ABI
#define di_int int64_t
#define di_uint uint64_t
-#include "torint.h"
+#include "common/torint.h"
di_int __mulodi4(di_int a, di_int b, int* overflow);
#endif
diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index 566dc032a1..9ca2326273 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -15,18 +15,18 @@
#define ADDRESSMAP_PRIVATE
-#include "or.h"
-#include "addressmap.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection_edge.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "dns.h"
-#include "nodelist.h"
-#include "routerset.h"
-
-#include "entry_connection_st.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection_edge.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/dns.h"
+#include "or/nodelist.h"
+#include "or/routerset.h"
+
+#include "or/entry_connection_st.h"
/** A client-side struct to remember requests to rewrite addresses
* to new addresses. These structs are stored in the hash table
diff --git a/src/or/addressmap.h b/src/or/addressmap.h
index b73915446b..0d53e77772 100644
--- a/src/or/addressmap.h
+++ b/src/or/addressmap.h
@@ -7,7 +7,7 @@
#ifndef TOR_ADDRESSMAP_H
#define TOR_ADDRESSMAP_H
-#include "testsupport.h"
+#include "common/testsupport.h"
void addressmap_init(void);
void addressmap_clear_excluded_trackexithosts(const or_options_t *options);
diff --git a/src/or/authority_cert_st.h b/src/or/authority_cert_st.h
index c8fbc52381..19c3fda2de 100644
--- a/src/or/authority_cert_st.h
+++ b/src/or/authority_cert_st.h
@@ -7,7 +7,7 @@
#ifndef AUTHORITY_CERT_ST_H
#define AUTHORITY_CERT_ST_H
-#include "signed_descriptor_st.h"
+#include "or/signed_descriptor_st.h"
/** Certificate for v3 directory protocol: binds long-term authority identity
* keys to medium-term authority signing keys. */
diff --git a/src/or/bridges.c b/src/or/bridges.c
index e7e16dda62..ca0a13f2a0 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -13,24 +13,24 @@
#define TOR_BRIDGES_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "connection.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "transports.h"
-
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/transports.h"
+
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/** Information about a configured bridge. Currently this just matches the
* ones in the torrc file, but one day we may be able to learn about new
diff --git a/src/or/channel.c b/src/or/channel.c
index 8ed36900d9..2cf5b8a2a7 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -57,30 +57,30 @@
/* This one's for stuff only channel.c and the test suite should see */
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "channelpadding.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "connection_or.h" /* For var_cell_free() */
-#include "circuitmux.h"
-#include "entrynodes.h"
-#include "geoip.h"
-#include "main.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "scheduler.h"
-#include "compat_time.h"
-#include "networkstatus.h"
-#include "rendservice.h"
-
-#include "cell_queue_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/channelpadding.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/connection_or.h" /* For var_cell_free() */
+#include "or/circuitmux.h"
+#include "or/entrynodes.h"
+#include "or/geoip.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/scheduler.h"
+#include "common/compat_time.h"
+#include "or/networkstatus.h"
+#include "or/rendservice.h"
+
+#include "or/cell_queue_st.h"
/* Global lists of channels */
diff --git a/src/or/channel.h b/src/or/channel.h
index 57d010b362..44b752e2c5 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -9,10 +9,10 @@
#ifndef TOR_CHANNEL_H
#define TOR_CHANNEL_H
-#include "or.h"
-#include "circuitmux.h"
-#include "timers.h"
-#include "handles.h"
+#include "or/or.h"
+#include "or/circuitmux.h"
+#include "common/timers.h"
+#include "common/handles.h"
/* Channel handler function pointer typedefs */
typedef void (*channel_listener_fn_ptr)(channel_listener_t *, channel_t *);
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index 889506414e..190f54f298 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -8,23 +8,23 @@
* channelpadding_channel_to_channelinfo() */
#define TOR_CHANNEL_INTERNAL_
-#include "or.h"
-#include "channel.h"
-#include "channelpadding.h"
-#include "channeltls.h"
-#include "config.h"
-#include "networkstatus.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "crypto_rand.h"
-#include "main.h"
-#include "rephist.h"
-#include "router.h"
-#include "compat_time.h"
-#include "rendservice.h"
-
-#include "cell_st.h"
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channelpadding.h"
+#include "or/channeltls.h"
+#include "or/config.h"
+#include "or/networkstatus.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "common/crypto_rand.h"
+#include "or/main.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "common/compat_time.h"
+#include "or/rendservice.h"
+
+#include "or/cell_st.h"
+#include "or/or_connection_st.h"
STATIC int32_t channelpadding_get_netflow_inactive_timeout_ms(
const channel_t *);
diff --git a/src/or/channelpadding.h b/src/or/channelpadding.h
index fb8d812e94..7eddbdbe2d 100644
--- a/src/or/channelpadding.h
+++ b/src/or/channelpadding.h
@@ -11,7 +11,7 @@
#ifndef TOR_CHANNELPADDING_H
#define TOR_CHANNELPADDING_H
-#include "channelpadding_negotiation.h"
+#include "trunnel/channelpadding_negotiation.h"
#define CHANNELPADDING_TOR2WEB_PARAM "nf_pad_tor2web"
#define CHANNELPADDING_TOR2WEB_DEFAULT 1
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 4bbfd4832b..5258935aee 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -38,36 +38,36 @@
#define CHANNELTLS_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "command.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "control.h"
-#include "entrynodes.h"
-#include "link_handshake.h"
-#include "relay.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "scheduler.h"
-#include "torcert.h"
-#include "networkstatus.h"
-#include "channelpadding_negotiation.h"
-#include "channelpadding.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "extend_info_st.h"
-#include "or_connection_st.h"
-#include "or_handshake_certs_st.h"
-#include "or_handshake_state_st.h"
-#include "routerinfo_st.h"
-#include "var_cell_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "or/command.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "or/entrynodes.h"
+#include "trunnel/link_handshake.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/scheduler.h"
+#include "or/torcert.h"
+#include "or/networkstatus.h"
+#include "trunnel/channelpadding_negotiation.h"
+#include "or/channelpadding.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/extend_info_st.h"
+#include "or/or_connection_st.h"
+#include "or/or_handshake_certs_st.h"
+#include "or/or_handshake_state_st.h"
+#include "or/routerinfo_st.h"
+#include "or/var_cell_st.h"
/** How many CELL_PADDING cells have we received, ever? */
uint64_t stats_n_padding_cells_processed = 0;
diff --git a/src/or/channeltls.h b/src/or/channeltls.h
index 72788b5066..be74127c9a 100644
--- a/src/or/channeltls.h
+++ b/src/or/channeltls.h
@@ -9,8 +9,8 @@
#ifndef TOR_CHANNELTLS_H
#define TOR_CHANNELTLS_H
-#include "or.h"
-#include "channel.h"
+#include "or/or.h"
+#include "or/channel.h"
#define BASE_CHAN_TO_TLS(c) (channel_tls_from_base((c)))
#define TLS_CHAN_TO_BASE(c) (channel_tls_to_base((c)))
diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index 489a433828..ace29c4a06 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -21,25 +21,25 @@
* each guard, and stored persistently in the state file.
*/
-#include "or.h"
-#include "channel.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitstats.h"
-#include "connection_edge.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "entrynodes.h"
-#include "networkstatus.h"
-#include "relay.h"
-
-#include "cell_st.h"
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "extend_info_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitstats.h"
+#include "or/connection_edge.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/entrynodes.h"
+#include "or/networkstatus.h"
+#include "or/relay.h"
+
+#include "or/cell_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/extend_info_st.h"
+#include "or/origin_circuit_st.h"
static void pathbias_count_successful_close(origin_circuit_t *circ);
static void pathbias_count_collapse(origin_circuit_t *circ);
diff --git a/src/or/circuit_st.h b/src/or/circuit_st.h
index 9657782ed2..0ace64f3ee 100644
--- a/src/or/circuit_st.h
+++ b/src/or/circuit_st.h
@@ -7,9 +7,9 @@
#ifndef CIRCUIT_ST_H
#define CIRCUIT_ST_H
-#include "or.h"
+#include "or/or.h"
-#include "cell_queue_st.h"
+#include "or/cell_queue_st.h"
/**
* A circuit is a path over the onion routing
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index fcd08d83f5..f527082773 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -27,54 +27,54 @@
#define CIRCUITBUILD_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "channel.h"
-#include "circpathbias.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
#define CIRCUITBUILD_PRIVATE
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "circuituse.h"
-#include "command.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "hs_ntor.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "onion.h"
-#include "onion_tap.h"
-#include "onion_fast.h"
-#include "policies.h"
-#include "relay.h"
-#include "relay_crypto.h"
-#include "rendcommon.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "transports.h"
-
-#include "cell_st.h"
-#include "cpath_build_state_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "microdesc_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "or/circuituse.h"
+#include "or/command.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/hs_ntor.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/onion.h"
+#include "or/onion_tap.h"
+#include "or/onion_fast.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/relay_crypto.h"
+#include "or/rendcommon.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/transports.h"
+
+#include "or/cell_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/microdesc_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
static channel_t * channel_connect_for_circuit(const tor_addr_t *addr,
uint16_t port,
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 99ce65448d..c3d017bf8d 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -51,54 +51,54 @@
* logic, which was originally circuit-focused.
**/
#define CIRCUITLIST_PRIVATE
-#include "torint.h" /* TOR_PRIuSZ */
-
-#include "or.h"
-#include "channel.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitstats.h"
-#include "connection.h"
-#include "config.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "main.h"
-#include "hs_circuit.h"
-#include "hs_circuitmap.h"
-#include "hs_ident.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "onion.h"
-#include "onion_fast.h"
-#include "policies.h"
-#include "relay.h"
-#include "relay_crypto.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rephist.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "channelpadding.h"
-#include "compress_lzma.h"
-#include "compress_zlib.h"
-#include "compress_zstd.h"
+#include "common/torint.h" /* TOR_PRIuSZ */
+
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitstats.h"
+#include "or/connection.h"
+#include "or/config.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/main.h"
+#include "or/hs_circuit.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_ident.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/onion.h"
+#include "or/onion_fast.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/relay_crypto.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rephist.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/channelpadding.h"
+#include "common/compress_lzma.h"
+#include "common/compress_zlib.h"
+#include "common/compress_zstd.h"
#include "ht.h"
-#include "cpath_build_state_st.h"
-#include "crypt_path_reference_st.h"
-#include "dir_connection_st.h"
-#include "edge_connection_st.h"
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_reference_st.h"
+#include "or/dir_connection_st.h"
+#include "or/edge_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
/********* START VARIABLES **********/
diff --git a/src/or/circuitlist.h b/src/or/circuitlist.h
index 2885a073b8..9f80c3efde 100644
--- a/src/or/circuitlist.h
+++ b/src/or/circuitlist.h
@@ -12,8 +12,8 @@
#ifndef TOR_CIRCUITLIST_H
#define TOR_CIRCUITLIST_H
-#include "testsupport.h"
-#include "hs_ident.h"
+#include "common/testsupport.h"
+#include "or/hs_ident.h"
/** Convert a circuit_t* to a pointer to the enclosing or_circuit_t. Assert
* if the cast is impossible. */
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 80f65f0aa0..31f9281ebb 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -69,15 +69,15 @@
* made to attach all existing circuits to the new policy.
**/
-#include "or.h"
-#include "channel.h"
-#include "circuitlist.h"
-#include "circuitmux.h"
-#include "relay.h"
-
-#include "cell_queue_st.h"
-#include "destroy_cell_queue_st.h"
-#include "or_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux.h"
+#include "or/relay.h"
+
+#include "or/cell_queue_st.h"
+#include "or/destroy_cell_queue_st.h"
+#include "or/or_circuit_st.h"
/*
* Private typedefs for circuitmux.c
diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index 1af73340e0..68bcbf6e75 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -9,8 +9,8 @@
#ifndef TOR_CIRCUITMUX_H
#define TOR_CIRCUITMUX_H
-#include "or.h"
-#include "testsupport.h"
+#include "or/or.h"
+#include "common/testsupport.h"
typedef struct circuitmux_policy_s circuitmux_policy_t;
typedef struct circuitmux_policy_data_s circuitmux_policy_data_t;
diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
index 631dc7c3ae..3b144e7d98 100644
--- a/src/or/circuitmux_ewma.c
+++ b/src/or/circuitmux_ewma.c
@@ -34,11 +34,11 @@
#include <math.h>
-#include "or.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
/*** EWMA parameter #defines ***/
diff --git a/src/or/circuitmux_ewma.h b/src/or/circuitmux_ewma.h
index c0c94101a0..1214b0264b 100644
--- a/src/or/circuitmux_ewma.h
+++ b/src/or/circuitmux_ewma.h
@@ -9,8 +9,8 @@
#ifndef TOR_CIRCUITMUX_EWMA_H
#define TOR_CIRCUITMUX_EWMA_H
-#include "or.h"
-#include "circuitmux.h"
+#include "or/or.h"
+#include "or/circuitmux.h"
/* The public EWMA policy callbacks object. */
extern circuitmux_policy_t ewma_policy;
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index 202de567b5..ebd082306d 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -25,24 +25,24 @@
#define CIRCUITSTATS_PRIVATE
-#include "or.h"
-#include "circuitbuild.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "confparse.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "rendclient.h"
-#include "rendservice.h"
-#include "router.h"
-#include "statefile.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-
-#include "crypt_path_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/rendclient.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/statefile.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+
+#include "or/crypt_path_st.h"
+#include "or/origin_circuit_st.h"
#undef log
#include <math.h>
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index e46d1459b3..0ba3f34b40 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -27,43 +27,43 @@
* logic in circuitstats.c.
**/
-#include "or.h"
-#include "addressmap.h"
-#include "bridges.h"
-#include "channel.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "control.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "hs_circuit.h"
-#include "hs_ident.h"
-#include "hs_stats.h"
-#include "nodelist.h"
-#include "networkstatus.h"
-#include "policies.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-
-#include "cpath_build_state_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "or/bridges.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/control.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/hs_circuit.h"
+#include "or/hs_ident.h"
+#include "or/hs_stats.h"
+#include "or/nodelist.h"
+#include "or/networkstatus.h"
+#include "or/policies.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
static void circuit_expire_old_circuits_clientside(void);
static void circuit_increment_failure_count(void);
diff --git a/src/or/command.c b/src/or/command.c
index 0c92927ec0..dd8e7d6f3e 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -36,30 +36,30 @@
* callbacks registered in command_setup_channel(),
* called when channels are created in circuitbuild.c
*/
-#include "or.h"
-#include "channel.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "command.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "config.h"
-#include "control.h"
-#include "cpuworker.h"
-#include "crypto_util.h"
-#include "dos.h"
-#include "hibernate.h"
-#include "nodelist.h"
-#include "onion.h"
-#include "rephist.h"
-#include "relay.h"
-#include "router.h"
-#include "routerlist.h"
-
-#include "cell_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "var_cell_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/command.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "or/cpuworker.h"
+#include "common/crypto_util.h"
+#include "or/dos.h"
+#include "or/hibernate.h"
+#include "or/nodelist.h"
+#include "or/onion.h"
+#include "or/rephist.h"
+#include "or/relay.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/var_cell_st.h"
/** How many CELL_CREATE cells have we received, ever? */
uint64_t stats_n_create_cells_processed = 0;
diff --git a/src/or/command.h b/src/or/command.h
index 5bdfa92fd8..864a5b2fd0 100644
--- a/src/or/command.h
+++ b/src/or/command.h
@@ -12,7 +12,7 @@
#ifndef TOR_COMMAND_H
#define TOR_COMMAND_H
-#include "channel.h"
+#include "or/channel.h"
void command_process_cell(channel_t *chan, cell_t *cell);
void command_process_var_cell(channel_t *chan, var_cell_t *cell);
diff --git a/src/or/config.c b/src/or/config.c
index 401c57f697..8c6e2382fb 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -60,64 +60,64 @@
**/
#define CONFIG_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "compat.h"
-#include "addressmap.h"
-#include "channel.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "circuitstats.h"
-#include "compress.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "consdiffmgr.h"
-#include "control.h"
-#include "confparse.h"
-#include "cpuworker.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "dirserv.h"
-#include "dns.h"
-#include "dos.h"
-#include "entrynodes.h"
-#include "git_revision.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendservice.h"
-#include "hs_config.h"
-#include "rephist.h"
-#include "router.h"
-#include "sandbox.h"
-#include "util.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "scheduler.h"
-#include "statefile.h"
-#include "transports.h"
-#include "ext_orport.h"
-#include "voting_schedule.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "common/compat.h"
+#include "or/addressmap.h"
+#include "or/channel.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "or/circuitstats.h"
+#include "common/compress.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/consdiffmgr.h"
+#include "or/control.h"
+#include "or/confparse.h"
+#include "or/cpuworker.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/dirserv.h"
+#include "or/dns.h"
+#include "or/dos.h"
+#include "or/entrynodes.h"
+#include "or/git_revision.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendservice.h"
+#include "or/hs_config.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "common/sandbox.h"
+#include "common/util.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/scheduler.h"
+#include "or/statefile.h"
+#include "or/transports.h"
+#include "or/ext_orport.h"
+#include "or/voting_schedule.h"
#ifdef _WIN32
#include <shlobj.h>
#endif
-#include "procmon.h"
+#include "common/procmon.h"
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
-#include "connection_st.h"
-#include "port_cfg_st.h"
+#include "or/connection_st.h"
+#include "or/port_cfg_st.h"
#ifdef HAVE_SYSTEMD
# if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
diff --git a/src/or/config.h b/src/or/config.h
index 4e901651dd..a94cd77538 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -12,7 +12,7 @@
#ifndef TOR_CONFIG_H
#define TOR_CONFIG_H
-#include "testsupport.h"
+#include "common/testsupport.h"
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(DARWIN)
#define KERNEL_MAY_SUPPORT_IPFW
diff --git a/src/or/confparse.c b/src/or/confparse.c
index 78fc581c7c..e88c4f72d8 100644
--- a/src/or/confparse.c
+++ b/src/or/confparse.c
@@ -22,9 +22,9 @@
* specified, and a linked list of key-value pairs.
*/
-#include "or.h"
-#include "confparse.h"
-#include "routerset.h"
+#include "or/or.h"
+#include "or/confparse.h"
+#include "or/routerset.h"
static uint64_t config_parse_memunit(const char *s, int *ok);
static int config_parse_msec_interval(const char *s, int *ok);
diff --git a/src/or/connection.c b/src/or/connection.c
index 8915e46cc0..267719881f 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -55,54 +55,54 @@
**/
#define CONNECTION_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "buffers.h"
-#include "buffers_tls.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "common/buffers.h"
+#include "common/buffers_tls.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 "backtrace.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dns.h"
-#include "dnsserv.h"
-#include "dos.h"
-#include "entrynodes.h"
-#include "ext_orport.h"
-#include "geoip.h"
-#include "main.h"
-#include "hibernate.h"
-#include "hs_common.h"
-#include "hs_ident.h"
-#include "nodelist.h"
-#include "proto_http.h"
-#include "proto_socks.h"
-#include "policies.h"
-#include "reasons.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "transports.h"
-#include "routerparse.h"
-#include "sandbox.h"
+#include "common/backtrace.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dns.h"
+#include "or/dnsserv.h"
+#include "or/dos.h"
+#include "or/entrynodes.h"
+#include "or/ext_orport.h"
+#include "or/geoip.h"
+#include "or/main.h"
+#include "or/hibernate.h"
+#include "or/hs_common.h"
+#include "or/hs_ident.h"
+#include "or/nodelist.h"
+#include "or/proto_http.h"
+#include "or/proto_socks.h"
+#include "or/policies.h"
+#include "or/reasons.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/transports.h"
+#include "or/routerparse.h"
+#include "common/sandbox.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
@@ -113,14 +113,14 @@
#include <sys/un.h>
#endif
-#include "dir_connection_st.h"
-#include "control_connection_st.h"
-#include "entry_connection_st.h"
-#include "listener_connection_st.h"
-#include "or_connection_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "socks_request_st.h"
+#include "or/dir_connection_st.h"
+#include "or/control_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/listener_connection_st.h"
+#include "or/or_connection_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/socks_request_st.h"
static connection_t *connection_listener_new(
const struct sockaddr *listensockaddr,
diff --git a/src/or/connection.h b/src/or/connection.h
index 7cfd4c51ce..7fcf710215 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -15,7 +15,7 @@
listener_connection_t *TO_LISTENER_CONN(connection_t *);
/* XXXX For buf_datalen in inline function */
-#include "buffers.h"
+#include "common/buffers.h"
const char *conn_type_to_string(int type);
const char *conn_state_to_string(int type, int state);
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index b351a2442b..125709786d 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -55,57 +55,57 @@
**/
#define CONNECTION_EDGE_PRIVATE
-#include "or.h"
-
-#include "backtrace.h"
-
-#include "addressmap.h"
-#include "buffers.h"
-#include "channel.h"
-#include "circpathbias.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_util.h"
-#include "dns.h"
-#include "dnsserv.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "hibernate.h"
-#include "hs_common.h"
-#include "hs_cache.h"
-#include "hs_client.h"
-#include "hs_circuit.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "proto_http.h"
-#include "proto_socks.h"
-#include "reasons.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "circuitbuild.h"
-
-#include "cell_st.h"
-#include "cpath_build_state_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+
+#include "common/backtrace.h"
+
+#include "or/addressmap.h"
+#include "common/buffers.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_util.h"
+#include "or/dns.h"
+#include "or/dnsserv.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/hibernate.h"
+#include "or/hs_common.h"
+#include "or/hs_cache.h"
+#include "or/hs_client.h"
+#include "or/hs_circuit.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/proto_http.h"
+#include "or/proto_socks.h"
+#include "or/reasons.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/circuitbuild.h"
+
+#include "or/cell_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index d8607af5a0..9d480aec2e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -12,7 +12,7 @@
#ifndef TOR_CONNECTION_EDGE_H
#define TOR_CONNECTION_EDGE_H
-#include "testsupport.h"
+#include "common/testsupport.h"
edge_connection_t *TO_EDGE_CONN(connection_t *);
entry_connection_t *TO_ENTRY_CONN(connection_t *);
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 772a774233..aff5f105a1 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -20,54 +20,54 @@
*
* This module also implements the client side of the v3 Tor link handshake,
**/
-#include "or.h"
-#include "bridges.h"
-#include "buffers.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "common/buffers.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_OR_PRIVATE
-#include "channel.h"
-#include "channeltls.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "command.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "geoip.h"
-#include "main.h"
-#include "link_handshake.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "proto_cell.h"
-#include "reasons.h"
-#include "relay.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "ext_orport.h"
-#include "scheduler.h"
-#include "torcert.h"
-#include "channelpadding.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "or_connection_st.h"
-#include "or_handshake_certs_st.h"
-#include "or_handshake_state_st.h"
-#include "routerinfo_st.h"
-#include "var_cell_st.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "or/command.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "or/geoip.h"
+#include "or/main.h"
+#include "trunnel/link_handshake.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/proto_cell.h"
+#include "or/reasons.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/ext_orport.h"
+#include "or/scheduler.h"
+#include "or/torcert.h"
+#include "or/channelpadding.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/or_connection_st.h"
+#include "or/or_handshake_certs_st.h"
+#include "or/or_handshake_state_st.h"
+#include "or/routerinfo_st.h"
+#include "or/var_cell_st.h"
static int connection_tls_finish_handshake(or_connection_t *conn);
static int connection_or_launch_v3_or_handshake(or_connection_t *conn);
diff --git a/src/or/conscache.c b/src/or/conscache.c
index 48ff49120c..5bfd78a786 100644
--- a/src/or/conscache.c
+++ b/src/or/conscache.c
@@ -1,12 +1,12 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
-#include "config.h"
-#include "conscache.h"
-#include "crypto_util.h"
-#include "storagedir.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "common/crypto_util.h"
+#include "common/storagedir.h"
#define CCE_MAGIC 0x17162253
diff --git a/src/or/conscache.h b/src/or/conscache.h
index 738516d1c9..20af6402c5 100644
--- a/src/or/conscache.h
+++ b/src/or/conscache.h
@@ -4,7 +4,7 @@
#ifndef TOR_CONSCACHE_H
#define TOR_CONSCACHE_H
-#include "handles.h"
+#include "common/handles.h"
typedef struct consensus_cache_entry_t consensus_cache_entry_t;
typedef struct consensus_cache_t consensus_cache_t;
diff --git a/src/or/consdiff.c b/src/or/consdiff.c
index 1001d30fb3..59e27c0aeb 100644
--- a/src/or/consdiff.c
+++ b/src/or/consdiff.c
@@ -38,10 +38,10 @@
#define CONSDIFF_PRIVATE
-#include "or.h"
-#include "consdiff.h"
-#include "memarea.h"
-#include "routerparse.h"
+#include "or/or.h"
+#include "or/consdiff.h"
+#include "common/memarea.h"
+#include "or/routerparse.h"
static const char* ns_diff_version = "network-status-diff-version 1";
static const char* hash_token = "hash";
diff --git a/src/or/consdiff.h b/src/or/consdiff.h
index 23c006860a..3f73b8536c 100644
--- a/src/or/consdiff.h
+++ b/src/or/consdiff.h
@@ -5,7 +5,7 @@
#ifndef TOR_CONSDIFF_H
#define TOR_CONSDIFF_H
-#include "or.h"
+#include "or/or.h"
char *consensus_diff_generate(const char *cons1,
const char *cons2);
diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c
index abb8f55839..7732cd1093 100644
--- a/src/or/consdiffmgr.c
+++ b/src/or/consdiffmgr.c
@@ -13,18 +13,18 @@
#define CONSDIFFMGR_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "conscache.h"
-#include "consdiff.h"
-#include "consdiffmgr.h"
-#include "cpuworker.h"
-#include "networkstatus.h"
-#include "routerparse.h"
-#include "workqueue.h"
-
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "or/consdiff.h"
+#include "or/consdiffmgr.h"
+#include "or/cpuworker.h"
+#include "or/networkstatus.h"
+#include "or/routerparse.h"
+#include "common/workqueue.h"
+
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
/**
* Labels to apply to items in the conscache object.
diff --git a/src/or/control.c b/src/or/control.c
index 181667b3b7..8d6da9c099 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -35,77 +35,77 @@
#define CONTROL_PRIVATE
-#include "or.h"
-#include "addressmap.h"
-#include "bridges.h"
-#include "buffers.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "circuituse.h"
-#include "command.h"
-#include "compat_libevent.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dnsserv.h"
-#include "entrynodes.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "hs_cache.h"
-#include "hs_common.h"
-#include "hs_control.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "proto_control0.h"
-#include "proto_http.h"
-#include "reasons.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "shared_random_client.h"
-
-#include "cached_dir_st.h"
-#include "control_connection_st.h"
-#include "cpath_build_state_st.h"
-#include "entry_connection_st.h"
-#include "extrainfo_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "or_connection_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "microdesc_st.h"
-#include "rend_authorized_client_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "or/bridges.h"
+#include "common/buffers.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "or/circuituse.h"
+#include "or/command.h"
+#include "common/compat_libevent.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dnsserv.h"
+#include "or/entrynodes.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/hs_cache.h"
+#include "or/hs_common.h"
+#include "or/hs_control.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/proto_control0.h"
+#include "or/proto_http.h"
+#include "or/reasons.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/shared_random_client.h"
+
+#include "or/cached_dir_st.h"
+#include "or/control_connection_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extrainfo_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/or_connection_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/microdesc_st.h"
+#include "or/rend_authorized_client_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/socks_request_st.h"
#ifndef _WIN32
#include <pwd.h>
#include <sys/resource.h>
#endif
-#include "crypto_s2k.h"
-#include "procmon.h"
+#include "common/crypto_s2k.h"
+#include "common/procmon.h"
/** Yield true iff <b>s</b> is the state of a control_connection_t that has
* finished authentication and is accepting commands. */
diff --git a/src/or/control_connection_st.h b/src/or/control_connection_st.h
index bd2b848577..4f8ab25d99 100644
--- a/src/or/control_connection_st.h
+++ b/src/or/control_connection_st.h
@@ -7,8 +7,8 @@
#ifndef CONTROL_CONNECTION_ST_H
#define CONTROL_CONNECTION_ST_H
-#include "or.h"
-#include "connection_st.h"
+#include "or/or.h"
+#include "or/connection_st.h"
/** Subtype of connection_t for an connection to a controller. */
struct control_connection_t {
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 6f3f8c2f12..18b8adab86 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -17,22 +17,22 @@
* <li>and for calculating diffs and compressing them in consdiffmgr.c.
* </ul>
**/
-#include "or.h"
-#include "channel.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "connection_or.h"
-#include "config.h"
-#include "cpuworker.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "main.h"
-#include "onion.h"
-#include "rephist.h"
-#include "router.h"
-#include "workqueue.h"
-
-#include "or_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "or/cpuworker.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/main.h"
+#include "or/onion.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "common/workqueue.h"
+
+#include "or/or_circuit_st.h"
static void queue_pending_tasks(void);
diff --git a/src/or/crypt_path_st.h b/src/or/crypt_path_st.h
index ebad872172..88b4085acb 100644
--- a/src/or/crypt_path_st.h
+++ b/src/or/crypt_path_st.h
@@ -7,7 +7,7 @@
#ifndef CRYPT_PATH_ST_H
#define CRYPT_PATH_ST_H
-#include "relay_crypto_st.h"
+#include "or/relay_crypto_st.h"
/** Holds accounting information for a single step in the layered encryption
* performed by a circuit. Used only at the client edge of a circuit. */
diff --git a/src/or/dir_connection_st.h b/src/or/dir_connection_st.h
index 5b79dfcb6c..f68266ca2e 100644
--- a/src/or/dir_connection_st.h
+++ b/src/or/dir_connection_st.h
@@ -7,7 +7,7 @@
#ifndef DIR_CONNECTION_ST_H
#define DIR_CONNECTION_ST_H
-#include "connection_st.h"
+#include "or/connection_st.h"
/** Subtype of connection_t for an "directory connection" -- that is, an HTTP
* connection to retrieve or serve directory material. */
diff --git a/src/or/dir_server_st.h b/src/or/dir_server_st.h
index 0c2e905fb9..8fdb04a7de 100644
--- a/src/or/dir_server_st.h
+++ b/src/or/dir_server_st.h
@@ -7,9 +7,9 @@
#ifndef DIR_SERVER_ST_H
#define DIR_SERVER_ST_H
-#include "torint.h"
-#include "or.h"
-#include "routerstatus_st.h"
+#include "common/torint.h"
+#include "or/or.h"
+#include "or/routerstatus_st.h"
/** Represents information about a single trusted or fallback directory
* server. */
diff --git a/src/or/dirauth/dircollate.c b/src/or/dirauth/dircollate.c
index 52d2f838e6..246977dcc8 100644
--- a/src/or/dirauth/dircollate.c
+++ b/src/or/dirauth/dircollate.c
@@ -22,11 +22,11 @@
*/
#define DIRCOLLATE_PRIVATE
-#include "dircollate.h"
-#include "dirvote.h"
+#include "or/dirauth/dircollate.h"
+#include "or/dirauth/dirvote.h"
-#include "networkstatus_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/networkstatus_st.h"
+#include "or/vote_routerstatus_st.h"
static void dircollator_collate_by_ed25519(dircollator_t *dc);
diff --git a/src/or/dirauth/dircollate.h b/src/or/dirauth/dircollate.h
index 7dc949760f..1d403b20f2 100644
--- a/src/or/dirauth/dircollate.h
+++ b/src/or/dirauth/dircollate.h
@@ -12,8 +12,8 @@
#ifndef TOR_DIRCOLLATE_H
#define TOR_DIRCOLLATE_H
-#include "testsupport.h"
-#include "or.h"
+#include "common/testsupport.h"
+#include "or/or.h"
typedef struct dircollator_s dircollator_t;
diff --git a/src/or/dirauth/dirvote.c b/src/or/dirauth/dirvote.c
index bd62109e03..a9429a9116 100644
--- a/src/or/dirauth/dirvote.c
+++ b/src/or/dirauth/dirvote.c
@@ -4,44 +4,44 @@
/* See LICENSE for licensing information */
#define DIRVOTE_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "dircollate.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "parsecommon.h"
-#include "policies.h"
-#include "protover.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "entrynodes.h" /* needed for guardfraction methods */
-#include "torcert.h"
-#include "voting_schedule.h"
-
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-#include "dirauth/shared_random_state.h"
-
-#include "authority_cert_st.h"
-#include "cached_dir_st.h"
-#include "dir_server_st.h"
-#include "document_signature_st.h"
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "node_st.h"
-#include "ns_detached_signatures_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
-#include "vote_timing_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/dirauth/dircollate.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/parsecommon.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/entrynodes.h" /* needed for guardfraction methods */
+#include "or/torcert.h"
+#include "or/voting_schedule.h"
+
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+#include "or/dirauth/shared_random_state.h"
+
+#include "or/authority_cert_st.h"
+#include "or/cached_dir_st.h"
+#include "or/dir_server_st.h"
+#include "or/document_signature_st.h"
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/node_st.h"
+#include "or/ns_detached_signatures_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
+#include "or/vote_timing_st.h"
/**
* \file dirvote.c
diff --git a/src/or/dirauth/mode.h b/src/or/dirauth/mode.h
index 462d81d1bd..17c35aff64 100644
--- a/src/or/dirauth/mode.h
+++ b/src/or/dirauth/mode.h
@@ -11,7 +11,7 @@
#ifdef HAVE_MODULE_DIRAUTH
-#include "router.h"
+#include "or/router.h"
/* Return true iff we believe ourselves to be a v3 authoritative directory
* server. */
diff --git a/src/or/dirauth/shared_random.c b/src/or/dirauth/shared_random.c
index a577b2fb2f..0860efacad 100644
--- a/src/or/dirauth/shared_random.c
+++ b/src/or/dirauth/shared_random.c
@@ -87,26 +87,26 @@
#define SHARED_RANDOM_PRIVATE
-#include "or.h"
-#include "shared_random.h"
-#include "config.h"
-#include "confparse.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "shared_random_client.h"
-#include "shared_random_state.h"
-#include "util.h"
-#include "voting_schedule.h"
-
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-
-#include "authority_cert_st.h"
-#include "networkstatus_st.h"
+#include "or/or.h"
+#include "or/dirauth/shared_random.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/shared_random_client.h"
+#include "or/dirauth/shared_random_state.h"
+#include "common/util.h"
+#include "or/voting_schedule.h"
+
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+
+#include "or/authority_cert_st.h"
+#include "or/networkstatus_st.h"
/* String prefix of shared random values in votes/consensuses. */
static const char previous_srv_str[] = "shared-rand-previous-value";
diff --git a/src/or/dirauth/shared_random.h b/src/or/dirauth/shared_random.h
index e2597f354d..93bab99f71 100644
--- a/src/or/dirauth/shared_random.h
+++ b/src/or/dirauth/shared_random.h
@@ -10,7 +10,7 @@
* with "sr_" which stands for shared random.
*/
-#include "or.h"
+#include "or/or.h"
/* Protocol version */
#define SR_PROTO_VERSION 1
diff --git a/src/or/dirauth/shared_random_state.c b/src/or/dirauth/shared_random_state.c
index a7047536c3..9bea02e820 100644
--- a/src/or/dirauth/shared_random_state.c
+++ b/src/or/dirauth/shared_random_state.c
@@ -10,17 +10,17 @@
#define SHARED_RANDOM_STATE_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "confparse.h"
-#include "crypto_util.h"
-#include "dirauth/dirvote.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "shared_random.h"
-#include "shared_random_client.h"
-#include "shared_random_state.h"
-#include "voting_schedule.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "common/crypto_util.h"
+#include "or/dirauth/dirvote.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/dirauth/shared_random.h"
+#include "or/shared_random_client.h"
+#include "or/dirauth/shared_random_state.h"
+#include "or/voting_schedule.h"
/* Default filename of the shared random state on disk. */
static const char default_fname[] = "sr-state";
diff --git a/src/or/dirauth/shared_random_state.h b/src/or/dirauth/shared_random_state.h
index b0e7cc4c27..a8ac0134cc 100644
--- a/src/or/dirauth/shared_random_state.h
+++ b/src/or/dirauth/shared_random_state.h
@@ -4,7 +4,7 @@
#ifndef TOR_SHARED_RANDOM_STATE_H
#define TOR_SHARED_RANDOM_STATE_H
-#include "shared_random.h"
+#include "or/dirauth/shared_random.h"
/* Action that can be performed on the state for any objects. */
typedef enum {
diff --git a/src/or/directory.c b/src/or/directory.c
index e7616881e9..e008ac7f7e 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -5,44 +5,44 @@
#define DIRECTORY_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "bridges.h"
-#include "buffers.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "conscache.h"
-#include "consdiff.h"
-#include "consdiffmgr.h"
-#include "control.h"
-#include "compat.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "fp_pair.h"
-#include "geoip.h"
-#include "hs_cache.h"
-#include "hs_common.h"
-#include "hs_control.h"
-#include "hs_client.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "or/bridges.h"
+#include "common/buffers.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/conscache.h"
+#include "or/consdiff.h"
+#include "or/consdiffmgr.h"
+#include "or/control.h"
+#include "common/compat.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "or/fp_pair.h"
+#include "or/geoip.h"
+#include "or/hs_cache.h"
+#include "or/hs_common.h"
+#include "or/hs_control.h"
+#include "or/hs_client.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
#if defined(EXPORTMALLINFO) && defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
#if !defined(OpenBSD)
@@ -50,19 +50,19 @@
#endif
#endif
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-#include "dirauth/shared_random.h"
-
-#include "authority_cert_st.h"
-#include "cached_dir_st.h"
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "entry_connection_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerinfo_st.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+#include "or/dirauth/shared_random.h"
+
+#include "or/authority_cert_st.h"
+#include "or/cached_dir_st.h"
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/entry_connection_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
/**
* \file directory.c
diff --git a/src/or/directory.h b/src/or/directory.h
index 9008df0f58..5cf8892ace 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -12,7 +12,7 @@
#ifndef TOR_DIRECTORY_H
#define TOR_DIRECTORY_H
-#include "hs_ident.h"
+#include "or/hs_ident.h"
dir_connection_t *TO_DIR_CONN(connection_t *c);
int directories_have_accepted_server_descriptor(void);
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index eaea502627..077135841f 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -4,47 +4,47 @@
/* See LICENSE for licensing information */
#define DIRSERV_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "confparse.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "command.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "conscache.h"
-#include "consdiffmgr.h"
-#include "control.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "hibernate.h"
-#include "keypin.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "protover.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "torcert.h"
-#include "voting_schedule.h"
-
-#include "dirauth/dirvote.h"
-
-#include "cached_dir_st.h"
-#include "dir_connection_st.h"
-#include "extrainfo_st.h"
-#include "microdesc_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "tor_version_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/command.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/conscache.h"
+#include "or/consdiffmgr.h"
+#include "or/control.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/hibernate.h"
+#include "or/keypin.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/torcert.h"
+#include "or/voting_schedule.h"
+
+#include "or/dirauth/dirvote.h"
+
+#include "or/cached_dir_st.h"
+#include "or/dir_connection_st.h"
+#include "or/extrainfo_st.h"
+#include "or/microdesc_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/tor_version_st.h"
+#include "or/vote_routerstatus_st.h"
/**
* \file dirserv.c
diff --git a/src/or/dirserv.h b/src/or/dirserv.h
index 61f4af4b50..a8d5ac616b 100644
--- a/src/or/dirserv.h
+++ b/src/or/dirserv.h
@@ -12,7 +12,7 @@
#ifndef TOR_DIRSERV_H
#define TOR_DIRSERV_H
-#include "testsupport.h"
+#include "common/testsupport.h"
/** What fraction (1 over this number) of the relay ID space do we
* (as a directory authority) launch connections to at each reachability
diff --git a/src/or/dns.c b/src/or/dns.c
index 8536fc8e90..3f5d39b41d 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -49,24 +49,24 @@
#define DNS_PRIVATE
-#include "or.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "dns.h"
-#include "main.h"
-#include "policies.h"
-#include "relay.h"
-#include "router.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/dns.h"
+#include "or/main.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/router.h"
#include "ht.h"
-#include "sandbox.h"
+#include "common/sandbox.h"
-#include "edge_connection_st.h"
-#include "or_circuit_st.h"
+#include "or/edge_connection_st.h"
+#include "or/or_circuit_st.h"
#include <event2/event.h>
#include <event2/dns.h>
diff --git a/src/or/dns.h b/src/or/dns.h
index d742083635..12853205ff 100644
--- a/src/or/dns.h
+++ b/src/or/dns.h
@@ -41,7 +41,7 @@ void dns_reset_correctness_checks(void);
void dump_dns_mem_usage(int severity);
#ifdef DNS_PRIVATE
-#include "dns_structs.h"
+#include "or/dns_structs.h"
MOCK_DECL(STATIC int,dns_resolve_impl,(edge_connection_t *exitconn,
int is_resolve,or_circuit_t *oncirc, char **hostname_out,
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c
index 3f2867feb1..ce1746fe27 100644
--- a/src/or/dnsserv.c
+++ b/src/or/dnsserv.c
@@ -21,19 +21,19 @@
* DNS client.
**/
-#include "or.h"
-#include "dnsserv.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "control.h"
-#include "main.h"
-#include "policies.h"
-
-#include "control_connection_st.h"
-#include "entry_connection_st.h"
-#include "listener_connection_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/dnsserv.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/control.h"
+#include "or/main.h"
+#include "or/policies.h"
+
+#include "or/control_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/listener_connection_st.h"
+#include "or/socks_request_st.h"
#include <event2/dns.h>
#include <event2/dns_compat.h>
diff --git a/src/or/dos.c b/src/or/dos.c
index f0b441c34e..5f4142b0e9 100644
--- a/src/or/dos.c
+++ b/src/or/dos.c
@@ -8,21 +8,21 @@
#define DOS_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "config.h"
-#include "connection_or.h"
-#include "crypto_rand.h"
-#include "geoip.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "router.h"
-
-#include "dos.h"
-
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/config.h"
+#include "or/connection_or.h"
+#include "common/crypto_rand.h"
+#include "or/geoip.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/router.h"
+
+#include "or/dos.h"
+
+#include "or/or_connection_st.h"
/*
* Circuit creation denial of service mitigation.
diff --git a/src/or/edge_connection_st.h b/src/or/edge_connection_st.h
index 6b3814353e..d58e1c2b8c 100644
--- a/src/or/edge_connection_st.h
+++ b/src/or/edge_connection_st.h
@@ -7,9 +7,9 @@
#ifndef EDGE_CONNECTION_ST_H
#define EDGE_CONNECTION_ST_H
-#include "or.h"
+#include "or/or.h"
-#include "connection_st.h"
+#include "or/connection_st.h"
/** Subtype of connection_t for an "edge connection" -- that is, an entry (ap)
* connection, or an exit. */
diff --git a/src/or/entry_connection_st.h b/src/or/entry_connection_st.h
index ade427f1f4..2f9676088c 100644
--- a/src/or/entry_connection_st.h
+++ b/src/or/entry_connection_st.h
@@ -7,7 +7,7 @@
#ifndef ENTRY_CONNECTION_ST_H
#define ENTRY_CONNECTION_ST_H
-#include "edge_connection_st.h"
+#include "or/edge_connection_st.h"
/** Subtype of edge_connection_t for an "entry connection" -- that is, a SOCKS
* connection, a DNS request, a TransPort connection or a NATD connection */
diff --git a/src/or/entry_port_cfg_st.h b/src/or/entry_port_cfg_st.h
index 78e0b3eb16..45dd844c46 100644
--- a/src/or/entry_port_cfg_st.h
+++ b/src/or/entry_port_cfg_st.h
@@ -7,8 +7,8 @@
#ifndef ENTRY_PORT_CFG_ST_H
#define ENTRY_PORT_CFG_ST_H
-#include "torint.h"
-#include "or.h"
+#include "common/torint.h"
+#include "or/or.h"
struct entry_port_cfg_t {
/* Client port types (socks, dns, trans, natd) only: */
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 604b79140a..6d13efda90 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -112,35 +112,35 @@
#define ENTRYNODES_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "bridges.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "transports.h"
-#include "statefile.h"
-
-#include "node_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/bridges.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/transports.h"
+#include "or/statefile.h"
+
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
/** A list of existing guard selection contexts. */
static smartlist_t *guard_contexts = NULL;
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h
index f26e905fd2..e56d4632b6 100644
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@ -12,7 +12,7 @@
#ifndef TOR_ENTRYNODES_H
#define TOR_ENTRYNODES_H
-#include "handles.h"
+#include "common/handles.h"
/* Forward declare for guard_selection_t; entrynodes.c has the real struct */
typedef struct guard_selection_s guard_selection_t;
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index 00c750975e..d84f263aa6 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -17,19 +17,19 @@
*/
#define EXT_ORPORT_PRIVATE
-#include "or.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "control.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "ext_orport.h"
-#include "main.h"
-#include "proto_ext_or.h"
-#include "util.h"
-
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/ext_orport.h"
+#include "or/main.h"
+#include "or/proto_ext_or.h"
+#include "common/util.h"
+
+#include "or/or_connection_st.h"
/** Allocate and return a structure capable of holding an Extended
* ORPort message of body length <b>len</b>. */
diff --git a/src/or/extrainfo_st.h b/src/or/extrainfo_st.h
index 041a932da7..f91bba7b68 100644
--- a/src/or/extrainfo_st.h
+++ b/src/or/extrainfo_st.h
@@ -7,7 +7,7 @@
#ifndef EXTRAINFO_ST_H
#define EXTRAINFO_ST_H
-#include "signed_descriptor_st.h"
+#include "or/signed_descriptor_st.h"
/** Information needed to keep and cache a signed extra-info document. */
struct extrainfo_t {
diff --git a/src/or/fp_pair.c b/src/or/fp_pair.c
index e437562fc3..1d7b751c23 100644
--- a/src/or/fp_pair.c
+++ b/src/or/fp_pair.c
@@ -17,8 +17,8 @@
* certificate for any (ID key, signing key) pair.
**/
-#include "or.h"
-#include "fp_pair.h"
+#include "or/or.h"
+#include "or/fp_pair.h"
/* Define fp_pair_map_t structures */
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 533468a2de..634ee707b4 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -28,15 +28,15 @@
*/
#define GEOIP_PRIVATE
-#include "or.h"
+#include "or/or.h"
#include "ht.h"
-#include "buffers.h"
-#include "config.h"
-#include "control.h"
-#include "dnsserv.h"
-#include "dos.h"
-#include "geoip.h"
-#include "routerlist.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "or/dnsserv.h"
+#include "or/dos.h"
+#include "or/geoip.h"
+#include "or/routerlist.h"
static void init_geoip_countries(void);
diff --git a/src/or/geoip.h b/src/or/geoip.h
index c3b51c6630..8a5dd701e0 100644
--- a/src/or/geoip.h
+++ b/src/or/geoip.h
@@ -12,8 +12,8 @@
#ifndef TOR_GEOIP_H
#define TOR_GEOIP_H
-#include "testsupport.h"
-#include "dos.h"
+#include "common/testsupport.h"
+#include "or/dos.h"
#ifdef GEOIP_PRIVATE
STATIC int geoip_parse_entry(const char *line, sa_family_t family);
diff --git a/src/or/git_revision.c b/src/or/git_revision.c
index cd63ed8302..be6f67423c 100644
--- a/src/or/git_revision.c
+++ b/src/or/git_revision.c
@@ -3,7 +3,7 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "git_revision.h"
+#include "or/git_revision.h"
/** String describing which Tor Git repository version the source was
* built from. This string is generated by a bit of shell kludging in
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 36534516bd..595b839574 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -28,21 +28,21 @@ hibernating, phase 2:
*/
#define HIBERNATE_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "hibernate.h"
-#include "main.h"
-#include "router.h"
-#include "statefile.h"
-
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/router.h"
+#include "or/statefile.h"
+
+#include "or/or_connection_st.h"
/** Are we currently awake, asleep, running out of bandwidth, or shutting
* down? */
diff --git a/src/or/hibernate.h b/src/or/hibernate.h
index b31dfb8fd9..cdef33543a 100644
--- a/src/or/hibernate.h
+++ b/src/or/hibernate.h
@@ -12,7 +12,7 @@
#ifndef TOR_HIBERNATE_H
#define TOR_HIBERNATE_H
-#include "testsupport.h"
+#include "common/testsupport.h"
int accounting_parse_options(const or_options_t *options, int validate_only);
MOCK_DECL(int, accounting_is_enabled, (const or_options_t *options));
diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index 3170f7196c..c16a42a482 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -9,19 +9,19 @@
/* For unit tests.*/
#define HS_CACHE_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "hs_ident.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "hs_descriptor.h"
-#include "networkstatus.h"
-#include "rendcache.h"
-
-#include "hs_cache.h"
-
-#include "networkstatus_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/hs_ident.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/hs_descriptor.h"
+#include "or/networkstatus.h"
+#include "or/rendcache.h"
+
+#include "or/hs_cache.h"
+
+#include "or/networkstatus_st.h"
static int cached_client_descriptor_has_expired(time_t now,
const hs_cache_client_descriptor_t *cached_desc);
diff --git a/src/or/hs_cache.h b/src/or/hs_cache.h
index 03cea8412b..5ca158781b 100644
--- a/src/or/hs_cache.h
+++ b/src/or/hs_cache.h
@@ -11,11 +11,11 @@
#include <stdint.h>
-#include "crypto_ed25519.h"
-#include "hs_common.h"
-#include "hs_descriptor.h"
-#include "rendcommon.h"
-#include "torcert.h"
+#include "common/crypto_ed25519.h"
+#include "or/hs_common.h"
+#include "or/hs_descriptor.h"
+#include "or/rendcommon.h"
+#include "or/torcert.h"
/* This is the maximum time an introduction point state object can stay in the
* client cache in seconds (2 mins or 120 seconds). */
diff --git a/src/or/hs_cell.c b/src/or/hs_cell.c
index f108407895..40ec4ba9e7 100644
--- a/src/or/hs_cell.c
+++ b/src/or/hs_cell.c
@@ -6,24 +6,24 @@
* \brief Hidden service API for cell creation and handling.
**/
-#include "or.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "rendservice.h"
-#include "replaycache.h"
-#include "util.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/rendservice.h"
+#include "or/replaycache.h"
+#include "common/util.h"
-#include "hs_cell.h"
-#include "hs_ntor.h"
+#include "or/hs_cell.h"
+#include "or/hs_ntor.h"
-#include "origin_circuit_st.h"
+#include "or/origin_circuit_st.h"
/* Trunnel. */
-#include "ed25519_cert.h"
-#include "hs/cell_common.h"
-#include "hs/cell_establish_intro.h"
-#include "hs/cell_introduce1.h"
-#include "hs/cell_rendezvous.h"
+#include "trunnel/ed25519_cert.h"
+#include "trunnel/hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_introduce1.h"
+#include "trunnel/hs/cell_rendezvous.h"
/* Compute the MAC of an INTRODUCE cell in mac_out. The encoded_cell param is
* the cell content up to the ENCRYPTED section of length encoded_cell_len.
diff --git a/src/or/hs_cell.h b/src/or/hs_cell.h
index 5c6f64350e..4a522810c6 100644
--- a/src/or/hs_cell.h
+++ b/src/or/hs_cell.h
@@ -9,8 +9,8 @@
#ifndef TOR_HS_CELL_H
#define TOR_HS_CELL_H
-#include "or.h"
-#include "hs_service.h"
+#include "or/or.h"
+#include "or/hs_service.h"
/* An INTRODUCE1 cell requires at least this amount of bytes (see section
* 3.2.2 of the specification). Below this value, the cell must be padded. */
diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index d0c2d75204..36a9820446 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -7,36 +7,36 @@
#define HS_CIRCUIT_PRIVATE
-#include "or.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "relay.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-
-#include "hs_cell.h"
-#include "hs_ident.h"
-#include "hs_ntor.h"
-#include "hs_service.h"
-#include "hs_circuit.h"
+#include "or/or.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/relay.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+
+#include "or/hs_cell.h"
+#include "or/hs_ident.h"
+#include "or/hs_ntor.h"
+#include "or/hs_service.h"
+#include "or/hs_circuit.h"
/* Trunnel. */
-#include "ed25519_cert.h"
-#include "hs/cell_common.h"
-#include "hs/cell_establish_intro.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
+#include "trunnel/ed25519_cert.h"
+#include "trunnel/hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
/* A circuit is about to become an e2e rendezvous circuit. Check
* <b>circ_purpose</b> and ensure that it's properly set. Return true iff
diff --git a/src/or/hs_circuit.h b/src/or/hs_circuit.h
index 9ea42b3167..fbf11d1cc8 100644
--- a/src/or/hs_circuit.h
+++ b/src/or/hs_circuit.h
@@ -9,10 +9,10 @@
#ifndef TOR_HS_CIRCUIT_H
#define TOR_HS_CIRCUIT_H
-#include "or.h"
-#include "crypto_ed25519.h"
+#include "or/or.h"
+#include "common/crypto_ed25519.h"
-#include "hs_service.h"
+#include "or/hs_service.h"
/* Cleanup function when the circuit is closed or/and freed. */
void hs_circ_cleanup(circuit_t *circ);
diff --git a/src/or/hs_circuitmap.c b/src/or/hs_circuitmap.c
index 7f9b7e3cf2..21db652492 100644
--- a/src/or/hs_circuitmap.c
+++ b/src/or/hs_circuitmap.c
@@ -13,13 +13,13 @@
#define HS_CIRCUITMAP_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "hs_circuitmap.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/hs_circuitmap.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
/************************** HS circuitmap code *******************************/
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index 01d7f8cb90..331793c1fa 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -8,38 +8,38 @@
#define HS_CLIENT_PRIVATE
-#include "or.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "container.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "hs_cache.h"
-#include "hs_cell.h"
-#include "hs_circuit.h"
-#include "hs_client.h"
-#include "hs_control.h"
-#include "hs_descriptor.h"
-#include "hs_ident.h"
-#include "hs_ntor.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "reasons.h"
-#include "rendclient.h"
-#include "router.h"
-#include "routerset.h"
-
-#include "cpath_build_state_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "common/container.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/hs_cache.h"
+#include "or/hs_cell.h"
+#include "or/hs_circuit.h"
+#include "or/hs_client.h"
+#include "or/hs_control.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_ident.h"
+#include "or/hs_ntor.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/reasons.h"
+#include "or/rendclient.h"
+#include "or/router.h"
+#include "or/routerset.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/origin_circuit_st.h"
/* Return a human-readable string for the client fetch status code. */
static const char *
diff --git a/src/or/hs_client.h b/src/or/hs_client.h
index 3854aadeb1..f7fca0b00e 100644
--- a/src/or/hs_client.h
+++ b/src/or/hs_client.h
@@ -9,9 +9,9 @@
#ifndef TOR_HS_CLIENT_H
#define TOR_HS_CLIENT_H
-#include "crypto_ed25519.h"
-#include "hs_descriptor.h"
-#include "hs_ident.h"
+#include "common/crypto_ed25519.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_ident.h"
/* Status code of a descriptor fetch request. */
typedef enum {
diff --git a/src/or/hs_common.c b/src/or/hs_common.c
index 3586ce1ba9..51d74bf5af 100644
--- a/src/or/hs_common.c
+++ b/src/or/hs_common.c
@@ -11,36 +11,36 @@
#define HS_COMMON_PRIVATE
-#include "or.h"
-
-#include "config.h"
-#include "circuitbuild.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "hs_cache.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "hs_ident.h"
-#include "hs_service.h"
-#include "hs_circuitmap.h"
-#include "policies.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "routerset.h"
-#include "router.h"
-#include "shared_random_client.h"
-#include "dirauth/shared_random_state.h"
-
-#include "edge_connection_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+
+#include "or/config.h"
+#include "or/circuitbuild.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/hs_cache.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/hs_ident.h"
+#include "or/hs_service.h"
+#include "or/hs_circuitmap.h"
+#include "or/policies.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/routerset.h"
+#include "or/router.h"
+#include "or/shared_random_client.h"
+#include "or/dirauth/shared_random_state.h"
+
+#include "or/edge_connection_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerstatus_st.h"
/* Trunnel */
-#include "ed25519_cert.h"
+#include "trunnel/ed25519_cert.h"
/* Ed25519 Basepoint value. Taken from section 5 of
* https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03 */
diff --git a/src/or/hs_common.h b/src/or/hs_common.h
index 82b1f3908a..6d60d7799f 100644
--- a/src/or/hs_common.h
+++ b/src/or/hs_common.h
@@ -9,10 +9,10 @@
#ifndef TOR_HS_COMMON_H
#define TOR_HS_COMMON_H
-#include "or.h"
+#include "or/or.h"
/* Trunnel */
-#include "ed25519_cert.h"
+#include "trunnel/ed25519_cert.h"
/* Protocol version 2. Use this instead of hardcoding "2" in the code base,
* this adds a clearer semantic to the value when used. */
diff --git a/src/or/hs_config.c b/src/or/hs_config.c
index a8ca549445..c8ce5b43fa 100644
--- a/src/or/hs_config.c
+++ b/src/or/hs_config.c
@@ -25,10 +25,10 @@
#define HS_CONFIG_PRIVATE
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_service.h"
-#include "rendservice.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_service.h"
+#include "or/rendservice.h"
/* Using the given list of services, stage them into our global state. Every
* service version are handled. This function can remove entries in the given
diff --git a/src/or/hs_config.h b/src/or/hs_config.h
index c8800d33ee..461d58d384 100644
--- a/src/or/hs_config.h
+++ b/src/or/hs_config.h
@@ -9,7 +9,7 @@
#ifndef TOR_HS_CONFIG_H
#define TOR_HS_CONFIG_H
-#include "or.h"
+#include "or/or.h"
/* Max value for HiddenServiceMaxStreams */
#define HS_CONFIG_MAX_STREAMS_PER_RDV_CIRCUIT 65535
diff --git a/src/or/hs_control.c b/src/or/hs_control.c
index 399a1d9bfb..fc828d0721 100644
--- a/src/or/hs_control.c
+++ b/src/or/hs_control.c
@@ -6,17 +6,17 @@
* \brief Contains control port event related code.
**/
-#include "or.h"
-#include "control.h"
-#include "crypto_util.h"
-#include "hs_common.h"
-#include "hs_control.h"
-#include "hs_descriptor.h"
-#include "hs_service.h"
-#include "nodelist.h"
-
-#include "node_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/control.h"
+#include "common/crypto_util.h"
+#include "or/hs_common.h"
+#include "or/hs_control.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_service.h"
+#include "or/nodelist.h"
+
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
/* Send on the control port the "HS_DESC REQUESTED [...]" event.
*
diff --git a/src/or/hs_control.h b/src/or/hs_control.h
index 936e0c01b6..040ce4a793 100644
--- a/src/or/hs_control.h
+++ b/src/or/hs_control.h
@@ -9,7 +9,7 @@
#ifndef TOR_HS_CONTROL_H
#define TOR_HS_CONTROL_H
-#include "hs_ident.h"
+#include "or/hs_ident.h"
/* Event "HS_DESC REQUESTED [...]" */
void hs_control_desc_event_requested(const ed25519_public_key_t *onion_pk,
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 9b814e3055..feec0e66d4 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -55,19 +55,19 @@
/* For unit tests.*/
#define HS_DESCRIPTOR_PRIVATE
-#include "or.h"
-#include "ed25519_cert.h" /* Trunnel interface. */
-#include "hs_descriptor.h"
-#include "circuitbuild.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "parsecommon.h"
-#include "rendcache.h"
-#include "hs_cache.h"
-#include "hs_config.h"
-#include "torcert.h" /* tor_cert_encode_ed22519() */
-
-#include "extend_info_st.h"
+#include "or/or.h"
+#include "trunnel/ed25519_cert.h" /* Trunnel interface. */
+#include "or/hs_descriptor.h"
+#include "or/circuitbuild.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/parsecommon.h"
+#include "or/rendcache.h"
+#include "or/hs_cache.h"
+#include "or/hs_config.h"
+#include "or/torcert.h" /* tor_cert_encode_ed22519() */
+
+#include "or/extend_info_st.h"
/* Constant string value used for the descriptor format. */
#define str_hs_desc "hs-descriptor"
diff --git a/src/or/hs_descriptor.h b/src/or/hs_descriptor.h
index def50997c9..8a2df95277 100644
--- a/src/or/hs_descriptor.h
+++ b/src/or/hs_descriptor.h
@@ -11,13 +11,13 @@
#include <stdint.h>
-#include "or.h"
-#include "address.h"
-#include "container.h"
-#include "crypto.h"
-#include "crypto_ed25519.h"
-#include "ed25519_cert.h" /* needed for trunnel */
-#include "torcert.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "common/container.h"
+#include "common/crypto.h"
+#include "common/crypto_ed25519.h"
+#include "trunnel/ed25519_cert.h" /* needed for trunnel */
+#include "or/torcert.h"
/* Trunnel */
struct link_specifier_t;
diff --git a/src/or/hs_ident.c b/src/or/hs_ident.c
index ff33d8d065..d3d11393f0 100644
--- a/src/or/hs_ident.c
+++ b/src/or/hs_ident.c
@@ -7,8 +7,8 @@
* subsytem.
**/
-#include "crypto_util.h"
-#include "hs_ident.h"
+#include "common/crypto_util.h"
+#include "or/hs_ident.h"
/* Return a newly allocated circuit identifier. The given public key is copied
* identity_pk into the identifier. */
diff --git a/src/or/hs_ident.h b/src/or/hs_ident.h
index cd50f77959..476cdc19ee 100644
--- a/src/or/hs_ident.h
+++ b/src/or/hs_ident.h
@@ -21,9 +21,9 @@
#ifndef TOR_HS_IDENT_H
#define TOR_HS_IDENT_H
-#include "crypto_ed25519.h"
+#include "common/crypto_ed25519.h"
-#include "hs_common.h"
+#include "or/hs_common.h"
/* Length of the rendezvous cookie that is used to connect circuits at the
* rendezvous point. */
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c
index 430f2ce4b0..6c0729b050 100644
--- a/src/or/hs_intropoint.c
+++ b/src/or/hs_intropoint.c
@@ -8,26 +8,26 @@
#define HS_INTROPOINT_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "relay.h"
-#include "rendmid.h"
-#include "rephist.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/relay.h"
+#include "or/rendmid.h"
+#include "or/rephist.h"
/* Trunnel */
-#include "ed25519_cert.h"
-#include "hs/cell_common.h"
-#include "hs/cell_establish_intro.h"
-#include "hs/cell_introduce1.h"
+#include "trunnel/ed25519_cert.h"
+#include "trunnel/hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_introduce1.h"
-#include "hs_circuitmap.h"
-#include "hs_descriptor.h"
-#include "hs_intropoint.h"
-#include "hs_common.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_common.h"
-#include "or_circuit_st.h"
+#include "or/or_circuit_st.h"
/** Extract the authentication key from an ESTABLISH_INTRO or INTRODUCE1 using
* the given <b>cell_type</b> from <b>cell</b> and place it in
diff --git a/src/or/hs_intropoint.h b/src/or/hs_intropoint.h
index 68b9178b00..77e41647be 100644
--- a/src/or/hs_intropoint.h
+++ b/src/or/hs_intropoint.h
@@ -9,8 +9,8 @@
#ifndef TOR_HS_INTRO_H
#define TOR_HS_INTRO_H
-#include "crypto_curve25519.h"
-#include "torcert.h"
+#include "common/crypto_curve25519.h"
+#include "or/torcert.h"
/* Authentication key type in an ESTABLISH_INTRO cell. */
typedef enum {
@@ -55,8 +55,8 @@ void hs_intropoint_clear(hs_intropoint_t *ip);
#ifdef HS_INTROPOINT_PRIVATE
-#include "hs/cell_establish_intro.h"
-#include "hs/cell_introduce1.h"
+#include "trunnel/hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_introduce1.h"
STATIC int
verify_establish_intro_cell(const trn_cell_establish_intro_t *out,
diff --git a/src/or/hs_ntor.c b/src/or/hs_ntor.c
index 76ff3c9ace..61e1474aad 100644
--- a/src/or/hs_ntor.c
+++ b/src/or/hs_ntor.c
@@ -24,9 +24,9 @@
* rendezvous key expansion to setup end-to-end rend circuit keys.
*/
-#include "or.h"
-#include "crypto_util.h"
-#include "hs_ntor.h"
+#include "or/or.h"
+#include "common/crypto_util.h"
+#include "or/hs_ntor.h"
/* String constants used by the ntor HS protocol */
#define PROTOID "tor-hs-ntor-curve25519-sha3-256-1"
diff --git a/src/or/hs_ntor.h b/src/or/hs_ntor.h
index bfd6745b27..cc4afd536b 100644
--- a/src/or/hs_ntor.h
+++ b/src/or/hs_ntor.h
@@ -4,7 +4,7 @@
#ifndef TOR_HS_NTOR_H
#define TOR_HS_NTOR_H
-#include "or.h"
+#include "or/or.h"
/* Output length of KDF for key expansion */
#define HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN \
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index af7369e17f..722cc7fc5a 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -8,49 +8,49 @@
#define HS_SERVICE_PRIVATE
-#include "or.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "rendservice.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "shared_random_client.h"
-#include "statefile.h"
-
-#include "hs_circuit.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_control.h"
-#include "hs_descriptor.h"
-#include "hs_ident.h"
-#include "hs_intropoint.h"
-#include "hs_service.h"
-#include "hs_stats.h"
-
-#include "dir_connection_st.h"
-#include "edge_connection_st.h"
-#include "extend_info_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/shared_random_client.h"
+#include "or/statefile.h"
+
+#include "or/hs_circuit.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_control.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_ident.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_service.h"
+#include "or/hs_stats.h"
+
+#include "or/dir_connection_st.h"
+#include "or/edge_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerstatus_st.h"
/* Trunnel */
-#include "ed25519_cert.h"
-#include "hs/cell_common.h"
-#include "hs/cell_establish_intro.h"
+#include "trunnel/ed25519_cert.h"
+#include "trunnel/hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
/* Helper macro. Iterate over every service in the global map. The var is the
* name of the service pointer. */
diff --git a/src/or/hs_service.h b/src/or/hs_service.h
index 8bc2201d01..32db63bd2e 100644
--- a/src/or/hs_service.h
+++ b/src/or/hs_service.h
@@ -9,17 +9,17 @@
#ifndef TOR_HS_SERVICE_H
#define TOR_HS_SERVICE_H
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
-#include "replaycache.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
+#include "or/replaycache.h"
-#include "hs_common.h"
-#include "hs_descriptor.h"
-#include "hs_ident.h"
-#include "hs_intropoint.h"
+#include "or/hs_common.h"
+#include "or/hs_descriptor.h"
+#include "or/hs_ident.h"
+#include "or/hs_intropoint.h"
/* Trunnel */
-#include "hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_establish_intro.h"
/* When loading and configuring a service, this is the default version it will
* be configured for as it is possible that no HiddenServiceVersion is
diff --git a/src/or/hs_stats.c b/src/or/hs_stats.c
index 1e2a96945b..c8a99b19d4 100644
--- a/src/or/hs_stats.c
+++ b/src/or/hs_stats.c
@@ -6,9 +6,9 @@
* \brief Keeps stats about the activity of our onion service(s).
**/
-#include "or.h"
-#include "hs_stats.h"
-#include "hs_service.h"
+#include "or/or.h"
+#include "or/hs_stats.h"
+#include "or/hs_service.h"
/** Number of v3 INTRODUCE2 cells received */
static uint32_t n_introduce2_v3 = 0;
diff --git a/src/or/keypin.c b/src/or/keypin.c
index fa6b412d5c..4026460281 100644
--- a/src/or/keypin.c
+++ b/src/or/keypin.c
@@ -11,17 +11,17 @@
#define KEYPIN_PRIVATE
#include "orconfig.h"
-#include "compat.h"
-#include "crypto_digest.h"
-#include "crypto_format.h"
-#include "di_ops.h"
+#include "common/compat.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_format.h"
+#include "common/di_ops.h"
#include "ht.h"
-#include "keypin.h"
+#include "or/keypin.h"
#include "siphash.h"
-#include "torint.h"
-#include "torlog.h"
-#include "util.h"
-#include "util_format.h"
+#include "common/torint.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/util_format.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/or/keypin.h b/src/or/keypin.h
index 98434d26df..b8b9ff5972 100644
--- a/src/or/keypin.h
+++ b/src/or/keypin.h
@@ -4,7 +4,7 @@
#ifndef TOR_KEYPIN_H
#define TOR_KEYPIN_H
-#include "testsupport.h"
+#include "common/testsupport.h"
int keypin_check_and_add(const uint8_t *rsa_id_digest,
const uint8_t *ed25519_id_key,
diff --git a/src/or/listener_connection_st.h b/src/or/listener_connection_st.h
index 5138783924..7b5aafcb58 100644
--- a/src/or/listener_connection_st.h
+++ b/src/or/listener_connection_st.h
@@ -7,7 +7,7 @@
#ifndef LISTENER_CONNECTION_ST_H
#define LISTENER_CONNECTION_ST_H
-#include "connection_st.h"
+#include "or/connection_st.h"
/** Subtype of connection_t; used for a listener socket. */
struct listener_connection_t {
diff --git a/src/or/main.c b/src/or/main.c
index b87644f968..a1d7a5e9a0 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -47,88 +47,88 @@
**/
#define MAIN_PRIVATE
-#include "or.h"
-#include "addressmap.h"
-#include "backtrace.h"
-#include "bridges.h"
-#include "buffers.h"
-#include "buffers_tls.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "channelpadding.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitmux_ewma.h"
-#include "command.h"
-#include "compress.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "consdiffmgr.h"
-#include "control.h"
-#include "cpuworker.h"
-#include "crypto_s2k.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dns.h"
-#include "dnsserv.h"
-#include "dos.h"
-#include "entrynodes.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "hs_cache.h"
-#include "hs_circuitmap.h"
-#include "hs_client.h"
-#include "keypin.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "ntmain.h"
-#include "onion.h"
-#include "periodic.h"
-#include "policies.h"
-#include "protover.h"
-#include "transports.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "scheduler.h"
-#include "statefile.h"
-#include "status.h"
-#include "tor_api.h"
-#include "tor_api_internal.h"
-#include "util_process.h"
-#include "ext_orport.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "common/backtrace.h"
+#include "or/bridges.h"
+#include "common/buffers.h"
+#include "common/buffers_tls.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/channelpadding.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitmux_ewma.h"
+#include "or/command.h"
+#include "common/compress.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/consdiffmgr.h"
+#include "or/control.h"
+#include "or/cpuworker.h"
+#include "common/crypto_s2k.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dns.h"
+#include "or/dnsserv.h"
+#include "or/dos.h"
+#include "or/entrynodes.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/hs_cache.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_client.h"
+#include "or/keypin.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/ntmain.h"
+#include "or/onion.h"
+#include "or/periodic.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/transports.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/scheduler.h"
+#include "or/statefile.h"
+#include "or/status.h"
+#include "or/tor_api.h"
+#include "or/tor_api_internal.h"
+#include "common/util_process.h"
+#include "or/ext_orport.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
-#include "memarea.h"
-#include "sandbox.h"
+#include "common/memarea.h"
+#include "common/sandbox.h"
#include <event2/event.h>
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-#include "dirauth/shared_random.h"
-
-#include "cell_st.h"
-#include "entry_connection_st.h"
-#include "networkstatus_st.h"
-#include "or_connection_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "socks_request_st.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+#include "or/dirauth/shared_random.h"
+
+#include "or/cell_st.h"
+#include "or/entry_connection_st.h"
+#include "or/networkstatus_st.h"
+#include "or/or_connection_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/socks_request_st.h"
#ifdef HAVE_SYSTEMD
# if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
diff --git a/src/or/main.h b/src/or/main.h
index 4739d1684b..214a9b3b0a 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -112,7 +112,7 @@ STATIC int get_my_roles(const or_options_t *options);
extern smartlist_t *connection_array;
/* We need the periodic_event_item_t definition. */
-#include "periodic.h"
+#include "or/periodic.h"
extern periodic_event_item_t periodic_events[];
#endif
#endif /* defined(MAIN_PRIVATE) */
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 31e2a2bd1c..d29d2c300e 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -8,24 +8,24 @@
* less-frequently-changing router information.
*/
-#include "or.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
/** A data structure to hold a bunch of cached microdescriptors. There are
* two active files in the cache: a "cache file" that we mmap, and a "journal
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 5a2dbdcbc4..649d146d45 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -37,55 +37,55 @@
*/
#define NETWORKSTATUS_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "channel.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "consdiffmgr.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dos.h"
-#include "entrynodes.h"
-#include "hibernate.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "protover.h"
-#include "relay.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "scheduler.h"
-#include "transports.h"
-#include "torcert.h"
-#include "channelpadding.h"
-#include "voting_schedule.h"
-
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-#include "dirauth/shared_random.h"
-
-#include "authority_cert_st.h"
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "document_signature_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "ns_detached_signatures_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/channel.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/consdiffmgr.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dos.h"
+#include "or/entrynodes.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/protover.h"
+#include "or/relay.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/scheduler.h"
+#include "or/transports.h"
+#include "or/torcert.h"
+#include "or/channelpadding.h"
+#include "or/voting_schedule.h"
+
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+#include "or/dirauth/shared_random.h"
+
+#include "or/authority_cert_st.h"
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/document_signature_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/ns_detached_signatures_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
/** Most recently received and validated v3 "ns"-flavored consensus network
* status. */
diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h
index 42cfa5b9b8..97b90dab61 100644
--- a/src/or/networkstatus.h
+++ b/src/or/networkstatus.h
@@ -12,7 +12,7 @@
#ifndef TOR_NETWORKSTATUS_H
#define TOR_NETWORKSTATUS_H
-#include "testsupport.h"
+#include "common/testsupport.h"
void networkstatus_reset_warnings(void);
void networkstatus_reset_download_failures(void);
diff --git a/src/or/networkstatus_st.h b/src/or/networkstatus_st.h
index 0a564ae0e4..4fc04a5aa7 100644
--- a/src/or/networkstatus_st.h
+++ b/src/or/networkstatus_st.h
@@ -7,7 +7,7 @@
#ifndef NETWORKSTATUS_ST_H
#define NETWORKSTATUS_ST_H
-#include "networkstatus_sr_info_st.h"
+#include "or/networkstatus_sr_info_st.h"
/** A common structure to hold a v3 network status vote, or a v3 network
* status consensus. */
diff --git a/src/or/node_st.h b/src/or/node_st.h
index f8772cbadd..cc777003d8 100644
--- a/src/or/node_st.h
+++ b/src/or/node_st.h
@@ -7,7 +7,7 @@
#ifndef NODE_ST_H
#define NODE_ST_H
-#include "hsdir_index_st.h"
+#include "or/hsdir_index_st.h"
/** A node_t represents a Tor router.
*
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 5ad91227a8..561ac9fdaa 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -40,41 +40,41 @@
#define NODELIST_PRIVATE
-#include "or.h"
-#include "address.h"
-#include "address_set.h"
-#include "bridges.h"
-#include "config.h"
-#include "control.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "geoip.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "protover.h"
-#include "rendservice.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "torcert.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "common/address_set.h"
+#include "or/bridges.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "or/geoip.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/torcert.h"
#include <string.h>
-#include "dirauth/mode.h"
+#include "or/dirauth/mode.h"
-#include "dir_server_st.h"
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "routerstatus_st.h"
+#include "or/dir_server_st.h"
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/routerstatus_st.h"
static void nodelist_drop_node(node_t *node, int remove_from_ht);
#define node_free(val) \
diff --git a/src/or/ntmain.c b/src/or/ntmain.c
index 8b9adb0eeb..72ab5d9d58 100644
--- a/src/or/ntmain.c
+++ b/src/or/ntmain.c
@@ -19,10 +19,10 @@
#ifdef _WIN32
-#include "or.h"
-#include "config.h"
-#include "main.h"
-#include "ntmain.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/main.h"
+#include "or/ntmain.h"
#include <windows.h>
#define GENSRV_SERVICENAME "tor"
diff --git a/src/or/onion.c b/src/or/onion.c
index c2bb3940c5..27e05c7cc7 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -62,27 +62,27 @@
* onion_fast.c for more information.
**/
-#include "or.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "config.h"
-#include "cpuworker.h"
-#include "crypto_util.h"
-#include "networkstatus.h"
-#include "onion.h"
-#include "onion_fast.h"
-#include "onion_ntor.h"
-#include "onion_tap.h"
-#include "relay.h"
-#include "rephist.h"
-#include "router.h"
-
-#include "cell_st.h"
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/config.h"
+#include "or/cpuworker.h"
+#include "common/crypto_util.h"
+#include "or/networkstatus.h"
+#include "or/onion.h"
+#include "or/onion_fast.h"
+#include "or/onion_ntor.h"
+#include "or/onion_tap.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/router.h"
+
+#include "or/cell_st.h"
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
// trunnel
-#include "ed25519_cert.h"
+#include "trunnel/ed25519_cert.h"
/** Type for a linked list of circuits that are waiting for a free CPU worker
* to process a waiting onion handshake. */
diff --git a/src/or/onion_fast.c b/src/or/onion_fast.c
index 84377f6f0d..7d92de038c 100644
--- a/src/or/onion_fast.c
+++ b/src/or/onion_fast.c
@@ -27,10 +27,10 @@
* many RSA1024 keys.
**/
-#include "or.h"
-#include "onion_fast.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
+#include "or/or.h"
+#include "or/onion_fast.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
/** Release all state held in <b>victim</b>. */
void
diff --git a/src/or/onion_ntor.c b/src/or/onion_ntor.c
index c8c96e21b0..d44933a2bd 100644
--- a/src/or/onion_ntor.c
+++ b/src/or/onion_ntor.c
@@ -21,13 +21,13 @@
#include "orconfig.h"
#define ONION_NTOR_PRIVATE
-#include "crypto.h"
-#include "crypto_hkdf.h"
-#include "crypto_digest.h"
-#include "crypto_util.h"
-#include "onion_ntor.h"
-#include "torlog.h"
-#include "util.h"
+#include "common/crypto.h"
+#include "common/crypto_hkdf.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_util.h"
+#include "or/onion_ntor.h"
+#include "common/torlog.h"
+#include "common/util.h"
/** Free storage held in an ntor handshake state. */
void
diff --git a/src/or/onion_ntor.h b/src/or/onion_ntor.h
index e90657e888..3acb1eb626 100644
--- a/src/or/onion_ntor.h
+++ b/src/or/onion_ntor.h
@@ -4,9 +4,9 @@
#ifndef TOR_ONION_NTOR_H
#define TOR_ONION_NTOR_H
-#include "torint.h"
-#include "crypto_curve25519.h"
-#include "di_ops.h"
+#include "common/torint.h"
+#include "common/crypto_curve25519.h"
+#include "common/di_ops.h"
/** State to be maintained by a client between sending an ntor onionskin
* and receiving a reply. */
diff --git a/src/or/onion_tap.c b/src/or/onion_tap.c
index 06dc7c93e4..0f9fe31be4 100644
--- a/src/or/onion_tap.c
+++ b/src/or/onion_tap.c
@@ -27,12 +27,12 @@
* invoked from onion.c.
**/
-#include "or.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "onion_tap.h"
-#include "rephist.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/onion_tap.h"
+#include "or/rephist.h"
/*----------------------------------------------------------------------*/
diff --git a/src/or/or.h b/src/or/or.h
index b9935ed2cc..dc6d353cd9 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -26,7 +26,7 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* FreeBSD needs this to know what version it is */
#endif
-#include "torint.h"
+#include "common/torint.h"
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
@@ -66,29 +66,29 @@
#include <windows.h>
#endif /* defined(_WIN32) */
-#include "crypto.h"
-#include "crypto_format.h"
-#include "crypto_dh.h"
-#include "crypto_hkdf.h"
-#include "tortls.h"
-#include "torlog.h"
-#include "container.h"
-#include "compress.h"
-#include "address.h"
-#include "compat_libevent.h"
+#include "common/crypto.h"
+#include "common/crypto_format.h"
+#include "common/crypto_dh.h"
+#include "common/crypto_hkdf.h"
+#include "common/tortls.h"
+#include "common/torlog.h"
+#include "common/container.h"
+#include "common/compress.h"
+#include "common/address.h"
+#include "common/compat_libevent.h"
#include "ht.h"
-#include "confline.h"
-#include "replaycache.h"
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
+#include "common/confline.h"
+#include "or/replaycache.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
#include "tor_queue.h"
-#include "token_bucket.h"
-#include "util_format.h"
-#include "hs_circuitmap.h"
+#include "common/token_bucket.h"
+#include "common/util_format.h"
+#include "or/hs_circuitmap.h"
// These, more than other includes, are for keeping the other struct
// definitions working. We should remove them when we minimize our includes.
-#include "entry_port_cfg_st.h"
+#include "or/entry_port_cfg_st.h"
/* These signals are defined to help handle_control_signal work.
*/
diff --git a/src/or/or_circuit_st.h b/src/or/or_circuit_st.h
index 7416219503..158a5314ef 100644
--- a/src/or/or_circuit_st.h
+++ b/src/or/or_circuit_st.h
@@ -7,10 +7,10 @@
#ifndef OR_CIRCUIT_ST_H
#define OR_CIRCUIT_ST_H
-#include "or.h"
+#include "or/or.h"
-#include "circuit_st.h"
-#include "crypt_path_st.h"
+#include "or/circuit_st.h"
+#include "or/crypt_path_st.h"
struct onion_queue_t;
diff --git a/src/or/or_connection_st.h b/src/or/or_connection_st.h
index a043c63f42..eba2721c37 100644
--- a/src/or/or_connection_st.h
+++ b/src/or/or_connection_st.h
@@ -7,7 +7,7 @@
#ifndef OR_CONNECTION_ST_H
#define OR_CONNECTION_ST_H
-#include "connection_st.h"
+#include "or/connection_st.h"
/** Subtype of connection_t for an "OR connection" -- that is, one that speaks
* cells over TLS. */
diff --git a/src/or/origin_circuit_st.h b/src/or/origin_circuit_st.h
index de25b67d70..fa41214d41 100644
--- a/src/or/origin_circuit_st.h
+++ b/src/or/origin_circuit_st.h
@@ -7,9 +7,9 @@
#ifndef ORIGIN_CIRCUIT_ST_H
#define ORIGIN_CIRCUIT_ST_H
-#include "or.h"
+#include "or/or.h"
-#include "circuit_st.h"
+#include "or/circuit_st.h"
struct onion_queue_t;
diff --git a/src/or/parsecommon.c b/src/or/parsecommon.c
index 8a8b7f6b13..09c7d665fe 100644
--- a/src/or/parsecommon.c
+++ b/src/or/parsecommon.c
@@ -6,9 +6,9 @@
* \brief Common code to parse and validate various type of descriptors.
**/
-#include "parsecommon.h"
-#include "torlog.h"
-#include "util_format.h"
+#include "or/parsecommon.h"
+#include "common/torlog.h"
+#include "common/util_format.h"
#define MIN_ANNOTATION A_PURPOSE
#define MAX_ANNOTATION A_UNKNOWN_
diff --git a/src/or/parsecommon.h b/src/or/parsecommon.h
index fdcd2838e7..bfd5c58b8e 100644
--- a/src/or/parsecommon.h
+++ b/src/or/parsecommon.h
@@ -9,9 +9,9 @@
#ifndef TOR_PARSECOMMON_H
#define TOR_PARSECOMMON_H
-#include "container.h"
-#include "crypto.h"
-#include "memarea.h"
+#include "common/container.h"
+#include "common/crypto.h"
+#include "common/memarea.h"
/** Enumeration of possible token types. The ones starting with K_ correspond
* to directory 'keywords'. A_ is for an annotation, R or C is related to
diff --git a/src/or/periodic.c b/src/or/periodic.c
index 57967ccdf3..d379325f50 100644
--- a/src/or/periodic.c
+++ b/src/or/periodic.c
@@ -11,11 +11,11 @@
* that they fire. See periodic_events[] in main.c for examples.
*/
-#include "or.h"
-#include "compat_libevent.h"
-#include "config.h"
-#include "main.h"
-#include "periodic.h"
+#include "or/or.h"
+#include "common/compat_libevent.h"
+#include "or/config.h"
+#include "or/main.h"
+#include "or/periodic.h"
/** We disable any interval greater than this number of seconds, on the
* grounds that it is probably an absolute time mistakenly passed in as a
diff --git a/src/or/policies.c b/src/or/policies.c
index 150635580c..0f52d6bf15 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -17,25 +17,25 @@
#define POLICIES_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "config.h"
-#include "dirserv.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerparse.h"
-#include "geoip.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/config.h"
+#include "or/dirserv.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerparse.h"
+#include "or/geoip.h"
#include "ht.h"
-#include "dir_server_st.h"
-#include "microdesc_st.h"
-#include "node_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/dir_server_st.h"
+#include "or/microdesc_st.h"
+#include "or/node_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/** Policy that addresses for incoming SOCKS connections must match. */
static smartlist_t *socks_policy = NULL;
diff --git a/src/or/port_cfg_st.h b/src/or/port_cfg_st.h
index 4a1aa5dbd3..86a3b963bc 100644
--- a/src/or/port_cfg_st.h
+++ b/src/or/port_cfg_st.h
@@ -7,8 +7,8 @@
#ifndef PORT_CFG_ST_H
#define PORT_CFG_ST_H
-#include "entry_port_cfg_st.h"
-#include "server_port_cfg_st.h"
+#include "or/entry_port_cfg_st.h"
+#include "or/server_port_cfg_st.h"
/** Configuration for a single port that we're listening on. */
struct port_cfg_t {
diff --git a/src/or/proto_cell.c b/src/or/proto_cell.c
index b27368911c..af0862a971 100644
--- a/src/or/proto_cell.c
+++ b/src/or/proto_cell.c
@@ -4,13 +4,13 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "buffers.h"
-#include "proto_cell.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/proto_cell.h"
-#include "connection_or.h"
+#include "or/connection_or.h"
-#include "var_cell_st.h"
+#include "or/var_cell_st.h"
/** True iff the cell command <b>command</b> is one that implies a
* variable-length cell in Tor link protocol <b>linkproto</b>. */
diff --git a/src/or/proto_control0.c b/src/or/proto_control0.c
index 9b4f7384c9..5d83b11cb9 100644
--- a/src/or/proto_control0.c
+++ b/src/or/proto_control0.c
@@ -4,9 +4,9 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "buffers.h"
-#include "proto_control0.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/proto_control0.h"
/** Return 1 iff buf looks more like it has an (obsolete) v0 controller
* command on it than any valid v1 controller command. */
diff --git a/src/or/proto_ext_or.c b/src/or/proto_ext_or.c
index 3e793f6e04..495b489bc4 100644
--- a/src/or/proto_ext_or.c
+++ b/src/or/proto_ext_or.c
@@ -4,10 +4,10 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "buffers.h"
-#include "ext_orport.h"
-#include "proto_ext_or.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/ext_orport.h"
+#include "or/proto_ext_or.h"
/** The size of the header of an Extended ORPort message: 2 bytes for
* COMMAND, 2 bytes for BODYLEN */
diff --git a/src/or/proto_http.c b/src/or/proto_http.c
index 3c8f108c95..45f763b2af 100644
--- a/src/or/proto_http.c
+++ b/src/or/proto_http.c
@@ -5,9 +5,9 @@
/* See LICENSE for licensing information */
#define PROTO_HTTP_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "proto_http.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/proto_http.h"
/** Return true if <b>cmd</b> looks like a HTTP (proxy) request. */
int
diff --git a/src/or/proto_socks.c b/src/or/proto_socks.c
index d908cd84f2..d113bc9cab 100644
--- a/src/or/proto_socks.c
+++ b/src/or/proto_socks.c
@@ -4,17 +4,17 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "addressmap.h"
-#include "buffers.h"
-#include "control.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "ext_orport.h"
-#include "proto_socks.h"
-#include "reasons.h"
-
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "common/buffers.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/ext_orport.h"
+#include "or/proto_socks.h"
+#include "or/reasons.h"
+
+#include "or/socks_request_st.h"
static void socks_request_set_socks5_error(socks_request_t *req,
socks5_reply_status_t reason);
diff --git a/src/or/protover.c b/src/or/protover.c
index 1dbb43007f..3a106a50e8 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -23,9 +23,9 @@
#define PROTOVER_PRIVATE
-#include "or.h"
-#include "protover.h"
-#include "routerparse.h"
+#include "or/or.h"
+#include "or/protover.h"
+#include "or/routerparse.h"
#ifndef HAVE_RUST
diff --git a/src/or/protover.h b/src/or/protover.h
index 30b61ff59c..6236ed133c 100644
--- a/src/or/protover.h
+++ b/src/or/protover.h
@@ -9,7 +9,7 @@
#ifndef TOR_PROTOVER_H
#define TOR_PROTOVER_H
-#include "container.h"
+#include "common/container.h"
/** The first version of Tor that included "proto" entries in its
* descriptors. Authorities should use this to decide whether to
diff --git a/src/or/protover_rust.c b/src/or/protover_rust.c
index f9743491c8..bd2f88b98e 100644
--- a/src/or/protover_rust.c
+++ b/src/or/protover_rust.c
@@ -7,8 +7,8 @@
* and safe translation/handling between the Rust/C boundary.
*/
-#include "or.h"
-#include "protover.h"
+#include "or/or.h"
+#include "or/protover.h"
#ifdef HAVE_RUST
diff --git a/src/or/reasons.c b/src/or/reasons.c
index 4082c8d0b2..b9b7a7db8b 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -14,9 +14,9 @@
* to another.
**/
-#include "or.h"
-#include "config.h"
-#include "reasons.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/reasons.h"
/***************************** Edge (stream) reasons **********************/
diff --git a/src/or/relay.c b/src/or/relay.c
index a60e5d6019..143580a310 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -46,53 +46,53 @@
**/
#define RELAY_PRIVATE
-#include "or.h"
-#include "addressmap.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "channel.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "compress.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "geoip.h"
-#include "hs_cache.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "onion.h"
-#include "policies.h"
-#include "reasons.h"
-#include "relay.h"
-#include "relay_crypto.h"
-#include "rendcache.h"
-#include "rendcommon.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "scheduler.h"
-#include "rephist.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "cpath_build_state_st.h"
-#include "dir_connection_st.h"
-#include "destroy_cell_queue_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/addressmap.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/channel.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "common/compress.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/geoip.h"
+#include "or/hs_cache.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/onion.h"
+#include "or/policies.h"
+#include "or/reasons.h"
+#include "or/relay.h"
+#include "or/relay_crypto.h"
+#include "or/rendcache.h"
+#include "or/rendcommon.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/scheduler.h"
+#include "or/rephist.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/cpath_build_state_st.h"
+#include "or/dir_connection_st.h"
+#include "or/destroy_cell_queue_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
+#include "or/socks_request_st.h"
static edge_connection_t *relay_lookup_conn(circuit_t *circ, cell_t *cell,
cell_direction_t cell_direction,
diff --git a/src/or/relay_crypto.c b/src/or/relay_crypto.c
index 82ff9aca88..5179984e7d 100644
--- a/src/or/relay_crypto.c
+++ b/src/or/relay_crypto.c
@@ -4,17 +4,17 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "circuitlist.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "hs_ntor.h" // for HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN
-#include "relay.h"
-#include "relay_crypto.h"
-
-#include "cell_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/hs_ntor.h" // for HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN
+#include "or/relay.h"
+#include "or/relay_crypto.h"
+
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
/** Update digest from the payload of cell. Assign integrity part to
* cell.
diff --git a/src/or/rendcache.c b/src/or/rendcache.c
index 1d1223883e..c18920154e 100644
--- a/src/or/rendcache.c
+++ b/src/or/rendcache.c
@@ -7,17 +7,17 @@
**/
#define RENDCACHE_PRIVATE
-#include "rendcache.h"
+#include "or/rendcache.h"
-#include "config.h"
-#include "rephist.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "rendcommon.h"
+#include "or/config.h"
+#include "or/rephist.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/rendcommon.h"
-#include "extend_info_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
+#include "or/extend_info_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
/** Map from service id (as generated by rend_get_service_id) to
* rend_cache_entry_t. */
diff --git a/src/or/rendcache.h b/src/or/rendcache.h
index 12af720cf3..bb075409ec 100644
--- a/src/or/rendcache.h
+++ b/src/or/rendcache.h
@@ -9,8 +9,8 @@
#ifndef TOR_RENDCACHE_H
#define TOR_RENDCACHE_H
-#include "or.h"
-#include "rendcommon.h"
+#include "or/or.h"
+#include "or/rendcommon.h"
/** How old do we let hidden service descriptors get before discarding
* them as too old? */
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index f1c410dfb3..6fde0ba266 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -7,41 +7,41 @@
* \brief Client code to access location-hidden services.
**/
-#include "or.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "hs_circuit.h"
-#include "hs_client.h"
-#include "hs_common.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "origin_circuit_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/hs_circuit.h"
+#include "or/hs_client.h"
+#include "or/hs_common.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerstatus_st.h"
static extend_info_t *rend_client_get_random_intro_impl(
const rend_cache_entry_t *rend_query,
diff --git a/src/or/rendclient.h b/src/or/rendclient.h
index 2d32a3b8f4..77395d6cb8 100644
--- a/src/or/rendclient.h
+++ b/src/or/rendclient.h
@@ -12,7 +12,7 @@
#ifndef TOR_RENDCLIENT_H
#define TOR_RENDCLIENT_H
-#include "rendcache.h"
+#include "or/rendcache.h"
void rend_client_purge_state(void);
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index ab064af708..2c1caa6ce5 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -10,36 +10,36 @@
#define RENDCOMMON_PRIVATE
-#include "or.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "hs_client.h"
-#include "hs_common.h"
-#include "hs_intropoint.h"
-#include "networkstatus.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendmid.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "extend_info_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/hs_client.h"
+#include "or/hs_common.h"
+#include "or/hs_intropoint.h"
+#include "or/networkstatus.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendmid.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/extend_info_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerstatus_st.h"
/** Return 0 if one and two are the same service ids, else -1 or 1 */
int
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index a6e987dc43..77a5347125 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -7,20 +7,20 @@
* \brief Implement introductions points and rendezvous points.
**/
-#include "or.h"
-#include "channel.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "crypto.h"
-#include "dos.h"
-#include "relay.h"
-#include "rendmid.h"
-#include "rephist.h"
-#include "hs_circuitmap.h"
-#include "hs_intropoint.h"
-
-#include "or_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "common/crypto.h"
+#include "or/dos.h"
+#include "or/relay.h"
+#include "or/rendmid.h"
+#include "or/rephist.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_intropoint.h"
+
+#include "or/or_circuit_st.h"
/** Respond to an ESTABLISH_INTRO cell by checking the signed data and
* setting the circuit's purpose and service pk digest.
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 89088153bd..21a5a4e03b 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -9,45 +9,45 @@
#define RENDSERVICE_PRIVATE
-#include "or.h"
-#include "circpathbias.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "directory.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "rendclient.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "router.h"
-#include "relay.h"
-#include "rephist.h"
-#include "replaycache.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "crypt_path_reference_st.h"
-#include "edge_connection_st.h"
-#include "extend_info_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "rend_authorized_client_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/circpathbias.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "or/directory.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/rendclient.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/replaycache.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/crypt_path_reference_st.h"
+#include "or/edge_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/rend_authorized_client_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerstatus_st.h"
struct rend_service_t;
static origin_circuit_t *find_intro_circuit(rend_intro_point_t *intro,
diff --git a/src/or/rendservice.h b/src/or/rendservice.h
index a4d7700787..b2644d8b40 100644
--- a/src/or/rendservice.h
+++ b/src/or/rendservice.h
@@ -12,8 +12,8 @@
#ifndef TOR_RENDSERVICE_H
#define TOR_RENDSERVICE_H
-#include "or.h"
-#include "hs_service.h"
+#include "or/or.h"
+#include "or/hs_service.h"
typedef struct rend_intro_cell_s rend_intro_cell_t;
diff --git a/src/or/rephist.c b/src/or/rephist.c
index d401e0b3e2..c7a0a25563 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -74,23 +74,23 @@
* (The "rephist" name originally stood for "reputation and history". )
**/
-#include "or.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
#include "ht.h"
-#include "channelpadding.h"
-#include "connection_or.h"
-#include "statefile.h"
+#include "or/channelpadding.h"
+#include "or/connection_or.h"
+#include "or/statefile.h"
-#include "networkstatus_st.h"
-#include "or_circuit_st.h"
+#include "or/networkstatus_st.h"
+#include "or/or_circuit_st.h"
static void bw_arrays_init(void);
static void predicted_ports_alloc(void);
diff --git a/src/or/replaycache.c b/src/or/replaycache.c
index fd09b9f402..b5cc6a2823 100644
--- a/src/or/replaycache.c
+++ b/src/or/replaycache.c
@@ -21,8 +21,8 @@
#define REPLAYCACHE_PRIVATE
-#include "or.h"
-#include "replaycache.h"
+#include "or/or.h"
+#include "or/replaycache.h"
/** Free the replaycache r and all of its entries.
*/
diff --git a/src/or/router.c b/src/or/router.c
index 53dc7e836e..4f162ceac1 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -6,49 +6,49 @@
#define ROUTER_PRIVATE
-#include "or.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "config.h"
-#include "connection.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "crypto_curve25519.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dns.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "protover.h"
-#include "relay.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "statefile.h"
-#include "torcert.h"
-#include "transports.h"
-#include "routerset.h"
-
-#include "dirauth/mode.h"
-
-#include "authority_cert_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "extend_info_st.h"
-#include "extrainfo_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "common/crypto_curve25519.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dns.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/relay.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/statefile.h"
+#include "or/torcert.h"
+#include "or/transports.h"
+#include "or/routerset.h"
+
+#include "or/dirauth/mode.h"
+
+#include "or/authority_cert_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/extend_info_st.h"
+#include "or/extrainfo_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
/**
* \file router.c
diff --git a/src/or/router.h b/src/or/router.h
index d4cf82d59e..4a383ac420 100644
--- a/src/or/router.h
+++ b/src/or/router.h
@@ -12,7 +12,7 @@
#ifndef TOR_ROUTER_H
#define TOR_ROUTER_H
-#include "testsupport.h"
+#include "common/testsupport.h"
#define TOR_ROUTERINFO_ERROR_NO_EXT_ADDR (-1)
#define TOR_ROUTERINFO_ERROR_CANNOT_PARSE (-2)
diff --git a/src/or/routerinfo_st.h b/src/or/routerinfo_st.h
index c9f9894390..feb3b41fc6 100644
--- a/src/or/routerinfo_st.h
+++ b/src/or/routerinfo_st.h
@@ -7,7 +7,7 @@
#ifndef ROUTERINFO_ST_H
#define ROUTERINFO_ST_H
-#include "signed_descriptor_st.h"
+#include "or/signed_descriptor_st.h"
/** Information about another onion router in the network. */
struct routerinfo_t {
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index 3fab049df7..6bf066fbb4 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -14,13 +14,13 @@
* (TODO: The keys in router.c should go here too.)
*/
-#include "or.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "router.h"
-#include "crypto_pwbox.h"
-#include "routerkeys.h"
-#include "torcert.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/router.h"
+#include "common/crypto_pwbox.h"
+#include "or/routerkeys.h"
+#include "or/torcert.h"
#define ENC_KEY_HEADER "Boxed Ed25519 key"
#define ENC_KEY_TAG "master"
diff --git a/src/or/routerkeys.h b/src/or/routerkeys.h
index 764f7513ab..2339495d40 100644
--- a/src/or/routerkeys.h
+++ b/src/or/routerkeys.h
@@ -4,7 +4,7 @@
#ifndef TOR_ROUTERKEYS_H
#define TOR_ROUTERKEYS_H
-#include "crypto_ed25519.h"
+#include "common/crypto_ed25519.h"
#define INIT_ED_KEY_CREATE (1u<<0)
#define INIT_ED_KEY_REPLACE (1u<<1)
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 8bdfbeee1a..9ab01f4b39 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -91,51 +91,51 @@
**/
#define ROUTERLIST_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "bridges.h"
-#include "crypto_ed25519.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "connection.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "fp_pair.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "main.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "reasons.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "sandbox.h"
-#include "torcert.h"
-
-#include "dirauth/dirvote.h"
-#include "dirauth/mode.h"
-
-#include "authority_cert_st.h"
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "document_signature_st.h"
-#include "extrainfo_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "or/bridges.h"
+#include "common/crypto_ed25519.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "or/fp_pair.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/reasons.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "common/sandbox.h"
+#include "or/torcert.h"
+
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/mode.h"
+
+#include "or/authority_cert_st.h"
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/document_signature_st.h"
+#include "or/extrainfo_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/vote_routerstatus_st.h"
// #define DEBUG_ROUTERLIST
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index eb6a658fbf..a90c26b444 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -11,7 +11,7 @@
#ifndef TOR_ROUTERLIST_H
#define TOR_ROUTERLIST_H
-#include "testsupport.h"
+#include "common/testsupport.h"
int get_n_authorities(dirinfo_type_t type);
int trusted_dirs_reload_certs(void);
diff --git a/src/or/routerlist_st.h b/src/or/routerlist_st.h
index 123c0ab639..0b94a4dfcd 100644
--- a/src/or/routerlist_st.h
+++ b/src/or/routerlist_st.h
@@ -7,7 +7,7 @@
#ifndef ROUTERLIST_ST_H
#define ROUTERLIST_ST_H
-#include "desc_store_st.h"
+#include "or/desc_store_st.h"
/** Contents of a directory of onion routers. */
struct routerlist_t {
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 20fb6d1700..48b1828172 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -55,48 +55,48 @@
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "dirauth/shared_random.h"
-#include "dirserv.h"
-#include "entrynodes.h"
-#include "memarea.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "parsecommon.h"
-#include "policies.h"
-#include "protover.h"
-#include "rendcommon.h"
-#include "rephist.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "sandbox.h"
-#include "shared_random_client.h"
-#include "torcert.h"
-#include "voting_schedule.h"
-
-#include "dirauth/dirvote.h"
-
-#include "authority_cert_st.h"
-#include "document_signature_st.h"
-#include "extend_info_st.h"
-#include "extrainfo_st.h"
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "ns_detached_signatures_st.h"
-#include "rend_authorized_client_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "tor_version_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/dirauth/shared_random.h"
+#include "or/dirserv.h"
+#include "or/entrynodes.h"
+#include "common/memarea.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/parsecommon.h"
+#include "or/policies.h"
+#include "or/protover.h"
+#include "or/rendcommon.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "common/sandbox.h"
+#include "or/shared_random_client.h"
+#include "or/torcert.h"
+#include "or/voting_schedule.h"
+
+#include "or/dirauth/dirvote.h"
+
+#include "or/authority_cert_st.h"
+#include "or/document_signature_st.h"
+#include "or/extend_info_st.h"
+#include "or/extrainfo_st.h"
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/ns_detached_signatures_st.h"
+#include "or/rend_authorized_client_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/tor_version_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
#undef log
#include <math.h>
diff --git a/src/or/routerset.c b/src/or/routerset.c
index d08db8f4ba..231ae152a5 100644
--- a/src/or/routerset.c
+++ b/src/or/routerset.c
@@ -27,19 +27,19 @@
#define ROUTERSET_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "geoip.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerparse.h"
-#include "routerset.h"
-
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/geoip.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/** Return a new empty routerset. */
routerset_t *
diff --git a/src/or/routerstatus_st.h b/src/or/routerstatus_st.h
index 9d749ddb64..3de4a40ae4 100644
--- a/src/or/routerstatus_st.h
+++ b/src/or/routerstatus_st.h
@@ -7,7 +7,7 @@
#ifndef ROUTERSTATUS_ST_H
#define ROUTERSTATUS_ST_H
-#include "download_status_st.h"
+#include "or/download_status_st.h"
/** Contents of a single router entry in a network status object.
*/
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index 90c81eb053..5190100261 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -1,19 +1,19 @@
/* Copyright (c) 2013-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "config.h"
+#include "or/or.h"
+#include "or/config.h"
-#include "compat_libevent.h"
+#include "common/compat_libevent.h"
#define SCHEDULER_PRIVATE_
#define SCHEDULER_KIST_PRIVATE
-#include "scheduler.h"
-#include "main.h"
-#include "buffers.h"
+#include "or/scheduler.h"
+#include "or/main.h"
+#include "common/buffers.h"
#define TOR_CHANNEL_INTERNAL_
-#include "channeltls.h"
+#include "or/channeltls.h"
-#include "or_connection_st.h"
+#include "or/or_connection_st.h"
/**
* \file scheduler.c
diff --git a/src/or/scheduler.h b/src/or/scheduler.h
index 24e85b21a3..37c192fea9 100644
--- a/src/or/scheduler.h
+++ b/src/or/scheduler.h
@@ -9,9 +9,9 @@
#ifndef TOR_SCHEDULER_H
#define TOR_SCHEDULER_H
-#include "or.h"
-#include "channel.h"
-#include "testsupport.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "common/testsupport.h"
/** Scheduler type, we build an ordered list with those values from the
* parsed strings in Schedulers. The reason to do such a thing is so we can
diff --git a/src/or/scheduler_kist.c b/src/or/scheduler_kist.c
index 796bdf6ab4..6f07458d44 100644
--- a/src/or/scheduler_kist.c
+++ b/src/or/scheduler_kist.c
@@ -3,18 +3,18 @@
#define SCHEDULER_KIST_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "connection.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/networkstatus.h"
#define TOR_CHANNEL_INTERNAL_
-#include "channel.h"
-#include "channeltls.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
#define SCHEDULER_PRIVATE_
-#include "scheduler.h"
+#include "or/scheduler.h"
-#include "or_connection_st.h"
+#include "or/or_connection_st.h"
#define TLS_PER_CELL_OVERHEAD 29
diff --git a/src/or/scheduler_vanilla.c b/src/or/scheduler_vanilla.c
index 0400d77d71..0346af2ada 100644
--- a/src/or/scheduler_vanilla.c
+++ b/src/or/scheduler_vanilla.c
@@ -1,12 +1,12 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "config.h"
+#include "or/or.h"
+#include "or/config.h"
#define TOR_CHANNEL_INTERNAL_
-#include "channel.h"
+#include "or/channel.h"
#define SCHEDULER_PRIVATE_
-#include "scheduler.h"
+#include "or/scheduler.h"
/*****************************************************************************
* Other internal data
diff --git a/src/or/shared_random_client.c b/src/or/shared_random_client.c
index e34c6e9a8b..f0b13a171e 100644
--- a/src/or/shared_random_client.c
+++ b/src/or/shared_random_client.c
@@ -9,15 +9,15 @@
**/
#define SHARED_RANDOM_CLIENT_PRIVATE
-#include "shared_random_client.h"
+#include "or/shared_random_client.h"
-#include "config.h"
-#include "voting_schedule.h"
-#include "networkstatus.h"
-#include "util.h"
-#include "util_format.h"
+#include "or/config.h"
+#include "or/voting_schedule.h"
+#include "or/networkstatus.h"
+#include "common/util.h"
+#include "common/util_format.h"
-#include "networkstatus_st.h"
+#include "or/networkstatus_st.h"
/* Convert a given srv object to a string for the control port. This doesn't
* fail and the srv object MUST be valid. */
diff --git a/src/or/shared_random_client.h b/src/or/shared_random_client.h
index aa71eb0d97..079829496c 100644
--- a/src/or/shared_random_client.h
+++ b/src/or/shared_random_client.h
@@ -10,7 +10,7 @@
#define TOR_SHARED_RANDOM_CLIENT_H
/* Dirauth module. */
-#include "dirauth/shared_random.h"
+#include "or/dirauth/shared_random.h"
/* Helper functions. */
void sr_srv_encode(char *dst, size_t dst_len, const sr_srv_t *srv);
diff --git a/src/or/signed_descriptor_st.h b/src/or/signed_descriptor_st.h
index 92990ab5d2..90cd4a2703 100644
--- a/src/or/signed_descriptor_st.h
+++ b/src/or/signed_descriptor_st.h
@@ -7,7 +7,7 @@
#ifndef SIGNED_DESCRIPTOR_ST_H
#define SIGNED_DESCRIPTOR_ST_H
-#include "download_status_st.h"
+#include "or/download_status_st.h"
/** Information need to cache an onion router's descriptor. */
struct signed_descriptor_t {
diff --git a/src/or/statefile.c b/src/or/statefile.c
index 5b30228b94..53a25e13f2 100644
--- a/src/or/statefile.c
+++ b/src/or/statefile.c
@@ -29,19 +29,19 @@
*/
#define STATEFILE_PRIVATE
-#include "or.h"
-#include "circuitstats.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "control.h"
-#include "entrynodes.h"
-#include "hibernate.h"
-#include "main.h"
-#include "rephist.h"
-#include "router.h"
-#include "sandbox.h"
-#include "statefile.h"
+#include "or/or.h"
+#include "or/circuitstats.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "or/entrynodes.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/rephist.h"
+#include "or/router.h"
+#include "common/sandbox.h"
+#include "or/statefile.h"
/** A list of state-file "abbreviations," for compatibility. */
static config_abbrev_t state_abbrevs_[] = {
diff --git a/src/or/status.c b/src/or/status.c
index 4f1d92cc2a..d0b3bc5536 100644
--- a/src/or/status.c
+++ b/src/or/status.c
@@ -14,26 +14,26 @@
#define STATUS_PRIVATE
-#include "or.h"
-#include "circuituse.h"
-#include "config.h"
-#include "status.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "router.h"
-#include "circuitlist.h"
-#include "main.h"
-#include "rephist.h"
-#include "hibernate.h"
-#include "statefile.h"
-#include "hs_stats.h"
-#include "hs_service.h"
-#include "dos.h"
-
-#include "routerinfo_st.h"
+#include "or/or.h"
+#include "or/circuituse.h"
+#include "or/config.h"
+#include "or/status.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/router.h"
+#include "or/circuitlist.h"
+#include "or/main.h"
+#include "or/rephist.h"
+#include "or/hibernate.h"
+#include "or/statefile.h"
+#include "or/hs_stats.h"
+#include "or/hs_service.h"
+#include "or/dos.h"
+
+#include "or/routerinfo_st.h"
static void log_accounting(const time_t now, const or_options_t *options);
-#include "geoip.h"
+#include "or/geoip.h"
/** Return the total number of circuits. */
STATIC int
diff --git a/src/or/status.h b/src/or/status.h
index f75e8f9995..840ec11986 100644
--- a/src/or/status.h
+++ b/src/or/status.h
@@ -4,7 +4,7 @@
#ifndef TOR_STATUS_H
#define TOR_STATUS_H
-#include "testsupport.h"
+#include "common/testsupport.h"
int log_heartbeat(time_t now);
diff --git a/src/or/tor_api.c b/src/or/tor_api.c
index 9d3355f31c..efedf2dc78 100644
--- a/src/or/tor_api.c
+++ b/src/or/tor_api.c
@@ -8,8 +8,8 @@
* \file tor_api.c
**/
-#include "tor_api.h"
-#include "tor_api_internal.h"
+#include "or/tor_api.h"
+#include "or/tor_api_internal.h"
// Include this after the above headers, to insure that they don't
// depend on anything else.
diff --git a/src/or/torcert.c b/src/or/torcert.c
index 688b3486b1..a6bbe4231d 100644
--- a/src/or/torcert.c
+++ b/src/or/torcert.c
@@ -25,17 +25,17 @@
* that one is authority_cert_t, and it's mostly handled in routerlist.c.
*/
-#include "or.h"
-#include "config.h"
-#include "crypto_util.h"
-#include "torcert.h"
-#include "ed25519_cert.h"
-#include "torlog.h"
-#include "util.h"
-#include "compat.h"
-#include "link_handshake.h"
-
-#include "or_handshake_certs_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_util.h"
+#include "or/torcert.h"
+#include "trunnel/ed25519_cert.h"
+#include "common/torlog.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "trunnel/link_handshake.h"
+
+#include "or/or_handshake_certs_st.h"
/** Helper for tor_cert_create(): signs any 32 bytes, not just an ed25519
* key.
diff --git a/src/or/torcert.h b/src/or/torcert.h
index cf61ac8302..cba3d3622b 100644
--- a/src/or/torcert.h
+++ b/src/or/torcert.h
@@ -4,7 +4,7 @@
#ifndef TORCERT_H_INCLUDED
#define TORCERT_H_INCLUDED
-#include "crypto_ed25519.h"
+#include "common/crypto_ed25519.h"
#define SIGNED_KEY_TYPE_ED25519 0x01
diff --git a/src/or/transports.c b/src/or/transports.c
index e2deb31ea5..b88c42cbb9 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -90,17 +90,17 @@
**/
#define PT_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "config.h"
-#include "circuitbuild.h"
-#include "transports.h"
-#include "util.h"
-#include "router.h"
-#include "statefile.h"
-#include "connection_or.h"
-#include "ext_orport.h"
-#include "control.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/config.h"
+#include "or/circuitbuild.h"
+#include "or/transports.h"
+#include "common/util.h"
+#include "or/router.h"
+#include "or/statefile.h"
+#include "or/connection_or.h"
+#include "or/ext_orport.h"
+#include "or/control.h"
static process_environment_t *
create_managed_proxy_environment(const managed_proxy_t *mp);
diff --git a/src/or/vote_routerstatus_st.h b/src/or/vote_routerstatus_st.h
index fcd0a993f8..7ec0c962fe 100644
--- a/src/or/vote_routerstatus_st.h
+++ b/src/or/vote_routerstatus_st.h
@@ -7,7 +7,7 @@
#ifndef VOTE_ROUTERSTATUS_ST_H
#define VOTE_ROUTERSTATUS_ST_H
-#include "routerstatus_st.h"
+#include "or/routerstatus_st.h"
/** The claim about a single router, made in a vote. */
struct vote_routerstatus_t {
diff --git a/src/or/voting_schedule.c b/src/or/voting_schedule.c
index b53d88672c..6edde3f229 100644
--- a/src/or/voting_schedule.c
+++ b/src/or/voting_schedule.c
@@ -9,13 +9,13 @@
**/
#define VOTING_SCHEDULE_PRIVATE
-#include "voting_schedule.h"
+#include "or/voting_schedule.h"
-#include "or.h"
-#include "config.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/networkstatus.h"
-#include "networkstatus_st.h"
+#include "or/networkstatus_st.h"
/* =====
* Vote scheduling
diff --git a/src/or/voting_schedule.h b/src/or/voting_schedule.h
index 6758477fa2..0f27d36d52 100644
--- a/src/or/voting_schedule.h
+++ b/src/or/voting_schedule.h
@@ -9,7 +9,7 @@
#ifndef TOR_VOTING_SCHEDULE_H
#define TOR_VOTING_SCHEDULE_H
-#include "or.h"
+#include "or/or.h"
/** Scheduling information for a voting interval. */
typedef struct {
diff --git a/src/test/bench.c b/src/test/bench.c
index f1f19411d3..f54d8f5c60 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -10,24 +10,24 @@
#include "orconfig.h"
-#include "or.h"
-#include "onion_tap.h"
-#include "relay_crypto.h"
+#include "or/or.h"
+#include "or/onion_tap.h"
+#include "or/relay_crypto.h"
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
#include <openssl/obj_mac.h>
-#include "config.h"
-#include "crypto_curve25519.h"
-#include "onion_ntor.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "consdiff.h"
+#include "or/config.h"
+#include "common/crypto_curve25519.h"
+#include "or/onion_ntor.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/consdiff.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
static uint64_t nanostart;
diff --git a/src/test/fuzz/fuzz_consensus.c b/src/test/fuzz/fuzz_consensus.c
index 9761c27ad2..de54da61b8 100644
--- a/src/test/fuzz/fuzz_consensus.c
+++ b/src/test/fuzz/fuzz_consensus.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_descriptor.c b/src/test/fuzz/fuzz_descriptor.c
index 3b5af883f5..d28793fdf3 100644
--- a/src/test/fuzz/fuzz_descriptor.c
+++ b/src/test/fuzz/fuzz_descriptor.c
@@ -1,11 +1,11 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "routerlist.h"
-#include "routerkeys.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/routerlist.h"
+#include "or/routerkeys.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_check_tap_onion_key_crosscert__nocheck(const uint8_t *crosscert,
diff --git a/src/test/fuzz/fuzz_diff.c b/src/test/fuzz/fuzz_diff.c
index 91ecfe3099..eb5fc27e08 100644
--- a/src/test/fuzz/fuzz_diff.c
+++ b/src/test/fuzz/fuzz_diff.c
@@ -4,10 +4,10 @@
#define CONSDIFF_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "consdiff.h"
+#include "or/or.h"
+#include "or/consdiff.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_consensus_compute_digest_(const char *c, consensus_digest_t *d)
diff --git a/src/test/fuzz/fuzz_diff_apply.c b/src/test/fuzz/fuzz_diff_apply.c
index 589406e076..76789fabcd 100644
--- a/src/test/fuzz/fuzz_diff_apply.c
+++ b/src/test/fuzz/fuzz_diff_apply.c
@@ -4,10 +4,10 @@
#define CONSDIFF_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "consdiff.h"
+#include "or/or.h"
+#include "or/consdiff.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static int
mock_consensus_compute_digest_(const char *c, consensus_digest_t *d)
diff --git a/src/test/fuzz/fuzz_extrainfo.c b/src/test/fuzz/fuzz_extrainfo.c
index a3f10f6a36..274ecc7866 100644
--- a/src/test/fuzz/fuzz_extrainfo.c
+++ b/src/test/fuzz/fuzz_extrainfo.c
@@ -1,11 +1,11 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "routerlist.h"
-#include "routerkeys.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/routerlist.h"
+#include "or/routerkeys.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_hsdescv2.c b/src/test/fuzz/fuzz_hsdescv2.c
index 1dd41c857b..5cf2cffb88 100644
--- a/src/test/fuzz/fuzz_hsdescv2.c
+++ b/src/test/fuzz/fuzz_hsdescv2.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "rendcommon.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/rendcommon.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index e6c553ba67..d1ef34b6b3 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -4,14 +4,14 @@
#define ROUTERPARSE_PRIVATE
#define HS_DESCRIPTOR_PRIVATE
-#include "or.h"
-#include "ed25519_cert.h" /* Trunnel interface. */
-#include "crypto_ed25519.h"
-#include "hs_descriptor.h"
-#include "routerparse.h"
-#include "util.h"
+#include "or/or.h"
+#include "trunnel/ed25519_cert.h" /* Trunnel interface. */
+#include "common/crypto_ed25519.h"
+#include "or/hs_descriptor.h"
+#include "or/routerparse.h"
+#include "common/util.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_http.c b/src/test/fuzz/fuzz_http.c
index 99e3102c5e..a5be26df4f 100644
--- a/src/test/fuzz/fuzz_http.c
+++ b/src/test/fuzz/fuzz_http.c
@@ -6,17 +6,17 @@
#define BUFFERS_PRIVATE
#define DIRECTORY_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "config.h"
-#include "connection.h"
-#include "directory.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/directory.h"
+#include "common/torlog.h"
-#include "dir_connection_st.h"
+#include "or/dir_connection_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_connection_write_to_buf_impl_(const char *string, size_t len,
diff --git a/src/test/fuzz/fuzz_http_connect.c b/src/test/fuzz/fuzz_http_connect.c
index d1db654dfe..6640075023 100644
--- a/src/test/fuzz/fuzz_http_connect.c
+++ b/src/test/fuzz/fuzz_http_connect.c
@@ -6,19 +6,19 @@
#define BUFFERS_PRIVATE
#define CONNECTION_EDGE_PRIVATE
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "proto_socks.h"
-#include "torlog.h"
-
-#include "entry_connection_st.h"
-#include "socks_request_st.h"
-
-#include "fuzzing.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/proto_socks.h"
+#include "common/torlog.h"
+
+#include "or/entry_connection_st.h"
+#include "or/socks_request_st.h"
+
+#include "test/fuzz/fuzzing.h"
static void
mock_connection_write_to_buf_impl_(const char *string, size_t len,
diff --git a/src/test/fuzz/fuzz_iptsv2.c b/src/test/fuzz/fuzz_iptsv2.c
index 5a44ca5a9e..7bf4d1282e 100644
--- a/src/test/fuzz/fuzz_iptsv2.c
+++ b/src/test/fuzz/fuzz_iptsv2.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "rendcommon.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/rendcommon.h"
-#include "rend_service_descriptor_st.h"
+#include "or/rend_service_descriptor_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_microdesc.c b/src/test/fuzz/fuzz_microdesc.c
index 02fde6c379..74e0ef4f46 100644
--- a/src/test/fuzz/fuzz_microdesc.c
+++ b/src/test/fuzz/fuzz_microdesc.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2016-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "microdesc.h"
-#include "fuzzing.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "or/microdesc.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 3e47c46d40..8126f8e48f 100644
--- a/src/test/fuzz/fuzz_vrs.c
+++ b/src/test/fuzz/fuzz_vrs.c
@@ -2,16 +2,16 @@
/* See LICENSE for licensing information */
#define ROUTERPARSE_PRIVATE
#define NETWORKSTATUS_PRIVATE
-#include "or.h"
-#include "routerparse.h"
-#include "memarea.h"
-#include "microdesc.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/routerparse.h"
+#include "common/memarea.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
-#include "networkstatus_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/networkstatus_st.h"
+#include "or/vote_routerstatus_st.h"
-#include "fuzzing.h"
+#include "test/fuzz/fuzzing.h"
static void
mock_dump_desc__nodump(const char *desc, const char *type)
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c
index 4111be598f..b2fc85a497 100644
--- a/src/test/fuzz/fuzzing_common.c
+++ b/src/test/fuzz/fuzzing_common.c
@@ -2,12 +2,12 @@
/* See LICENSE for licensing information */
#define CRYPTO_ED25519_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "backtrace.h"
-#include "config.h"
-#include "fuzzing.h"
-#include "crypto.h"
-#include "crypto_ed25519.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "or/config.h"
+#include "test/fuzz/fuzzing.h"
+#include "common/crypto.h"
+#include "common/crypto_ed25519.h"
static or_options_t *mock_options = NULL;
static const or_options_t *
diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c
index 0b79004e26..ea12970b92 100644
--- a/src/test/hs_test_helpers.c
+++ b/src/test/hs_test_helpers.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_ed25519.h"
-#include "test.h"
-#include "torcert.h"
+#include "or/or.h"
+#include "common/crypto_ed25519.h"
+#include "test/test.h"
+#include "or/torcert.h"
-#include "hs_common.h"
-#include "hs_test_helpers.h"
+#include "or/hs_common.h"
+#include "test/hs_test_helpers.h"
hs_desc_intro_point_t *
hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now,
diff --git a/src/test/hs_test_helpers.h b/src/test/hs_test_helpers.h
index d1bb30c167..5c0262207a 100644
--- a/src/test/hs_test_helpers.h
+++ b/src/test/hs_test_helpers.h
@@ -4,8 +4,8 @@
#ifndef TOR_HS_TEST_HELPERS_H
#define TOR_HS_TEST_HELPERS_H
-#include "ed25519_cert.h"
-#include "hs_descriptor.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/hs_descriptor.h"
/* Set of functions to help build and test descriptors. */
hs_desc_intro_point_t *hs_helper_build_intro_point(
diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c
index 7a4412c2b2..03429b72cb 100644
--- a/src/test/log_test_helpers.c
+++ b/src/test/log_test_helpers.c
@@ -1,8 +1,8 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#define LOG_PRIVATE
-#include "torlog.h"
-#include "log_test_helpers.h"
+#include "common/torlog.h"
+#include "test/log_test_helpers.h"
/**
* \file log_test_helpers.c
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 8125b1c6cc..7c38504527 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -1,7 +1,7 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifndef TOR_LOG_TEST_HELPERS_H
#define TOR_LOG_TEST_HELPERS_H
diff --git a/src/test/rend_test_helpers.c b/src/test/rend_test_helpers.c
index 2844629610..6f0c1c121b 100644
--- a/src/test/rend_test_helpers.c
+++ b/src/test/rend_test_helpers.c
@@ -1,15 +1,15 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "rendcommon.h"
-#include "rend_test_helpers.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "or/rendcommon.h"
+#include "test/rend_test_helpers.h"
-#include "extend_info_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
+#include "or/extend_info_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
void
generate_desc(int time_diff, rend_encoded_v2_service_descriptor_t **desc,
diff --git a/src/test/rend_test_helpers.h b/src/test/rend_test_helpers.h
index 13846acd44..aca675b2a4 100644
--- a/src/test/rend_test_helpers.h
+++ b/src/test/rend_test_helpers.h
@@ -1,7 +1,7 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifndef TOR_REND_TEST_HELPERS_H
#define TOR_REND_TEST_HELPERS_H
diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c
index 452a440140..a8326aa671 100644
--- a/src/test/test-memwipe.c
+++ b/src/test/test-memwipe.c
@@ -7,9 +7,9 @@
#include <sys/types.h>
#include <stdlib.h>
-#include "crypto_util.h"
-#include "compat.h"
-#include "util.h"
+#include "common/crypto_util.h"
+#include "common/compat.h"
+#include "common/util.h"
static unsigned fill_a_buffer_memset(void) __attribute__((noinline));
static unsigned fill_a_buffer_memwipe(void) __attribute__((noinline));
diff --git a/src/test/test-timers.c b/src/test/test-timers.c
index 6636869aff..1953ea5e31 100644
--- a/src/test/test-timers.c
+++ b/src/test/test-timers.c
@@ -7,11 +7,11 @@
#include <stdio.h>
#include <string.h>
-#include "compat.h"
-#include "compat_libevent.h"
-#include "crypto_rand.h"
-#include "timers.h"
-#include "util.h"
+#include "common/compat.h"
+#include "common/compat_libevent.h"
+#include "common/crypto_rand.h"
+#include "common/timers.h"
+#include "common/util.h"
#define N_TIMERS 1000
#define MAX_DURATION 30
diff --git a/src/test/test.c b/src/test/test.c
index 8ae172538b..98f554b319 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -9,7 +9,7 @@
**/
#include "orconfig.h"
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#include <stdio.h>
#ifdef HAVE_FCNTL_H
@@ -39,34 +39,34 @@
long int lround(double x);
double fabs(double x);
-#include "or.h"
-#include "backtrace.h"
-#include "buffers.h"
-#include "circuitlist.h"
-#include "circuitstats.h"
-#include "compress.h"
-#include "config.h"
-#include "connection_edge.h"
-#include "rendcommon.h"
-#include "rendcache.h"
-#include "test.h"
-#include "main.h"
-#include "memarea.h"
-#include "onion.h"
-#include "onion_ntor.h"
-#include "onion_fast.h"
-#include "onion_tap.h"
-#include "policies.h"
-#include "rephist.h"
-#include "routerparse.h"
-#include "statefile.h"
-#include "crypto_curve25519.h"
-
-#include "extend_info_st.h"
-#include "or_circuit_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
+#include "or/or.h"
+#include "common/backtrace.h"
+#include "common/buffers.h"
+#include "or/circuitlist.h"
+#include "or/circuitstats.h"
+#include "common/compress.h"
+#include "or/config.h"
+#include "or/connection_edge.h"
+#include "or/rendcommon.h"
+#include "or/rendcache.h"
+#include "test/test.h"
+#include "or/main.h"
+#include "common/memarea.h"
+#include "or/onion.h"
+#include "or/onion_ntor.h"
+#include "or/onion_fast.h"
+#include "or/onion_tap.h"
+#include "or/policies.h"
+#include "or/rephist.h"
+#include "or/routerparse.h"
+#include "or/statefile.h"
+#include "common/crypto_curve25519.h"
+
+#include "or/extend_info_st.h"
+#include "or/or_circuit_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
/** Run unit tests for the onion handshake code. */
static void
diff --git a/src/test/test.h b/src/test/test.h
index 7cbebcb6a1..29e6544697 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -13,7 +13,7 @@
#define DEBUG_SMARTLIST 1
-#include "compat.h"
+#include "common/compat.h"
#include "tinytest.h"
#define TT_EXIT_TEST_FUNCTION STMT_BEGIN goto done; STMT_END
#include "tinytest_macros.h"
diff --git a/src/test/test_accounting.c b/src/test/test_accounting.c
index 9e16c09edf..ce8e08f7c9 100644
--- a/src/test/test_accounting.c
+++ b/src/test/test_accounting.c
@@ -1,13 +1,13 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
#define HIBERNATE_PRIVATE
-#include "hibernate.h"
-#include "config.h"
+#include "or/hibernate.h"
+#include "or/config.h"
#define STATEFILE_PRIVATE
-#include "statefile.h"
+#include "or/statefile.h"
#define NS_MODULE accounting
diff --git a/src/test/test_addr.c b/src/test/test_addr.c
index b61a9478c3..6778fde974 100644
--- a/src/test/test_addr.c
+++ b/src/test/test_addr.c
@@ -5,11 +5,11 @@
#define ADDRESSMAP_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "addressmap.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "or/addressmap.h"
+#include "test/log_test_helpers.h"
/** Mocking replacement: only handles localhost. */
static int
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 1a0f163535..38a5310ede 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -23,10 +23,10 @@
#include <net/if.h>
#endif /* defined(HAVE_IFCONF_TO_SMARTLIST) */
-#include "or.h"
-#include "address.h"
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
/** Return 1 iff <b>sockaddr1</b> and <b>sockaddr2</b> represent
* the same IP address and port combination. Otherwise, return 0.
diff --git a/src/test/test_address_set.c b/src/test/test_address_set.c
index 0ed9987a26..1df7b34422 100644
--- a/src/test/test_address_set.c
+++ b/src/test/test_address_set.c
@@ -1,21 +1,21 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "address_set.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "common/address_set.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
static networkstatus_t *dummy_ns = NULL;
static networkstatus_t *
diff --git a/src/test/test_bridges.c b/src/test/test_bridges.c
index c44f791e0d..c1de731b2d 100644
--- a/src/test/test_bridges.c
+++ b/src/test/test_bridges.c
@@ -11,16 +11,16 @@
#include <stdbool.h>
-#include "or.h"
-#include "address.h"
-#include "bridges.h"
-#include "config.h"
-#include "container.h"
-#include "transports.h"
-#include "util.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "or/bridges.h"
+#include "or/config.h"
+#include "common/container.h"
+#include "or/transports.h"
+#include "common/util.h"
/* Test suite stuff */
-#include "test.h"
+#include "test/test.h"
/**
* A mocked transport_t, constructed via mock_transport_get_by_name().
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c
index 9f16f8f50c..d2d167ac33 100644
--- a/src/test/test_bt_cl.c
+++ b/src/test/test_bt_cl.c
@@ -7,10 +7,10 @@
/* To prevent 'assert' from going away. */
#undef TOR_COVERAGE
-#include "or.h"
-#include "util.h"
-#include "backtrace.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/backtrace.h"
+#include "common/torlog.h"
/* -1: no crash.
* 0: crash with a segmentation fault.
diff --git a/src/test/test_buffers.c b/src/test/test_buffers.c
index 0828e720fc..cd4c9d0aef 100644
--- a/src/test/test_buffers.c
+++ b/src/test/test_buffers.c
@@ -5,13 +5,13 @@
#define BUFFERS_PRIVATE
#define PROTO_HTTP_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "buffers_tls.h"
-#include "crypto_rand.h"
-#include "proto_http.h"
-#include "proto_socks.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "common/buffers_tls.h"
+#include "common/crypto_rand.h"
+#include "or/proto_http.h"
+#include "or/proto_socks.h"
+#include "test/test.h"
/** Run unit tests for buffers.c */
static void
diff --git a/src/test/test_bwmgt.c b/src/test/test_bwmgt.c
index 268917005e..90c1b457d7 100644
--- a/src/test/test_bwmgt.c
+++ b/src/test/test_bwmgt.c
@@ -8,10 +8,10 @@
#define TOKEN_BUCKET_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "token_bucket.h"
+#include "common/token_bucket.h"
// an imaginary time, in timestamp units. Chosen so it will roll over.
static const uint32_t START_TS = UINT32_MAX-10;
diff --git a/src/test/test_cell_formats.c b/src/test/test_cell_formats.c
index 4b73aa9b50..685b6efc36 100644
--- a/src/test/test_cell_formats.c
+++ b/src/test/test_cell_formats.c
@@ -7,23 +7,23 @@
#define CONNECTION_EDGE_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "connection_edge.h"
-#include "connection_or.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "onion.h"
-#include "onion_tap.h"
-#include "onion_fast.h"
-#include "onion_ntor.h"
-#include "relay.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "var_cell_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/connection_edge.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/onion.h"
+#include "or/onion_tap.h"
+#include "or/onion_fast.h"
+#include "or/onion_ntor.h"
+#include "or/relay.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/var_cell_st.h"
+
+#include "test/test.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/test/test_cell_queue.c b/src/test/test_cell_queue.c
index 7662cad105..3369511afc 100644
--- a/src/test/test_cell_queue.c
+++ b/src/test/test_cell_queue.c
@@ -3,15 +3,15 @@
#define CIRCUITLIST_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "circuitlist.h"
-#include "relay.h"
-#include "test.h"
-
-#include "cell_st.h"
-#include "cell_queue_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/relay.h"
+#include "test/test.h"
+
+#include "or/cell_st.h"
+#include "or/cell_queue_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static void
test_cq_manip(void *arg)
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index b7f7653dbf..5b30c71123 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -3,33 +3,33 @@
#define TOR_CHANNEL_INTERNAL_
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "channel.h"
+#include "or/or.h"
+#include "or/channel.h"
/* For channel_note_destroy_not_pending */
#define CIRCUITLIST_PRIVATE
-#include "circuitlist.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
/* For var_cell_free */
-#include "connection_or.h"
-#include "crypto_rand.h"
+#include "or/connection_or.h"
+#include "common/crypto_rand.h"
/* For packed_cell stuff */
#define RELAY_PRIVATE
-#include "relay.h"
+#include "or/relay.h"
/* For init/free stuff */
-#include "scheduler.h"
-#include "networkstatus.h"
+#include "or/scheduler.h"
+#include "or/networkstatus.h"
-#include "cell_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "routerstatus_st.h"
-#include "var_cell_st.h"
+#include "or/cell_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerstatus_st.h"
+#include "or/var_cell_st.h"
/* Test suite stuff */
-#include "log_test_helpers.h"
-#include "test.h"
-#include "fakechans.h"
+#include "test/log_test_helpers.h"
+#include "test/test.h"
+#include "test/fakechans.h"
static int test_chan_accept_cells = 0;
static int test_chan_fixed_cells_recved = 0;
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 630d4ba60d..b48bf0f162 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -5,25 +5,25 @@
#define MAIN_PRIVATE
#define NETWORKSTATUS_PRIVATE
#define TOR_TIMERS_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "testsupport.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "channelpadding.h"
-#include "compat_libevent.h"
-#include "config.h"
-#include "compat_time.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "log_test_helpers.h"
-
-#include "cell_st.h"
-#include "networkstatus_st.h"
-#include "or_connection_st.h"
-#include "routerstatus_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/testsupport.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/channelpadding.h"
+#include "common/compat_libevent.h"
+#include "or/config.h"
+#include "common/compat_time.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "test/log_test_helpers.h"
+
+#include "or/cell_st.h"
+#include "or/networkstatus_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerstatus_st.h"
int channelpadding_get_netflow_inactive_timeout_ms(channel_t *chan);
int64_t channelpadding_compute_time_until_pad_for_netflow(channel_t *chan);
diff --git a/src/test/test_channeltls.c b/src/test/test_channeltls.c
index b6d2746aa1..08fec2de24 100644
--- a/src/test/test_channeltls.c
+++ b/src/test/test_channeltls.c
@@ -6,22 +6,22 @@
#include <math.h>
#define TOR_CHANNEL_INTERNAL_
-#include "or.h"
-#include "address.h"
-#include "buffers.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection_or.h"
-#include "config.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "common/buffers.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection_or.h"
+#include "or/config.h"
/* For init/free stuff */
-#include "scheduler.h"
-#include "tortls.h"
+#include "or/scheduler.h"
+#include "common/tortls.h"
-#include "or_connection_st.h"
+#include "or/or_connection_st.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
/* The channeltls unit tests */
static void test_channeltls_create(void *arg);
diff --git a/src/test/test_checkdir.c b/src/test/test_checkdir.c
index c2a44d1270..d0c899a07e 100644
--- a/src/test/test_checkdir.c
+++ b/src/test/test_checkdir.c
@@ -2,7 +2,7 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
#ifdef _WIN32
#include <direct.h>
@@ -10,9 +10,9 @@
#include <dirent.h>
#endif
-#include "config.h"
-#include "test.h"
-#include "util.h"
+#include "or/config.h"
+#include "test/test.h"
+#include "common/util.h"
#ifdef _WIN32
#define mkdir(a,b) mkdir(a)
diff --git a/src/test/test_circuitbuild.c b/src/test/test_circuitbuild.c
index 1dde24ab96..d17a04614c 100644
--- a/src/test/test_circuitbuild.c
+++ b/src/test/test_circuitbuild.c
@@ -5,14 +5,14 @@
#define CIRCUITBUILD_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "config.h"
-#include "circuitbuild.h"
-
-#include "extend_info_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "or/config.h"
+#include "or/circuitbuild.h"
+
+#include "or/extend_info_st.h"
/* Dummy nodes smartlist for testing */
static smartlist_t dummy_nodes;
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 6f8f23ef1d..96de2eed04 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -5,17 +5,17 @@
#define CIRCUITBUILD_PRIVATE
#define CIRCUITLIST_PRIVATE
#define HS_CIRCUITMAP_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuitmux_ewma.h"
-#include "hs_circuitmap.h"
-#include "test.h"
-#include "log_test_helpers.h"
-
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuitmux_ewma.h"
+#include "or/hs_circuitmap.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static channel_t *
new_fake_channel(void)
diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 4ed92f20f3..8a89927df9 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -5,15 +5,15 @@
#define CIRCUITMUX_PRIVATE
#define CIRCUITMUX_EWMA_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "circuitmux.h"
-#include "circuitmux_ewma.h"
-#include "relay.h"
-#include "scheduler.h"
-#include "test.h"
-
-#include "destroy_cell_queue_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/circuitmux.h"
+#include "or/circuitmux_ewma.h"
+#include "or/relay.h"
+#include "or/scheduler.h"
+#include "test/test.h"
+
+#include "or/destroy_cell_queue_st.h"
/* XXXX duplicated function from test_circuitlist.c */
static channel_t *
diff --git a/src/test/test_circuitstats.c b/src/test/test_circuitstats.c
index 79cf126fb4..94ba6ed448 100644
--- a/src/test/test_circuitstats.c
+++ b/src/test/test_circuitstats.c
@@ -6,21 +6,21 @@
#define CIRCUITLIST_PRIVATE
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "circuitstats.h"
-#include "circuituse.h"
-#include "channel.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "extend_info_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/circuitstats.h"
+#include "or/circuituse.h"
+#include "or/channel.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/extend_info_st.h"
+#include "or/origin_circuit_st.h"
void test_circuitstats_timeout(void *arg);
void test_circuitstats_hoplen(void *arg);
diff --git a/src/test/test_circuituse.c b/src/test/test_circuituse.c
index 3417d2e9ef..2524e43c68 100644
--- a/src/test/test_circuituse.c
+++ b/src/test/test_circuituse.c
@@ -5,17 +5,17 @@
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "test_helpers.h"
-#include "config.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "circuitbuild.h"
-#include "nodelist.h"
-
-#include "cpath_build_state_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "or/config.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "or/circuitbuild.h"
+#include "or/nodelist.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/origin_circuit_st.h"
static void
test_circuit_is_available_for_use_ret_false_when_marked_for_close(void *arg)
diff --git a/src/test/test_compat_libevent.c b/src/test/test_compat_libevent.c
index 292148d426..8e59137856 100644
--- a/src/test/test_compat_libevent.c
+++ b/src/test/test_compat_libevent.c
@@ -3,15 +3,15 @@
#define COMPAT_LIBEVENT_PRIVATE
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "compat_libevent.h"
+#include "common/compat_libevent.h"
#include <event2/event.h>
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE compat_libevent
diff --git a/src/test/test_config.c b/src/test/test_config.c
index a0a015a49b..177368c655 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -8,45 +8,45 @@
#define CONFIG_PRIVATE
#define PT_PRIVATE
#define ROUTERSET_PRIVATE
-#include "or.h"
-#include "address.h"
-#include "addressmap.h"
-#include "bridges.h"
-#include "circuitmux_ewma.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "test.h"
-#include "util.h"
-#include "connection_or.h"
-#include "control.h"
-#include "cpuworker.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "dns.h"
-#include "entrynodes.h"
-#include "transports.h"
-#include "ext_orport.h"
-#include "geoip.h"
-#include "hibernate.h"
-#include "main.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "rendclient.h"
-#include "rendservice.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "statefile.h"
-
-#include "test_helpers.h"
-
-#include "dir_server_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
+#include "or/or.h"
+#include "common/address.h"
+#include "or/addressmap.h"
+#include "or/bridges.h"
+#include "or/circuitmux_ewma.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "test/test.h"
+#include "common/util.h"
+#include "or/connection_or.h"
+#include "or/control.h"
+#include "or/cpuworker.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dns.h"
+#include "or/entrynodes.h"
+#include "or/transports.h"
+#include "or/ext_orport.h"
+#include "or/geoip.h"
+#include "or/hibernate.h"
+#include "or/main.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/rendclient.h"
+#include "or/rendservice.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/statefile.h"
+
+#include "test/test_helpers.h"
+
+#include "or/dir_server_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
static void
test_config_addressmap(void *arg)
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index db273e3ec3..674e2284e6 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -7,29 +7,29 @@
#define MAIN_PRIVATE
#define CONNECTION_OR_PRIVATE
-#include "or.h"
-#include "test.h"
-
-#include "connection.h"
-#include "connection_edge.h"
-#include "hs_common.h"
-#include "main.h"
-#include "microdesc.h"
-#include "nodelist.h"
-#include "networkstatus.h"
-#include "rendcache.h"
-#include "directory.h"
-#include "connection_or.h"
-
-#include "test_connection.h"
-#include "test_helpers.h"
-
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "node_st.h"
-#include "or_connection_st.h"
-#include "routerinfo_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "test/test.h"
+
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/hs_common.h"
+#include "or/main.h"
+#include "or/microdesc.h"
+#include "or/nodelist.h"
+#include "or/networkstatus.h"
+#include "or/rendcache.h"
+#include "or/directory.h"
+#include "or/connection_or.h"
+
+#include "test/test_connection.h"
+#include "test/test_helpers.h"
+
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/node_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerinfo_st.h"
+#include "or/socks_request_st.h"
static void * test_conn_get_basic_setup(const struct testcase_t *tc);
static int test_conn_get_basic_teardown(const struct testcase_t *tc,
diff --git a/src/test/test_conscache.c b/src/test/test_conscache.c
index fb5e4c842c..e3a617fe3e 100644
--- a/src/test/test_conscache.c
+++ b/src/test/test_conscache.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "config.h"
-#include "conscache.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "test/test.h"
#ifdef HAVE_UTIME_H
#include <utime.h>
diff --git a/src/test/test_consdiff.c b/src/test/test_consdiff.c
index cb02036795..e293866f3d 100644
--- a/src/test/test_consdiff.c
+++ b/src/test/test_consdiff.c
@@ -4,12 +4,12 @@
#define CONSDIFF_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "consdiff.h"
-#include "memarea.h"
-#include "log_test_helpers.h"
+#include "or/consdiff.h"
+#include "common/memarea.h"
+#include "test/log_test_helpers.h"
#define tt_str_eq_line(a,b) \
tt_assert(line_str_eq((b),(a)))
diff --git a/src/test/test_consdiffmgr.c b/src/test/test_consdiffmgr.c
index a8f862fdb0..c4b89ddf03 100644
--- a/src/test/test_consdiffmgr.c
+++ b/src/test/test_consdiffmgr.c
@@ -3,21 +3,21 @@
#define CONSDIFFMGR_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "conscache.h"
-#include "consdiff.h"
-#include "consdiffmgr.h"
-#include "cpuworker.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
-#include "routerparse.h"
-#include "workqueue.h"
-
-#include "networkstatus_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/conscache.h"
+#include "or/consdiff.h"
+#include "or/consdiffmgr.h"
+#include "or/cpuworker.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
+#include "or/routerparse.h"
+#include "common/workqueue.h"
+
+#include "or/networkstatus_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
// ============================== Setup/teardown the consdiffmgr
// These functions get run before/after each test in this module
diff --git a/src/test/test_containers.c b/src/test/test_containers.c
index 72a02863f1..1d5ee4fc97 100644
--- a/src/test/test_containers.c
+++ b/src/test/test_containers.c
@@ -4,10 +4,10 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "crypto_rand.h"
-#include "fp_pair.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "or/fp_pair.h"
+#include "test/test.h"
/** Helper: return a tristate based on comparing the strings in *<b>a</b> and
* *<b>b</b>. */
diff --git a/src/test/test_controller.c b/src/test/test_controller.c
index 4044a841e3..de8e4630cd 100644
--- a/src/test/test_controller.c
+++ b/src/test/test_controller.c
@@ -2,22 +2,22 @@
/* See LICENSE for licensing information */
#define CONTROL_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "control.h"
-#include "entrynodes.h"
-#include "hs_common.h"
-#include "networkstatus.h"
-#include "rendservice.h"
-#include "routerlist.h"
-#include "nodelist.h"
-#include "test.h"
-#include "test_helpers.h"
-
-#include "control_connection_st.h"
-#include "download_status_st.h"
-#include "microdesc_st.h"
-#include "node_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/control.h"
+#include "or/entrynodes.h"
+#include "or/hs_common.h"
+#include "or/networkstatus.h"
+#include "or/rendservice.h"
+#include "or/routerlist.h"
+#include "or/nodelist.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/control_connection_st.h"
+#include "or/download_status_st.h"
+#include "or/microdesc_st.h"
+#include "or/node_st.h"
static void
test_add_onion_helper_keyarg_v3(void *arg)
diff --git a/src/test/test_controller_events.c b/src/test/test_controller_events.c
index 5f0de3d385..b642a37d22 100644
--- a/src/test/test_controller_events.c
+++ b/src/test/test_controller_events.c
@@ -4,15 +4,15 @@
#define CONNECTION_PRIVATE
#define TOR_CHANNEL_INTERNAL_
#define CONTROL_PRIVATE
-#include "or.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection.h"
-#include "control.h"
-#include "test.h"
-
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection.h"
+#include "or/control.h"
+#include "test/test.h"
+
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
static void
add_testing_cell_stats_entry(circuit_t *circ, uint8_t command,
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index ffe4983cdc..ed4c0b05f2 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -6,14 +6,14 @@
#include "orconfig.h"
#define CRYPTO_CURVE25519_PRIVATE
#define CRYPTO_RAND_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "aes.h"
-#include "util.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/aes.h"
+#include "common/util.h"
#include "siphash.h"
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
#include "ed25519_vectors.inc"
/** Run unit tests for Diffie-Hellman functionality. */
diff --git a/src/test/test_crypto_openssl.c b/src/test/test_crypto_openssl.c
index 910d5cbe84..f33ed58d40 100644
--- a/src/test/test_crypto_openssl.c
+++ b/src/test/test_crypto_openssl.c
@@ -7,15 +7,15 @@
#define CRYPTO_RAND_PRIVATE
-#include "crypto_rand.h"
-#include "util.h"
-#include "util_format.h"
-#include "compat.h"
-#include "test.h"
+#include "common/crypto_rand.h"
+#include "common/util.h"
+#include "common/util_format.h"
+#include "common/compat.h"
+#include "test/test.h"
#include <openssl/evp.h>
#include <openssl/rand.h>
-#include "compat_openssl.h"
+#include "common/compat_openssl.h"
/* Test for rectifying openssl RAND engine. */
static void
diff --git a/src/test/test_crypto_slow.c b/src/test/test_crypto_slow.c
index 137953d453..c15d8deb9e 100644
--- a/src/test/test_crypto_slow.c
+++ b/src/test/test_crypto_slow.c
@@ -5,11 +5,11 @@
#include "orconfig.h"
#define CRYPTO_S2K_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "crypto_s2k.h"
-#include "crypto_pwbox.h"
-#include "crypto_rand.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/crypto_s2k.h"
+#include "common/crypto_pwbox.h"
+#include "common/crypto_rand.h"
#if defined(HAVE_LIBSCRYPT_H) && defined(HAVE_LIBSCRYPT_SCRYPT)
#define HAVE_LIBSCRYPT
diff --git a/src/test/test_data.c b/src/test/test_data.c
index 6a6979fc6a..be8153258b 100644
--- a/src/test/test_data.c
+++ b/src/test/test_data.c
@@ -3,7 +3,7 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "test.h"
+#include "test/test.h"
/* Our unit test expect that the AUTHORITY_CERT_* public keys will sort
* in this order. */
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index d6939ede3a..56293b5787 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -17,46 +17,46 @@
#define NETWORKSTATUS_PRIVATE
#define RELAY_PRIVATE
-#include "or.h"
-#include "bridges.h"
-#include "confparse.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "entrynodes.h"
-#include "fp_pair.h"
-#include "hibernate.h"
-#include "memarea.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "dirauth/shared_random_state.h"
-#include "test.h"
-#include "test_dir_common.h"
-#include "torcert.h"
-#include "relay.h"
-#include "log_test_helpers.h"
-#include "voting_schedule.h"
-
-#include "authority_cert_st.h"
-#include "document_signature_st.h"
-#include "extrainfo_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "ns_detached_signatures_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
-#include "tor_version_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/or.h"
+#include "or/bridges.h"
+#include "or/confparse.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "or/entrynodes.h"
+#include "or/fp_pair.h"
+#include "or/hibernate.h"
+#include "common/memarea.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/dirauth/shared_random_state.h"
+#include "test/test.h"
+#include "test/test_dir_common.h"
+#include "or/torcert.h"
+#include "or/relay.h"
+#include "test/log_test_helpers.h"
+#include "or/voting_schedule.h"
+
+#include "or/authority_cert_st.h"
+#include "or/document_signature_st.h"
+#include "or/extrainfo_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/ns_detached_signatures_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
+#include "or/tor_version_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
#define NS_MODULE dir
diff --git a/src/test/test_dir_common.c b/src/test/test_dir_common.c
index 7712c1a650..6933800eb8 100644
--- a/src/test/test_dir_common.c
+++ b/src/test/test_dir_common.c
@@ -5,21 +5,21 @@
#include "orconfig.h"
#define DIRVOTE_PRIVATE
-#include "test.h"
-#include "container.h"
-#include "or.h"
-#include "dirauth/dirvote.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "test_dir_common.h"
-#include "voting_schedule.h"
+#include "test/test.h"
+#include "common/container.h"
+#include "or/or.h"
+#include "or/dirauth/dirvote.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "test/test_dir_common.h"
+#include "or/voting_schedule.h"
-#include "authority_cert_st.h"
-#include "networkstatus_st.h"
-#include "networkstatus_voter_info_st.h"
-#include "routerinfo_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
+#include "or/authority_cert_st.h"
+#include "or/networkstatus_st.h"
+#include "or/networkstatus_voter_info_st.h"
+#include "or/routerinfo_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
void dir_common_setup_vote(networkstatus_t **vote, time_t now);
networkstatus_t * dir_common_add_rs_and_parse(networkstatus_t *vote,
diff --git a/src/test/test_dir_common.h b/src/test/test_dir_common.h
index d3441205ba..7d5f55afe6 100644
--- a/src/test/test_dir_common.h
+++ b/src/test/test_dir_common.h
@@ -3,9 +3,9 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "networkstatus.h"
-#include "routerparse.h"
+#include "or/or.h"
+#include "or/networkstatus.h"
+#include "or/routerparse.h"
#define TEST_DIR_ROUTER_ID_1 3
#define TEST_DIR_ROUTER_ID_2 5
diff --git a/src/test/test_dir_handle_get.c b/src/test/test_dir_handle_get.c
index 9c2e6b8494..fbc14e3d30 100644
--- a/src/test/test_dir_handle_get.c
+++ b/src/test/test_dir_handle_get.c
@@ -9,37 +9,37 @@
#define CONFIG_PRIVATE
#define RENDCACHE_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "consdiffmgr.h"
-#include "directory.h"
-#include "test.h"
-#include "compress.h"
-#include "rendcommon.h"
-#include "rendcache.h"
-#include "router.h"
-#include "routerlist.h"
-#include "rend_test_helpers.h"
-#include "microdesc.h"
-#include "test_helpers.h"
-#include "nodelist.h"
-#include "entrynodes.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-#include "proto_http.h"
-#include "geoip.h"
-#include "dirserv.h"
-#include "dirauth/dirvote.h"
-#include "log_test_helpers.h"
-#include "voting_schedule.h"
-
-#include "dir_connection_st.h"
-#include "dir_server_st.h"
-#include "networkstatus_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "routerinfo_st.h"
-#include "routerlist_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/consdiffmgr.h"
+#include "or/directory.h"
+#include "test/test.h"
+#include "common/compress.h"
+#include "or/rendcommon.h"
+#include "or/rendcache.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "test/rend_test_helpers.h"
+#include "or/microdesc.h"
+#include "test/test_helpers.h"
+#include "or/nodelist.h"
+#include "or/entrynodes.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+#include "or/proto_http.h"
+#include "or/geoip.h"
+#include "or/dirserv.h"
+#include "or/dirauth/dirvote.h"
+#include "test/log_test_helpers.h"
+#include "or/voting_schedule.h"
+
+#include "or/dir_connection_st.h"
+#include "or/dir_server_st.h"
+#include "or/networkstatus_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerlist_st.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_dns.c b/src/test/test_dns.c
index b843aef6b9..3bcef0aa7c 100644
--- a/src/test/test_dns.c
+++ b/src/test/test_dns.c
@@ -1,17 +1,17 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
#define DNS_PRIVATE
-#include "dns.h"
-#include "connection.h"
-#include "router.h"
+#include "or/dns.h"
+#include "or/connection.h"
+#include "or/router.h"
-#include "edge_connection_st.h"
-#include "or_circuit_st.h"
+#include "or/edge_connection_st.h"
+#include "or/or_circuit_st.h"
#define NS_MODULE dns
diff --git a/src/test/test_dos.c b/src/test/test_dos.c
index bc77bd8cd6..7a2a87d32d 100644
--- a/src/test/test_dos.c
+++ b/src/test/test_dos.c
@@ -5,23 +5,23 @@
#define TOR_CHANNEL_INTERNAL_
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "dos.h"
-#include "circuitlist.h"
-#include "crypto_rand.h"
-#include "geoip.h"
-#include "channel.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "routerlist.h"
-
-#include "networkstatus_st.h"
-#include "or_connection_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/dos.h"
+#include "or/circuitlist.h"
+#include "common/crypto_rand.h"
+#include "or/geoip.h"
+#include "or/channel.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+
+#include "or/networkstatus_st.h"
+#include "or/or_connection_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
static networkstatus_t *dummy_ns = NULL;
static networkstatus_t *
diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c
index 503f311f36..d6ac5e1d38 100644
--- a/src/test/test_entryconn.c
+++ b/src/test/test_entryconn.c
@@ -6,21 +6,21 @@
#define CONNECTION_PRIVATE
#define CONNECTION_EDGE_PRIVATE
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "addressmap.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "nodelist.h"
+#include "or/addressmap.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/nodelist.h"
-#include "hs_cache.h"
-#include "rendcache.h"
+#include "or/hs_cache.h"
+#include "or/rendcache.h"
-#include "entry_connection_st.h"
-#include "socks_request_st.h"
+#include "or/entry_connection_st.h"
+#include "or/socks_request_st.h"
static void *
entryconn_rewrite_setup(const struct testcase_t *tc)
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index e36705927d..2af9c4a378 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -10,38 +10,38 @@
#define ROUTERLIST_PRIVATE
#define DIRECTORY_PRIVATE
-#include "or.h"
-#include "test.h"
-
-#include "bridges.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "config.h"
-#include "confparse.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "entrynodes.h"
-#include "nodelist.h"
-#include "networkstatus.h"
-#include "policies.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "routerset.h"
-#include "statefile.h"
-#include "util.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+
+#include "or/bridges.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/entrynodes.h"
+#include "or/nodelist.h"
+#include "or/networkstatus.h"
+#include "or/policies.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/routerset.h"
+#include "or/statefile.h"
+#include "common/util.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
/* TODO:
* choose_random_entry() test with state set.
diff --git a/src/test/test_extorport.c b/src/test/test_extorport.c
index 5e782c785b..64ecd422f5 100644
--- a/src/test/test_extorport.c
+++ b/src/test/test_extorport.c
@@ -4,19 +4,19 @@
#define CONNECTION_PRIVATE
#define EXT_ORPORT_PRIVATE
#define MAIN_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "ext_orport.h"
-#include "main.h"
-
-#include "or_connection_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/ext_orport.h"
+#include "or/main.h"
+
+#include "or/or_connection_st.h"
+
+#include "test/test.h"
/* Test connection_or_remove_from_ext_or_id_map and
* connection_or_set_ext_or_identifier */
diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c
index 0711a113eb..6951ab185c 100644
--- a/src/test/test_geoip.c
+++ b/src/test/test_geoip.c
@@ -8,10 +8,10 @@
/* These macros pull in declarations for some functions and structures that
* are typically file-private. */
#define GEOIP_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "geoip.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/geoip.h"
+#include "test/test.h"
/* Record odd numbered fake-IPs using ipv6, even numbered fake-IPs
* using ipv4. Since our fake geoip database is the same between
diff --git a/src/test/test_guardfraction.c b/src/test/test_guardfraction.c
index 169d3e87ea..fc451b1629 100644
--- a/src/test/test_guardfraction.c
+++ b/src/test/test_guardfraction.c
@@ -6,22 +6,22 @@
#define NETWORKSTATUS_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "config.h"
-#include "dirserv.h"
-#include "container.h"
-#include "entrynodes.h"
-#include "util.h"
-#include "routerparse.h"
-#include "networkstatus.h"
-
-#include "networkstatus_st.h"
-#include "vote_microdesc_hash_st.h"
-#include "vote_routerstatus_st.h"
-
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/dirserv.h"
+#include "common/container.h"
+#include "or/entrynodes.h"
+#include "common/util.h"
+#include "or/routerparse.h"
+#include "or/networkstatus.h"
+
+#include "or/networkstatus_st.h"
+#include "or/vote_microdesc_hash_st.h"
+#include "or/vote_routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
/** Generate a vote_routerstatus_t for a router with identity digest
* <b>digest_in_hex</b>. */
diff --git a/src/test/test_handles.c b/src/test/test_handles.c
index 44c52fd577..153ac5787b 100644
--- a/src/test/test_handles.c
+++ b/src/test/test_handles.c
@@ -2,10 +2,10 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "test.h"
+#include "test/test.h"
-#include "util.h"
-#include "handles.h"
+#include "common/util.h"
+#include "common/handles.h"
typedef struct demo_t {
HANDLE_ENTRY(demo, demo_t);
diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c
index 4d1514db2a..f346c15caa 100644
--- a/src/test/test_helpers.c
+++ b/src/test/test_helpers.c
@@ -12,27 +12,27 @@
#define MAIN_PRIVATE
#include "orconfig.h"
-#include "or.h"
-
-#include "buffers.h"
-#include "config.h"
-#include "confparse.h"
-#include "connection.h"
-#include "crypto_rand.h"
-#include "main.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "routerlist.h"
-
-#include "cell_st.h"
-#include "connection_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerlist_st.h"
-
-#include "test.h"
-#include "test_helpers.h"
-#include "test_connection.h"
+#include "or/or.h"
+
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/connection.h"
+#include "common/crypto_rand.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/routerlist.h"
+
+#include "or/cell_st.h"
+#include "or/connection_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerlist_st.h"
+
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/test_connection.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
DISABLE_GCC_WARNING(overlength-strings)
@@ -40,7 +40,7 @@ DISABLE_GCC_WARNING(overlength-strings)
* at large. */
#endif
#include "test_descriptors.inc"
-#include "circuitlist.h"
+#include "or/circuitlist.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
ENABLE_GCC_WARNING(overlength-strings)
#endif
diff --git a/src/test/test_helpers.h b/src/test/test_helpers.h
index 7f15be708f..c6339d97fa 100644
--- a/src/test/test_helpers.h
+++ b/src/test/test_helpers.h
@@ -4,7 +4,7 @@
#ifndef TOR_TEST_HELPERS_H
#define TOR_TEST_HELPERS_H
-#include "or.h"
+#include "or/or.h"
const char *get_yesterday_date_str(void);
diff --git a/src/test/test_hs.c b/src/test/test_hs.c
index 7e14d73c24..166faa8928 100644
--- a/src/test/test_hs.c
+++ b/src/test/test_hs.c
@@ -12,22 +12,22 @@
#define RENDSERVICE_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "control.h"
-#include "config.h"
-#include "hs_common.h"
-#include "rendcommon.h"
-#include "rendservice.h"
-#include "routerset.h"
-#include "circuitbuild.h"
-
-#include "node_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "routerinfo_st.h"
-
-#include "test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/rendcommon.h"
+#include "or/rendservice.h"
+#include "or/routerset.h"
+#include "or/circuitbuild.h"
+
+#include "or/node_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/test_helpers.h"
/* mock ID digest and longname for node that's in nodelist */
#define HSDIR_EXIST_ID "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" \
diff --git a/src/test/test_hs_cache.c b/src/test/test_hs_cache.c
index a0d2c56d2c..ccad3062b7 100644
--- a/src/test/test_hs_cache.c
+++ b/src/test/test_hs_cache.c
@@ -10,20 +10,20 @@
#define DIRECTORY_PRIVATE
#define HS_CACHE_PRIVATE
-#include "ed25519_cert.h"
-#include "hs_cache.h"
-#include "rendcache.h"
-#include "directory.h"
-#include "networkstatus.h"
-#include "connection.h"
-#include "proto_http.h"
-
-#include "dir_connection_st.h"
-#include "networkstatus_st.h"
-
-#include "hs_test_helpers.h"
-#include "test_helpers.h"
-#include "test.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/hs_cache.h"
+#include "or/rendcache.h"
+#include "or/directory.h"
+#include "or/networkstatus.h"
+#include "or/connection.h"
+#include "or/proto_http.h"
+
+#include "or/dir_connection_st.h"
+#include "or/networkstatus_st.h"
+
+#include "test/hs_test_helpers.h"
+#include "test/test_helpers.h"
+#include "test/test.h"
/* Static variable used to encoded the HSDir query. */
static char query_b64[256];
diff --git a/src/test/test_hs_cell.c b/src/test/test_hs_cell.c
index 90c32c0769..f9d25ca099 100644
--- a/src/test/test_hs_cell.c
+++ b/src/test/test_hs_cell.c
@@ -9,18 +9,18 @@
#define HS_INTROPOINT_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
-#include "crypto_ed25519.h"
-#include "crypto_rand.h"
-#include "hs_cell.h"
-#include "hs_intropoint.h"
-#include "hs_service.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_rand.h"
+#include "or/hs_cell.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_service.h"
/* Trunnel. */
-#include "hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_establish_intro.h"
/** We simulate the creation of an outgoing ESTABLISH_INTRO cell, and then we
* parse it from the receiver side. */
diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index 196d7479bf..ebe75d5aa0 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -14,37 +14,37 @@
#define CIRCUITLIST_PRIVATE
#define CONNECTION_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "rend_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "config.h"
-#include "crypto.h"
-#include "channeltls.h"
-#include "main.h"
-#include "nodelist.h"
-#include "routerset.h"
-
-#include "hs_circuit.h"
-#include "hs_client.h"
-#include "hs_ident.h"
-#include "hs_cache.h"
-#include "circuitlist.h"
-#include "circuitbuild.h"
-#include "connection.h"
-#include "connection_edge.h"
-#include "networkstatus.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "dir_connection_st.h"
-#include "entry_connection_st.h"
-#include "extend_info_st.h"
-#include "networkstatus_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/rend_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/config.h"
+#include "common/crypto.h"
+#include "or/channeltls.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/routerset.h"
+
+#include "or/hs_circuit.h"
+#include "or/hs_client.h"
+#include "or/hs_ident.h"
+#include "or/hs_cache.h"
+#include "or/circuitlist.h"
+#include "or/circuitbuild.h"
+#include "or/connection.h"
+#include "or/connection_edge.h"
+#include "or/networkstatus.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/dir_connection_st.h"
+#include "or/entry_connection_st.h"
+#include "or/extend_info_st.h"
+#include "or/networkstatus_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
static int
mock_connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index cb1069aa22..1822d6c21c 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -11,33 +11,33 @@
#define HS_SERVICE_PRIVATE
#define NODELIST_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "connection_edge.h"
-#include "crypto_rand.h"
-#include "hs_common.h"
-#include "hs_client.h"
-#include "hs_service.h"
-#include "config.h"
-#include "networkstatus.h"
-#include "directory.h"
-#include "dirauth/dirvote.h"
-#include "nodelist.h"
-#include "routerlist.h"
-#include "statefile.h"
-#include "circuitlist.h"
-#include "dirauth/shared_random.h"
-#include "util.h"
-#include "voting_schedule.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/connection_edge.h"
+#include "common/crypto_rand.h"
+#include "or/hs_common.h"
+#include "or/hs_client.h"
+#include "or/hs_service.h"
+#include "or/config.h"
+#include "or/networkstatus.h"
+#include "or/directory.h"
+#include "or/dirauth/dirvote.h"
+#include "or/nodelist.h"
+#include "or/routerlist.h"
+#include "or/statefile.h"
+#include "or/circuitlist.h"
+#include "or/dirauth/shared_random.h"
+#include "common/util.h"
+#include "or/voting_schedule.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/** Test the validation of HS v3 addresses */
static void
diff --git a/src/test/test_hs_config.c b/src/test/test_hs_config.c
index c3674435f8..33ad09313c 100644
--- a/src/test/test_hs_config.c
+++ b/src/test/test_hs_config.c
@@ -9,15 +9,15 @@
#define CONFIG_PRIVATE
#define HS_SERVICE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-
-#include "config.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_service.h"
-#include "rendservice.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_service.h"
+#include "or/rendservice.h"
static int
helper_config_service(const char *conf, int validate_only)
diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c
index 424bc9f28e..f5beced45f 100644
--- a/src/test/test_hs_control.c
+++ b/src/test/test_hs_control.c
@@ -8,18 +8,18 @@
#define CONTROL_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "control.h"
-#include "config.h"
-#include "hs_common.h"
-#include "hs_control.h"
-#include "nodelist.h"
-
-#include "node_st.h"
-#include "routerstatus_st.h"
-
-#include "test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+#include "or/hs_control.h"
+#include "or/nodelist.h"
+
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test_helpers.h"
/* mock ID digest and longname for node that's in nodelist */
#define HSDIR_EXIST_ID \
diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c
index a7eac59b10..00b25f142f 100644
--- a/src/test/test_hs_descriptor.c
+++ b/src/test/test_hs_descriptor.c
@@ -8,18 +8,18 @@
#define HS_DESCRIPTOR_PRIVATE
-#include "crypto_ed25519.h"
-#include "crypto_digest.h"
-#include "crypto_rand.h"
-#include "ed25519_cert.h"
-#include "or.h"
-#include "hs_descriptor.h"
-#include "test.h"
-#include "torcert.h"
-
-#include "hs_test_helpers.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "common/crypto_ed25519.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_rand.h"
+#include "trunnel/ed25519_cert.h"
+#include "or/or.h"
+#include "or/hs_descriptor.h"
+#include "test/test.h"
+#include "or/torcert.h"
+
+#include "test/hs_test_helpers.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
DISABLE_GCC_WARNING(overlength-strings)
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
index e7f49faa64..34e51cba61 100644
--- a/src/test/test_hs_intropoint.c
+++ b/src/test/test_hs_intropoint.c
@@ -11,29 +11,29 @@
#define RENDSERVICE_PRIVATE
#define CIRCUITLIST_PRIVATE
-#include "test.h"
-#include "log_test_helpers.h"
-#include "crypto_rand.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+#include "common/crypto_rand.h"
-#include "or.h"
-#include "circuitlist.h"
-#include "circuituse.h"
+#include "or/or.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
#include "ht.h"
-#include "relay.h"
-#include "rendservice.h"
+#include "or/relay.h"
+#include "or/rendservice.h"
-#include "hs_cell.h"
-#include "hs_circuitmap.h"
-#include "hs_common.h"
-#include "hs_intropoint.h"
-#include "hs_service.h"
+#include "or/hs_cell.h"
+#include "or/hs_circuitmap.h"
+#include "or/hs_common.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_service.h"
-#include "or_circuit_st.h"
+#include "or/or_circuit_st.h"
/* Trunnel. */
-#include "hs/cell_establish_intro.h"
-#include "hs/cell_introduce1.h"
-#include "hs/cell_common.h"
+#include "trunnel/hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_introduce1.h"
+#include "trunnel/hs/cell_common.h"
static size_t
new_establish_intro_cell(const char *circ_nonce,
diff --git a/src/test/test_hs_ntor.c b/src/test/test_hs_ntor.c
index 8bd5f7fdba..51373af645 100644
--- a/src/test/test_hs_ntor.c
+++ b/src/test/test_hs_ntor.c
@@ -6,11 +6,11 @@
* \brief Test hidden service ntor functionality.
*/
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
-#include "hs_ntor.h"
+#include "or/hs_ntor.h"
/* Test the HS ntor handshake. Simulate the sending of an encrypted INTRODUCE1
* cell, and verify the proper derivation of decryption keys on the other end.
diff --git a/src/test/test_hs_ntor_cl.c b/src/test/test_hs_ntor_cl.c
index 943d787f06..8c19877729 100644
--- a/src/test/test_hs_ntor_cl.c
+++ b/src/test/test_hs_ntor_cl.c
@@ -13,13 +13,13 @@
#include <stdlib.h>
#define ONION_NTOR_PRIVATE
-#include "or.h"
-#include "util.h"
-#include "compat.h"
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "hs_ntor.h"
-#include "onion_ntor.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "or/hs_ntor.h"
+#include "or/onion_ntor.h"
#define N_ARGS(n) STMT_BEGIN { \
if (argc < (n)) { \
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 036745beca..bcf72b4546 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -22,46 +22,46 @@
#define HS_CLIENT_PRIVATE
#define ROUTERPARSE_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-#include "log_test_helpers.h"
-#include "rend_test_helpers.h"
-#include "hs_test_helpers.h"
-
-#include "or.h"
-#include "config.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "circuituse.h"
-#include "crypto_rand.h"
-#include "dirauth/dirvote.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "relay.h"
-#include "routerparse.h"
-#include "hs_common.h"
-#include "hs_config.h"
-#include "hs_ident.h"
-#include "hs_intropoint.h"
-#include "hs_ntor.h"
-#include "hs_circuit.h"
-#include "hs_service.h"
-#include "hs_client.h"
-#include "main.h"
-#include "rendservice.h"
-#include "statefile.h"
-#include "dirauth/shared_random_state.h"
-#include "voting_schedule.h"
-
-#include "cpath_build_state_st.h"
-#include "crypt_path_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+#include "test/log_test_helpers.h"
+#include "test/rend_test_helpers.h"
+#include "test/hs_test_helpers.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/circuituse.h"
+#include "common/crypto_rand.h"
+#include "or/dirauth/dirvote.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/relay.h"
+#include "or/routerparse.h"
+#include "or/hs_common.h"
+#include "or/hs_config.h"
+#include "or/hs_ident.h"
+#include "or/hs_intropoint.h"
+#include "or/hs_ntor.h"
+#include "or/hs_circuit.h"
+#include "or/hs_service.h"
+#include "or/hs_client.h"
+#include "or/main.h"
+#include "or/rendservice.h"
+#include "or/statefile.h"
+#include "or/dirauth/shared_random_state.h"
+#include "or/voting_schedule.h"
+
+#include "or/cpath_build_state_st.h"
+#include "or/crypt_path_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
/* Trunnel */
-#include "hs/cell_establish_intro.h"
+#include "trunnel/hs/cell_establish_intro.h"
static networkstatus_t mock_ns;
diff --git a/src/test/test_introduce.c b/src/test/test_introduce.c
index 3c53f81075..6ffb22fcac 100644
--- a/src/test/test_introduce.c
+++ b/src/test/test_introduce.c
@@ -2,12 +2,12 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "crypto.h"
-#include "or.h"
-#include "test.h"
+#include "common/crypto.h"
+#include "or/or.h"
+#include "test/test.h"
#define RENDSERVICE_PRIVATE
-#include "rendservice.h"
+#include "or/rendservice.h"
static uint8_t v0_test_plaintext[] =
/* 20 bytes of rendezvous point nickname */
diff --git a/src/test/test_keypin.c b/src/test/test_keypin.c
index c1e74259cd..e7e7e62963 100644
--- a/src/test/test_keypin.c
+++ b/src/test/test_keypin.c
@@ -3,11 +3,11 @@
#include "orconfig.h"
#define KEYPIN_PRIVATE
-#include "or.h"
-#include "keypin.h"
-#include "util.h"
+#include "or/or.h"
+#include "or/keypin.h"
+#include "common/util.h"
-#include "test.h"
+#include "test/test.h"
static void
test_keypin_parse_line(void *arg)
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index e84c37e94a..2650caf950 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -8,26 +8,26 @@
#define TOR_CHANNEL_INTERNAL_
#define TORTLS_PRIVATE
-#include "compat.h"
-
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "channeltls.h"
-#include "link_handshake.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "scheduler.h"
-#include "torcert.h"
-
-#include "or_connection_st.h"
-#include "or_handshake_certs_st.h"
-#include "or_handshake_state_st.h"
-#include "var_cell_st.h"
-
-#include "test.h"
-#include "log_test_helpers.h"
+#include "common/compat.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/channeltls.h"
+#include "trunnel/link_handshake.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/scheduler.h"
+#include "or/torcert.h"
+
+#include "or/or_connection_st.h"
+#include "or/or_handshake_certs_st.h"
+#include "or/or_handshake_state_st.h"
+#include "or/var_cell_st.h"
+
+#include "test/test.h"
+#include "test/log_test_helpers.h"
static var_cell_t *mock_got_var_cell = NULL;
diff --git a/src/test/test_logging.c b/src/test/test_logging.c
index 898f9dab5d..aebfd36068 100644
--- a/src/test/test_logging.c
+++ b/src/test/test_logging.c
@@ -2,9 +2,9 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "torlog.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/torlog.h"
+#include "test/test.h"
static void
dummy_cb_fn(int severity, uint32_t domain, const char *msg)
diff --git a/src/test/test_mainloop.c b/src/test/test_mainloop.c
index 9da8a039dd..559bbe587a 100644
--- a/src/test/test_mainloop.c
+++ b/src/test/test_mainloop.c
@@ -6,11 +6,11 @@
* \brief Tests for functions closely related to the Tor main loop
*/
-#include "test.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
-#include "or.h"
-#include "main.h"
+#include "or/or.h"
+#include "or/main.h"
static const uint64_t BILLION = 1000000000;
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index 68c7432b54..1b680c02c5 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -2,23 +2,23 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "config.h"
+#include "or/config.h"
#define DIRVOTE_PRIVATE
-#include "dirauth/dirvote.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/dirauth/dirvote.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index 7810883715..0e5ad7bba7 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -6,19 +6,19 @@
* \brief Unit tests for nodelist related functions.
**/
-#include "or.h"
-#include "crypto_rand.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "torcert.h"
-
-#include "microdesc_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/torcert.h"
+
+#include "or/microdesc_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
/** Test the case when node_get_by_id() returns NULL,
* node_get_verbose_nickname_by_id should return the base 16 encoding
diff --git a/src/test/test_ntor_cl.c b/src/test/test_ntor_cl.c
index 2e1a8f62a0..dbc607db3d 100644
--- a/src/test/test_ntor_cl.c
+++ b/src/test/test_ntor_cl.c
@@ -6,12 +6,12 @@
#include <stdlib.h>
#define ONION_NTOR_PRIVATE
-#include "or.h"
-#include "util.h"
-#include "compat.h"
-#include "crypto.h"
-#include "crypto_curve25519.h"
-#include "onion_ntor.h"
+#include "or/or.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/crypto.h"
+#include "common/crypto_curve25519.h"
+#include "or/onion_ntor.h"
#define N_ARGS(n) STMT_BEGIN { \
if (argc < (n)) { \
diff --git a/src/test/test_oom.c b/src/test/test_oom.c
index 48578f9055..0edc22c502 100644
--- a/src/test/test_oom.c
+++ b/src/test/test_oom.c
@@ -7,21 +7,21 @@
#define BUFFERS_PRIVATE
#define CIRCUITLIST_PRIVATE
#define CONNECTION_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "circuitlist.h"
-#include "compat_libevent.h"
-#include "connection.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "relay.h"
-#include "test.h"
-#include "test_helpers.h"
-
-#include "cell_st.h"
-#include "entry_connection_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/circuitlist.h"
+#include "common/compat_libevent.h"
+#include "or/connection.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/relay.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/cell_st.h"
+#include "or/entry_connection_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
/* small replacement mock for circuit_mark_for_close_ to avoid doing all
* the other bookkeeping that comes with marking circuits. */
diff --git a/src/test/test_oos.c b/src/test/test_oos.c
index 6db9d644c6..6ecb1a0786 100644
--- a/src/test/test_oos.c
+++ b/src/test/test_oos.c
@@ -5,15 +5,15 @@
#define CONNECTION_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "connection_or.h"
-#include "main.h"
-#include "test.h"
-
-#include "dir_connection_st.h"
-#include "or_connection_st.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "or/connection_or.h"
+#include "or/main.h"
+#include "test/test.h"
+
+#include "or/dir_connection_st.h"
+#include "or/or_connection_st.h"
static or_options_t mock_options;
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 587f0ba997..bf35e3c5be 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -4,21 +4,21 @@
/* See LICENSE for licensing information */
#define CONFIG_PRIVATE
-#include "or.h"
-#include "confparse.h"
-#include "config.h"
-#include "test.h"
-#include "geoip.h"
+#include "or/or.h"
+#include "or/confparse.h"
+#include "or/config.h"
+#include "test/test.h"
+#include "or/geoip.h"
#define ROUTERSET_PRIVATE
-#include "routerset.h"
-#include "main.h"
-#include "log_test_helpers.h"
-
-#include "sandbox.h"
-#include "memarea.h"
-#include "policies.h"
-#include "test_helpers.h"
+#include "or/routerset.h"
+#include "or/main.h"
+#include "test/log_test_helpers.h"
+
+#include "common/sandbox.h"
+#include "common/memarea.h"
+#include "or/policies.h"
+#include "test/test_helpers.h"
#define NS_MODULE test_options
diff --git a/src/test/test_periodic_event.c b/src/test/test_periodic_event.c
index 34689b64f4..b353cf87a3 100644
--- a/src/test/test_periodic_event.c
+++ b/src/test/test_periodic_event.c
@@ -11,15 +11,15 @@
#define HS_SERVICE_PRIVATE
#define MAIN_PRIVATE
-#include "test.h"
-#include "test_helpers.h"
-
-#include "or.h"
-#include "config.h"
-#include "hibernate.h"
-#include "hs_service.h"
-#include "main.h"
-#include "periodic.h"
+#include "test/test.h"
+#include "test/test_helpers.h"
+
+#include "or/or.h"
+#include "or/config.h"
+#include "or/hibernate.h"
+#include "or/hs_service.h"
+#include "or/main.h"
+#include "or/periodic.h"
/** Helper function: This is replaced in some tests for the event callbacks so
* we don't actually go into the code path of those callbacks. */
diff --git a/src/test/test_policy.c b/src/test/test_policy.c
index 48a093ce14..2c29bbb16a 100644
--- a/src/test/test_policy.c
+++ b/src/test/test_policy.c
@@ -1,19 +1,19 @@
/* Copyright (c) 2013-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#define CONFIG_PRIVATE
-#include "config.h"
-#include "router.h"
-#include "routerparse.h"
+#include "or/config.h"
+#include "or/router.h"
+#include "or/routerparse.h"
#define POLICIES_PRIVATE
-#include "policies.h"
-#include "test.h"
+#include "or/policies.h"
+#include "test/test.h"
-#include "node_st.h"
-#include "port_cfg_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
+#include "or/node_st.h"
+#include "or/port_cfg_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
/* Helper: assert that short_policy parses and writes back out as itself,
or as <b>expected</b> if that's provided. */
diff --git a/src/test/test_procmon.c b/src/test/test_procmon.c
index 25f2417cb8..ae30bd00b6 100644
--- a/src/test/test_procmon.c
+++ b/src/test/test_procmon.c
@@ -3,12 +3,12 @@
#define PROCMON_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
-#include "procmon.h"
+#include "common/procmon.h"
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE procmon
diff --git a/src/test/test_proto_http.c b/src/test/test_proto_http.c
index 5880868850..b98ee83aea 100644
--- a/src/test/test_proto_http.c
+++ b/src/test/test_proto_http.c
@@ -6,11 +6,11 @@
* \brief Tests for our HTTP protocol parser code
*/
-#include "or.h"
-#include "test.h"
-#include "buffers.h"
-#include "proto_http.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/buffers.h"
+#include "or/proto_http.h"
+#include "test/log_test_helpers.h"
#define S(str) str, sizeof(str)-1
diff --git a/src/test/test_proto_misc.c b/src/test/test_proto_misc.c
index 539fd1ad58..979fc72f18 100644
--- a/src/test/test_proto_misc.c
+++ b/src/test/test_proto_misc.c
@@ -6,16 +6,16 @@
* \brief Test our smaller buffer-based protocol functions
*/
-#include "or.h"
-#include "test.h"
-#include "buffers.h"
-#include "connection_or.h"
-#include "ext_orport.h"
-#include "proto_cell.h"
-#include "proto_control0.h"
-#include "proto_ext_or.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/buffers.h"
+#include "or/connection_or.h"
+#include "or/ext_orport.h"
+#include "or/proto_cell.h"
+#include "or/proto_control0.h"
+#include "or/proto_ext_or.h"
-#include "var_cell_st.h"
+#include "or/var_cell_st.h"
static void
test_proto_var_cell(void *arg)
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index 7899c099f7..f17f68ced2 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -4,12 +4,12 @@
#define PROTOVER_PRIVATE
#include "orconfig.h"
-#include "test.h"
+#include "test/test.h"
-#include "protover.h"
+#include "or/protover.h"
-#include "or.h"
-#include "connection_or.h"
+#include "or/or.h"
+#include "or/connection_or.h"
static void
test_protover_parse(void *arg)
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 6529dd0374..d6ab00bb6b 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -8,15 +8,15 @@
#define UTIL_PRIVATE
#define STATEFILE_PRIVATE
#define CONTROL_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "confparse.h"
-#include "control.h"
-#include "transports.h"
-#include "circuitbuild.h"
-#include "util.h"
-#include "statefile.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/confparse.h"
+#include "or/control.h"
+#include "or/transports.h"
+#include "or/circuitbuild.h"
+#include "common/util.h"
+#include "or/statefile.h"
+#include "test/test.h"
static void
reset_mp(managed_proxy_t *mp)
diff --git a/src/test/test_pubsub.c b/src/test/test_pubsub.c
index d281e51ee3..4f6cdc1996 100644
--- a/src/test/test_pubsub.c
+++ b/src/test/test_pubsub.c
@@ -6,9 +6,9 @@
* \brief Unit tests for publish-subscribe abstraction.
**/
-#include "or.h"
-#include "test.h"
-#include "pubsub.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "common/pubsub.h"
DECLARE_PUBSUB_STRUCT_TYPES(foobar)
DECLARE_PUBSUB_TOPIC(foobar)
diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index 559f046fd4..777153d11b 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -1,20 +1,20 @@
/* Copyright (c) 2014-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#define CIRCUITBUILD_PRIVATE
-#include "circuitbuild.h"
+#include "or/circuitbuild.h"
#define RELAY_PRIVATE
-#include "relay.h"
+#include "or/relay.h"
/* For init/free stuff */
-#include "scheduler.h"
+#include "or/scheduler.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan);
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c
index 63b47d8962..770692440d 100644
--- a/src/test/test_relaycell.c
+++ b/src/test/test_relaycell.c
@@ -5,22 +5,22 @@
#define RELAY_PRIVATE
#define CIRCUITLIST_PRIVATE
-#include "or.h"
-#include "main.h"
-#include "config.h"
-#include "connection.h"
-#include "crypto.h"
-#include "circuitbuild.h"
-#include "circuitlist.h"
-#include "connection_edge.h"
-#include "relay.h"
-#include "test.h"
-
-#include "cell_st.h"
-#include "crypt_path_st.h"
-#include "entry_connection_st.h"
-#include "origin_circuit_st.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "or/main.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "common/crypto.h"
+#include "or/circuitbuild.h"
+#include "or/circuitlist.h"
+#include "or/connection_edge.h"
+#include "or/relay.h"
+#include "test/test.h"
+
+#include "or/cell_st.h"
+#include "or/crypt_path_st.h"
+#include "or/entry_connection_st.h"
+#include "or/origin_circuit_st.h"
+#include "or/socks_request_st.h"
static int srm_ncalls;
static entry_connection_t *srm_conn;
diff --git a/src/test/test_relaycrypt.c b/src/test/test_relaycrypt.c
index 9f6b5bbe66..0b8541974f 100644
--- a/src/test/test_relaycrypt.c
+++ b/src/test/test_relaycrypt.c
@@ -3,19 +3,19 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "circuitbuild.h"
+#include "or/or.h"
+#include "or/circuitbuild.h"
#define CIRCUITLIST_PRIVATE
-#include "circuitlist.h"
-#include "crypto_rand.h"
-#include "relay.h"
-#include "relay_crypto.h"
+#include "or/circuitlist.h"
+#include "common/crypto_rand.h"
+#include "or/relay.h"
+#include "or/relay_crypto.h"
-#include "cell_st.h"
-#include "or_circuit_st.h"
-#include "origin_circuit_st.h"
+#include "or/cell_st.h"
+#include "or/or_circuit_st.h"
+#include "or/origin_circuit_st.h"
-#include "test.h"
+#include "test/test.h"
static const char KEY_MATERIAL[3][CPATH_KEY_MATERIAL_LEN] = {
" 'My public key is in this signed x509 object', said Tom assertively.",
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c
index 44b84d07ee..3d606aac0d 100644
--- a/src/test/test_rendcache.c
+++ b/src/test/test_rendcache.c
@@ -2,24 +2,24 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
#define RENDCACHE_PRIVATE
-#include "rendcache.h"
-#include "router.h"
-#include "routerlist.h"
-#include "config.h"
-#include "hs_common.h"
-
-#include "extend_info_st.h"
-#include "rend_encoded_v2_service_descriptor_st.h"
-#include "rend_intro_point_st.h"
-#include "rend_service_descriptor_st.h"
-#include "routerinfo_st.h"
-
-#include "rend_test_helpers.h"
-#include "log_test_helpers.h"
+#include "or/rendcache.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/config.h"
+#include "or/hs_common.h"
+
+#include "or/extend_info_st.h"
+#include "or/rend_encoded_v2_service_descriptor_st.h"
+#include "or/rend_intro_point_st.h"
+#include "or/rend_service_descriptor_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/rend_test_helpers.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE rend_cache
diff --git a/src/test/test_replay.c b/src/test/test_replay.c
index 97951241ea..7f9c0b09e4 100644
--- a/src/test/test_replay.c
+++ b/src/test/test_replay.c
@@ -4,9 +4,9 @@
#define REPLAYCACHE_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "replaycache.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/replaycache.h"
+#include "test/test.h"
static const char *test_buffer =
"Lorem ipsum dolor sit amet, consectetur adipisici elit, sed do eiusmod"
diff --git a/src/test/test_router.c b/src/test/test_router.c
index 239c17a94a..f2f325785f 100644
--- a/src/test/test_router.c
+++ b/src/test/test_router.c
@@ -7,17 +7,17 @@
* \brief Unittests for code in src/or/router.c
**/
-#include "or.h"
-#include "config.h"
-#include "crypto_curve25519.h"
-#include "crypto_ed25519.h"
-#include "router.h"
-#include "routerlist.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_ed25519.h"
+#include "or/router.h"
+#include "or/routerlist.h"
-#include "routerinfo_st.h"
+#include "or/routerinfo_st.h"
/* Test suite stuff */
-#include "test.h"
+#include "test/test.h"
NS_DECL(const routerinfo_t *, router_get_my_routerinfo, (void));
diff --git a/src/test/test_routerkeys.c b/src/test/test_routerkeys.c
index fd1117485e..8cfc9f808f 100644
--- a/src/test/test_routerkeys.c
+++ b/src/test/test_routerkeys.c
@@ -5,14 +5,14 @@
#include "orconfig.h"
#define ROUTER_PRIVATE
-#include "or.h"
-#include "config.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "util.h"
-#include "crypto.h"
-#include "torcert.h"
-#include "test.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "common/util.h"
+#include "common/crypto.h"
+#include "or/torcert.h"
+#include "test/test.h"
#ifdef _WIN32
/* For mkdir() */
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 15f717f1af..b6032ed87c 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -13,36 +13,36 @@
#define NETWORKSTATUS_PRIVATE
#define ROUTERLIST_PRIVATE
#define TOR_UNIT_TESTING
-#include "or.h"
-#include "config.h"
-#include "connection.h"
-#include "container.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "directory.h"
-#include "dirauth/dirvote.h"
-#include "entrynodes.h"
-#include "hibernate.h"
-#include "microdesc.h"
-#include "networkstatus.h"
-#include "nodelist.h"
-#include "policies.h"
-#include "router.h"
-#include "routerlist.h"
-#include "routerset.h"
-#include "routerparse.h"
-#include "dirauth/shared_random.h"
-#include "statefile.h"
-
-#include "authority_cert_st.h"
-#include "dir_connection_st.h"
-#include "networkstatus_st.h"
-#include "node_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
-#include "test_dir_common.h"
-#include "log_test_helpers.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "or/connection.h"
+#include "common/container.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "or/directory.h"
+#include "or/dirauth/dirvote.h"
+#include "or/entrynodes.h"
+#include "or/hibernate.h"
+#include "or/microdesc.h"
+#include "or/networkstatus.h"
+#include "or/nodelist.h"
+#include "or/policies.h"
+#include "or/router.h"
+#include "or/routerlist.h"
+#include "or/routerset.h"
+#include "or/routerparse.h"
+#include "or/dirauth/shared_random.h"
+#include "or/statefile.h"
+
+#include "or/authority_cert_st.h"
+#include "or/dir_connection_st.h"
+#include "or/networkstatus_st.h"
+#include "or/node_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
+#include "test/test_dir_common.h"
+#include "test/log_test_helpers.h"
void construct_consensus(char **consensus_text_md, time_t now);
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c
index 727e153921..e64c24e89e 100644
--- a/src/test/test_routerset.c
+++ b/src/test/test_routerset.c
@@ -3,19 +3,19 @@
#define ROUTERSET_PRIVATE
-#include "or.h"
-#include "geoip.h"
-#include "routerset.h"
-#include "routerparse.h"
-#include "policies.h"
-#include "nodelist.h"
-
-#include "extend_info_st.h"
-#include "node_st.h"
-#include "routerinfo_st.h"
-#include "routerstatus_st.h"
-
-#include "test.h"
+#include "or/or.h"
+#include "or/geoip.h"
+#include "or/routerset.h"
+#include "or/routerparse.h"
+#include "or/policies.h"
+#include "or/nodelist.h"
+
+#include "or/extend_info_st.h"
+#include "or/node_st.h"
+#include "or/routerinfo_st.h"
+#include "or/routerstatus_st.h"
+
+#include "test/test.h"
#define NS_MODULE routerset
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c
index eece5db934..1087befa68 100644
--- a/src/test/test_scheduler.c
+++ b/src/test/test_scheduler.c
@@ -8,19 +8,19 @@
#define SCHEDULER_KIST_PRIVATE
#define TOR_CHANNEL_INTERNAL_
#define CHANNEL_PRIVATE_
-#include "or.h"
-#include "config.h"
-#include "compat_libevent.h"
-#include "channel.h"
-#include "channeltls.h"
-#include "connection.h"
-#include "networkstatus.h"
+#include "or/or.h"
+#include "or/config.h"
+#include "common/compat_libevent.h"
+#include "or/channel.h"
+#include "or/channeltls.h"
+#include "or/connection.h"
+#include "or/networkstatus.h"
#define SCHEDULER_PRIVATE_
-#include "scheduler.h"
+#include "or/scheduler.h"
/* Test suite stuff */
-#include "test.h"
-#include "fakechans.h"
+#include "test/test.h"
+#include "test/fakechans.h"
/* Shamelessly stolen from compat_libevent.c */
#define V(major, minor, patch) \
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
index 06eb65f255..149129d0c7 100644
--- a/src/test/test_shared_random.c
+++ b/src/test/test_shared_random.c
@@ -6,24 +6,24 @@
#define CONFIG_PRIVATE
#define DIRVOTE_PRIVATE
-#include "or.h"
-#include "test.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "dirauth/dirvote.h"
-#include "dirauth/shared_random.h"
-#include "dirauth/shared_random_state.h"
-#include "log_test_helpers.h"
-#include "networkstatus.h"
-#include "router.h"
-#include "routerkeys.h"
-#include "routerlist.h"
-#include "routerparse.h"
-#include "shared_random_client.h"
-#include "voting_schedule.h"
-
-#include "dir_server_st.h"
-#include "networkstatus_st.h"
+#include "or/or.h"
+#include "test/test.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/dirauth/dirvote.h"
+#include "or/dirauth/shared_random.h"
+#include "or/dirauth/shared_random_state.h"
+#include "test/log_test_helpers.h"
+#include "or/networkstatus.h"
+#include "or/router.h"
+#include "or/routerkeys.h"
+#include "or/routerlist.h"
+#include "or/routerparse.h"
+#include "or/shared_random_client.h"
+#include "or/voting_schedule.h"
+
+#include "or/dir_server_st.h"
+#include "or/networkstatus_st.h"
static authority_cert_t *mock_cert;
diff --git a/src/test/test_slow.c b/src/test/test_slow.c
index 74f6bdeeb2..951851ec07 100644
--- a/src/test/test_slow.c
+++ b/src/test/test_slow.c
@@ -15,8 +15,8 @@
#include <fcntl.h>
#endif
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
struct testgroup_t testgroups[] = {
{ "slow/crypto/", slow_crypto_tests },
diff --git a/src/test/test_socks.c b/src/test/test_socks.c
index d7b9f03938..04c0280584 100644
--- a/src/test/test_socks.c
+++ b/src/test/test_socks.c
@@ -3,13 +3,13 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "proto_socks.h"
-#include "test.h"
-#include "log_test_helpers.h"
-#include "socks_request_st.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/proto_socks.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
+#include "or/socks_request_st.h"
typedef struct socks_test_data_t {
socks_request_t *req;
diff --git a/src/test/test_status.c b/src/test/test_status.c
index 8ed6364616..2f305224cb 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -11,24 +11,24 @@
#include <float.h>
#include <math.h>
-#include "or.h"
-#include "torlog.h"
+#include "or/or.h"
+#include "common/torlog.h"
#include "tor_queue.h"
-#include "status.h"
-#include "circuitlist.h"
-#include "config.h"
-#include "hibernate.h"
-#include "rephist.h"
-#include "relay.h"
-#include "router.h"
-#include "main.h"
-#include "nodelist.h"
-#include "statefile.h"
-
-#include "origin_circuit_st.h"
-#include "routerinfo_st.h"
-
-#include "test.h"
+#include "or/status.h"
+#include "or/circuitlist.h"
+#include "or/config.h"
+#include "or/hibernate.h"
+#include "or/rephist.h"
+#include "or/relay.h"
+#include "or/router.h"
+#include "or/main.h"
+#include "or/nodelist.h"
+#include "or/statefile.h"
+
+#include "or/origin_circuit_st.h"
+#include "or/routerinfo_st.h"
+
+#include "test/test.h"
#define NS_MODULE status
diff --git a/src/test/test_storagedir.c b/src/test/test_storagedir.c
index 1214448e47..4deb881335 100644
--- a/src/test/test_storagedir.c
+++ b/src/test/test_storagedir.c
@@ -1,10 +1,10 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "crypto_rand.h"
-#include "storagedir.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/crypto_rand.h"
+#include "common/storagedir.h"
+#include "test/test.h"
#ifdef HAVE_UTIME_H
#include <utime.h>
diff --git a/src/test/test_switch_id.c b/src/test/test_switch_id.c
index 63be102886..149dda8f72 100644
--- a/src/test/test_switch_id.c
+++ b/src/test/test_switch_id.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2015-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
+#include "or/or.h"
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
diff --git a/src/test/test_threads.c b/src/test/test_threads.c
index eecbf69e4b..11f41a0444 100644
--- a/src/test/test_threads.c
+++ b/src/test/test_threads.c
@@ -4,9 +4,9 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
-#include "compat_threads.h"
-#include "test.h"
+#include "or/or.h"
+#include "common/compat_threads.h"
+#include "test/test.h"
/** mutex for thread test to stop the threads hitting data at the same time. */
static tor_mutex_t *thread_test_mutex_ = NULL;
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 0bf9d80552..6c63149425 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -11,7 +11,7 @@
#endif
#include <math.h>
-#include "compat.h"
+#include "common/compat.h"
/* Some versions of OpenSSL declare SSL_get_selected_srtp_profile twice in
* srtp.h. Suppress the GCC warning so we can build with -Wredundant-decl. */
@@ -30,13 +30,13 @@ DISABLE_GCC_WARNING(redundant-decls)
ENABLE_GCC_WARNING(redundant-decls)
-#include "or.h"
-#include "torlog.h"
-#include "config.h"
-#include "tortls.h"
+#include "or/or.h"
+#include "common/torlog.h"
+#include "or/config.h"
+#include "common/tortls.h"
-#include "test.h"
-#include "log_test_helpers.h"
+#include "test/test.h"
+#include "test/log_test_helpers.h"
#define NS_MODULE tortls
#ifndef HAVE_SSL_STATE
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 9585f5872b..4d06e3e7c4 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -8,16 +8,16 @@
#define COMPAT_TIME_PRIVATE
#define CONTROL_PRIVATE
#define UTIL_PRIVATE
-#include "or.h"
-#include "buffers.h"
-#include "config.h"
-#include "control.h"
-#include "crypto_rand.h"
-#include "test.h"
-#include "memarea.h"
-#include "util_process.h"
-#include "log_test_helpers.h"
-#include "compress_zstd.h"
+#include "or/or.h"
+#include "common/buffers.h"
+#include "or/config.h"
+#include "or/control.h"
+#include "common/crypto_rand.h"
+#include "test/test.h"
+#include "common/memarea.h"
+#include "common/util_process.h"
+#include "test/log_test_helpers.h"
+#include "common/compress_zstd.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/test/test_util_format.c b/src/test/test_util_format.c
index 3a1db62584..d56915822f 100644
--- a/src/test/test_util_format.c
+++ b/src/test/test_util_format.c
@@ -2,13 +2,13 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#define UTIL_FORMAT_PRIVATE
-#include "util_format.h"
+#include "common/util_format.h"
#define NS_MODULE util_format
diff --git a/src/test/test_util_process.c b/src/test/test_util_process.c
index d05c04653c..a09d12ac61 100644
--- a/src/test/test_util_process.c
+++ b/src/test/test_util_process.c
@@ -3,13 +3,13 @@
#define UTIL_PROCESS_PRIVATE
#include "orconfig.h"
-#include "or.h"
+#include "or/or.h"
-#include "test.h"
+#include "test/test.h"
-#include "util_process.h"
+#include "common/util_process.h"
-#include "log_test_helpers.h"
+#include "test/log_test_helpers.h"
#ifndef _WIN32
#define NS_MODULE util_process
diff --git a/src/test/test_util_slow.c b/src/test/test_util_slow.c
index e3b65bc969..3d725d5025 100644
--- a/src/test/test_util_slow.c
+++ b/src/test/test_util_slow.c
@@ -5,11 +5,11 @@
#include "orconfig.h"
#define UTIL_PRIVATE
-#include "util.h"
-#include "util_process.h"
-#include "crypto.h"
-#include "torlog.h"
-#include "test.h"
+#include "common/util.h"
+#include "common/util_process.h"
+#include "common/crypto.h"
+#include "common/torlog.h"
+#include "test/test.h"
#ifndef BUILDDIR
#define BUILDDIR "."
diff --git a/src/test/test_voting_schedule.c b/src/test/test_voting_schedule.c
index df6058b74f..b5df596436 100644
--- a/src/test/test_voting_schedule.c
+++ b/src/test/test_voting_schedule.c
@@ -3,10 +3,10 @@
#include "orconfig.h"
-#include "or.h"
-#include "voting_schedule.h"
+#include "or/or.h"
+#include "or/voting_schedule.h"
-#include "test.h"
+#include "test/test.h"
static void
test_voting_schedule_interval_start(void *arg)
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index 92b0d94d3d..6935d286c8 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -3,13 +3,13 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "or.h"
-#include "compat_threads.h"
-#include "onion.h"
-#include "workqueue.h"
-#include "crypto_curve25519.h"
-#include "crypto_rand.h"
-#include "compat_libevent.h"
+#include "or/or.h"
+#include "common/compat_threads.h"
+#include "or/onion.h"
+#include "common/workqueue.h"
+#include "common/crypto_curve25519.h"
+#include "common/crypto_rand.h"
+#include "common/compat_libevent.h"
#include <stdio.h>
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index eb1838e166..18b5b61064 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -10,15 +10,15 @@
#define MAIN_PRIVATE
#include "orconfig.h"
-#include "or.h"
-#include "control.h"
-#include "config.h"
-#include "crypto_rand.h"
-#include "rephist.h"
-#include "backtrace.h"
-#include "test.h"
-#include "channelpadding.h"
-#include "main.h"
+#include "or/or.h"
+#include "or/control.h"
+#include "or/config.h"
+#include "common/crypto_rand.h"
+#include "or/rephist.h"
+#include "common/backtrace.h"
+#include "test/test.h"
+#include "or/channelpadding.h"
+#include "or/main.h"
#include <stdio.h>
#ifdef HAVE_FCNTL_H
@@ -34,7 +34,7 @@
#ifdef USE_DMALLOC
#include <dmalloc.h>
-#include "main.h"
+#include "or/main.h"
#endif
/** Temporary directory (set up by setup_directory) under which we store all
diff --git a/src/test/testing_rsakeys.c b/src/test/testing_rsakeys.c
index 9c2c52180e..f45fcb11a4 100644
--- a/src/test/testing_rsakeys.c
+++ b/src/test/testing_rsakeys.c
@@ -3,10 +3,10 @@
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "crypto_rand.h"
+#include "common/crypto_rand.h"
#include "orconfig.h"
-#include "or.h"
-#include "test.h"
+#include "or/or.h"
+#include "test/test.h"
/** Define this if unit tests spend too much time generating public keys.
* This module is meant to save time by using a bunch of pregenerated RSA
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 7f716e685f..e1d3e54d8e 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -13,7 +13,7 @@
#include <unistd.h>
#endif
-#include "compat.h"
+#include "common/compat.h"
/* Some versions of OpenSSL declare X509_STORE_CTX_set_verify_cb twice in
* x509.h and x509_vfy.h. Suppress the GCC warning so we can build with
@@ -36,14 +36,14 @@ ENABLE_GCC_WARNING(redundant-decls)
#include <assert.h>
#endif
-#include "util.h"
-#include "torlog.h"
-#include "crypto.h"
-#include "crypto_digest.h"
-#include "crypto_rand.h"
-#include "crypto_util.h"
-#include "address.h"
-#include "util_format.h"
+#include "common/util.h"
+#include "common/torlog.h"
+#include "common/crypto.h"
+#include "common/crypto_digest.h"
+#include "common/crypto_rand.h"
+#include "common/crypto_util.h"
+#include "common/address.h"
+#include "common/util_format.h"
#define IDENTITY_KEY_BITS 3072
#define SIGNING_KEY_BITS 2048
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 072f545699..dfca7d7925 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -4,11 +4,11 @@
/* See LICENSE for licensing information */
#include "orconfig.h"
-#include "compat.h"
-#include "util.h"
-#include "address.h"
-#include "torlog.h"
-#include "sandbox.h"
+#include "common/compat.h"
+#include "common/util.h"
+#include "common/address.h"
+#include "common/torlog.h"
+#include "common/sandbox.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/tools/tor_runner.c b/src/tools/tor_runner.c
index c03a806a8f..8e74a06cd9 100644
--- a/src/tools/tor_runner.c
+++ b/src/tools/tor_runner.c
@@ -23,8 +23,8 @@
* functions. Don't add more dependencies!
*/
-#include "tor_api.h"
-#include "tor_api_internal.h"
+#include "or/tor_api.h"
+#include "or/tor_api_internal.h"
#include "orconfig.h"
#ifdef HAVE_UNISTD_H
diff --git a/src/trace/debug.h b/src/trace/debug.h
index 59fa73d558..0241f2ccf8 100644
--- a/src/trace/debug.h
+++ b/src/trace/debug.h
@@ -4,7 +4,7 @@
#ifndef TOR_TRACE_LOG_DEBUG_H
#define TOR_TRACE_LOG_DEBUG_H
-#include "torlog.h"
+#include "common/torlog.h"
/* Stringify pre-processor trick. */
#define XSTR(d) STR(d)
diff --git a/src/trace/trace.c b/src/trace/trace.c
index 14d0254b15..b39a2bbc5c 100644
--- a/src/trace/trace.c
+++ b/src/trace/trace.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2017-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include "trace.h"
+#include "trace/trace.h"
/** Initialize the tracing library. */
void
diff --git a/src/trunnel/trunnel-local.h b/src/trunnel/trunnel-local.h
index 8aa6d0ddaa..f25659bf6f 100644
--- a/src/trunnel/trunnel-local.h
+++ b/src/trunnel/trunnel-local.h
@@ -2,9 +2,9 @@
#ifndef TRUNNEL_LOCAL_H_INCLUDED
#define TRUNNEL_LOCAL_H_INCLUDED
-#include "util.h"
-#include "compat.h"
-#include "crypto_util.h"
+#include "common/util.h"
+#include "common/compat.h"
+#include "common/crypto_util.h"
#define trunnel_malloc tor_malloc
#define trunnel_calloc tor_calloc