Commit Graph

539 Commits

Author SHA1 Message Date
Nick Mathewson 2be65619f9 Fix wide lines in control.c 2011-01-07 12:16:12 -05:00
Damian Johnson 6661e16e7c GETINFO options for querying traffic usage
This was originally a patch provided by pipe
(http://www.mail-archive.com/or-talk@freehaven.net/msg13085.html) to
provide a method for controllers to query the total amount of traffic
tor has handled (this is a frequently requested piece of information
by relay operators).
2011-01-07 12:15:14 -05:00
Nick Mathewson 1e295666d9 Tweak GETINFO process/* code: no need to print an int as anything other than %d 2011-01-03 12:11:09 -05:00
Damian Johnson 8708ffa655 Implementing getinfo options for the pid, uid, user, and descriptor limit as per proposal 173. 2011-01-03 12:04:56 -05:00
Nick Mathewson 8730884ebe Merge remote branch 'origin/maint-0.2.2' 2011-01-03 11:53:28 -05:00
Nick Mathewson f1de329e78 Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2
Conflicts:
	src/common/test.h
	src/or/test.c
2011-01-03 11:51:17 -05:00
Nick Mathewson 1a07348a50 Bump copyright statements to 2011 2011-01-03 11:50:39 -05:00
Nick Mathewson 520182579a Merge remote branch 'origin/maint-0.2.2' 2010-12-02 13:21:09 -05:00
Nick Mathewson ee8f451bf1 Fix a harmless off-by-one error in counting controller argument lengths
Bugfix on 0.1.1.1-alpha; found by boboper.
2010-12-02 13:19:21 -05:00
Nick Mathewson 9cbe64db45 Add missing cast when formatting uintptr_t
Found by Christian Kujau
2010-11-20 05:18:34 -05:00
Nick Mathewson c77a32932d Fix wide lines in SIGNAL patch 2010-11-19 15:54:53 -05:00
John Brooks 7441999738 Add a SIGNAL event for control connections
Implements ticket #1955
2010-11-19 15:49:54 -05:00
Nick Mathewson 8c837db38f Merge branch 'nodes' 2010-10-13 16:04:25 -04:00
Nick Mathewson a0c1c2ac01 Use connection_mark_and_flush consistently. 2010-10-13 13:08:46 -04:00
Nick Mathewson 26e897420e Initial conversion to use node_t throughout our codebase.
A node_t is an abstraction over routerstatus_t, routerinfo_t, and
microdesc_t.  It should try to present a consistent interface to all
of them.  There should be a node_t for a server whenever there is
  * A routerinfo_t for it in the routerlist
  * A routerstatus_t in the current_consensus.
(note that a microdesc_t alone isn't enough to make a node_t exist,
since microdescriptors aren't usable on their own.)

There are three ways to get a node_t right now: looking it up by ID,
looking it up by nickname, and iterating over the whole list of
microdescriptors.

All (or nearly all) functions that are supposed to return "a router"
-- especially those used in building connections and circuits --
should return a node_t, not a routerinfo_t or a routerstatus_t.

A node_t should hold all the *mutable* flags about a node.  This
patch moves the is_foo flags from routerinfo_t into node_t.  The
flags in routerstatus_t remain, but they get set from the consensus
and should not change.

Some other highlights of this patch are:

  * Looking up routerinfo and routerstatus by nickname is now
    unified and based on the "look up a node by nickname" function.
    This tries to look only at the values from current consensus,
    and not get confused by the routerinfo_t->is_named flag, which
    could get set for other weird reasons.  This changes the
    behavior of how authorities (when acting as clients) deal with
    nodes that have been listed by nickname.

  * I tried not to artificially increase the size of the diff here
    by moving functions around.  As a result, some functions that
    now operate on nodes are now in the wrong file -- they should
    get moved to nodelist.c once this refactoring settles down.
    This moving should happen as part of a patch that moves
    functions AND NOTHING ELSE.

  * Some old code is now left around inside #if 0/1 blocks, and
    should get removed once I've verified that I don't want it
    sitting around to see how we used to do things.

There are still some unimplemented functions: these are flagged
with "UNIMPLEMENTED_NODELIST()."  I'll work on filling in the
implementation here, piece by piece.

I wish this patch could have been smaller, but there did not seem to
be any piece of it that was independent from the rest.  Moving flags
forces many functions that once returned routerinfo_t * to return
node_t *, which forces their friends to change, and so on.
2010-10-01 18:14:27 -04:00
Nick Mathewson 6dd7f85bc7 Try to make most routerstatus_t interfaces const 2010-10-01 18:14:27 -04:00
Nick Mathewson d84d20cbb2 Try to make most routerinfo_t interfaces const 2010-10-01 18:14:27 -04:00
Nick Mathewson ddcb59bb70 Fix more remaining users of inbuf/outbuf to handle bufferevents instead. 2010-09-27 12:31:13 -04:00
Nick Mathewson ec10c044fb Move the "stop writing when the buffer is empty" logic to cnnection_finished_flushing 2010-09-27 12:29:43 -04:00
Nick Mathewson 0514917800 Add a new connection_fetch_from_buf_line() that can handle bufferevents 2010-09-27 12:28:43 -04:00
Nick Mathewson c9cb4f0a0e Rename has_completed_circuit to can_complete_circuit
Also redocument it.  Related to #1362.
2010-09-22 01:52:57 -04:00
Sebastian Hahn 561ca9b987 Fix misplaced labels 2010-08-16 00:46:44 +02:00
Sebastian Hahn 05072723cb Create routerparse.h 2010-07-27 10:00:46 +02:00
Sebastian Hahn cc060ea220 Create reasons.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn 7bd8dee463 Create policies.h 2010-07-27 10:00:45 +02:00
Sebastian Hahn 69fcbbaa89 Create networkstatus.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn 0f1548ab18 Create main.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn a86f464f6b Create hibernate.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn 7d4c027fb0 Create dirserv.h 2010-07-27 07:58:16 +02:00
Sebastian Hahn bec1c838ca Create directory.h 2010-07-27 07:58:15 +02:00
Sebastian Hahn 0bfa34e1f6 Create control.h 2010-07-27 07:58:15 +02:00
Sebastian Hahn 78b6a4650b Create connection_edge.h 2010-07-27 07:58:14 +02:00
Sebastian Hahn 2a74101f7a Create connection.h 2010-07-27 07:58:14 +02:00
Sebastian Hahn c4f8f1316e Create config.h 2010-07-27 07:58:14 +02:00
Sebastian Hahn 01c7b60a80 Create circuituse.h 2010-07-27 07:58:14 +02:00
Sebastian Hahn 174a88dd79 Create circuitlist.h 2010-07-27 07:58:13 +02:00
Sebastian Hahn 21155204c6 Create circuitbuild.h 2010-07-27 07:58:13 +02:00
Sebastian Hahn 34dfce0d82 Create buffers.h 2010-07-27 07:56:26 +02:00
Sebastian Hahn cbee969f40 Create routerlist.h 2010-07-27 07:56:25 +02:00
Sebastian Hahn c53b6cc831 Create router.h 2010-07-27 07:56:25 +02:00
Sebastian Hahn ff4030f621 Create geoip.h 2010-07-27 07:56:25 +02:00
Sebastian Hahn e69dc22f4e Split headers for dnsserv.c functions out of or.h
The next series of commits begins addressing the issue that we're
currently including the complete or.h file in all of our source files.
To change that, we're splitting function definitions into new header
files (one header file per source file).
2010-07-27 07:56:25 +02:00
Nick Mathewson 0b4b51314f Make the controller act more usefully when GETINFO fails
Right now it says "552 internal error" because there's no way for
getinfo_helper_*() countries to specify an error message.  This
patch changes the getinfo_helper_*() interface, and makes most of the
getinfo helpers give useful error messages in response to failures.

This should prevent recurrences of bug 1699, where a missing GeoIPFile
line in the torrc made GETINFO ip-to-county/* fail in a "not obvious
how to fix" way.
2010-07-18 17:05:58 +02:00
Nick Mathewson bea55766af Merge remote branch 'mikeperry/cbt-bugfixes3' 2010-06-29 18:57:50 -04:00
Kat Magic e2b117eb80 Remove the extra space that is sent in certain STREAM messages from the controller. (closes #1583) 2010-06-22 20:49:29 -04:00
Mike Perry 2abe1ceccf Add CLOSE_MS and CLOSE_RATE keywords to buildtimeout event. 2010-06-15 20:04:49 -07:00
Mike Perry 835ab53102 Add a TIMEOUT_RATE keyword to buildtimeout event. 2010-05-10 12:59:05 -07:00
Nick Mathewson 927425150b Merge branch 'asprintf' 2010-04-02 12:30:46 -04:00
Nick Mathewson 47e919424d Tweak users of snprintf to use asprintf where appropriate 2010-02-28 21:46:50 -05:00
Nick Mathewson b006e3279f Merge remote branch 'origin/maint-0.2.1'
Conflicts:
	src/common/test.h
	src/or/test.c
2010-02-27 17:16:31 -05:00