Kaynağa Gözat

Merge branch 'destroy_common'

Nick Mathewson 5 yıl önce
ebeveyn
işleme
02ba0a2dbb
89 değiştirilmiş dosya ile 195 ekleme ve 279 silme
  1. 2 13
      .gitignore
  2. 2 4
      Makefile.am
  3. 4 19
      scripts/codegen/fuzzing_include_am.py
  4. 0 28
      src/common/Makefile.nmake
  5. 0 62
      src/common/include.am
  6. 0 52
      src/common/util.h
  7. 1 1
      src/include.am
  8. 0 0
      src/lib/container/handles.h
  9. 1 0
      src/lib/container/include.am
  10. 15 0
      src/lib/evloop/.may_include
  11. 1 1
      src/lib/evloop/compat_libevent.c
  12. 0 0
      src/lib/evloop/compat_libevent.h
  13. 26 0
      src/lib/evloop/include.am
  14. 1 1
      src/lib/evloop/procmon.c
  15. 1 1
      src/lib/evloop/procmon.h
  16. 2 2
      src/lib/evloop/timers.c
  17. 0 0
      src/lib/evloop/timers.h
  18. 1 1
      src/lib/evloop/token_bucket.c
  19. 0 0
      src/lib/evloop/token_bucket.h
  20. 2 2
      src/lib/evloop/workqueue.c
  21. 0 0
      src/lib/evloop/workqueue.h
  22. 4 0
      src/lib/malloc/include.am
  23. 2 1
      src/lib/net/include.am
  24. 0 0
      src/lib/net/socks5_status.h
  25. 1 1
      src/or/address_set.c
  26. 0 0
      src/or/address_set.h
  27. 1 1
      src/or/channel.c
  28. 1 1
      src/or/channel.h
  29. 1 1
      src/or/channelpadding.c
  30. 1 2
      src/or/config.c
  31. 1 1
      src/or/connection.c
  32. 1 1
      src/or/connection_edge.c
  33. 1 1
      src/or/conscache.h
  34. 2 2
      src/or/consdiffmgr.c
  35. 3 3
      src/or/control.c
  36. 1 1
      src/or/cpuworker.c
  37. 0 1
      src/or/dirauth/shared_random.c
  38. 1 1
      src/or/dns.c
  39. 1 1
      src/or/dnsserv.c
  40. 1 1
      src/or/entrynodes.h
  41. 0 1
      src/or/ext_orport.c
  42. 1 1
      src/or/hibernate.c
  43. 0 1
      src/or/hs_cell.c
  44. 2 0
      src/or/include.am
  45. 20 5
      src/or/keypin.c
  46. 2 2
      src/or/main.c
  47. 1 1
      src/or/nodelist.c
  48. 1 1
      src/or/ntmain.c
  49. 7 4
      src/or/onion_ntor.c
  50. 36 2
      src/or/or.h
  51. 1 1
      src/or/or_connection_st.h
  52. 2 2
      src/or/periodic.c
  53. 1 1
      src/or/reasons.h
  54. 2 2
      src/or/scheduler.c
  55. 0 1
      src/or/shared_random_client.c
  56. 0 1
      src/or/torcert.c
  57. 0 1
      src/or/transports.c
  58. 0 1
      src/test/fuzz/fuzz_hsdescv3.c
  59. 1 1
      src/test/include.am
  60. 5 4
      src/test/test-memwipe.c
  61. 5 4
      src/test/test-timers.c
  62. 1 1
      src/test/test_address_set.c
  63. 0 1
      src/test/test_bridges.c
  64. 0 1
      src/test/test_bt_cl.c
  65. 1 1
      src/test/test_bwmgt.c
  66. 2 2
      src/test/test_channelpadding.c
  67. 0 1
      src/test/test_checkdir.c
  68. 1 1
      src/test/test_compat_libevent.c
  69. 0 1
      src/test/test_config.c
  70. 1 1
      src/test/test_consdiffmgr.c
  71. 0 1
      src/test/test_crypto.c
  72. 2 3
      src/test/test_crypto_openssl.c
  73. 0 1
      src/test/test_entrynodes.c
  74. 0 1
      src/test/test_guardfraction.c
  75. 4 3
      src/test/test_handles.c
  76. 0 1
      src/test/test_hs_common.c
  77. 0 1
      src/test/test_hs_ntor_cl.c
  78. 0 1
      src/test/test_keypin.c
  79. 0 1
      src/test/test_ntor_cl.c
  80. 1 1
      src/test/test_oom.c
  81. 1 1
      src/test/test_procmon.c
  82. 0 1
      src/test/test_pt.c
  83. 0 1
      src/test/test_routerkeys.c
  84. 1 1
      src/test/test_scheduler.c
  85. 1 1
      src/test/test_socks.c
  86. 6 2
      src/test/test_util_slow.c
  87. 2 2
      src/test/test_workqueue.c
  88. 1 1
      src/test/testing_common.c
  89. 1 1
      src/tools/tor-resolve.c

+ 2 - 13
.gitignore

@@ -132,19 +132,6 @@ uptime-*.json
 # /src/trace
 /src/trace/libor-trace.a
 
-# /src/common/
-/src/common/Makefile
-/src/common/Makefile.in
-/src/common/libor.a
-/src/common/libor-testing.a
-/src/common/libor.lib
-/src/common/libor-ctime.a
-/src/common/libor-ctime-testing.a
-/src/common/libor-ctime.lib
-/src/common/libor-event.a
-/src/common/libor-event-testing.a
-/src/common/libor-event.lib
-
 # /src/config/
 /src/config/Makefile
 /src/config/Makefile.in
@@ -173,6 +160,8 @@ uptime-*.json
 /src/lib/libtor-ctime-testing.a
 /src/lib/libtor-encoding.a
 /src/lib/libtor-encoding-testing.a
