aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitmux_ewma.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-02-15 13:51:34 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-02-15 13:51:34 -0500
commit9af5b625e8be64ed63ad5b19ae6c4b450e977ce0 (patch)
tree002b0236d9b9511a575d8678760d2978de8118ab /src/or/circuitmux_ewma.c
parent6b1dba214db3058b143bbb4d4c4bdfee32d100f1 (diff)
downloadtor-9af5b625e8be64ed63ad5b19ae6c4b450e977ce0.tar.gz
tor-9af5b625e8be64ed63ad5b19ae6c4b450e977ce0.zip
cmux: Rename cell_ewma_set_scale_factor()
It is rename to something more meaningful that explains what it does exactly which is sets the EWMA options (currently only one exists). The new name is cmux_ewma_set_options(). Also, remove a public function from circuitmux_ewma.h that is only used in the C file. Make it static inline as well. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/circuitmux_ewma.c')
-rw-r--r--src/or/circuitmux_ewma.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
index d9ee8d3ef5..b2ace8a9fa 100644
--- a/src/or/circuitmux_ewma.c
+++ b/src/or/circuitmux_ewma.c
@@ -241,6 +241,13 @@ circuitmux_policy_t ewma_policy = {
/*** EWMA method implementations using the below EWMA helper functions ***/
+/** Compute and return the current cell_ewma tick. */
+static inline unsigned int
+cell_ewma_get_tick(void)
+{
+ return ((unsigned)approx_time() / EWMA_TICK_LEN);
+}
+
/**
* Allocate an ewma_policy_data_t and upcast it to a circuitmux_policy_data_t;
* this is called when setting the policy on a circuitmux_t to ewma_policy.
@@ -610,13 +617,6 @@ cell_ewma_tick_from_timeval(const struct timeval *now,
return res;
}
-/** Compute and return the current cell_ewma tick. */
-unsigned int
-cell_ewma_get_tick(void)
-{
- return ((unsigned)approx_time() / EWMA_TICK_LEN);
-}
-
/* Default value for the CircuitPriorityHalflifeMsec consensus parameter in
* msec. */
#define CMUX_PRIORITY_HALFLIFE_MSEC_DEFAULT 30000
@@ -672,8 +672,8 @@ get_circuit_priority_halflife(const or_options_t *options,
/** Adjust the global cell scale factor based on <b>options</b> */
void
-cell_ewma_set_scale_factor(const or_options_t *options,
- const networkstatus_t *consensus)
+cmux_ewma_set_options(const or_options_t *options,
+ const networkstatus_t *consensus)
{
double halflife;
const char *source;