Commit Graph

12380 Commits

Author SHA1 Message Date
Nick Mathewson
4080d9b0fa Fix a couple more node_t-related nullpointer bugs 2010-10-04 23:51:30 -04:00
Nick Mathewson
9edd85aa4c Switch an && to an ||, stop a *NULL. 2010-10-04 23:33:50 -04:00
Nick Mathewson
b9f2ccbdcc More debugging code for node_t branch 2010-10-01 19:52:05 -04:00
Nick Mathewson
1bb9734e3a Implement policies for nodes (and for microdescriptors too) 2010-10-01 18:14:28 -04:00
Nick Mathewson
42acef68ad Fix a bug in smartlist_choose_node_by_bandwidth 2010-10-01 18:14:28 -04:00
Nick Mathewson
b5341314c1 Implement a few more node-based functions
Some of these functions only work for routerinfo-based nodes, and as
such are only usable for advisory purposes.  Fortunately, our uses
of them are compatible with this limitation.
2010-10-01 18:14:27 -04:00
Nick Mathewson
f9ea242aca Implement node-based router family code
Also, make the NodeFamily option into a list of routersets.  This
lets us git rid of router_in_nickname_list (or whatever it was
called) without porting it to work with nodes, and also lets people
specify country codes and IP ranges in NodeFamily
2010-10-01 18:14:27 -04:00
Nick Mathewson
45f1e4d5ee Rename routerstatus_t.is_running to is_flagged_running
This was the only flag in routerstatus_t that we would previously
change in a routerstatus_t in a consensus. We no longer have reason
to do so -- and probably never did -- as you can now confirm more
easily than you could have done by grepping for is_running before
this patch.

The name change is to emphasize that the routerstatus_t is_running
flag is only there to tell you whether the consensus says it's
running, not whether it *you* think it's running.
2010-10-01 18:14:27 -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
fe309e7ad6 Implement a basic node and nodelist type
The node_t type is meant to serve two key functions:

  1) Abstracting difference between routerinfo_t and microdesc_t
     so that clients can use microdesc_t instead of routerinfo_t.

  2) Being a central place to hold mutable state about nodes
     formerly held in routerstatus_t and routerinfo_t.

This patch implements a nodelist type that holds a node for every
router that we would consider using.
2010-10-01 18:14:26 -04:00
Nick Mathewson
80b515b85f Initialize fd values in tor_port_check_forwarding to -1 2010-10-01 18:14:17 -04:00
Roger Dingledine
165aaf560a Merge branch 'maint-0.2.2' 2010-10-01 14:12:11 -04:00
Roger Dingledine
734ba2f937 fix comment 2010-10-01 14:11:08 -04:00
Roger Dingledine
6cb5383e56 log when we guess our ip address, not just when we fail 2010-10-01 13:32:38 -04:00
Roger Dingledine
a00d48b4c3 Merge branch 'maint-0.2.2'
Conflicts:

	configure.in
	contrib/tor-mingw.nsi.in
	src/win32/orconfig.h
2010-10-01 05:00:02 -04:00
Roger Dingledine
6e00877fa3 bump to 0.2.2.17-alpha-dev 2010-10-01 04:59:11 -04:00
Roger Dingledine
dd68c07dc3 retroactively declare the cbt fixes to be major
also put in release blurbs
2010-10-01 04:53:23 -04:00
Nick Mathewson
92640aa578 The build stuff for tor-fw-helper means we need automake 1.6 or later 2010-10-01 00:01:08 -04:00
Nick Mathewson
1b2120654c Merge remote branch 'sebastian/fw-helper-manpage' 2010-09-30 22:24:18 -04:00
Roger Dingledine
5b7669130b renumber, clean whitespace 2010-09-30 22:04:52 -04:00
Roger Dingledine
6de26d2bc8 give steven's everybody-a-bridge proposal a number 2010-09-30 22:04:52 -04:00
Steven Murdoch
60842424ae Add comments from nickm and arma, from IRC 2010-09-30 22:04:52 -04:00
Steven Murdoch
2ba53aca76 Add algorithm and rationale for performance measurement 2010-09-30 22:04:52 -04:00
Steven Murdoch
df3911ded8 In the migration plan, mention how to prevent overloading the bridge authority 2010-09-30 22:04:52 -04:00
Steven Murdoch
ac55247350 Integrate more feedback from IRC
- For now we are only talking about moving clients to be bridges

