summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-04-18 15:06:44 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-08 20:29:33 -0400
commit267bc7bc3b574f3e60d7836fde5a24652e3ac9c2 (patch)
treede4b64fa9ea873e5694a67bc6c4b74b816a9ffe4 /src/or/or.h
parent77b279c35c5ecf83c045f9c1d613544d958aef81 (diff)
downloadtor-267bc7bc3b574f3e60d7836fde5a24652e3ac9c2.tar.gz
tor-267bc7bc3b574f3e60d7836fde5a24652e3ac9c2.zip
prop224: Build hsdir index for node_t
This hsdir index value is used to give an index value to all node_t (relays) that supports HSDir v3. An index value is then computed using the blinded key to know where to fetch/upload the service descriptor from/to. To avoid computing that index value everytime the client/service needs it, we do that everytime we get a new consensus which then doesn't change until the next one. The downside is that we need to sort them once we need to compute the set of responsible HSDir. Finally, the "hs_index" function is also added but not used. It will be used in later commits to compute which node_t is a responsible HSDir for the service we want to fetch/upload the descriptor. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index f6c42b7a99..a06c816e8b 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -850,6 +850,8 @@ rend_data_v2_t *TO_REND_DATA_V2(const rend_data_t *d)
struct hs_ident_edge_conn_t;
struct hs_ident_dir_conn_t;
struct hs_ident_circuit_t;
+/* Stub because we can't include hs_common.h. */
+struct hsdir_index_t;
/** Time interval for tracking replays of DH public keys received in
* INTRODUCE2 cells. Used only to avoid launching multiple
@@ -2490,6 +2492,10 @@ typedef struct node_t {
time_t last_reachable; /* IPv4. */
time_t last_reachable6; /* IPv6. */
+ /* Hidden service directory index data. This is used by a service or client
+ * in order to know what's the hs directory index for this node at the time
+ * the consensus is set. */
+ struct hsdir_index_t *hsdir_index;
} node_t;
/** Linked list of microdesc hash lines for a single router in a directory