]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'bug23512-v4-029' into bug23512-v4-032
authorMike Perry <mikeperry-git@torproject.org>
Mon, 17 Sep 2018 23:12:45 +0000 (23:12 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Mon, 17 Sep 2018 23:12:45 +0000 (23:12 +0000)
1  2 
src/or/channeltls.h
src/or/circuitlist.c
src/or/circuitlist.h
src/or/or.h
src/or/relay.c
src/or/rephist.c
src/or/rephist.h
src/test/test_relay.c

Simple merge
Simple merge
Simple merge
diff --cc src/or/or.h
Simple merge
diff --cc src/or/relay.c
Simple merge
index 345722d8ce9647aaf6657462b00ed248dbf57c46,211480284af47734b011d377a96a192b3956c46e..4b9265875db7f14e44a8a15841ec40a206c98b2e
  #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. */
index 496e3668657841b025deb57832c6edaf7b51bfd9,837bb8d0438ecd3b79b59950f6fe3e4122261da5..e67209d3ee104482607d314e780ddd3028118754
@@@ -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) */
  
Simple merge