+/src/lib/libtor-evloop.a
+/src/lib/libtor-evloop-testing.a
 /src/lib/libtor-err.a
 /src/lib/libtor-err-testing.a
 /src/lib/libtor-fdio.a

+ 2 - 4
Makefile.am

@@ -40,7 +40,6 @@ endif
 
 # "Common" libraries used to link tor's utility code.
 TOR_UTIL_LIBS = \
-	src/common/libor.a \
 	src/lib/libtor-process.a \
 	src/lib/libtor-time.a \
 	src/lib/libtor-fs.a \
@@ -68,7 +67,6 @@ TOR_UTIL_LIBS = \
 # Variants of the above for linking the testing variant of tor (for coverage
 # and tests)
 TOR_UTIL_TESTING_LIBS = \
-	src/common/libor-testing.a \
 	src/lib/libtor-process-testing.a \
 	src/lib/libtor-time-testing.a \
 	src/lib/libtor-fs-testing.a \
@@ -112,9 +110,9 @@ TOR_CRYPTO_TESTING_LIBS = \
 TOR_INTERNAL_LIBS = \
 	src/or/libtor-app.a \
 	src/lib/libtor-compress.a \
+	src/lib/libtor-evloop.a \
 	$(TOR_CRYPTO_LIBS) \
 	$(TOR_UTIL_LIBS) \
-	src/common/libor-event.a \
 	src/trunnel/libor-trunnel.a \
 	src/lib/libtor-trace.a
 
@@ -123,9 +121,9 @@ TOR_INTERNAL_LIBS = \
 TOR_INTERNAL_TESTING_LIBS = \
 	src/or/libtor-app-testing.a \
 	src/lib/libtor-compress-testing.a \
+	src/lib/libtor-evloop-testing.a \
 	$(TOR_CRYPTO_TESTING_LIBS) \
 	$(TOR_UTIL_TESTING_LIBS) \
-	src/common/libor-event-testing.a \
 	src/trunnel/libor-trunnel-testing.a \
 	src/lib/libtor-trace.a
 

+ 4 - 19
scripts/codegen/fuzzing_include_am.py

@@ -24,32 +24,17 @@ FUZZING_CFLAGS = \
 FUZZING_LDFLAG = \
 	@TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
 FUZZING_LIBS = \
-	src/or/libtor-testing.a \
-	src/common/libor-crypto-testing.a \
-	$(LIBKECCAK_TINY) \
-	$(LIBDONNA) \
-	src/common/libor-testing.a \
-	src/common/libor-ctime-testing.a \
-	src/common/libor-event-testing.a \
-	src/trunnel/libor-trunnel-testing.a \
+	$(TOR_INTERNAL_TESTING_LIBS) \
 	$(rust_ldadd) \
 	@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
-	@TOR_LIBEVENT_LIBS@ \
-	@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ \
-	@CURVE25519_LIBS@ \
+	@TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
+	@TOR_LIB_WS32@ @TOR_LIB_IPHLPAPI@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ @CURVE25519_LIBS@ \
 	@TOR_SYSTEMD_LIBS@ \
 	@TOR_LZMA_LIBS@ \
 	@TOR_ZSTD_LIBS@
 
 oss-fuzz-prereqs: \
-	src/or/libtor-testing.a \
-	src/common/libor-crypto-testing.a \
-	$(LIBKECCAK_TINY) \
-	$(LIBDONNA) \
-	src/common/libor-testing.a \
-	src/common/libor-ctime-testing.a \
-	src/common/libor-event-testing.a \
-	src/trunnel/libor-trunnel-testing.a
+    $(TOR_INTERNAL_TESTING_LIBS)
 
 noinst_HEADERS += \
 	src/test/fuzz/fuzzing.h

+ 0 - 28
src/common/Makefile.nmake

@@ -1,28 +0,0 @@
-all: libor.lib libor-crypto.lib libor-event.lib
-
-CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
-    /I ..\ext
-
-LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
-	log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
-	util_codedigest.obj
-
-LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj compress.obj compress_zlib.obj \
-	tortls.obj crypto_curve25519.obj curve25519-donna.obj
-
-LIBOR_EVENT_OBJECTS = compat_libevent.obj
-
-curve25519-donna.obj: ..\ext\curve25519_donna\curve25519-donna.c
-	$(CC) $(CFLAGS) /D inline=_inline /c ..\ext\curve25519_donna\curve25519-donna.c
-
-libor.lib: $(LIBOR_OBJECTS)
-	lib $(LIBOR_OBJECTS) /out:libor.lib
-
-libor-crypto.lib: $(LIBOR_CRYPTO_OBJECTS)
-	lib $(LIBOR_CRYPTO_OBJECTS) /out:libor-crypto.lib
-
-libor-event.lib:  $(LIBOR_EVENT_OBJECTS)
-	lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
-
-clean:
-	del *.obj *.lib libor*.lib

+ 0 - 62
src/common/include.am

