Tor 0.4.9.0-alpha-dev
Functions
conflux_pool.h File Reference

Header file for conflux_pool.c. More...

#include "core/or/or.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)
 
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 cell_t *cell, const uint16_t cell_len)
 
void conflux_process_linked (circuit_t *circ, crypt_path_t *layer_hint, const cell_t *cell, const uint16_t cell_len)
 
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 1205 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 1273 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 2071 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 1702 of file conflux_pool.c.

◆ conflux_circuit_has_opened()

void conflux_circuit_has_opened ( origin_circuit_t orig_circ)

Circuit with conflux purpose just opened.

Definition at line 1715 of file conflux_pool.c.

◆ conflux_get_circ_for_conn()

origin_circuit_t * conflux_get_circ_for_conn ( const entry_connection_t conn,
time_t  now 
)

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

Definition at line 1403 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().

◆ 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 2114 of file conflux_pool.c.

◆ 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 2172 of file conflux_pool.c.

◆ 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 2192 of file conflux_pool.c.

◆ conflux_pool_init()

void conflux_pool_init ( void  )

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

Definition at line 2091 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 1358 of file conflux_pool.c.

Referenced by circuit_predict_and_launch_new().

◆ conflux_process_link()

void conflux_process_link ( circuit_t circ,
const cell_t cell,
const uint16_t  cell_len 
)

Process a CONFLUX_LINK cell which arrived on the given circuit.

Definition at line 1766 of file conflux_pool.c.

◆ conflux_process_linked()

void conflux_process_linked ( circuit_t circ,
crypt_path_t layer_hint,
const cell_t cell,
const uint16_t  cell_len 
)

Process a CONFLUX_LINKED cell which arrived on the given circuit.

Definition at line 1877 of file conflux_pool.c.

◆ 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 2024 of file conflux_pool.c.