- Some questions on how we should inform users
2010-09-30 22:04:52 -04:00
Steven Murdoch
d3d411533c Add some open questions, and mention Roger's idea about asking for consent via email 2010-09-30 22:04:52 -04:00
Steven Murdoch
60d416a564 Note that we only can't handle automatic demotion. Users can always change their state manually. 2010-09-30 22:04:51 -04:00
Steven Murdoch
b112ecbcd9 Change "server" to "relay", so as to match existing terminology 2010-09-30 22:04:51 -04:00
Steven Murdoch
6008fcf863 Start idea xxx-automatic-node-promotion
- Initial draft of overview and motivation
- Start of design
2010-09-30 22:04:51 -04:00
Roger Dingledine
28b55c92d5 Merge branch 'maint-0.2.2' 2010-09-30 22:02:54 -04:00
Erinn Clark
dadd9608d2 improve rpm init script by borrowing from Debian 2010-09-30 21:48:29 -04:00
Erinn Clark
18b1097f28 Update rpm spec file so that it will build without manual intervention on all rpm-based distributions 2010-09-30 21:48:29 -04:00
Erinn Clark
951340f516 AUTHORS doesn't exist, so stop trying to cp it. Add 'sudo' to a mv that needs higher permissions. 2010-09-30 21:48:28 -04:00
Roger Dingledine
fe9402271a Merge branch 'maint-0.2.2'
Conflicts:

	configure.in
	contrib/tor-mingw.nsi.in
	src/win32/orconfig.h
2010-09-30 17:55:01 -04:00
Roger Dingledine
a3f488a887 bump to 0.2.2.17-alpha 2010-09-30 17:49:11 -04:00
Roger Dingledine
d62a2d6ee5 write up a changelog file 2010-09-30 17:32:17 -04:00
Sebastian Hahn
8264166259 Add more tor-fw-helper files to gitignore 2010-09-30 23:13:30 +02:00
Sebastian Hahn
d67bdddec5 Build the tor-fw-helper manpage
So far we just had the asciidoc manpage, but didn't build it.
2010-09-30 23:13:24 +02:00
Nick Mathewson
d2cca82b76 Add 'compile' to .gitignore 2010-09-30 16:41:12 -04:00
Nick Mathewson
495e630a49 Merge branch 'tor-fw-squashed2'
Conflicts:
	src/common/util.c
2010-09-30 16:22:39 -04:00
Nick Mathewson
0e9d969bb2 Fix space and formatting issues 2010-09-30 15:55:42 -04:00
Nick Mathewson
d39e46c26d Merge remote branch 'origin/maint-0.2.2' 2010-09-30 15:30:14 -04:00
Nick Mathewson
2835dcf69f #if-out the fw-helper code in util.c when building on windows 2010-09-30 12:58:48 -04:00
Nick Mathewson
1779fee27a Turn select() usage in tor-fw-helper into a function. 2010-09-30 12:18:21 -04:00
Steven Murdoch
a6dc00fa75 Start tor-fw-helper in the background, and log whatever it outputs 2010-09-30 11:40:37 -04:00
Jacob Appelbaum
3eaa9a376c Changes to tor-fw-helper, some based on Nick's review
* MINIUPNPC rather than the generic UPNP
 * Nick suggested a better abstraction model for tor-fw-helper
 * Fix autoconf to build with either natpmp or miniupnpc
 * Add AM_PROG_CC_C_O to fix automake complaint
 * update spec to address nickm's concern
 * refactor nat-pmp to match upnp state
 * we prefer tor_snprintf to snprintf
 * link properlty for tor_snprintf
 * rename test_commandline_options to log_commandline_options
 * cast this uint as an int
 * detect possible FD_SETSIZE errors
 * make note about future enhancements for natpmp
 * add upnp enhancement note
 * ChangeLog entry
 * doxygen and check-spaces cleanup
 * create tor-fw-helper.1.txt
2010-09-30 11:39:34 -04:00
Jacob Appelbaum
9cc76cf005 First implementation of tor-fw-helper.
tor-fw-helper is a command-line tool to wrap and abstract various
firewall port-forwarding tools.

This commit matches the state of Jacob's tor-fw-helper branch as of
23 September 2010.

  (commit msg by Nick)
2010-09-30 11:37:53 -04:00
Nick Mathewson
3ad43ef75f Whitespace fixes on recent merges to master. 2010-09-30 01:36:36 -04:00