diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-28 00:46:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-28 00:46:01 -0400 |
commit | d6e255edbd11f159c33ff77ceb638c0304dd9873 (patch) | |
tree | 204706d2ea7591ad94a280a503d3296f1546299a /src/or/or.h | |
parent | f006f02ca48c73d3833ae548ca41398ffdacb5c8 (diff) | |
parent | d45b912058a38d5c29a389f547660dd1283d2ae1 (diff) | |
download | tor-d6e255edbd11f159c33ff77ceb638c0304dd9873.tar.gz tor-d6e255edbd11f159c33ff77ceb638c0304dd9873.zip |
Merge branch 'microdesc_dl_v2'
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/or/or.h b/src/or/or.h index 5a9fbf26f8..4741cc341b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -391,7 +391,9 @@ typedef enum { /** A connection to a hidden service directory server: download a v2 rendezvous * descriptor. */ #define DIR_PURPOSE_FETCH_RENDDESC_V2 18 -#define _DIR_PURPOSE_MAX 18 +/** A connection to a directory server: download a microdescriptor. */ +#define DIR_PURPOSE_FETCH_MICRODESC 19 +#define _DIR_PURPOSE_MAX 19 /** True iff <b>p</b> is a purpose corresponding to uploading data to a * directory server. */ @@ -1191,8 +1193,13 @@ typedef struct edge_connection_t { typedef struct dir_connection_t { connection_t _base; - char *requested_resource; /**< Which 'resource' did we ask the directory - * for? */ + /** Which 'resource' did we ask the directory for? This is typically the part + * of the URL string that defines, relative to the directory conn purpose, + * what thing we want. For example, in router descriptor downloads by + * descriptor digest, it contains "d/", then one ore more +-separated + * fingerprints. + **/ + char *requested_resource; unsigned int dirconn_direct:1; /**< Is this dirconn direct, or via Tor? */ /* Used only for server sides of some dir connections, to implement @@ -1569,8 +1576,9 @@ typedef struct routerstatus_t { * has. */ char identity_digest[DIGEST_LEN]; /**< Digest of the router's identity * key. */ - char descriptor_digest[DIGEST_LEN]; /**< Digest of the router's most recent - * descriptor. */ + /** Digest of the router's most recent descriptor or microdescriptor. + * If it's a descriptor, we only use the first DIGEST_LEN bytes. */ + char descriptor_digest[DIGEST256_LEN]; uint32_t addr; /**< IPv4 address for this router. */ uint16_t or_port; /**< OR port for this router. */ uint16_t dir_port; /**< Directory port for this router. */ @@ -1689,6 +1697,10 @@ typedef struct microdesc_t { * up? */ #define MAX_ROUTERDESC_DOWNLOAD_FAILURES 8 +/** How many times will we try to download a microdescriptor before giving + * up? */ +#define MAX_MICRODESC_DOWNLOAD_FAILURES 8 + /** Contents of a v2 (non-consensus, non-vote) network status object. */ typedef struct networkstatus_v2_t { /** When did we receive the network-status document? */ @@ -3516,6 +3528,8 @@ typedef struct trusted_dir_server_t { * fetches to _any_ single directory server.] */ #define PDS_NO_EXISTING_SERVERDESC_FETCH (1<<3) +#define PDS_NO_EXISTING_MICRODESC_FETCH (1<<4) + #define _PDS_PREFER_TUNNELED_DIR_CONNS (1<<16) /** Possible ways to weight routers when choosing one randomly. See |