minor updates on upcoming changelog
[tor.git] / src / or / hs_client.h
blob2523568ad1c009cef1d96f3369f676aaab647d05
1 /* Copyright (c) 2017, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 /**
5 * \file hs_client.h
6 * \brief Header file containing client data for the HS subsytem.
7 **/
9 #ifndef TOR_HS_CLIENT_H
10 #define TOR_HS_CLIENT_H
12 #include "crypto_ed25519.h"
13 #include "hs_descriptor.h"
14 #include "hs_ident.h"
16 /* Status code of a descriptor fetch request. */
17 typedef enum {
18 /* Something internally went wrong. */
19 HS_CLIENT_FETCH_ERROR = -1,
20 /* The fetch request has been launched successfully. */
21 HS_CLIENT_FETCH_LAUNCHED = 0,
22 /* We already have a usable descriptor. No fetch. */
23 HS_CLIENT_FETCH_HAVE_DESC = 1,
24 /* No more HSDir available to query. */
25 HS_CLIENT_FETCH_NO_HSDIRS = 2,
26 /* The fetch request is not allowed. */
27 HS_CLIENT_FETCH_NOT_ALLOWED = 3,
28 /* We are missing information to be able to launch a request. */
29 HS_CLIENT_FETCH_MISSING_INFO = 4,
30 /* There is a pending fetch for the requested service. */
31 HS_CLIENT_FETCH_PENDING = 5,
32 } hs_client_fetch_status_t;
34 void hs_client_note_connection_attempt_succeeded(
35 const edge_connection_t *conn);
37 int hs_client_decode_descriptor(
38 const char *desc_str,
39 const ed25519_public_key_t *service_identity_pk,
40 hs_descriptor_t **desc);
41 int hs_client_any_intro_points_usable(const ed25519_public_key_t *service_pk,
42 const hs_descriptor_t *desc);
43 int hs_client_refetch_hsdesc(const ed25519_public_key_t *identity_pk);
44 void hs_client_dir_info_changed(void);
46 int hs_client_send_introduce1(origin_circuit_t *intro_circ,
47 origin_circuit_t *rend_circ);
49 void hs_client_circuit_has_opened(origin_circuit_t *circ);
51 int hs_client_receive_rendezvous_acked(origin_circuit_t *circ,
52 const uint8_t *payload,
53 size_t payload_len);
54 int hs_client_receive_introduce_ack(origin_circuit_t *circ,
55 const uint8_t *payload,
56 size_t payload_len);
57 int hs_client_receive_rendezvous2(origin_circuit_t *circ,
58 const uint8_t *payload,
59 size_t payload_len);
61 void hs_client_desc_has_arrived(const hs_ident_dir_conn_t *ident);
63 extend_info_t *hs_client_get_random_intro_from_edge(
64 const edge_connection_t *edge_conn);
66 int hs_client_reextend_intro_circuit(origin_circuit_t *circ);
68 void hs_client_purge_state(void);
70 void hs_client_free_all(void);
72 #ifdef HS_CLIENT_PRIVATE
74 STATIC routerstatus_t *
75 pick_hsdir_v3(const ed25519_public_key_t *onion_identity_pk);
77 STATIC extend_info_t *
78 client_get_random_intro(const ed25519_public_key_t *service_pk);
80 STATIC extend_info_t *
81 desc_intro_point_to_extend_info(const hs_desc_intro_point_t *ip);
83 STATIC int handle_rendezvous2(origin_circuit_t *circ, const uint8_t *payload,
84 size_t payload_len);
86 MOCK_DECL(STATIC hs_client_fetch_status_t,
87 fetch_v3_desc, (const ed25519_public_key_t *onion_identity_pk));
89 #endif /* defined(HS_CLIENT_PRIVATE) */
91 #endif /* !defined(TOR_HS_CLIENT_H) */