4

Is there any way I can see what each file does in Tor source code? A simple file with a list for example?I do not want to read and surf through whole code.

  • Your question have my upvote. – Roya Jul 11 '14 at 17:33
2

Gitweb allows you to browse through the code. Especially the src/or directory has relevant source code. Some of the files contain a description what this file does:

 /**
 * \file directory.c
 * \brief Code to send and fetch directories and router
 * descriptors via HTTP. Directories use dirserv.c to generate the
 * results; clients use routers.c to parse them.
 **/

This belongs tosrc/or/directory.c.

1

Yes, this way, for example:

(sorry, do not know how to hide it)


[tor-2ee56e4/contrib/id_to_fp.c]

Helper for directory authority ops. When somebody sends us a private key, this utility converts the private key into a fingerprint so you can de-list that fingerprint


[tor-2ee56e4/src/ext/strlcat.c]

Appends src to string dst of size siz


[tor-2ee56e4/src/ext/strlcpy.c]

Copy src to string dst of size siz


[tor-2ee56e4/src/ext/eventdns.c]

Async DNS Library


[tor-2ee56e4/src/ext/tinytest_demo.c]

Welcome to the example file for tinytest


[tor-2ee56e4/src/ext/tinytest.c]

tinytest.c


[tor-2ee56e4/src/ext/curve25519_donna/curve25519-donna-c64.c]

Curve25519 elliptic curve, public key function


[tor-2ee56e4/src/ext/curve25519_donna/curve25519-donna.c]

Curve25519 elliptic curve, public key function


[tor-2ee56e4/src/ext/OpenBSD_malloc_Linux.c]

malloc.c


[tor-2ee56e4/src/common/crypto_format.c]

Formatting and parsing code for crypto-related data structures


[tor-2ee56e4/src/common/crypto_curve25519.c]

Wrapper code for a curve25519 implementation


[tor-2ee56e4/src/common/log.c]

Functions to send messages to log files or the console


[tor-2ee56e4/src/common/util_codedigest.c]

Return a string describing the digest of the source files in src/common/


[tor-2ee56e4/src/common/procmon.c]

Process-termination monitor functions


[tor-2ee56e4/src/common/container.c]

Implements a smartlist (a resizable array) along with helper functions to use smartlists. Also includes hash table implementations of a string-to-void* map, and of a digest-to-void* map


[tor-2ee56e4/src/common/di_ops.c]

Functions for data-independent operations


[tor-2ee56e4/src/common/compat_libevent.c]

Wrappers to handle porting between different versions of libevent


[tor-2ee56e4/src/common/memarea.c]

Implementation for memarea_t, an allocator for allocating lots of small objects that will be freed all at once


[tor-2ee56e4/src/common/crypto.c]

Wrapper functions to present a consistent interface to public-key and symmetric cryptography operations from OpenSSL


[tor-2ee56e4/src/common/tortls.c]

Wrapper functions to present a consistent interface to TLS, SSL, and X.509 functions from OpenSSL


[tor-2ee56e4/src/common/address.c]

Functions to use and manipulate the tor_addr_t structure


[tor-2ee56e4/src/common/torgzip.c]

A simple in-memory gzip implementation


[tor-2ee56e4/src/common/aes.c]

Implements a counter-mode stream cipher on top of AES


[tor-2ee56e4/src/common/mempool.c]

This is an implementation of memory pools for Tor cells


[tor-2ee56e4/src/common/util.c]

Common functions for strings, IO, network, data structures, process control


[tor-2ee56e4/src/common/compat.c]

Wrappers to make calls more portable


[tor-2ee56e4/src/test/test_config.c]

test_config.c


[tor-2ee56e4/src/test/test_containers.c]

test_containers.c


[tor-2ee56e4/src/test/test_introduce.c]

test_introduce.c


[tor-2ee56e4/src/test/test.c]

Unit tests for many pieces of the lower level Tor modules


[tor-2ee56e4/src/test/test_util.c]

test_util.c


[tor-2ee56e4/src/test/test_dir.c]

test_dir.c


[tor-2ee56e4/src/test/bench.c]

Benchmarks for lower level Tor modules


[tor-2ee56e4/src/test/test_ntor_cl.c]

test_ntor_cl.c


[tor-2ee56e4/src/test/test_microdesc.c]

test_microdesc.c


[tor-2ee56e4/src/test/test_crypto.c]

test_crypto.c


[tor-2ee56e4/src/test/test_addr.c]

test_addr.c


[tor-2ee56e4/src/test/test_cell_formats.c]

test_cell_formats.c


[tor-2ee56e4/src/test/test_replay.c]

test_replay.c


[tor-2ee56e4/src/test/test_data.c]

test_data.c


[tor-2ee56e4/src/test/test-child.c]

Trivial test program which prints out its command line arguments


[tor-2ee56e4/src/test/test_pt.c]

test_pt.c


[tor-2ee56e4/src/or/networkstatus.c]

Functions and structures for handling network status documents as a client or cache


[tor-2ee56e4/src/or/dns.c]

Implements a local cache for DNS results for Tor servers


[tor-2ee56e4/src/or/rendcommon.c]

Rendezvous implementation: shared code between introducers, services, clients, and rendezvous points


[tor-2ee56e4/src/or/config.c]

Code to parse and interpret configuration files


[tor-2ee56e4/src/or/replaycache.c]

Self-scrubbing replay cache for rendservice.c


[tor-2ee56e4/src/or/command.c]

Functions for processing incoming cells


[tor-2ee56e4/src/or/transports.c]

Pluggable Transports related code


[tor-2ee56e4/src/or/connection_or.c]

