9#ifndef TOR_CIRCUITMUX_EWMA_H
10#define TOR_CIRCUITMUX_EWMA_H
24#ifdef CIRCUITMUX_EWMA_PRIVATE
28typedef struct cell_ewma_t cell_ewma_t;
29typedef struct ewma_policy_data_t ewma_policy_data_t;
30typedef struct ewma_policy_circ_data_t ewma_policy_circ_data_t;
45 unsigned int last_adjusted_tick;
50 unsigned int is_for_p_chan : 1;
56struct ewma_policy_data_t {
72 unsigned int active_circuit_pqueue_last_recalibrated;
75struct ewma_policy_circ_data_t {
83 cell_ewma_t cell_ewma;
94#define EWMA_POL_DATA_MAGIC 0x2fd8b16aU
95#define EWMA_POL_CIRC_DATA_MAGIC 0x761e7747U
104static inline ewma_policy_data_t *
107 if (!pol)
return NULL;
109 tor_assertf(pol->magic == EWMA_POL_DATA_MAGIC,
110 "Mismatch: %"PRIu32
" != %"PRIu32,
111 pol->magic, EWMA_POL_DATA_MAGIC);
112 return DOWNCAST(ewma_policy_data_t, pol);
121static inline ewma_policy_circ_data_t *
124 if (!pol)
return NULL;
126 tor_assertf(pol->magic == EWMA_POL_CIRC_DATA_MAGIC,
127 "Mismatch: %"PRIu32
" != %"PRIu32,
128 pol->magic, EWMA_POL_CIRC_DATA_MAGIC);
129 return DOWNCAST(ewma_policy_circ_data_t, pol);
Header file for circuitmux.c.
STATIC void cell_ewma_initialize_ticks(void)
STATIC unsigned cell_ewma_get_current_tick_and_fraction(double *remainder_out)
void circuitmux_ewma_free_all(void)
void cmux_ewma_set_options(const or_options_t *options, const networkstatus_t *consensus)
Master header file for Tor-specific functionality.
#define DOWNCAST(to, ptr)