@@ -1,62 +0,0 @@
-
-noinst_LIBRARIES += \
-	src/common/libor.a \
-	src/common/libor-event.a
-
-if UNITTESTS_ENABLED
-noinst_LIBRARIES += \
-	src/common/libor-testing.a \
-	src/common/libor-event-testing.a
-endif
-
-EXTRA_DIST += src/common/Makefile.nmake
-
-if USE_OPENBSD_MALLOC
-libor_extra_source=src/ext/OpenBSD_malloc_Linux.c
-else
-libor_extra_source=
-endif
-
-LIBOR_A_SRC = \
-  src/common/address_set.c				\
-  src/common/token_bucket.c				\
-  src/common/workqueue.c				\
-  $(libor_extra_source)
-
-src/common/src_common_libor_testing_a-log.$(OBJEXT) \
-  src/common/log.$(OBJEXT): micro-revision.i
-
-LIBOR_EVENT_A_SRC = \
-	src/common/compat_libevent.c \
-	src/common/procmon.c         \
-	src/common/timers.c          \
-	src/ext/timeouts/timeout.c
-
-src_common_libor_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_event_a_SOURCES = $(LIBOR_EVENT_A_SRC)
-
-if UNITTESTS_ENABLED
-src_common_libor_testing_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_event_testing_a_SOURCES = $(LIBOR_EVENT_A_SRC)
-else
-src_common_libor_testing_a_SOURCES =
-src_common_libor_event_testing_a_SOURCES =
-endif
-
-src_common_libor_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
-src_common_libor_event_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
-src_common_libor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
-src_common_libor_event_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
-
-COMMONHEADERS = \
-  src/common/address_set.h			\
-  src/common/compat_libevent.h			\
-  src/common/handles.h				\
-  src/common/procmon.h				\
-  src/common/socks5_status.h                    \
-  src/common/timers.h				\
-  src/common/token_bucket.h			\
-  src/common/util.h				\
-  src/common/workqueue.h
-
-noinst_HEADERS+= $(COMMONHEADERS)

+ 0 - 52
src/common/util.h

@@ -1,52 +0,0 @@
-/* Copyright (c) 2003-2004, Roger Dingledine
- * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2018, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file util.h
- * \brief Headers for util.c
- **/
-
-#ifndef TOR_UTIL_H
-#define TOR_UTIL_H
-
-#include "orconfig.h"
-#include "lib/arch/bytes.h"
-#include "lib/cc/compat_compiler.h"
-#include "lib/cc/torint.h"
-#include "lib/ctime/di_ops.h"
-#include "lib/encoding/cstring.h"
-#include "lib/encoding/time_fmt.h"
-#include "lib/err/torerr.h"
-#include "lib/fs/dir.h"
-#include "lib/fs/files.h"
-#include "lib/fs/mmap.h"
-#include "lib/fs/path.h"
-#include "lib/fs/userdb.h"
-#include "lib/intmath/addsub.h"
-#include "lib/intmath/bits.h"
-#include "lib/intmath/cmp.h"
-#include "lib/intmath/logic.h"
-#include "lib/intmath/muldiv.h"
-#include "lib/log/escape.h"
-#include "lib/log/ratelim.h"
-#include "lib/log/util_bug.h"
-#include "lib/malloc/util_malloc.h"
-#include "lib/net/ipv4.h"
-#include "lib/net/ipv6.h"
-#include "lib/net/resolve.h"
-#include "lib/net/socket.h"
-#include "lib/string/compat_ctype.h"
-#include "lib/string/compat_string.h"
-#include "lib/string/parse_int.h"
-#include "lib/string/printf.h"
-#include "lib/string/scanf.h"
-#include "lib/string/util_string.h"
-#include "lib/testsupport/testsupport.h"
-#include "lib/thread/threads.h"
-#include "lib/time/compat_time.h"
-#include "lib/wallclock/approx_time.h"
-#include "lib/wallclock/timeval.h"
-
-#endif /* !defined(TOR_UTIL_H) */

+ 1 - 1
src/include.am

@@ -8,6 +8,7 @@ include src/lib/container/include.am
 include src/lib/crypt_ops/include.am
 include src/lib/defs/include.am
 include src/lib/encoding/include.am
+include src/lib/evloop/include.am
 include src/lib/fdio/include.am
 include src/lib/fs/include.am
 include src/lib/include.libdonna.am
@@ -31,7 +32,6 @@ include src/lib/time/include.am
 include src/lib/tls/include.am
 include src/lib/trace/include.am
 include src/lib/wallclock/include.am
-include src/common/include.am
 include src/trunnel/include.am
 include src/or/include.am
 include src/rust/include.am

+ 0 - 0
src/common/handles.h → src/lib/container/handles.h


+ 1 - 0
src/lib/container/include.am

@@ -21,6 +21,7 @@ noinst_HEADERS +=					\
 	src/lib/container/bitarray.h			\
 	src/lib/container/bloomfilt.h			\
 	src/lib/container/buffers.h			\
+	src/lib/container/handles.h			\
 	src/lib/container/map.h				\
 	src/lib/container/order.h			\
 	src/lib/container/smartlist.h

+ 15 - 0
src/lib/evloop/.may_include

@@ -0,0 +1,15 @@
+orconfig.h
+
+lib/cc/*.h
+lib/crypt_ops/*.h
+lib/evloop/*.h
+lib/intmath/*.h
+lib/log/*.h
+lib/malloc/*.h
+lib/net/*.h
+lib/string/*.h
+lib/testsupport/*.h
+lib/thread/*.h
+lib/time/*.h
+
+src/ext/timeouts/timeout.c

+ 1 - 1
src/common/compat_libevent.c → src/lib/evloop/compat_libevent.c

@@ -8,7 +8,7 @@
 
 #include "orconfig.h"
 #define COMPAT_LIBEVENT_PRIVATE
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/log/torlog.h"

+ 0 - 0
src/common/compat_libevent.h → src/lib/evloop/compat_libevent.h


+ 26 - 0
src/lib/evloop/include.am

@@ -0,0 +1,26 @@
+
+noinst_LIBRARIES += src/lib/libtor-evloop.a
+
+if UNITTESTS_ENABLED
+noinst_LIBRARIES += src/lib/libtor-evloop-testing.a
+endif
+
+src_lib_libtor_evloop_a_SOURCES =			\
+	src/lib/evloop/compat_libevent.c		\
+	src/lib/evloop/procmon.c			\
+	src/lib/evloop/timers.c				\
+	src/lib/evloop/token_bucket.c			\
+	src/lib/evloop/workqueue.c
+
+
+src_lib_libtor_evloop_testing_a_SOURCES = \
+	$(src_lib_libtor_evloop_a_SOURCES)
+src_lib_libtor_evloop_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
+src_lib_libtor_evloop_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+
+noinst_HEADERS +=					\
+	src/lib/evloop/compat_libevent.h		\
+	src/lib/evloop/procmon.h			\
+	src/lib/evloop/timers.h				\
+	src/lib/evloop/token_bucket.h			\
+	src/lib/evloop/workqueue.h

+ 1 - 1
src/common/procmon.c → src/lib/evloop/procmon.c

@@ -6,7 +6,7 @@
  * \brief Process-termination monitor functions
  **/
 
-#include "common/procmon.h"
+#include "lib/evloop/procmon.h"
 
 #include "lib/log/torlog.h"
 #include "lib/log/util_bug.h"

+ 1 - 1
src/common/procmon.h → src/lib/evloop/procmon.h

@@ -9,7 +9,7 @@
 #ifndef TOR_PROCMON_H
 #define TOR_PROCMON_H
 
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include "lib/log/torlog.h"
 

+ 2 - 2
src/common/timers.c → src/lib/evloop/timers.c

@@ -31,8 +31,8 @@
 
 #define TOR_TIMERS_PRIVATE
 
-#include "common/compat_libevent.h"
-#include "common/timers.h"
+#include "lib/evloop/compat_libevent.h"
+#include "lib/evloop/timers.h"
 #include "lib/intmath/muldiv.h"
 #include "lib/log/torlog.h"
 #include "lib/log/util_bug.h"

+ 0 - 0
src/common/timers.h → src/lib/evloop/timers.h


+ 1 - 1
src/common/token_bucket.c → src/lib/evloop/token_bucket.c

@@ -18,7 +18,7 @@
 
 #define TOKEN_BUCKET_PRIVATE
 
-#include "common/token_bucket.h"
+#include "lib/evloop/token_bucket.h"
 #include "lib/log/util_bug.h"
 #include "lib/intmath/cmp.h"
 #include "lib/time/compat_time.h"

+ 0 - 0
src/common/token_bucket.h → src/lib/evloop/token_bucket.h


+ 2 - 2
src/common/workqueue.c → src/lib/evloop/workqueue.c

@@ -24,8 +24,8 @@
  */
 
 #include "orconfig.h"
-#include "common/compat_libevent.h"
-#include "common/workqueue.h"
+#include "lib/evloop/compat_libevent.h"
+#include "lib/evloop/workqueue.h"
 
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/intmath/weakrng.h"

+ 0 - 0
src/common/workqueue.h → src/lib/evloop/workqueue.h


+ 4 - 0
src/lib/malloc/include.am

@@ -8,6 +8,10 @@ endif
 src_lib_libtor_malloc_a_SOURCES =			\
 	src/lib/malloc/util_malloc.c
 
+if USE_OPENBSD_MALLOC
+src_lib_libtor_malloc_a_SOURCES += src/ext/OpenBSD_malloc_Linux.c
+endif
+
 src_lib_libtor_malloc_testing_a_SOURCES = \
 	$(src_lib_libtor_malloc_a_SOURCES)
 src_lib_libtor_malloc_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)

+ 2 - 1
src/lib/net/include.am

@@ -29,4 +29,5 @@ noinst_HEADERS +=				\
 	src/lib/net/ipv6.h			\
 	src/lib/net/nettypes.h			\
 	src/lib/net/resolve.h			\
-	src/lib/net/socket.h
+	src/lib/net/socket.h			\
+	src/lib/net/socks5_status.h

+ 0 - 0
src/common/socks5_status.h → src/lib/net/socks5_status.h


+ 1 - 1
src/common/address_set.c → src/or/address_set.c

@@ -11,7 +11,7 @@
  **/
 
 #include "orconfig.h"
-#include "common/address_set.h"
+#include "or/address_set.h"
 #include "lib/net/address.h"
 #include "lib/container/bloomfilt.h"
 #include "lib/crypt_ops/crypto_rand.h"

+ 0 - 0
src/common/address_set.h → src/or/address_set.h


+ 1 - 1
src/or/channel.c

@@ -79,7 +79,7 @@
 #include "lib/time/compat_time.h"
 #include "or/networkstatus.h"
 #include "or/rendservice.h"
-#include "common/timers.h"
+#include "lib/evloop/timers.h"
 
 #include "or/cell_queue_st.h"
 

+ 1 - 1
src/or/channel.h

@@ -11,7 +11,7 @@
 
 #include "or/or.h"
 #include "or/circuitmux.h"
-#include "common/handles.h"
+#include "lib/container/handles.h"
 #include "lib/crypt_ops/crypto_ed25519.h"
 
 #include "tor_queue.h"

+ 1 - 1
src/or/channelpadding.c

@@ -22,7 +22,7 @@
 #include "or/router.h"
 #include "lib/time/compat_time.h"
 #include "or/rendservice.h"
-#include "common/timers.h"
+#include "lib/evloop/timers.h"
 
 #include "or/cell_st.h"
 #include "or/or_connection_st.h"

+ 1 - 2
src/or/config.c

@@ -99,7 +99,6 @@
 #include "or/rephist.h"
 #include "or/router.h"
 #include "lib/sandbox/sandbox.h"
-#include "common/util.h"
 #include "or/routerlist.h"
 #include "or/routerset.h"
 #include "or/scheduler.h"
@@ -132,7 +131,7 @@
 
 #include "lib/encoding/keyval.h"
 #include "lib/fs/conffile.h"
-#include "common/procmon.h"
+#include "lib/evloop/procmon.h"
 
 #include "or/dirauth/dirvote.h"
 #include "or/dirauth/mode.h"

+ 1 - 1
src/or/connection.c

