Skip to content

Commit

Permalink
Merge branch 'split_or_directory'
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Jul 5, 2018
2 parents 4eac5c6 + 50963f3 commit 8b0920b
Show file tree
Hide file tree
Showing 398 changed files with 3,606 additions and 3,783 deletions.
19 changes: 9 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,15 @@ uptime-*.json
/src/lib/libtor-wallclock.a
/src/lib/libtor-wallclock-testing.a

# /src/or/
/src/or/Makefile
/src/or/Makefile.in
/src/or/tor
/src/or/tor.exe
/src/or/tor-cov
/src/or/tor-cov.exe
/src/or/libtor-app.a
/src/or/libtor-app-testing.a
/src/or/libtor.lib
# /src/tor
/src/core/libtor-app.a
/src/core/libtor-app-testing.a

# /src/app
/src/app/tor
/src/app/tor.exe
/src/app/tor-cov
/src/app/tor-cov.exe

# /src/rust
/src/rust/.cargo/config
Expand Down
1,156 changes: 579 additions & 577 deletions Doxyfile.in

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLA
SHELL=@SHELL@

if COVERAGE_ENABLED
TESTING_TOR_BINARY=$(top_builddir)/src/or/tor-cov$(EXEEXT)
TESTING_TOR_BINARY=$(top_builddir)/src/app/tor-cov$(EXEEXT)
else
TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT)
TESTING_TOR_BINARY=$(top_builddir)/src/app/tor$(EXEEXT)
endif

if USE_RUST
Expand Down Expand Up @@ -108,7 +108,7 @@ TOR_CRYPTO_TESTING_LIBS = \

