Tor 0.4.9.8
Loading...
Searching...
No Matches
conflux_pool.h File Reference

Header file for conflux_pool.c. More...

#include "core/or/or.h"
#include "core/or/relay_msg_st.h"

Go to the source code of this file.

Functions

void conflux_pool_init (void)
 
void conflux_notify_shutdown (void)
 
void conflux_pool_free_all (void)
 
origin_circuit_tconflux_get_circ_for_conn (const entry_connection_t *conn, time_t now, int need_internal)
 
void conflux_mark_all_for_close (const uint8_t *nonce, bool is_client, int reason)
 
void conflux_predict_new (time_t now)
 
bool conflux_launch_leg (const uint8_t *nonce)
 
void conflux_add_guards_to_exclude_list (const origin_circuit_t *circ, smartlist_t *excluded)
 
void conflux_add_middles_to_exclude_list (const origin_circuit_t *circ, smartlist_t *excluded)
 
void conflux_circuit_has_closed (circuit_t *circ)
 
void conflux_circuit_has_opened (origin_circuit_t *orig_circ)
 
void conflux_circuit_about_to_free (circuit_t *circ)
 
void conflux_process_link (circuit_t *circ, const relay_msg_t *msg)
 
void conflux_process_linked (circuit_t *circ, crypt_path_t *layer_hint, const relay_msg_t *msg)
 
void conflux_process_linked_ack (circuit_t *circ)
 
void conflux_log_set (int loglevel, const conflux_t *cfx, bool is_client)
 

Detailed Description

Header file for conflux_pool.c.

Definition in file conflux_pool.h.

Function Documentation

◆ conflux_add_guards_to_exclude_list()

void conflux_add_guards_to_exclude_list ( const origin_circuit_t * orig_circ,
smartlist_t * excluded )

Add the identity digest of the guard nodes of all legs of the conflux circuit.

This function checks both pending and linked conflux circuits.

Definition at line 1217 of file conflux_pool.c.

◆ conflux_add_middles_to_exclude_list()

void conflux_add_middles_to_exclude_list ( const origin_circuit_t * orig_circ,
smartlist_t * excluded )

Add the identity digest of the middle nodes of all legs of the conflux circuit.

This function checks both pending and linked conflux circuits.

XXX: The add guard and middle could be merged since it is the exact same code except for the cpath position and the identity digest vs node_t in the list. We could use an extra param indicating guard or middle.

Definition at line 1285 of file conflux_pool.c.

Referenced by build_middle_exclude_list().

◆ conflux_circuit_about_to_free()

void conflux_circuit_about_to_free ( circuit_t * circ)

Called when a circuit is freed.

It is possible a conflux circuit gets freed without being closed (for instance SIGTERM) and so this callback is needed in order to finalize the cleanup.

Definition at line 2095 of file conflux_pool.c.

Referenced by circuit_about_to_free(), and circuit_about_to_free_atexit().

◆ conflux_circuit_has_closed()

void conflux_circuit_has_closed ( circuit_t * circ)

Circuit has been marked for close.

Definition at line 1728 of file conflux_pool.c.

Referenced by circuit_change_purpose(), and circuit_mark_for_close_().

◆ conflux_circuit_has_opened()

void conflux_circuit_has_opened ( origin_circuit_t * orig_circ)

Circuit with conflux purpose just opened.

Definition at line 1741 of file conflux_pool.c.

Referenced by circuit_has_opened().

◆ conflux_get_circ_for_conn()

origin_circuit_t * conflux_get_circ_for_conn ( const entry_connection_t * conn,
time_t now,
int need_internal )

Return the first circuit from the linked pool that will work with the conn. If no such circuit exists, return NULL.

The need_internal argument must match the caller's stream requirement. When it is true (for example, for anonymized directory requests), non-internal conflux circuits are excluded by circuit_is_acceptable(). At present, conflux circuits in this pool are non-internal.

Definition at line 1421 of file conflux_pool.c.

Referenced by circuit_get_best().

◆ conflux_launch_leg()

bool conflux_launch_leg ( const uint8_t * nonce)

Launch a new conflux leg for the given nonce.

Return true on success else false which teardowns the entire unlinked set if any.

Definition at line 1129 of file conflux_pool.c.

Referenced by launch_new_set(), and unlinked_circuit_closed().

◆ conflux_log_set()

void conflux_log_set ( int loglevel,
const conflux_t * cfx,
bool is_client )

Return a description of all linked and unlinked circuits associated with a conflux set.

For use in rare bug cases that are hard to diagnose.

Definition at line 2138 of file conflux_pool.c.

Referenced by conflux_pick_first_leg(), conflux_validate_legs(), linked_circuit_free(), and try_finalize_set().

◆ conflux_mark_all_for_close()

void conflux_mark_all_for_close ( const uint8_t * nonce,
bool is_client,
int reason )

Upon an error condition or a close of an in-use circuit, we must close all linked and unlinked circuits associated with a set. When the last leg of each set is closed, the set is removed from the pool.

Definition at line 679 of file conflux_pool.c.

Referenced by conflux_decide_circ_for_send(), linked_circuit_closed(), and try_finalize_set().

◆ conflux_notify_shutdown()

void conflux_notify_shutdown ( void )

Conflux needs a notification when tor_shutdown() begins, so that when circuits are freed, new legs are not launched.

This needs a separate notification from conflux_pool_free_all(), because circuits must be freed before that function.

Definition at line 2199 of file conflux_pool.c.

Referenced by tor_free_all().

◆ conflux_pool_free_all()

void conflux_pool_free_all ( void )

Free and clean up the conflux pool subsystem. This is called by the subsys manager AFTER all circuits have been freed which implies that all objects in the pools aren't referenced anymore.

Definition at line 2219 of file conflux_pool.c.

Referenced by tor_free_all().

◆ conflux_pool_init()

void conflux_pool_init ( void )

Initialize the conflux pool subsystem. This is called by the subsys manager.

Definition at line 2115 of file conflux_pool.c.

◆ conflux_predict_new()

void conflux_predict_new ( time_t now)

Determine if we need to launch new conflux circuits for our preemptive pool.

This is called once a second from the mainloop from circuit_predict_and_launch_new().

Definition at line 1370 of file conflux_pool.c.

Referenced by circuit_predict_and_launch_new().

◆ conflux_process_link()

void conflux_process_link ( circuit_t * circ,
const relay_msg_t * msg )

Process a CONFLUX_LINK cell which arrived on the given circuit.

Definition at line 1792 of file conflux_pool.c.

Referenced by handle_relay_msg().

◆ conflux_process_linked()

void conflux_process_linked ( circuit_t * circ,
crypt_path_t * layer_hint,
const relay_msg_t * msg )

Process a CONFLUX_LINKED cell which arrived on the given circuit.

Definition at line 1902 of file conflux_pool.c.

Referenced by handle_relay_msg().

◆ conflux_process_linked_ack()

void conflux_process_linked_ack ( circuit_t * circ)

Process a CONFLUX_LINKED_ACK cell which arrived on the given circuit.

Definition at line 2048 of file conflux_pool.c.

Referenced by handle_relay_msg().