tor/changes
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
..
automake_required The build stuff for tor-fw-helper means we need automake 1.6 or later 2010-10-01 00:01:08 -04:00
autoreconf Use autoreconf, not autoconf&&automake&&etc in autogen.sh 2010-09-27 11:20:12 -04:00
bufferevent-support Add a new option to enable/disable IOCP support 2010-09-28 14:01:45 -04:00
bug1534 log when we guess our ip address, not just when we fail 2010-10-01 13:32:38 -04:00
cpudetect Autodetect the number of CPUs when possible if NumCPUs==0 2010-09-28 14:42:21 -04:00
eventdns_routerinfo_key Remove the has_old_dnsworkers flag. 2010-09-28 23:37:45 -04:00
microdesc_dl Code to download, parse, and store microdesc consensuses 2010-09-27 18:04:43 -04:00
nodelist Initial conversion to use node_t throughout our codebase. 2010-10-01 18:14:27 -04:00
tor-fw-helper Changes to tor-fw-helper, some based on Nick's review 2010-09-30 11:39:34 -04:00