aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.h
AgeCommit message (Collapse)Author
2012-06-04Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson
Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
2012-05-18Use a more helpful log message when we can't find a proxy.George Kadianakis
2012-01-25Allow 0.2.3.x clients to use 0.2.2.x bridges.Roger Dingledine
Previously the client would ask the bridge for microdescriptors, which are only supported in 0.2.3.x and later, and then fail to bootstrap when it didn't get the answers it wanted. Fixes bug 4013; bugfix on 0.2.3.2-alpha. The fix here is to revert to using normal descriptors if any of our bridges are known to not support microdescs. This is not ideal, a) because we'll start downloading a microdesc consensus as soon as we get a bridge descriptor, and that will waste time if we later get a bridge descriptor that tells us we don't like microdescriptors; and b) by changing our mind we're leaking to our other bridges that we have an old-version bridge. The alternate fix would have been to change we_use_microdescriptors_for_circuits() to ask if *any* of our bridges can support microdescriptors, and then change the directory logic that picks a bridge to only select from those that do. For people living in the future, where 0.2.2.x is obsolete, there won't be a difference. Note that in either of these potential fixes, we have risk of oscillation if our one funny-looking bridges goes away / comes back.
2012-01-18Rename nonconformant identifiers.Nick Mathewson
Fixes bug 4893. These changes are pure mechanical, and were generated with this perl script: /usr/bin/perl -w -i.bak -p s/crypto_pk_env_t/crypto_pk_t/g; s/crypto_dh_env_t/crypto_dh_t/g; s/crypto_cipher_env_t/crypto_cipher_t/g; s/crypto_digest_env_t/crypto_digest_t/g; s/aes_free_cipher/aes_cipher_free/g; s/crypto_free_cipher_env/crypto_cipher_free/g; s/crypto_free_digest_env/crypto_digest_free/g; s/crypto_free_pk_env/crypto_pk_free/g; s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g; s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g; s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g; s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g; s/crypto_new_cipher_env/crypto_cipher_new/g; s/crypto_new_digest_env/crypto_digest_new/g; s/crypto_new_digest256_env/crypto_digest256_new/g; s/crypto_new_pk_env/crypto_pk_new/g; s/crypto_create_crypto_env/crypto_cipher_new/g; s/connection_create_listener/connection_listener_new/g; s/smartlist_create/smartlist_new/g; s/transport_create/transport_new/g;
2011-11-30First chunk of support for bridges on IPv6Linus Nordberg
Comments below focus on changes, see diff for added code. New type tor_addr_port_t holding an IP address and a TCP/UDP port. New flag in routerinfo_t, ipv6_preferred. This should go in the node_t instead but not now. Replace node_get_addr() with - node_get_prim_addr() for primary address, i.e. IPv4 for now - node_get_pref_addr() for preferred address, IPv4 or IPv6. Rename node_get_addr_ipv4h() node_get_prim_addr_ipv4h() for consistency. The primary address will not allways be an IPv4 address. Same for node_get_orport() -> node_get_prim_orport(). Rewrite node_is_a_configured_bridge() to take all OR ports into account. Extend argument list to extend_info_from_node and extend_info_from_router with a flag indicating if we want to use the routers primary address or the preferred address. Use the preferred address in as few situtations as possible for allowing clients to connect to bridges over IPv6.
2011-10-07Merge remote-tracking branch 'asn2/bug3656'Nick Mathewson
Conflicts: src/common/util.c src/common/util.h src/or/config.h src/or/main.c src/test/test_util.c
2011-09-11Don't warn of stray Bridges if managed proxies are still unconfigured.George Kadianakis
With managed proxies you would always get the error message: "You have a Bridge line using the X pluggable transport, but there doesn't seem to be a corresponding ClientTransportPlugin line." because the check happened directly after parse_client_transport_line() when managed proxies were not fully configured and their transports were not registered. The fix is to move the validation to run_scheduled_events() and make sure that all managed proxies are configured first.
2011-09-11Prepare circuitbuild.[ch] and config.[ch] for SIGHUPs.George Kadianakis
* Create mark/sweep functions for transports. * Create a transport_resolve_conflicts() function that tries to resolve conflicts when registering transports.
2011-07-13Put some last missing pieces together.George Kadianakis
* Add some utility transport functions in circuitbuild.[ch] so that we can use them from pt.c. * Make the accounting system consider traffic coming from proxies. * Make sure that we only fetch bridge descriptors when all the transports are configured.
2011-07-11Merge remote-tracking branch 'public/bug2841'Nick Mathewson
Conflicts: src/or/config.c
2011-07-02Style and grammar tweaks on 2841 branchNick Mathewson
2011-07-02Small tweaks to 2841 codeNick Mathewson
- const-ify some transport_t pointers - Remove a vestigial argument to parse_bridge_line - Make it compile without warnings on my laptop with --enable-gcc-warnings
2011-06-22Revised how we handle ClientTransportPlugin and Bridge lines.George Kadianakis
Multiple Bridge lines can point to the same one ClientTransportPlugin line, and we can have multiple ClientTransportPlugin lines in our configuration file that don't match with a bridge. We also issue a warning when we have a Bridge line with a pluggable transport but we can't match it to a ClientTransportPlugin line.
2011-06-21Fixes on circuitbuild.[ch] based on nick's comments.George Kadianakis
* Renamed transport_info_t to transport_t. * Introduced transport_get_by_name(). * Killed match_bridges_with_transports(). We currently *don't* detect whether any bridges miss their transports, of if any transports miss their bridges. * Various code and aesthetic tweaks and English language changes.
2011-06-14Make the get_options() return constNick Mathewson
This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
2011-06-14Fixes small bugs.George Kadianakis
2011-06-12Various trivial changes.George Kadianakis
* Improved function documentation. * Renamed find_bridge_transport_by_addrport() to find_transport_by_bridge_addrport(). * Sanitized log severities we use. * Ran check-spaces.
2011-06-12We can now connect using transports as well!George Kadianakis
2011-06-11We can now match our transports with our bridges.George Kadianakis
2011-06-02Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
This merge was a bit nontrivial, since I had to write a new node_is_a_configured_bridge to parallel router_is_a_configured_bridge. Conflicts: src/or/circuitbuild.c
2011-05-15Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/or/circuitbuild.h
2011-05-15Preserve bridge download status across SETCONF, HUPNick Mathewson
This code changes it so that we don't remove bridges immediately when we start re-parsing our configuration. Instead, we mark them all, and remove all the marked ones after re-parsing our bridge lines. As we add a bridge, we see if it's already in the list. If so, we just unmark it. This new behavior will lose the property we used to have that bridges were in bridge_list in the same order in which they appeared in the torrc. I took a quick look through the code, and I'm pretty sure we didn't actually depend on that anywhere. This is for bug 3019; it's a fix on 0.2.0.3-alpha.
2011-01-15Merge branch 'maint-0.2.2'Roger Dingledine
2011-01-15Sanity-check consensus param valuesSebastian Hahn
We need to make sure that the worst thing that a weird consensus param can do to us is to break our Tor (and only if the other Tors are reliably broken in the same way) so that the majority of directory authorities can't pull any attacks that are worse than the DoS that they can trigger by simply shutting down. One of these worse things was the cbtnummodes parameter, which could lead to heap corruption on some systems if the value was sufficiently large. This commit fixes this particular issue and also introduces sanity checking for all consensus parameters.
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Bump copyright statements to 2011 (0.2.2)Nick Mathewson
2010-12-19Merge branch 'maint-0.2.2'Roger Dingledine
2010-12-15Merge remote branch fix_security_bug_021 into fix_security_bug_022Nick Mathewson
Conflicts: src/common/memarea.c src/or/or.h src/or/rendclient.c
2010-10-01Initial conversion to use node_t throughout our codebase.Nick Mathewson
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-01Try to make most routerinfo_t interfaces constNick Mathewson
2010-09-29Merge branch 'bug1772' into maint-0.2.2Roger Dingledine
2010-09-29refactor and recomment; no actual changesRoger Dingledine
2010-09-29Merge commit 'mikeperry/bug1740' into maint-0.2.2Roger Dingledine
2010-09-29Only count timeout data for 3 hop circuits.Mike Perry
Use 4/3 of this timeout value for 4 hop circuits, and use half of it for canabalized circuits.
2010-09-28optimistically retry EntryNodes on socks requestRoger Dingledine
We used to mark all our known bridges up when they're all down and we get a new socks request. Now do that when we've set EntryNodes too.
2010-09-28refactor; no actual changesRoger Dingledine
2010-08-17Remove unused function declarationsSebastian Hahn
Also remove some #if 0'd code from the unit tests for buffers. The code was killed in e6794e58081af773073c266e23fe3ab2ebecdb7e (5 years ago), and is now broken anyways.
2010-08-16Refactor circuit_build_times_parse_stateSebastian Hahn
Remove the msg parameter to pass an error message out. This wasn't needed and made it harder to detect a memory leak.
2010-07-28Fix typos, make all \brief's conformant, end sentences with a period.Linus Nordberg
2010-07-27Create circuitbuild.hSebastian Hahn