summaryrefslogtreecommitdiff
path: root/src/or/hs_common.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-06-01 13:48:03 +0300
committerDavid Goulet <dgoulet@torproject.org>2017-08-24 13:03:27 -0400
commit912c11761c5b5b0a80e232bdc96788677300ca67 (patch)
treefa1eb7a0ef856a51d3b3148d2d8ec4d74200b20b /src/or/hs_common.h
parent7aef3ec0fde0b320343ecb3aa7080b6e1d9a2e62 (diff)
downloadtor-912c11761c5b5b0a80e232bdc96788677300ca67.tar.gz
tor-912c11761c5b5b0a80e232bdc96788677300ca67.zip
prop224: Move some rendclient.c code to hs_common.c
Specifically move the pick_hsdir() function and all the HSDir request tracking code. We plan to use all that code both for v2 and v3. This commit only moves code. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_common.h')
-rw-r--r--src/or/hs_common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/hs_common.h b/src/or/hs_common.h
index fd2a1f4e32..aa810c0db8 100644
--- a/src/or/hs_common.h
+++ b/src/or/hs_common.h
@@ -187,6 +187,10 @@ const char *rend_data_get_desc_id(const rend_data_t *rend_data,
const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data,
size_t *len_out);
+void rend_client_purge_last_hid_serv_requests(void);
+void purge_hid_serv_from_last_hid_serv_requests(const char *desc_id);
+routerstatus_t *pick_hsdir(const char *desc_id, const char *desc_id_base32);
+
void hs_get_subcredential(const ed25519_public_key_t *identity_pk,
const ed25519_public_key_t *blinded_pk,
uint8_t *subcred_out);
@@ -229,6 +233,13 @@ void hs_dec_rdv_stream_counter(origin_circuit_t *circ);
STATIC void get_disaster_srv(uint64_t time_period_num, uint8_t *srv_out);
+/** The period for which a hidden service directory cannot be queried for
+ * the same descriptor ID again. */
+#define REND_HID_SERV_DIR_REQUERY_PERIOD (15 * 60)
+/** Test networks generate a new consensus every 5 or 10 seconds.
+ * So allow them to requery HSDirs much faster. */
+#define REND_HID_SERV_DIR_REQUERY_PERIOD_TESTING (5)
+
#ifdef TOR_UNIT_TESTS
STATIC uint64_t get_time_period_length(void);