@@ -105,7 +105,7 @@
 #include "lib/sandbox/sandbox.h"
 #include "lib/net/buffers_net.h"
 #include "lib/tls/tortls.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "lib/compress/compress.h"
 
 #ifdef HAVE_PWD_H

+ 1 - 1
src/or/connection_edge.c

@@ -106,7 +106,7 @@
 #include "or/or_circuit_st.h"
 #include "or/origin_circuit_st.h"
 #include "or/socks_request_st.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #ifdef HAVE_LINUX_TYPES_H
 #include <linux/types.h>

+ 1 - 1
src/or/conscache.h

@@ -4,7 +4,7 @@
 #ifndef TOR_CONSCACHE_H
 #define TOR_CONSCACHE_H
 
-#include "common/handles.h"
+#include "lib/container/handles.h"
 
 typedef struct consensus_cache_entry_t consensus_cache_entry_t;
 typedef struct consensus_cache_t consensus_cache_t;

+ 2 - 2
src/or/consdiffmgr.c

@@ -21,8 +21,8 @@
 #include "or/cpuworker.h"
 #include "or/networkstatus.h"
 #include "or/routerparse.h"
-#include "common/compat_libevent.h"
-#include "common/workqueue.h"
+#include "lib/evloop/compat_libevent.h"
+#include "lib/evloop/workqueue.h"
 #include "lib/compress/compress.h"
 #include "lib/encoding/confline.h"
 

+ 3 - 3
src/or/control.c

@@ -46,7 +46,7 @@
 #include "or/circuitstats.h"
 #include "or/circuituse.h"
 #include "or/command.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "or/config.h"
 #include "or/confparse.h"
 #include "or/connection.h"
@@ -113,8 +113,8 @@
 #endif
 
 #include "lib/crypt_ops/crypto_s2k.h"
-#include "common/procmon.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/procmon.h"
+#include "lib/evloop/compat_libevent.h"
 
 /** Yield true iff <b>s</b> is the state of a control_connection_t that has
  * finished authentication and is accepting commands. */

+ 1 - 1
src/or/cpuworker.c

@@ -30,7 +30,7 @@
 #include "or/onion.h"
 #include "or/rephist.h"
 #include "or/router.h"
-#include "common/workqueue.h"
+#include "lib/evloop/workqueue.h"
 
 #include "or/or_circuit_st.h"
 #include "lib/intmath/weakrng.h"

+ 0 - 1
src/or/dirauth/shared_random.c

@@ -99,7 +99,6 @@
 #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"

+ 1 - 1
src/or/dns.c

@@ -64,7 +64,7 @@
 #include "or/router.h"
 #include "ht.h"
 #include "lib/sandbox/sandbox.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include "or/edge_connection_st.h"
 #include "or/or_circuit_st.h"

+ 1 - 1
src/or/dnsserv.c

@@ -34,7 +34,7 @@
 #include "or/entry_connection_st.h"
 #include "or/listener_connection_st.h"
 #include "or/socks_request_st.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include <event2/dns.h>
 #include <event2/dns_compat.h>

+ 1 - 1
src/or/entrynodes.h

@@ -12,7 +12,7 @@
 #ifndef TOR_ENTRYNODES_H
 #define TOR_ENTRYNODES_H
 
-#include "common/handles.h"
+#include "lib/container/handles.h"
 
 /* Forward declare for guard_selection_t; entrynodes.c has the real struct */
 typedef struct guard_selection_s guard_selection_t;

+ 0 - 1
src/or/ext_orport.c

@@ -27,7 +27,6 @@
 #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"
 

+ 1 - 1
src/or/hibernate.c

@@ -41,7 +41,7 @@ hibernating, phase 2:
 #include "or/main.h"
 #include "or/router.h"
 #include "or/statefile.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include "or/or_connection_st.h"
 #include "or/or_state_st.h"

+ 0 - 1
src/or/hs_cell.c

@@ -11,7 +11,6 @@
 #include "lib/crypt_ops/crypto_util.h"
 #include "or/rendservice.h"
 #include "or/replaycache.h"
-#include "common/util.h"
 
 #include "or/hs_cell.h"
 #include "or/hs_ntor.h"

+ 2 - 0
src/or/include.am

@@ -19,6 +19,7 @@ EXTRA_DIST+= src/or/ntmain.c src/or/Makefile.nmake
 
 LIBTOR_APP_A_SOURCES = \
 	src/or/addressmap.c				\
+	src/or/address_set.c				\
 	src/or/bridges.c				\
 	src/or/channel.c				\
 	src/or/channelpadding.c				\
@@ -180,6 +181,7 @@ endif
 
 ORHEADERS = \
 	src/or/addressmap.h				\
+	src/or/address_set.h				\
 	src/or/addr_policy_st.h				\
 	src/or/authority_cert_st.h			\
 	src/or/auth_dirs.inc				\

+ 20 - 5
src/or/keypin.c

@@ -11,17 +11,28 @@
 #define KEYPIN_PRIVATE
 
 #include "orconfig.h"
+
+#include "lib/cc/torint.h"
 #include "lib/crypt_ops/crypto_digest.h"
 #include "lib/crypt_ops/crypto_format.h"
+#include "lib/crypt_ops/crypto_format.h"
+#include "lib/ctime/di_ops.h"
 #include "lib/ctime/di_ops.h"
+#include "lib/encoding/binascii.h"
+#include "lib/encoding/time_fmt.h"
+#include "lib/fdio/fdio.h"
+#include "lib/fs/files.h"
+#include "lib/fs/mmap.h"
+#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "lib/string/compat_ctype.h"
+#include "lib/string/printf.h"
+#include "lib/wallclock/approx_time.h"
+
 #include "ht.h"
 #include "or/keypin.h"
+
 #include "siphash.h"
