Tor  0.4.7.0-alpha-dev
Data Fields
circpad_machine_runtime_t Struct Reference

#include <circuitpadding.h>

Data Fields

tor_timer_t * padding_timer
 
struct circuit_ton_circ
 
circpad_hist_token_thistogram
 
circpad_hist_index_t histogram_len
 
circpad_hist_index_t chosen_bin
 
uint64_t state_length
 
uint16_t padding_sent
 
uint16_t nonpadding_sent
 
time_t last_cell_time_sec
 
circpad_delay_t rtt_estimate_usec
 
circpad_time_t last_received_time_usec
 
circpad_time_t padding_scheduled_at_usec
 
circpad_statenum_t current_state
 
uint32_t machine_ctr
 
unsigned is_padding_timer_scheduled: 1
 
unsigned stop_rtt_update: 1
 
unsigned machine_index: 1
 

Detailed Description

Mutable padding machine info.

This structure contains mutable information about a padding machine. The mutable information must be kept separate because it exists per-circuit, where as the machines themselves are global. This separation is done to conserve space in the circuit structure.

This is the per-circuit state that changes regarding the global state machine. Some parts of it are optional (ie NULL).

XXX: Play with layout to minimize space on x64 Linux (most common relay).

Definition at line 509 of file circuitpadding.h.

Field Documentation

◆ chosen_bin

Remove token from this index upon sending padding

Definition at line 532 of file circuitpadding.h.

◆ current_state

circpad_statenum_t current_state

What state is this machine in?

Definition at line 576 of file circuitpadding.h.

Referenced by circpad_machine_current_state(), and circpad_send_padding_cell_for_callback().

◆ histogram

◆ histogram_len

circpad_hist_index_t histogram_len

Length of the above histogram. XXX: This field could be removed at the expense of added complexity+overhead for reaching back into the immutable machine state every time we need to inspect the histogram. It's only a byte, though, so it seemed worth it.

Definition at line 530 of file circuitpadding.h.

Referenced by circpad_machine_first_higher_index(), and circpad_machine_setup_tokens().

◆ is_padding_timer_scheduled

unsigned is_padding_timer_scheduled

True if we have scheduled a timer for padding.

This is 1 if a timer is pending. It is 0 if no timer is scheduled. (It can be 0 even when padding_was_scheduled_at_usec is non-zero).

Definition at line 592 of file circuitpadding.h.

Referenced by circpad_send_padding_cell_for_callback().

◆ last_cell_time_sec

time_t last_cell_time_sec

Timestamp of the most recent cell event (sent, received, padding, non-padding), in seconds from approx_time().

Used as an emergency break to stop holding padding circuits open.

Definition at line 552 of file circuitpadding.h.

Referenced by circpad_cell_event_nonpadding_received(), and circpad_cell_event_padding_received().

◆ last_received_time_usec

circpad_time_t last_received_time_usec

The last time we got an event relevant to estimating the RTT. Monotonic time in microseconds since system start.

Definition at line 564 of file circuitpadding.h.

Referenced by circpad_estimate_circ_rtt_on_received(), and circpad_estimate_circ_rtt_on_send().

◆ machine_ctr

uint32_t machine_ctr

Machine counter, for shutdown sync.

Set from circuit_t.padding_machine_ctr, which is incremented each padding machine instantiation.

Definition at line 583 of file circuitpadding.h.

Referenced by circpad_machine_spec_transitioned_to_end(), circpad_shutdown_old_machines(), and free_circ_machineinfos_with_machine_num().

◆ machine_index

unsigned machine_index

Which padding machine index was this for. (make sure changes to the bitwidth can support the CIRCPAD_MAX_MACHINES define).

Definition at line 606 of file circuitpadding.h.

Referenced by circpad_send_padding_cell_for_callback().

◆ nonpadding_sent

uint16_t nonpadding_sent

A scaled count of non-padding packets sent, used to limit padding overhead. When this reaches UINT16_MAX, we cut it and padding_sent in half.

Definition at line 544 of file circuitpadding.h.

Referenced by circpad_machine_count_nonpadding_sent(), and circpad_machine_reached_padding_limit().

◆ on_circ

struct circuit_t* on_circ

The circuit for this machine

Definition at line 519 of file circuitpadding.h.

Referenced by circpad_machine_spec_transitioned_to_end(), and circpad_send_padding_cell_for_callback().

◆ padding_scheduled_at_usec

circpad_time_t padding_scheduled_at_usec

The time at which we scheduled a non-padding packet, or selected an infinite delay.

Monotonic time in microseconds since system start. This is 0 if we haven't chosen a padding delay.

Definition at line 573 of file circuitpadding.h.

Referenced by circpad_machine_remove_token(), and circpad_send_padding_cell_for_callback().

◆ padding_sent

uint16_t padding_sent

A scaled count of padding packets sent, used to limit padding overhead. When this reaches UINT16_MAX, we cut it and nonpadding_sent in half.

Definition at line 540 of file circuitpadding.h.

Referenced by circpad_machine_count_nonpadding_sent(), and circpad_machine_reached_padding_limit().

◆ padding_timer

tor_timer_t* padding_timer

The callback pointer for the padding callbacks.

These timers stick around the machineinfo until the machineinfo's circuit is closed, at which point the timer is cancelled. For this reason it's safe to assume that the machineinfo exists if this timer gets triggered.

Definition at line 516 of file circuitpadding.h.

◆ rtt_estimate_usec

circpad_delay_t rtt_estimate_usec

EWMA estimate of the RTT of the circuit from this hop to the exit end, in microseconds.

Definition at line 557 of file circuitpadding.h.

Referenced by circpad_estimate_circ_rtt_on_received(), and circpad_estimate_circ_rtt_on_send().

◆ state_length

uint64_t state_length

Stop padding/transition if this many cells sent

Definition at line 535 of file circuitpadding.h.

Referenced by circpad_machine_count_padding_sent(), and circpad_machine_update_state_length_for_nonpadding().

◆ stop_rtt_update

unsigned stop_rtt_update

If this is true, we have seen full duplex behavior. Stop updating the RTT.

Definition at line 598 of file circuitpadding.h.

Referenced by circpad_estimate_circ_rtt_on_received(), and circpad_estimate_circ_rtt_on_send().


The documentation for this struct was generated from the following file: