Commit 45938298 authored by Nick Mathewson's avatar Nick Mathewson
Browse files

Remove util.h

Inline its contents (which were all includes) into or.h, and some of
its contents into other places that didn't include or.h at all.
parent 0adcfbc7
......@@ -52,7 +52,6 @@ COMMONHEADERS = \
src/common/procmon.h \
src/common/timers.h \
src/common/token_bucket.h \
src/common/util.h \
src/common/workqueue.h
noinst_HEADERS+= $(COMMONHEADERS)
/* 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) */
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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;
}
}
......@@ -8,9 +8,11 @@
#include <string.h>
#include "common/compat_libevent.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "common/timers.h"
#include "common/util.h"
#include "lib/crypt_ops/crypto_rand.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;
}
......@@ -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"
......
......@@ -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"
......
......@@ -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>
......
......@@ -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"
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment