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

Header file for cpuworker.c. More...

Go to the source code of this file.

Functions

int cpuworker_init (void)
 
void cpuworker_free_all (void)
 
void cpuworkers_rotate_keyinfo (void)
 
void cpuworker_consensus_has_changed (const networkstatus_t *ns)
 
struct workqueue_entry_tcpuworker_queue_work (enum workqueue_priority_t priority, enum workqueue_reply_t(*fn)(void *, void *), void(*reply_fn)(void *), void *arg)
 
int assign_onionskin_to_cpuworker (or_circuit_t *circ, struct create_cell_t *onionskin)
 
uint64_t estimated_usec_for_onionskins (uint32_t n_requests, uint16_t onionskin_type)
 
void cpuworker_log_onionskin_overhead (int severity, int onionskin_type, const char *onionskin_type_name)
 
void cpuworker_cancel_circ_handshake (or_circuit_t *circ)
 
unsigned int cpuworker_get_n_threads (void)
 

Detailed Description

Header file for cpuworker.c.

Definition in file cpuworker.h.

Function Documentation

◆ assign_onionskin_to_cpuworker()

int assign_onionskin_to_cpuworker ( or_circuit_t * circ,
create_cell_t * onionskin )

Try to tell a cpuworker to perform the public key operations necessary to respond to onionskin for the circuit circ.

Return 0 if we successfully assign the task, or -1 on failure.

Definition at line 597 of file cpuworker.c.

Referenced by command_process_create_cell(), and queue_pending_tasks().

◆ cpuworker_cancel_circ_handshake()

void cpuworker_cancel_circ_handshake ( or_circuit_t * circ)

If circ has a pending handshake that hasn't been processed yet, remove it from the worker queue.

Definition at line 670 of file cpuworker.c.

Referenced by onion_pending_remove().

◆ cpuworker_consensus_has_changed()

void cpuworker_consensus_has_changed ( const networkstatus_t * ns)

Called when the consensus has changed.

Definition at line 110 of file cpuworker.c.

◆ cpuworker_free_all()

void cpuworker_free_all ( void )

Free all resources allocated by cpuworker.

Definition at line 149 of file cpuworker.c.

Referenced by tor_free_all().

◆ cpuworker_get_n_threads()

unsigned int cpuworker_get_n_threads ( void )

Return the number of threads configured for our CPU worker.

Definition at line 156 of file cpuworker.c.

Referenced by have_room_for_onionskin().

◆ cpuworker_init()

int cpuworker_init ( void )

Initialize the cpuworker subsystem.

Definition at line 118 of file cpuworker.c.

◆ cpuworker_log_onionskin_overhead()

void cpuworker_log_onionskin_overhead ( int severity,
int onionskin_type,
const char * onionskin_type_name )

If we've measured overhead for onionskins of type onionskin_type, log it.

Definition at line 354 of file cpuworker.c.

Referenced by dumpstats().

◆ cpuworker_queue_work()

struct workqueue_entry_t * cpuworker_queue_work ( workqueue_priority_t priority,
workqueue_reply_t(* fn )(void *, void *),
void(* reply_fn )(void *),
void * arg )

◆ cpuworkers_rotate_keyinfo()

void cpuworkers_rotate_keyinfo ( void )

Called when the onion key has changed so update all CPU worker(s) with new function pointers with which a new state will be generated.

Definition at line 250 of file cpuworker.c.

Referenced by do_hup(), and options_act_relay().

◆ estimated_usec_for_onionskins()

uint64_t estimated_usec_for_onionskins ( uint32_t n_requests,
uint16_t onionskin_type )

Return an estimate of how many microseconds we will need for a single cpuworker to process n_requests onionskins of type onionskin_type.

Definition at line 306 of file cpuworker.c.

Referenced by have_room_for_onionskin().