aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.h
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2014-04-14
|\
| * Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson2014-04-14
| |\ | | | | | | | | | | | | Conflicts: src/or/routerlist.h
| | * Code to blacklist authority signing keysNick Mathewson2014-04-14
| | | | | | | | | | | | (I need a list of actual signing keys to blacklist.)
* | | Rip out all of the v2 directory code.Nick Mathewson2014-01-29
| | | | | | | | | | | | | | | | | | The remaining vestige is that we continue to publish the V2dir flag, and that, for the controller, we continue to emit v2 directory formats when requested.
* | | Completely refactor how FILENAME_PRIVATE worksNick Mathewson2013-07-10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
* | Merge bug5595-v2-squashed into maint-0.2.4Andrea Shepard2013-05-10
|\ \
| * | When downloading certificates, distinguish requesting by identity digest ↵Andrea Shepard2013-05-09
| |/ | | | | | | from requesting by ID digest, signing key pair; fixes bug 5595
* | Remove some totally unused functionsNick Mathewson2013-02-23
| |
* | Add a function to compute fraction of nodes (by weighted bw) with descriptorsNick Mathewson2013-01-30
| |
* | Update the copyright date to 201.Nick Mathewson2013-01-16
| |
* | New FallbackDir option to add extra directories for bootstrapingNick Mathewson2012-12-06
| | | | | | | | | | | | This replaces the old FallbackConsensus notion, and should provide a way -- assuming we pick reasonable nodes! -- to give clients suggestions of placs to go to get their first consensus.
* | Refactor add_trusted_dir_serverNick Mathewson2012-12-06
| | | | | | | | | | | | Now creating a dir_server_t and adding it are separate functions, and there are frontend functions for adding a trusted dirserver and a fallback dirserver.
* | Rename trusted_dir_server_t to dir_server_t. Automatic renaming.Nick Mathewson2012-12-06
| |
* | Start refactoring trusted_dir_servers into trusted and fallback listsNick Mathewson2012-12-06
| | | | | | | | | | | | | | | | | | We use trusted_dir_server_t for two pieces of functionality: a list of all directory authorities, and a list of initial places to look for a directory. With this patch we start to separate those two roles. There is as of now no actual way to be a fallback directory without being an authority.
* | Make output of router_get_trusted_dir_servers constNick Mathewson2012-12-06
| |
* | Convert all include-guard macros to avoid reserved identifiers.Nick Mathewson2012-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C, we technically aren't supposed to define our own things that start with an underscore. This is a purely machine-generated commit. First, I ran this script on all the headers in src/{common,or,test,tools/*}/*.h : ============================== use strict; my %macros = (); my %skipped = (); FILE: for my $fn (@ARGV) { my $f = $fn; if ($fn !~ /^\.\//) { $f = "./$fn"; } $skipped{$fn} = 0; open(F, $fn); while (<F>) { if (/^#ifndef ([A-Za-z0-9_]+)/) { $macros{$fn} = $1; next FILE; } } } print "#!/usr/bin/perl -w -i -p\n\n"; for my $fn (@ARGV) { if (! exists $macros{$fn}) { print "# No macro known for $fn!\n" if (!$skipped{$fn}); next; } if ($macros{$fn} !~ /_H_?$/) { print "# Weird macro for $fn...\n"; } my $goodmacro = uc $fn; $goodmacro =~ s#.*/##; $goodmacro =~ s#[\/\-\.]#_#g; print "s/(?<![A-Za-z0-9_])$macros{$fn}(?![A-Za-z0-9_])/TOR_${goodmacro}/g;\n" } ============================== It produced the following output, which I then re-ran on those same files: ============================== s/(?<![A-Za-z0-9_])_TOR_ADDRESS_H(?![A-Za-z0-9_])/TOR_ADDRESS_H/g; s/(?<![A-Za-z0-9_])_TOR_AES_H(?![A-Za-z0-9_])/TOR_AES_H/g; s/(?<![A-Za-z0-9_])_TOR_COMPAT_H(?![A-Za-z0-9_])/TOR_COMPAT_H/g; s/(?<![A-Za-z0-9_])_TOR_COMPAT_LIBEVENT_H(?![A-Za-z0-9_])/TOR_COMPAT_LIBEVENT_H/g; s/(?<![A-Za-z0-9_])_TOR_CONTAINER_H(?![A-Za-z0-9_])/TOR_CONTAINER_H/g; s/(?<![A-Za-z0-9_])_TOR_CRYPTO_H(?![A-Za-z0-9_])/TOR_CRYPTO_H/g; s/(?<![A-Za-z0-9_])TOR_DI_OPS_H(?![A-Za-z0-9_])/TOR_DI_OPS_H/g; s/(?<![A-Za-z0-9_])_TOR_MEMAREA_H(?![A-Za-z0-9_])/TOR_MEMAREA_H/g; s/(?<![A-Za-z0-9_])_TOR_MEMPOOL_H(?![A-Za-z0-9_])/TOR_MEMPOOL_H/g; s/(?<![A-Za-z0-9_])TOR_PROCMON_H(?![A-Za-z0-9_])/TOR_PROCMON_H/g; s/(?<![A-Za-z0-9_])_TOR_TORGZIP_H(?![A-Za-z0-9_])/TOR_TORGZIP_H/g; s/(?<![A-Za-z0-9_])_TOR_TORINT_H(?![A-Za-z0-9_])/TOR_TORINT_H/g; s/(?<![A-Za-z0-9_])_TOR_LOG_H(?![A-Za-z0-9_])/TOR_TORLOG_H/g; s/(?<![A-Za-z0-9_])_TOR_TORTLS_H(?![A-Za-z0-9_])/TOR_TORTLS_H/g; s/(?<![A-Za-z0-9_])_TOR_UTIL_H(?![A-Za-z0-9_])/TOR_UTIL_H/g; s/(?<![A-Za-z0-9_])_TOR_BUFFERS_H(?![A-Za-z0-9_])/TOR_BUFFERS_H/g; s/(?<![A-Za-z0-9_])_TOR_CHANNEL_H(?![A-Za-z0-9_])/TOR_CHANNEL_H/g; s/(?<![A-Za-z0-9_])_TOR_CHANNEL_TLS_H(?![A-Za-z0-9_])/TOR_CHANNELTLS_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITBUILD_H(?![A-Za-z0-9_])/TOR_CIRCUITBUILD_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITLIST_H(?![A-Za-z0-9_])/TOR_CIRCUITLIST_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_EWMA_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_EWMA_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_H/g; s/(?<![A-Za-z0-9_])_TOR_CIRCUITUSE_H(?![A-Za-z0-9_])/TOR_CIRCUITUSE_H/g; s/(?<![A-Za-z0-9_])_TOR_COMMAND_H(?![A-Za-z0-9_])/TOR_COMMAND_H/g; s/(?<![A-Za-z0-9_])_TOR_CONFIG_H(?![A-Za-z0-9_])/TOR_CONFIG_H/g; s/(?<![A-Za-z0-9_])TOR_CONFPARSE_H(?![A-Za-z0-9_])/TOR_CONFPARSE_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_EDGE_H(?![A-Za-z0-9_])/TOR_CONNECTION_EDGE_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_H(?![A-Za-z0-9_])/TOR_CONNECTION_H/g; s/(?<![A-Za-z0-9_])_TOR_CONNECTION_OR_H(?![A-Za-z0-9_])/TOR_CONNECTION_OR_H/g; s/(?<![A-Za-z0-9_])_TOR_CONTROL_H(?![A-Za-z0-9_])/TOR_CONTROL_H/g; s/(?<![A-Za-z0-9_])_TOR_CPUWORKER_H(?![A-Za-z0-9_])/TOR_CPUWORKER_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRECTORY_H(?![A-Za-z0-9_])/TOR_DIRECTORY_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRSERV_H(?![A-Za-z0-9_])/TOR_DIRSERV_H/g; s/(?<![A-Za-z0-9_])_TOR_DIRVOTE_H(?![A-Za-z0-9_])/TOR_DIRVOTE_H/g; s/(?<![A-Za-z0-9_])_TOR_DNS_H(?![A-Za-z0-9_])/TOR_DNS_H/g; s/(?<![A-Za-z0-9_])_TOR_DNSSERV_H(?![A-Za-z0-9_])/TOR_DNSSERV_H/g; s/(?<![A-Za-z0-9_])TOR_EVENTDNS_TOR_H(?![A-Za-z0-9_])/TOR_EVENTDNS_TOR_H/g; s/(?<![A-Za-z0-9_])_TOR_GEOIP_H(?![A-Za-z0-9_])/TOR_GEOIP_H/g; s/(?<![A-Za-z0-9_])_TOR_HIBERNATE_H(?![A-Za-z0-9_])/TOR_HIBERNATE_H/g; s/(?<![A-Za-z0-9_])_TOR_MAIN_H(?![A-Za-z0-9_])/TOR_MAIN_H/g; s/(?<![A-Za-z0-9_])_TOR_MICRODESC_H(?![A-Za-z0-9_])/TOR_MICRODESC_H/g; s/(?<![A-Za-z0-9_])_TOR_NETWORKSTATUS_H(?![A-Za-z0-9_])/TOR_NETWORKSTATUS_H/g; s/(?<![A-Za-z0-9_])_TOR_NODELIST_H(?![A-Za-z0-9_])/TOR_NODELIST_H/g; s/(?<![A-Za-z0-9_])_TOR_NTMAIN_H(?![A-Za-z0-9_])/TOR_NTMAIN_H/g; s/(?<![A-Za-z0-9_])_TOR_ONION_H(?![A-Za-z0-9_])/TOR_ONION_H/g; s/(?<![A-Za-z0-9_])_TOR_OR_H(?![A-Za-z0-9_])/TOR_OR_H/g; s/(?<![A-Za-z0-9_])_TOR_POLICIES_H(?![A-Za-z0-9_])/TOR_POLICIES_H/g; s/(?<![A-Za-z0-9_])_TOR_REASONS_H(?![A-Za-z0-9_])/TOR_REASONS_H/g; s/(?<![A-Za-z0-9_])_TOR_RELAY_H(?![A-Za-z0-9_])/TOR_RELAY_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDCLIENT_H(?![A-Za-z0-9_])/TOR_RENDCLIENT_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDCOMMON_H(?![A-Za-z0-9_])/TOR_RENDCOMMON_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDMID_H(?![A-Za-z0-9_])/TOR_RENDMID_H/g; s/(?<![A-Za-z0-9_])_TOR_RENDSERVICE_H(?![A-Za-z0-9_])/TOR_RENDSERVICE_H/g; s/(?<![A-Za-z0-9_])_TOR_REPHIST_H(?![A-Za-z0-9_])/TOR_REPHIST_H/g; s/(?<![A-Za-z0-9_])_TOR_REPLAYCACHE_H(?![A-Za-z0-9_])/TOR_REPLAYCACHE_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTER_H(?![A-Za-z0-9_])/TOR_ROUTER_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTERLIST_H(?![A-Za-z0-9_])/TOR_ROUTERLIST_H/g; s/(?<![A-Za-z0-9_])_TOR_ROUTERPARSE_H(?![A-Za-z0-9_])/TOR_ROUTERPARSE_H/g; s/(?<![A-Za-z0-9_])TOR_ROUTERSET_H(?![A-Za-z0-9_])/TOR_ROUTERSET_H/g; s/(?<![A-Za-z0-9_])TOR_STATEFILE_H(?![A-Za-z0-9_])/TOR_STATEFILE_H/g; s/(?<![A-Za-z0-9_])_TOR_STATUS_H(?![A-Za-z0-9_])/TOR_STATUS_H/g; s/(?<![A-Za-z0-9_])TOR_TRANSPORTS_H(?![A-Za-z0-9_])/TOR_TRANSPORTS_H/g; s/(?<![A-Za-z0-9_])_TOR_TEST_H(?![A-Za-z0-9_])/TOR_TEST_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_NATPMP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_NATPMP_H/g; s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_UPNP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_UPNP_H/g; ==============================
* | Move functions for seeing if we know enough nodes into nodelistNick Mathewson2012-09-14
| |
* | Remove router_get_by_{nickname,hexdigest} entirelyNick Mathewson2012-09-14
| |
* | Move many of the node_ functions from routerlist to nodelistNick Mathewson2012-09-14
| |
* | Split the routerset code out of routerlist.cNick Mathewson2012-09-14
| |
* | Merge remote-tracking branch 'public/bug6538'Nick Mathewson2012-09-11
|\ \ | | | | | | | | | | | | Conflicts: configure.ac
| * | In choose-by-bw, scale to better use the range of uint64Nick Mathewson2012-08-27
| | | | | | | | | | | | | | | The smart part of this is based on an approach and a suggestion by rransom. The unsmart part is my own fault.
| * | Refactor the core of choosing by weights into a functionNick Mathewson2012-08-09
| |/ | | | | | | | | This eliminates duplicated code, and lets us test a hairy piece of functionality.
* / Rename routers_have_same_or_addr() to reflect the fact that it now checks ↵Linus Nordberg2012-07-19
|/ | | | both OR ports.
* Resolve about 24 DOCDOCsNick Mathewson2012-06-05
|
* Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson2012-06-04
|
* Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson2012-06-04
| | | | | | | | 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.
* Remove compare_addr_to_node_policyNick Mathewson2011-07-15
| | | | | | | | Instead, use compare_tor_addr_to_node_policy everywhere. One advantage of this is that compare_tor_addr_to_node_policy can better distinguish 0.0.0.0 from "unknown", which caused a nasty bug with microdesc users.
* Rename and tweak nodelist_add_node_family() to add nodeNick Mathewson2011-07-11
| | | | | | | | | | | | | It's very easy for nodelist_add_node_family(sl,node) to accidentally add 'node', and kind of hard to make sure that it omits it. Instead of taking pains to leave 'node' out, let's instead make sure that we always include it. I also rename the function to nodelist_add_node_and_family, and audit its users so that they don't add the node itself any longer, since the function will take care of that for them. Resolves bug 2616, which was not actually a bug.
* Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | The conflicts were mainly caused by the routerinfo->node transition. Conflicts: src/or/circuitbuild.c src/or/command.c src/or/connection_edge.c src/or/directory.c src/or/dirserv.c src/or/relay.c src/or/rendservice.c src/or/routerlist.c
* | Move dummy authority.z fetch out of update_router_descriptor_downloadsNick Mathewson2011-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make sure that a server learns if its IP has changed, the server sometimes launches authority.z descriptor fetches from update_router_descriptor_downloads. That's nice, but we're moving towards a situation where update_router_descriptor_downloads doesn't always get called. So this patch breaks the authority.z check-and-fetch into a new function. This function also renames last_routerdesc_download to a more appropriate last_descriptor_download, and adds a new update_all_descriptor_downloads() function. (For now, this is unnecessary, since servers don't actually use microdescriptors. But that could change, or bridges could start using microdescriptors, and then we'll be glad this is refactored nicely.)
* | Code to make clients fetch and use microdescriptors for circuit buildingNick Mathewson2011-05-05
| | | | | | | | | | | | | | | | | | To turn this on, set UseMicrodescriptors to "1" (or "auto" if you want it on-if-you're-a-client). It should go auto-by-default once 0.2.3.1-alpha is released. Because of our node logic, directory caches will never use microdescriptors when they have the right routerinfo available.
* | Replace _AUTHORITY enum values with _DIRINFO values (automted)Nick Mathewson2011-05-05
| |
* | Automated rename from authority_type_t to dirinfo_type_tNick Mathewson2011-05-05
| | | | | | | | | | We were already overloading this type to mean "a directory that can serve us X" in addition to "a directory that is an authority for X."
* | Merge maint-0.2.2 for the bug1090-part1-squashed branchNick Mathewson2011-04-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved conflicts in: doc/tor.1.txt src/or/circuitbuild.c src/or/circuituse.c src/or/connection_edge.c src/or/connection_edge.h src/or/directory.c src/or/rendclient.c src/or/routerlist.c src/or/routerlist.h These were mostly releated to the routerinfo_t->node_t conversion.
| * When there is a transition in permitted nodes, apply it to trackexithosts mapNick Mathewson2011-04-26
| | | | | | | | | | | | | | | | | | IOW, if we were using TrackExitHosts, and we added an excluded node or removed a node from exitnodes, we wouldn't actually remove the mapping that points us at the new node. Also, note with an XXX022 comment a place that I think we are looking at the wrong string.
| * If ExitNodes and Exclude{Exit}Nodes overlap, obey Exclude{Exit}Nodes.Roger Dingledine2011-04-26
| | | | | | | | Also, ExitNodes are always strict.
| * If EntryNodes and ExcludeNodes overlap, obey ExcludeNodes.Roger Dingledine2011-04-26
| |
* | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\|
| * Bump copyright statements to 2011 (0.2.2)Nick Mathewson2011-01-03
| |
* | Rename router_get_by_digest()Sebastian Hahn2010-10-14
| | | | | | | | | | We now call the function router_get_by_id_digest() to make clear that we're talking about the identity digest here, not descriptor digest.
* | Initial conversion to use node_t throughout our codebase.Nick Mathewson2010-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Try to make most routerstatus_t interfaces constNick Mathewson2010-10-01
| |
* | Try to make most routerinfo_t interfaces constNick Mathewson2010-10-01
| |
* | Download microdescriptors if you're a cacheNick Mathewson2010-09-27
|/ | | | | This commit adds some functions to see what microdescriptors we're missing, and adds fetch-microdesc/store-microdesc logic to the directory code.
* Merge branch 'bug1899'Nick Mathewson2010-09-14
|\
| * Extract the "do these routers have the same addr:orport" logic into a fnNick Mathewson2010-09-14
| |
* | Merge branch 'bug911'Nick Mathewson2010-09-14
|\|
| * Move code for launching tests out of router_add_to_routerlist()Nick Mathewson2010-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | router_add_to_routerlist() is supposed to be a nice minimal function that only touches the routerlist structures, but it included a call to dirserv_single_reachability_test(). We have a function that gets called _after_ adding descriptors successfully: routerlist_descriptors_added. This patch moves the responsibility for testing there. Because the decision of whether to test or not depends on whether there was an old routerinfo for this router or not, we have to first detect whether we _will_ want to run the tests if the router is added. We make this the job of routers_update_status_from_consensus_networkstatus(). Finally, this patch makes the code notice if a router is going from hibernating to non-hibernating, and if so causes a reachability test to get launched.
* | Complicate the rules on WARN vs INFO in consensus verificationNick Mathewson2010-09-02
|/ | | | | | | | | It's normal when bootstrapping to have a lot of different certs missing, so we don't want missing certs to make us warn... unless the certs we're missing are ones that we've tried to fetch a couple of times and failed at. May fix bug 1145.