# All static libraries used to link tor.
TOR_INTERNAL_LIBS = \
src/or/libtor-app.a \
src/core/libtor-app.a \
src/lib/libtor-compress.a \
src/lib/libtor-evloop.a \
$(TOR_CRYPTO_LIBS) \
Expand All @@ -119,7 +119,7 @@ TOR_INTERNAL_LIBS = \
# Variants of the above for linking the testing variant of tor (for coverage
# and tests)
TOR_INTERNAL_TESTING_LIBS = \
src/or/libtor-app-testing.a \
src/core/libtor-app-testing.a \
src/lib/libtor-compress-testing.a \
src/lib/libtor-evloop-testing.a \
$(TOR_CRYPTO_TESTING_LIBS) \
Expand Down Expand Up @@ -302,10 +302,10 @@ coverage-html-full: all
check-spaces:
if USE_PERL
$(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \
$(top_srcdir)/src/common/*.[ch] \
$(top_srcdir)/src/lib/*/*.[ch] \
$(top_srcdir)/src/or/*.[ch] \
$(top_srcdir)/src/or/*/*.[ch] \
$(top_srcdir)/src/core/*/*.[ch] \
$(top_srcdir)/src/feature/*/*.[ch] \
$(top_srcdir)/src/app/*/*.[ch] \
$(top_srcdir)/src/test/*.[ch] \
$(top_srcdir)/src/test/*/*.[ch] \
$(top_srcdir)/src/tools/*.[ch]
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dnl See LICENSE for licensing information

AC_PREREQ([2.63])
AC_INIT([tor],[0.3.5.0-alpha-dev])
AC_CONFIG_SRCDIR([src/or/main.c])
AC_CONFIG_SRCDIR([src/app/main/tor_main.c])
AC_CONFIG_MACRO_DIR([m4])

# "foreign" means we don't follow GNU package layout standards
Expand Down
1 change: 0 additions & 1 deletion contrib/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ EXTRA_DIST+= \
contrib/operator-tools/linux-tor-prio.sh \
contrib/operator-tools/tor-exit-notice.html \
contrib/or-tools/exitlist \
contrib/win32build/package_nsis-mingw.sh \
contrib/win32build/tor-mingw.nsi.in \
contrib/win32build/tor.ico \
contrib/win32build/tor.nsi.in
Expand Down
95 changes: 0 additions & 95 deletions contrib/win32build/package_nsis-mingw.sh

This file was deleted.

6 changes: 3 additions & 3 deletions doc/HACKING/HelpfulTools.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Jenkins
Valgrind
--------

valgrind --leak-check=yes --error-limit=no --show-reachable=yes src/or/tor
valgrind --leak-check=yes --error-limit=no --show-reachable=yes src/app/tor

(Note that if you get a zillion openssl warnings, you will also need to
pass `--undef-value-errors=no` to valgrind, or rebuild your openssl
Expand Down Expand Up @@ -232,10 +232,10 @@ Beforehand, install google-perftools.
Now you can run Tor with profiling enabled, and use the pprof utility to look at
performance! See the gperftools manual for more info, but basically:

2. Run `env CPUPROFILE=/tmp/profile src/or/tor -f <path/torrc>`. The profile file
2. Run `env CPUPROFILE=/tmp/profile src/app/tor -f <path/torrc>`. The profile file
is not written to until Tor finishes execuction.

3. Run `pprof src/or/tor /tm/profile` to start the REPL.
3. Run `pprof src/app/tor /tm/profile` to start the REPL.

Generating and analyzing a callgraph
------------------------------------
Expand Down
26 changes: 13 additions & 13 deletions doc/HACKING/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Currently, there is only one module:

- Directory Authority subsystem (dirauth)

It is located in its own directory in `src/or/dirauth/`. To disable it, one
need to pass `--disable-module-dirauth` at configure time. All modules are
currently enabled by default.
It is located in its own directory in `src/feature/dirauth/`. To disable it,
one need to pass `--disable-module-dirauth` at configure time. All modules
are currently enabled by default.

## Build System ##

Expand All @@ -32,10 +32,10 @@ The changes to the build system are pretty straightforward.
the C code to conditionally compile things for your module. And the
`BUILD_MODULE_<name>` is also defined for automake files (e.g: include.am).

3. In the `src/or/include.am` file, locate the `MODULE_DIRAUTH_SOURCES` value.
You need to create your own `_SOURCES` variable for your module and then
conditionally add the it to `LIBTOR_A_SOURCES` if you should build the
module.
3. In the `src/core/include.am` file, locate the `MODULE_DIRAUTH_SOURCES`
value. You need to create your own `_SOURCES` variable for your module
and then conditionally add the it to `LIBTOR_A_SOURCES` if you should
build the module.

It is then **very** important to add your SOURCES variable to
`src_or_libtor_testing_a_SOURCES` so the tests can build it.
Expand All @@ -51,7 +51,7 @@ always build everything in order to tests everything.
## Coding ##

As mentioned above, a module must be isolated in its own directory (name of
the module) in `src/or/`.
the module) in `src/feature/`.

There are couples of "rules" you want to follow:

Expand Down Expand Up @@ -87,10 +87,10 @@ There are couples of "rules" you want to follow:
making the code much more difficult to follow/understand.

* It is possible that you end up with code that needs to be used by the rest
of the code base but is still part of your module. As a good example, if you
look at `src/or/shared_random_client.c`: it contains code needed by the hidden
service subsystem but mainly related to the shared random subsystem very
specific to the dirauth module.
of the code base but is still part of your module. As a good example, if
you look at `src/feature/shared_random_client.c`: it contains code needed
by the hidden service subsystem but mainly related to the shared random
subsystem very specific to the dirauth module.

This is fine but try to keep it as lean as possible and never use the same
filename as the one in the module. For example, this is a bad idea and
Expand All @@ -102,7 +102,7 @@ There are couples of "rules" you want to follow:
* When you include headers from the module, **always** use the full module
path in your statement. Example:

`#include "dirauth/dirvote.h"`
`#include "feature/dirauth/dirvote.h"`

The main reason is that we do **not** add the module include path by default
so it needs to be specified. But also, it helps our human brain understand
Expand Down
2 changes: 1 addition & 1 deletion doc/HACKING/Tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ configure option:
## Instrument Tor ##

This is pretty easy. Let's say you want to add a trace event in
`src/or/rendcache.c`, you only have to add this include statement:
`src/feature/rend/rendcache.c`, you only have to add this include statement:

#include "trace/events.h"

Expand Down
2 changes: 1 addition & 1 deletion scripts/maint/checkOptionDocs.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ my %torrcSampleOptions = ();
my %manPageOptions = ();

# Load the canonical list as actually accepted by Tor.
open(F, "@abs_top_builddir@/src/or/tor --list-torrc-options |") or die;
open(F, "@abs_top_builddir@/src/app/tor --list-torrc-options |") or die;
while (<F>) {
next if m!\[notice\] Tor v0\.!;
if (m!^([A-Za-z0-9_]+)!) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/maint/fallback.whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

# To replace this list with the hard-coded fallback list (for testing), use
# a command similar to:
# cat src/or/fallback_dirs.inc | grep \" | grep -v weight | tr -d '\n' | \
# cat src/app/config/fallback_dirs.inc | grep \" | grep -v weight | \
# tr -d '\n' | \
# sed 's/"" / /g' | sed 's/""/"/g' | tr \" '\n' | grep -v '^$' \
# > scripts/maint/fallback.whitelist
#
Expand Down
8 changes: 4 additions & 4 deletions scripts/maint/updateFallbackDirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Usage:
#
# Regenerate the list:
# scripts/maint/updateFallbackDirs.py > src/or/fallback_dirs.inc 2> fallback_dirs.log
# scripts/maint/updateFallbackDirs.py > src/app/config/fallback_dirs.inc 2> fallback_dirs.log
#
# Check the existing list:
# scripts/maint/updateFallbackDirs.py check_existing > fallback_dirs.inc.ok 2> fallback_dirs.log
# mv fallback_dirs.inc.ok src/or/fallback_dirs.inc
# mv fallback_dirs.inc.ok src/app/config/fallback_dirs.inc
#
# This script should be run from a stable, reliable network connection,
# with no other network activity (and not over tor).
Expand Down Expand Up @@ -112,7 +112,7 @@
# expired consensus. This makes them fail the download check.
# We use a tolerance of 0, so that 0.2.x series relays also fail the download
# check if they serve an expired consensus.
CONSENSUS_EXPIRY_TOLERANCE = 0
CONSENSUS_EXPIRY_TOLERANCE = 0

# Output fallback name, flags, bandwidth, and ContactInfo in a C comment?
OUTPUT_COMMENTS = True if OUTPUT_CANDIDATES else False
Expand Down Expand Up @@ -161,7 +161,7 @@

WHITELIST_FILE_NAME = 'scripts/maint/fallback.whitelist'
BLACKLIST_FILE_NAME = 'scripts/maint/fallback.blacklist'
FALLBACK_FILE_NAME = 'src/or/fallback_dirs.inc'
FALLBACK_FILE_NAME = 'src/app/config/fallback_dirs.inc'

# The number of bytes we'll read from a filter file before giving up
MAX_LIST_FILE_SIZE = 1024 * 1024
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/coverage
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

dst=$1

for fn in src/or/*.c src/or/*/*.c src/common/*.c src/lib/*/*.c; do
for fn in src/core/*/*.c src/feature/*/*.c src/app/*/*.c src/lib/*/*.c; do
BN=`basename $fn`
DN=`dirname $fn`
F=`echo $BN | sed -e 's/\.c$//;'`
Expand Down
File renamed without changes.

0 comments on commit 8b0920b

Please sign in to comment.