-#include "lib/cc/torint.h"
-#include "lib/log/torlog.h"
-#include "lib/fdio/fdio.h"
-#include "common/util.h"
-#include "lib/encoding/binascii.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -34,6 +45,10 @@
 #include <io.h>
 #endif
 
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
 /**
  * @file keypin.c
  * @brief Key-pinning for RSA and Ed25519 identity keys at directory

+ 2 - 2
src/or/main.c

@@ -117,9 +117,9 @@
 #include "lib/fs/lockfile.h"
 #include "lib/net/buffers_net.h"
 #include "lib/tls/tortls.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "lib/encoding/confline.h"
-#include "common/timers.h"
+#include "lib/evloop/timers.h"
 
 #include <event2/event.h>
 

+ 1 - 1
src/or/nodelist.c

@@ -42,7 +42,7 @@
 
 #include "or/or.h"
 #include "lib/net/address.h"
-#include "common/address_set.h"
+#include "or/address_set.h"
 #include "or/bridges.h"
 #include "or/config.h"
 #include "or/control.h"

+ 1 - 1
src/or/ntmain.c

@@ -25,7 +25,7 @@
 #include "or/ntmain.h"
 #include "lib/log/win32err.h"
 #include "lib/fs/winlib.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include <windows.h>
 #define GENSRV_SERVICENAME  "tor"

+ 7 - 4
src/or/onion_ntor.c

@@ -21,14 +21,17 @@
 #include "orconfig.h"
 
 #define ONION_NTOR_PRIVATE
+
 #include "lib/crypt_ops/crypto.h"
-#include "lib/crypt_ops/crypto_hkdf.h"
 #include "lib/crypt_ops/crypto_digest.h"
+#include "lib/crypt_ops/crypto_hkdf.h"
 #include "lib/crypt_ops/crypto_util.h"
-#include "or/onion_ntor.h"
-#include "lib/log/torlog.h"
 #include "lib/ctime/di_ops.h"
-#include "common/util.h"
+#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "or/onion_ntor.h"
+
+#include <string.h>
 
 /** Free storage held in an ntor handshake state. */
 void

+ 36 - 2
src/or/or.h

@@ -22,14 +22,48 @@
 #include <time.h>
 #endif
 
-#include "common/util.h"
-
+#include "lib/arch/bytes.h"
+#include "lib/cc/compat_compiler.h"
+#include "lib/cc/torint.h"
 #include "lib/container/map.h"
 #include "lib/container/smartlist.h"
 #include "lib/crypt_ops/crypto.h"
+#include "lib/ctime/di_ops.h"
 #include "lib/defs/dh_sizes.h"
 #include "lib/encoding/binascii.h"
+#include "lib/encoding/cstring.h"
+#include "lib/encoding/time_fmt.h"
+#include "lib/err/torerr.h"
+#include "lib/fs/dir.h"
+#include "lib/fs/files.h"
+#include "lib/fs/mmap.h"
+#include "lib/fs/path.h"
+#include "lib/fs/userdb.h"
+#include "lib/intmath/addsub.h"
+#include "lib/intmath/bits.h"
+#include "lib/intmath/cmp.h"
+#include "lib/intmath/logic.h"
+#include "lib/intmath/muldiv.h"
+#include "lib/log/escape.h"
+#include "lib/log/ratelim.h"
+#include "lib/log/util_bug.h"
+#include "lib/malloc/util_malloc.h"
 #include "lib/net/address.h"
+#include "lib/net/ipv4.h"
+#include "lib/net/ipv6.h"
+#include "lib/net/resolve.h"
+#include "lib/net/socket.h"
+#include "lib/string/compat_ctype.h"
+#include "lib/string/compat_string.h"
+#include "lib/string/parse_int.h"
+#include "lib/string/printf.h"
+#include "lib/string/scanf.h"
+#include "lib/string/util_string.h"
+#include "lib/testsupport/testsupport.h"
+#include "lib/thread/threads.h"
+#include "lib/time/compat_time.h"
+#include "lib/wallclock/approx_time.h"
+#include "lib/wallclock/timeval.h"
 
 #include "ht.h"
 

+ 1 - 1
src/or/or_connection_st.h

@@ -8,7 +8,7 @@
 #define OR_CONNECTION_ST_H
 
 #include "or/connection_st.h"
-#include "common/token_bucket.h"
+#include "lib/evloop/token_bucket.h"
 
 struct tor_tls_t;
 

+ 2 - 2
src/or/periodic.c

@@ -12,11 +12,11 @@
  */
 
 #include "or/or.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "or/config.h"
 #include "or/main.h"
 #include "or/periodic.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.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

+ 1 - 1
src/or/reasons.h

@@ -12,7 +12,7 @@
 #ifndef TOR_REASONS_H
 #define TOR_REASONS_H
 
-#include "common/socks5_status.h"
+#include "lib/net/socks5_status.h"
 enum bandwidth_weight_rule_t;
 
 const char *stream_end_reason_to_control_string(int reason);

+ 2 - 2
src/or/scheduler.c

@@ -4,7 +4,7 @@
 #include "or/or.h"
 #include "or/config.h"
 
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #define SCHEDULER_PRIVATE_
 #define SCHEDULER_KIST_PRIVATE
 #include "or/scheduler.h"
@@ -12,7 +12,7 @@
 #include "lib/container/buffers.h"
 #define TOR_CHANNEL_INTERNAL_
 #include "or/channeltls.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include "or/or_connection_st.h"
 

+ 0 - 1
src/or/shared_random_client.c

@@ -14,7 +14,6 @@
 #include "or/config.h"
 #include "or/voting_schedule.h"
 #include "or/networkstatus.h"
-#include "common/util.h"
 #include "lib/encoding/binascii.h"
 
 #include "or/networkstatus_st.h"

+ 0 - 1
src/or/torcert.c

