Cache control file
[tor/appveyor.git] / src / or / hs_circuit.h
blob2f5beaa1681187f8ce3370f43749c5925d7ca209
1 /* Copyright (c) 2017, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 /**
5 * \file hs_circuit.h
6 * \brief Header file containing circuit data for the whole HS subsytem.
7 **/
9 #ifndef TOR_HS_CIRCUIT_H
10 #define TOR_HS_CIRCUIT_H
12 #include "or.h"
13 #include "crypto.h"
14 #include "crypto_ed25519.h"
16 #include "hs_service.h"
18 /* Cleanup function when the circuit is closed or/and freed. */
19 void hs_circ_cleanup(circuit_t *circ);
21 /* Circuit API. */
22 int hs_circ_service_intro_has_opened(hs_service_t *service,
23 hs_service_intro_point_t *ip,
24 const hs_service_descriptor_t *desc,
25 origin_circuit_t *circ);
26 void hs_circ_service_rp_has_opened(const hs_service_t *service,
27 origin_circuit_t *circ);
28 int hs_circ_launch_intro_point(hs_service_t *service,
29 const hs_service_intro_point_t *ip,
30 extend_info_t *ei);
31 int hs_circ_launch_rendezvous_point(const hs_service_t *service,
32 const curve25519_public_key_t *onion_key,
33 const uint8_t *rendezvous_cookie);
34 void hs_circ_retry_service_rendezvous_point(origin_circuit_t *circ);
36 origin_circuit_t *hs_circ_service_get_intro_circ(
37 const hs_service_intro_point_t *ip);
39 /* Cell API. */
40 int hs_circ_handle_intro_established(const hs_service_t *service,
41 const hs_service_intro_point_t *ip,
42 origin_circuit_t *circ,
43 const uint8_t *payload,
44 size_t payload_len);
45 int hs_circ_handle_introduce2(const hs_service_t *service,
46 const origin_circuit_t *circ,
47 hs_service_intro_point_t *ip,
48 const uint8_t *subcredential,
49 const uint8_t *payload, size_t payload_len);
50 int hs_circ_send_introduce1(origin_circuit_t *intro_circ,
51 origin_circuit_t *rend_circ,
52 const hs_desc_intro_point_t *ip,
53 const uint8_t *subcredential);
54 int hs_circ_send_establish_rendezvous(origin_circuit_t *circ);
56 /* e2e circuit API. */
58 int hs_circuit_setup_e2e_rend_circ(origin_circuit_t *circ,
59 const uint8_t *ntor_key_seed,
60 size_t seed_len,
61 int is_service_side);
62 int hs_circuit_setup_e2e_rend_circ_legacy_client(origin_circuit_t *circ,
63 const uint8_t *rend_cell_body);
65 #ifdef HS_CIRCUIT_PRIVATE
67 STATIC hs_ident_circuit_t *
68 create_rp_circuit_identifier(const hs_service_t *service,
69 const uint8_t *rendezvous_cookie,
70 const curve25519_public_key_t *server_pk,
71 const hs_ntor_rend_cell_keys_t *keys);
73 #endif /* defined(HS_CIRCUIT_PRIVATE) */
75 #endif /* !defined(TOR_HS_CIRCUIT_H) */