Functions to handle OR connections, TLS handshaking, and cells on the network


[tor-2ee56e4/src/or/status.c]

Keep status information and log the heartbeat messages


[tor-2ee56e4/src/or/circuitbuild.c]

The actual details of building circuits


[tor-2ee56e4/src/or/circuitlist.c]

Manage the global circuit list


[tor-2ee56e4/src/or/routerset.c]

A routerset specifies constraints on a set of possible routerinfos


[tor-2ee56e4/src/or/confparse.c]

Functions to parse config options


[tor-2ee56e4/src/or/addressmap.c]

A client-side struct to remember requests to rewrite addresses to new addresses


[tor-2ee56e4/src/or/nodelist.c]

A list of all the nodes


[tor-2ee56e4/src/or/circuitmux.c]

Circuit mux/cell selection abstraction


[tor-2ee56e4/src/or/rendmid.c]

Implement introductions points and rendezvous points


[tor-2ee56e4/src/or/config_codedigest.c]

Return a string describing the digest of the source files in src/or/


[tor-2ee56e4/src/or/statefile.c]

statefile.c


[tor-2ee56e4/src/or/routerparse.c]

Code to parse and validate router descriptors and directories


[tor-2ee56e4/src/or/dirserv.c]

Directory server core implementation


[tor-2ee56e4/src/or/connection_edge.c]

Handle edge streams


[tor-2ee56e4/src/or/dnsserv.c]

Implements client-side DNS proxy server code


[tor-2ee56e4/src/or/onion_tap.c]

Functions to implement the original Tor circuit extension handshake


[tor-2ee56e4/src/or/buffers.c]

Implements a generic interface buffer


[tor-2ee56e4/src/or/rendclient.c]

Client code to access location-hidden services


[tor-2ee56e4/src/or/ntmain.c]

ntmain.c


[tor-2ee56e4/src/or/onion_ntor.c]

onion_ntor.c


[tor-2ee56e4/src/or/relay.c]

Handle relay cell encryption/decryption, plus packaging and receiving from circuits, plus queuing on circuits


[tor-2ee56e4/src/or/fp_pair.c]

fp_pair.c


[tor-2ee56e4/src/or/hibernate.c]

Functions to close listeners, stop allowing new circuits, etc


[tor-2ee56e4/src/or/circuituse.c]

Launch the right sort of circuits and attach streams to them


[tor-2ee56e4/src/or/entrynodes.c]

Code to manage our fixed first nodes for various functions


[tor-2ee56e4/src/or/router.c]

OR functionality, including key maintenance, generating and uploading server descriptors, retrying OR connections


[tor-2ee56e4/src/or/connection.c]

General high-level functions to handle reading and writing on connections


[tor-2ee56e4/src/or/reasons.c]

Convert circuit, stream, and orconn error reasons to and/or from strings and errno values


[tor-2ee56e4/src/or/microdesc.c]

microdesc.c


[tor-2ee56e4/src/or/tor_main.c]

Stub module containing a main() function. Allows unit test binary to link against main.c


[tor-2ee56e4/src/or/main.c]

Toplevel module. Handles signals, multiplexes between connections, implements main loop, and drives scheduled events


[tor-2ee56e4/src/or/circuitmux_ewma.c]

EWMA circuit selection as a circuitmux_t policy


[tor-2ee56e4/src/or/policies.c]

Code to parse and use address policies and exit policies


[tor-2ee56e4/src/or/cpuworker.c]

Implements a farm of 'CPU worker' processes to perform CPU-intensive tasks in another thread or process, to not interrupt the main thread


[tor-2ee56e4/src/or/directory.c]

Code to send and fetch directories and router descriptors via HTTP


[tor-2ee56e4/src/or/control.c]

Implementation for Tor's control-socket interface


[tor-2ee56e4/src/or/onion_fast.c]

Functions implement the CREATE_FAST circuit handshake


[tor-2ee56e4/src/or/channeltls.c]

channel_t concrete subclass using or_connection_t


[tor-2ee56e4/src/or/rendservice.c]

The hidden-service side of rendezvous functionality


[tor-2ee56e4/src/or/dirvote.c]

Functions to compute directory consensus, and schedule voting


[tor-2ee56e4/src/or/onion.c]

Functions to queue create cells, wrap the various onionskin types, and parse and create the CREATE cell and its allies


[tor-2ee56e4/src/or/circuitstats.c]

Global list of circuit build times


[tor-2ee56e4/src/or/geoip.c]

Functions related to maintaining an IP-to-country database


[tor-2ee56e4/src/or/channel.c]

OR-to-OR channel abstraction layer


[tor-2ee56e4/src/or/routerlist.c]

Code to maintain and access the global list of routerinfos for known servers


[tor-2ee56e4/src/or/rephist.c]

Basic history and "reputation" functionality to remember which servers have worked in the past, how much bandwidth we've been using, which ports we tend to want, and so on


[tor-2ee56e4/src/tools/tor-gencert.c]

tor-gencert.c


[tor-2ee56e4/src/tools/tor-fw-helper/tor-fw-helper.c]

The main wrapper around our firewall helper logic


[tor-2ee56e4/src/tools/tor-fw-helper/tor-fw-helper-upnp.c]

The implementation of our UPnP firewall helper


[tor-2ee56e4/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c]

The implementation of our NAT-PMP firewall helper


[tor-2ee56e4/src/tools/tor-resolve.c]

tor-resolve.c


[tor-2ee56e4/src/tools/tor-checkkey.c]

tor-checkkey.c


But there might be stuff that you must read from source code files.

  • Interesting, your answer have my upvote. – Roya Jul 11 '14 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.