mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Implement cell_ewma_enabled()
This commit is contained in:
parent
8afe41b481
commit
0c4f717b3e
2 changed files with 9 additions and 0 deletions
|
@ -520,6 +520,7 @@ cell_ewma_to_circuit(cell_ewma_t *ewma)
|
|||
*
|
||||
* These tick values are not meant to be shared between Tor instances, or used
|
||||
* for other purposes. */
|
||||
|
||||
static unsigned
|
||||
cell_ewma_tick_from_timeval(const struct timeval *now,
|
||||
double *remainder_out)
|
||||
|
@ -532,6 +533,13 @@ cell_ewma_tick_from_timeval(const struct timeval *now,
|
|||
return res;
|
||||
}
|
||||
|
||||
/** Tell the caller whether ewma_enabled is set */
|
||||
int
|
||||
cell_ewma_enabled(void)
|
||||
{
|
||||
return ewma_enabled;
|
||||
}
|
||||
|
||||
/** Compute and return the current cell_ewma tick. */
|
||||
unsigned int
|
||||
cell_ewma_get_tick(void)
|
||||
|
|
|
@ -20,6 +20,7 @@ extern circuitmux_policy_t ewma_policy;
|
|||
#endif /* !(_TOR_CIRCUITMUX_EWMA_C) */
|
||||
|
||||
/* Externally visible EWMA functions */
|
||||
int cell_ewma_enabled(void);
|
||||
unsigned int cell_ewma_get_tick(void);
|
||||
void cell_ewma_set_scale_factor(const or_options_t *options,
|
||||
const networkstatus_t *consensus);
|
||||
|
|
Loading…
Add table
Reference in a new issue