Tor  0.4.3.0-alpha-dev
Functions
rendclient.h File Reference

Header file for rendclient.c. More...

#include "feature/hs/hs_circuit.h"
#include "feature/rend/rendcache.h"

Go to the source code of this file.

Functions

void rend_client_purge_state (void)
 
void rend_client_introcirc_has_opened (origin_circuit_t *circ)
 
void rend_client_rendcirc_has_opened (origin_circuit_t *circ)
 
int rend_client_introduction_acked (origin_circuit_t *circ, const uint8_t *request, size_t request_len)
 
void rend_client_refetch_v2_renddesc (rend_data_t *rend_query)
 
int rend_client_fetch_v2_desc (rend_data_t *query, smartlist_t *hsdirs)
 
void rend_client_cancel_descriptor_fetches (void)
 
int rend_client_report_intro_point_failure (extend_info_t *failed_intro, rend_data_t *rend_data, unsigned int failure_type)
 
int rend_client_receive_rendezvous (origin_circuit_t *circ, const uint8_t *request, size_t request_len)
 
void rend_client_desc_trynow (const char *query)
 
void rend_client_note_connection_attempt_ended (const rend_data_t *rend_data)
 
extend_info_trend_client_get_random_intro (const rend_data_t *rend_query)
 
int rend_client_any_intro_points_usable (const rend_cache_entry_t *entry)
 
int rend_client_send_introduction (origin_circuit_t *introcirc, origin_circuit_t *rendcirc)
 
int rend_parse_service_authorization (const or_options_t *options, int validate_only)
 
rend_service_authorization_trend_client_lookup_service_authorization (const char *onion_address)
 
void rend_service_authorization_free_all (void)
 
void rend_client_circuit_cleanup_on_free (const circuit_t *circ)
 

Detailed Description

Header file for rendclient.c.

Definition in file rendclient.h.

Function Documentation

◆ rend_client_any_intro_points_usable()

int rend_client_any_intro_points_usable ( const rend_cache_entry_t entry)

Return true iff any introduction points still listed in entry are usable.

Definition at line 1122 of file rendclient.c.

Referenced by rend_client_get_random_intro(), and rend_client_refetch_v2_renddesc().

◆ rend_client_cancel_descriptor_fetches()

void rend_client_cancel_descriptor_fetches ( void  )

Cancel all rendezvous descriptor fetches currently in progress.

Definition at line 741 of file rendclient.c.

Referenced by rend_client_purge_state().

◆ rend_client_circuit_cleanup_on_free()

void rend_client_circuit_cleanup_on_free ( const circuit_t circ)

The given circuit is being freed. Take appropriate action if it is of interest to the client subsystem.

Definition at line 1257 of file rendclient.c.

Referenced by cleanup_on_free_client_circ().

◆ rend_client_desc_trynow()

void rend_client_desc_trynow ( const char *  query)

Find all the apconns in state AP_CONN_STATE_RENDDESC_WAIT that are waiting on query. If there's a working cache entry here with at least one intro point, move them to the next state.

Definition at line 915 of file rendclient.c.

◆ rend_client_fetch_v2_desc()

int rend_client_fetch_v2_desc ( rend_data_t query,
smartlist_t hsdirs 
)

Fetch a v2 descriptor using the given query. If any hsdir are specified, use them for the fetch.

On success, 1 is returned. If no hidden service is left to ask, return 0. On error, -1 is returned.

Definition at line 675 of file rendclient.c.

◆ rend_client_get_random_intro()

extend_info_t* rend_client_get_random_intro ( const rend_data_t rend_query)

Return a newly allocated extend_info_t* for a randomly chosen introduction point for the named hidden service. Return NULL if all introduction points have been tried and failed.

Definition at line 1009 of file rendclient.c.

Referenced by hs_client_get_random_intro_from_edge(), and hs_client_reextend_intro_circuit().

◆ rend_client_introcirc_has_opened()

void rend_client_introcirc_has_opened ( origin_circuit_t circ)

Called when we've established a circuit to an introduction point: send the introduction request.

Definition at line 67 of file rendclient.c.

Referenced by hs_client_circuit_has_opened().

◆ rend_client_introduction_acked()

int rend_client_introduction_acked ( origin_circuit_t circ,
const uint8_t *  request,
size_t  request_len 
)

Called when get an ACK or a NAK for a REND_INTRODUCE1 cell.

Definition at line 376 of file rendclient.c.

◆ rend_client_lookup_service_authorization()

rend_service_authorization_t* rend_client_lookup_service_authorization ( const char *  onion_address)

Look up the client-side authorization for the hidden service with onion_address. Return NULL if no authorization is available for that address.

Definition at line 1141 of file rendclient.c.

◆ rend_client_note_connection_attempt_ended()

void rend_client_note_connection_attempt_ended ( const rend_data_t rend_data)

Clear temporary state used only during an attempt to connect to the hidden service with rend_data. Called when a connection attempt has ended; it is possible for this to be called multiple times while handling an ended connection attempt, and any future changes to this function must ensure it remains idempotent.

Definition at line 967 of file rendclient.c.

Referenced by connection_mark_unattached_ap_().

◆ rend_client_purge_state()

void rend_client_purge_state ( void  )

Purge all potentially remotely-detectable state held in the hidden service client code. Called on SIGNAL NEWNYM.

Definition at line 56 of file rendclient.c.

Referenced by hs_client_purge_state().

◆ rend_client_receive_rendezvous()

int rend_client_receive_rendezvous ( origin_circuit_t circ,
const uint8_t *  request,
size_t  request_len 
)

The service sent us a rendezvous cell; join the circuits.

Definition at line 891 of file rendclient.c.

◆ rend_client_refetch_v2_renddesc()

void rend_client_refetch_v2_renddesc ( rend_data_t rend_query)

Unless we already have a descriptor for rend_query with at least one (possibly) working introduction point in it, start a connection to a hidden service directory to fetch a v2 rendezvous service descriptor.

Definition at line 709 of file rendclient.c.

Referenced by connection_dir_client_refetch_hsdesc_if_needed().

◆ rend_client_rendcirc_has_opened()

void rend_client_rendcirc_has_opened ( origin_circuit_t circ)

Called when a rendezvous circuit is open; sends a establish rendezvous circuit as appropriate.

Definition at line 337 of file rendclient.c.

Referenced by hs_client_circuit_has_opened().

◆ rend_client_report_intro_point_failure()

int rend_client_report_intro_point_failure ( extend_info_t failed_intro,
rend_data_t rend_data,
unsigned int  failure_type 
)

Mark failed_intro as a failed introduction point for the hidden service specified by rend_query. If the HS now has no usable intro points, or we do not have an HS descriptor for it, then launch a new renddesc fetch.

If failure_type is INTRO_POINT_FAILURE_GENERIC, remove the intro point from (our parsed copy of) the HS descriptor.

If failure_type is INTRO_POINT_FAILURE_TIMEOUT, mark the intro point as 'timed out'; it will not be retried until the current hidden service connection attempt has ended or it has appeared in a newly fetched rendezvous descriptor.

If failure_type is INTRO_POINT_FAILURE_UNREACHABLE, increment the intro point's reachability-failure count; if it has now failed MAX_INTRO_POINT_REACHABILITY_FAILURES or more times, remove the intro point from (our parsed copy of) the HS descriptor.

Return -1 if error, 0 if no usable intro points remain or service unrecognized, 1 if recognized and some intro points remain.

Definition at line 794 of file rendclient.c.

◆ rend_client_send_introduction()

int rend_client_send_introduction ( origin_circuit_t introcirc,
origin_circuit_t rendcirc 
)

Called when we're trying to connect an ap conn; sends an INTRODUCE1 cell down introcirc if possible.

Definition at line 112 of file rendclient.c.

Referenced by hs_client_send_introduce1().

◆ rend_parse_service_authorization()

int rend_parse_service_authorization ( const or_options_t options,
int  validate_only 
)

Parse config_line as a client-side authorization for a hidden service and add it to the local map of hidden service authorizations. Return 0 for success and -1 for failure.

Definition at line 1182 of file rendclient.c.

Referenced by hs_config_client_auth_all().

◆ rend_service_authorization_free_all()

void rend_service_authorization_free_all ( void  )

Release all the storage held in auth_hid_servs.

Definition at line 1169 of file rendclient.c.