@@ -31,7 +31,6 @@
 #include "or/torcert.h"
 #include "trunnel/ed25519_cert.h"
 #include "lib/log/torlog.h"
-#include "common/util.h"
 #include "trunnel/link_handshake.h"
 #include "lib/tls/tortls.h"
 

+ 0 - 1
src/or/transports.c

@@ -96,7 +96,6 @@
 #include "or/connection.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"

+ 0 - 1
src/test/fuzz/fuzz_hsdescv3.c

@@ -9,7 +9,6 @@
 #include "lib/crypt_ops/crypto_ed25519.h"
 #include "or/hs_descriptor.h"
 #include "or/routerparse.h"
-#include "common/util.h"
 
 #include "test/fuzz/fuzzing.h"
 

+ 1 - 1
src/test/include.am

@@ -271,7 +271,7 @@ src_test_test_workqueue_LDADD = \
 src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
 src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
 src_test_test_timers_LDADD = \
-	src/common/libor-event-testing.a \
+	src/lib/libtor-evloop-testing.a \
 	$(TOR_CRYPTO_TESTING_LIBS) \
 	$(TOR_UTIL_TESTING_LIBS) \
 	$(rust_ldadd) \

+ 5 - 4
src/test/test-memwipe.c

@@ -2,14 +2,16 @@
 /* See LICENSE for licensing information */
 
 #include "orconfig.h"
+#include "lib/crypt_ops/crypto_util.h"
+
+#include "lib/intmath/cmp.h"
+#include "lib/malloc/util_malloc.h"
+
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
 
-#include "lib/crypt_ops/crypto_util.h"
-#include "common/util.h"
-
 static unsigned fill_a_buffer_memset(void) __attribute__((noinline));
 static unsigned fill_a_buffer_memwipe(void) __attribute__((noinline));
 static unsigned fill_a_buffer_nothing(void) __attribute__((noinline));
@@ -214,4 +216,3 @@ main(int argc, char **argv)
     return 0;
   }
 }
-

+ 5 - 4
src/test/test-timers.c

@@ -7,10 +7,12 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
+#include "lib/evloop/timers.h"
 #include "lib/crypt_ops/crypto_rand.h"
-#include "common/timers.h"
-#include "common/util.h"
+#include "lib/log/util_bug.h"
+#include "lib/time/compat_time.h"
+#include "lib/wallclock/timeval.h"
 
 #define N_TIMERS 1000
 #define MAX_DURATION 30
@@ -138,4 +140,3 @@ main(int argc, char **argv)
   timers_shutdown();
   return ret;
 }
-

+ 1 - 1
src/test/test_address_set.c

@@ -3,7 +3,7 @@
 
 #include "or/or.h"
 #include "lib/crypt_ops/crypto_rand.h"
-#include "common/address_set.h"
+#include "or/address_set.h"
 #include "or/microdesc.h"
 #include "or/networkstatus.h"
 #include "or/nodelist.h"

+ 0 - 1
src/test/test_bridges.c

@@ -16,7 +16,6 @@
 #include "or/bridges.h"
 #include "or/config.h"
 #include "or/transports.h"
-#include "common/util.h"
 
 /* Test suite stuff */
 #include "test/test.h"

+ 0 - 1
src/test/test_bt_cl.c

@@ -8,7 +8,6 @@
 /* To prevent 'assert' from going away. */
 #undef TOR_COVERAGE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/err/backtrace.h"
 #include "lib/log/torlog.h"
 

+ 1 - 1
src/test/test_bwmgt.c

@@ -11,7 +11,7 @@
 #include "or/or.h"
 #include "test/test.h"
 
-#include "common/token_bucket.h"
+#include "lib/evloop/token_bucket.h"
 
 // an imaginary time, in timestamp units. Chosen so it will roll over.
 static const uint32_t START_TS = UINT32_MAX-10;

+ 2 - 2
src/test/test_channelpadding.c

@@ -13,14 +13,14 @@
 #include "or/channel.h"
 #include "or/channeltls.h"
 #include "or/channelpadding.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "or/config.h"
 #include "lib/time/compat_time.h"
 #include "or/main.h"
 #include "or/networkstatus.h"
 #include "test/log_test_helpers.h"
 #include "lib/tls/tortls.h"
-#include "common/timers.h"
+#include "lib/evloop/timers.h"
 #include "lib/container/buffers.h"
 
 #include "or/cell_st.h"

+ 0 - 1
src/test/test_checkdir.c

@@ -12,7 +12,6 @@
 
 #include "or/config.h"
 #include "test/test.h"
-#include "common/util.h"
 
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>

+ 1 - 1
src/test/test_compat_libevent.c

@@ -7,7 +7,7 @@
 
 #include "test/test.h"
 
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include <event2/event.h>
 

+ 0 - 1
src/test/test_config.c

@@ -19,7 +19,6 @@
 #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"

+ 1 - 1
src/test/test_consdiffmgr.c

@@ -12,7 +12,7 @@
 #include "lib/crypt_ops/crypto_rand.h"
 #include "or/networkstatus.h"
 #include "or/routerparse.h"
-#include "common/workqueue.h"
+#include "lib/evloop/workqueue.h"
 #include "lib/compress/compress.h"
 #include "lib/encoding/confline.h"
 

+ 0 - 1
src/test/test_crypto.c

@@ -9,7 +9,6 @@
 #include "or/or.h"
 #include "test/test.h"
 #include "lib/crypt_ops/aes.h"
-#include "common/util.h"
 #include "siphash.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "lib/crypt_ops/crypto_dh.h"

+ 2 - 3
src/test/test_crypto_openssl.c

@@ -7,14 +7,14 @@
 
 #define CRYPTO_RAND_PRIVATE
 
+#include "lib/crypt_ops/compat_openssl.h"
 #include "lib/crypt_ops/crypto_rand.h"
