[tor-commits] [tor/maint-0.3.4] Merge branch 'bug23512-v4-029' into bug23512-v4-032
teor at torproject.org
teor at torproject.org
Wed Mar 13 23:06:41 UTC 2019
commit 36e81e1f59581f1dbc29ab44585a202463a99054
Merge: 0971b3ce4 6af352172
Author: Mike Perry <mikeperry-git at torproject.org>
Date: Mon Sep 17 23:12:45 2018 +0000
Merge branch 'bug23512-v4-029' into bug23512-v4-032
changes/bug23512 | 6 +++
src/or/channeltls.h | 2 +
src/or/circuitlist.c | 59 ++++++++++++++++++++++++++
src/or/circuitlist.h | 2 +
src/or/or.h | 12 ++++++
src/or/relay.c | 1 +
src/or/rephist.c | 21 ++++++----
src/or/rephist.h | 10 +++--
src/test/test_relay.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++---
9 files changed, 208 insertions(+), 17 deletions(-)
diff --cc src/or/rephist.c
index 345722d8c,211480284..4b9265875
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@@ -84,14 -84,15 +84,19 @@@
#include "router.h"
#include "routerlist.h"
#include "ht.h"
+#include "channelpadding.h"
+
+#include "channelpadding.h"
+#include "connection_or.h"
static void bw_arrays_init(void);
-static void predicted_ports_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 --cc src/or/rephist.h
index 496e36686,837bb8d04..e67209d3e
--- a/src/or/rephist.h
+++ b/src/or/rephist.h
@@@ -116,32 -117,9 +116,34 @@@ 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];
+ typedef struct bw_array_t bw_array_t;
+ extern bw_array_t *write_array;
#endif
-#endif
+/**
+ * Represents the type of a cell for padding accounting
+ */
+typedef enum padding_type_t {
+ /** A RELAY_DROP cell */
+ PADDING_TYPE_DROP,
+ /** A CELL_PADDING cell */
+ PADDING_TYPE_CELL,
+ /** Total counts of padding and non-padding together */
+ PADDING_TYPE_TOTAL,
+ /** Total cell counts for all padding-enabled channels */
+ PADDING_TYPE_ENABLED_TOTAL,
+ /** CELL_PADDING counts for all padding-enabled channels */
+ PADDING_TYPE_ENABLED_CELL
+} padding_type_t;
+
+/** The amount of time over which the padding cell counts were counted */
+#define REPHIST_CELL_PADDING_COUNTS_INTERVAL (24*60*60)
+void rep_hist_padding_count_read(padding_type_t type);
+void rep_hist_padding_count_write(padding_type_t type);
+char *rep_hist_get_padding_count_lines(void);
+void rep_hist_reset_padding_counts(void);
+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) */
More information about the tor-commits
mailing list