Loading src/feature/stats/rephist.c +1 −5 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ * (The "rephist" name originally stood for "reputation and history". ) **/ #define REPHIST_PRIVATE #include "core/or/or.h" #include "core/or/circuitlist.h" #include "core/or/circuituse.h" Loading Loading @@ -106,11 +107,6 @@ static void bw_arrays_init(void); static void predicted_ports_alloc(void); typedef struct bw_array_t bw_array_t; STATIC uint64_t find_largest_max(bw_array_t *b); STATIC void commit_max(bw_array_t *b); STATIC void advance_obs(bw_array_t *b); /** Total number of bytes currently allocated in fields used by rephist.c. */ uint64_t rephist_total_alloc=0; /** Number of or_history_t objects currently allocated. */ Loading src/feature/stats/rephist.h +7 −2 Original line number Diff line number Diff line Loading @@ -109,8 +109,14 @@ extern uint32_t rephist_total_num; #ifdef TOR_UNIT_TESTS extern int onion_handshakes_requested[MAX_ONION_HANDSHAKE_TYPE+1]; extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1]; extern struct bw_array_t *write_array; #endif #ifdef REPHIST_PRIVATE typedef struct bw_array_t bw_array_t; extern bw_array_t *write_array; STATIC uint64_t find_largest_max(bw_array_t *b); STATIC void commit_max(bw_array_t *b); STATIC void advance_obs(bw_array_t *b); #endif /** Loading Loading @@ -139,4 +145,3 @@ void rep_hist_prep_published_padding_counts(time_t now); void rep_hist_padding_count_timers(uint64_t num_timers); #endif /* !defined(TOR_REPHIST_H) */ src/test/test_relay.c +5 −5 Original line number Diff line number Diff line /* Copyright (c) 2014-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "core/or/or.h" #define CIRCUITBUILD_PRIVATE #define RELAY_PRIVATE #define REPHIST_PRIVATE #include "core/or/or.h" #include "core/or/circuitbuild.h" #include "core/or/circuitlist.h" #include "core/or/channeltls.h" #include "feature/stats/rephist.h" #define RELAY_PRIVATE #include "core/or/relay.h" #include "feature/stats/rephist.h" #include "lib/container/order.h" /* For init/free stuff */ #include "core/or/scheduler.h" Loading @@ -22,9 +25,6 @@ static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan); static void test_relay_append_cell_to_circuit_queue(void *arg); uint64_t find_largest_max(bw_array_t *b); void commit_max(bw_array_t *b); void advance_obs(bw_array_t *b); static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan) Loading Loading
src/feature/stats/rephist.c +1 −5 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ * (The "rephist" name originally stood for "reputation and history". ) **/ #define REPHIST_PRIVATE #include "core/or/or.h" #include "core/or/circuitlist.h" #include "core/or/circuituse.h" Loading Loading @@ -106,11 +107,6 @@ static void bw_arrays_init(void); static void predicted_ports_alloc(void); typedef struct bw_array_t bw_array_t; STATIC uint64_t find_largest_max(bw_array_t *b); STATIC void commit_max(bw_array_t *b); STATIC void advance_obs(bw_array_t *b); /** Total number of bytes currently allocated in fields used by rephist.c. */ uint64_t rephist_total_alloc=0; /** Number of or_history_t objects currently allocated. */ Loading
src/feature/stats/rephist.h +7 −2 Original line number Diff line number Diff line Loading @@ -109,8 +109,14 @@ extern uint32_t rephist_total_num; #ifdef TOR_UNIT_TESTS extern int onion_handshakes_requested[MAX_ONION_HANDSHAKE_TYPE+1]; extern int onion_handshakes_assigned[MAX_ONION_HANDSHAKE_TYPE+1]; extern struct bw_array_t *write_array; #endif #ifdef REPHIST_PRIVATE typedef struct bw_array_t bw_array_t; extern bw_array_t *write_array; STATIC uint64_t find_largest_max(bw_array_t *b); STATIC void commit_max(bw_array_t *b); STATIC void advance_obs(bw_array_t *b); #endif /** Loading Loading @@ -139,4 +145,3 @@ void rep_hist_prep_published_padding_counts(time_t now); void rep_hist_padding_count_timers(uint64_t num_timers); #endif /* !defined(TOR_REPHIST_H) */
src/test/test_relay.c +5 −5 Original line number Diff line number Diff line /* Copyright (c) 2014-2018, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #include "core/or/or.h" #define CIRCUITBUILD_PRIVATE #define RELAY_PRIVATE #define REPHIST_PRIVATE #include "core/or/or.h" #include "core/or/circuitbuild.h" #include "core/or/circuitlist.h" #include "core/or/channeltls.h" #include "feature/stats/rephist.h" #define RELAY_PRIVATE #include "core/or/relay.h" #include "feature/stats/rephist.h" #include "lib/container/order.h" /* For init/free stuff */ #include "core/or/scheduler.h" Loading @@ -22,9 +25,6 @@ static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan); static void test_relay_append_cell_to_circuit_queue(void *arg); uint64_t find_largest_max(bw_array_t *b); void commit_max(bw_array_t *b); void advance_obs(bw_array_t *b); static or_circuit_t * new_fake_orcirc(channel_t *nchan, channel_t *pchan) Loading