-#include "common/util.h"
 #include "lib/encoding/binascii.h"
 #include "test/test.h"
 
 #include <openssl/evp.h>
 #include <openssl/rand.h>
-#include "lib/crypt_ops/compat_openssl.h"
+#include <string.h>
 
 /* Test for rectifying openssl RAND engine. */
 static void
@@ -103,4 +103,3 @@ struct testcase_t crypto_openssl_tests[] = {
     TT_FORK, NULL, NULL },
   END_OF_TESTCASES
 };
-

+ 0 - 1
src/test/test_entrynodes.c

@@ -28,7 +28,6 @@
 #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"

+ 0 - 1
src/test/test_guardfraction.c

@@ -10,7 +10,6 @@
 #include "or/config.h"
 #include "or/dirserv.h"
 #include "or/entrynodes.h"
-#include "common/util.h"
 #include "or/routerparse.h"
 #include "or/networkstatus.h"
 

+ 4 - 3
src/test/test_handles.c

@@ -4,8 +4,10 @@
 #include "orconfig.h"
 #include "test/test.h"
 
-#include "common/util.h"
-#include "common/handles.h"
+#include "lib/container/handles.h"
+#include "lib/log/util_bug.h"
+
+#include <stdio.h>
 
 typedef struct demo_t {
   HANDLE_ENTRY(demo, demo_t);
@@ -94,4 +96,3 @@ struct testcase_t handle_tests[] = {
   HANDLE_TEST(basic, 0),
   END_OF_TESTCASES
 };
-

+ 0 - 1
src/test/test_hs_common.c

@@ -31,7 +31,6 @@
 #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"

+ 0 - 1
src/test/test_hs_ntor_cl.c

@@ -14,7 +14,6 @@
 
 #define ONION_NTOR_PRIVATE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "lib/crypt_ops/crypto_ed25519.h"

+ 0 - 1
src/test/test_keypin.c

@@ -5,7 +5,6 @@
 #define KEYPIN_PRIVATE
 #include "or/or.h"
 #include "or/keypin.h"
-#include "common/util.h"
 
 #include "test/test.h"
 

+ 0 - 1
src/test/test_ntor_cl.c

@@ -7,7 +7,6 @@
 
 #define ONION_NTOR_PRIVATE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "or/onion_ntor.h"

+ 1 - 1
src/test/test_oom.c

@@ -10,7 +10,7 @@
 #include "or/or.h"
 #include "lib/container/buffers.h"
 #include "or/circuitlist.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "or/connection.h"
 #include "or/config.h"
 #include "lib/crypt_ops/crypto_rand.h"

+ 1 - 1
src/test/test_procmon.c

@@ -6,7 +6,7 @@
 #include "or/or.h"
 #include "test/test.h"
 
-#include "common/procmon.h"
+#include "lib/evloop/procmon.h"
 
 #include "test/log_test_helpers.h"
 

+ 0 - 1
src/test/test_pt.c

@@ -15,7 +15,6 @@
 #include "or/control.h"
 #include "or/transports.h"
 #include "or/circuitbuild.h"
-#include "common/util.h"
 #include "or/statefile.h"
 #include "test/test.h"
 #include "lib/process/subprocess.h"

+ 0 - 1
src/test/test_routerkeys.c

@@ -9,7 +9,6 @@
 #include "or/config.h"
 #include "or/router.h"
 #include "or/routerkeys.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_format.h"
 #include "or/torcert.h"

+ 1 - 1
src/test/test_scheduler.c

@@ -10,7 +10,7 @@
 #define CHANNEL_PRIVATE_
 #include "or/or.h"
 #include "or/config.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "or/channel.h"
 #include "or/channeltls.h"
 #include "or/connection.h"

+ 1 - 1
src/test/test_socks.c

@@ -11,7 +11,7 @@
 #include "test/test.h"
 #include "test/log_test_helpers.h"
 #include "or/socks_request_st.h"
-#include "common/socks5_status.h"
+#include "lib/net/socks5_status.h"
 
 typedef struct socks_test_data_t {
   socks_request_t *req;

+ 6 - 2
src/test/test_util_slow.c

@@ -6,13 +6,17 @@
 #include "orconfig.h"
 #define UTIL_PRIVATE
 #define SUBPROCESS_PRIVATE
-#include "common/util.h"
-#include "lib/process/waitpid.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/log/torlog.h"
 #include "lib/process/subprocess.h"
+#include "lib/process/waitpid.h"
+#include "lib/string/printf.h"
+#include "lib/time/compat_time.h"
 #include "test/test.h"
 
+#include <errno.h>
+#include <string.h>
+
 #ifndef BUILDDIR
 #define BUILDDIR "."
 #endif

+ 2 - 2
src/test/test_workqueue.c

@@ -6,11 +6,11 @@
 #include "or/or.h"
 #include "lib/thread/threads.h"
 #include "or/onion.h"
-#include "common/workqueue.h"
+#include "lib/evloop/workqueue.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/net/alertsock.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 #include "lib/intmath/weakrng.h"
 
 #include <stdio.h>

+ 1 - 1
src/test/testing_common.c

@@ -22,7 +22,7 @@
 #include "or/channelpadding.h"
 #include "or/main.h"
 #include "lib/compress/compress.h"
-#include "common/compat_libevent.h"
+#include "lib/evloop/compat_libevent.h"
 
 #include <stdio.h>
 #ifdef HAVE_FCNTL_H

+ 1 - 1
src/tools/tor-resolve.c

@@ -14,7 +14,7 @@
 #include "lib/sandbox/sandbox.h"
 #include "lib/string/util_string.h"
 
-#include "common/socks5_status.h"
+#include "lib/net/socks5_status.h"
 
 #include <stdio.h>
 #include <stdlib.h>