summaryrefslogtreecommitdiff
path: root/src/feature/stats
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-20 14:41:44 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-20 14:41:44 -0400
commit813019cc57844876fcc63d87510b8efbcbf80563 (patch)
tree9e6c751dc96ef2f6889fd441e5ec6096ccaae2dc /src/feature/stats
parenta406255cf395b053d6216df4252ad1320ab73a54 (diff)
parent1da9741bca8b16e8c5f15d91f646ee1ea4985750 (diff)
downloadtor-813019cc57844876fcc63d87510b8efbcbf80563.tar.gz
tor-813019cc57844876fcc63d87510b8efbcbf80563.zip
Merge branch 'bug23512-v4-029-fixes'
Diffstat (limited to 'src/feature/stats')
-rw-r--r--src/feature/stats/rephist.c6
-rw-r--r--src/feature/stats/rephist.h9
2 files changed, 8 insertions, 7 deletions
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c
index 2588bb4c00..a2dbb0ff16 100644
--- a/src/feature/stats/rephist.c
+++ b/src/feature/stats/rephist.c
@@ -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"
@@ -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. */
diff --git a/src/feature/stats/rephist.h b/src/feature/stats/rephist.h
index e17a722489..842184f815 100644
--- a/src/feature/stats/rephist.h
+++ b/src/feature/stats/rephist.h
@@ -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
/**
@@ -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) */
-