2010-07-23 22:57:20 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2011-01-03 17:52:09 +01:00
|
|
|
* Copyright (c) 2007-2011, The Tor Project, Inc. */
|
2010-07-23 22:57:20 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file rephist.h
|
2010-07-28 17:42:33 +02:00
|
|
|
* \brief Header file for rephist.c.
|
2010-07-23 22:57:20 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _TOR_REPHIST_H
|
|
|
|
#define _TOR_REPHIST_H
|
|
|
|
|
|
|
|
void rep_hist_init(void);
|
|
|
|
void rep_hist_note_connect_failed(const char* nickname, time_t when);
|
|
|
|
void rep_hist_note_connect_succeeded(const char* nickname, time_t when);
|
|
|
|
void rep_hist_note_disconnect(const char* nickname, time_t when);
|
|
|
|
void rep_hist_note_connection_died(const char* nickname, time_t when);
|
|
|
|
void rep_hist_note_extend_succeeded(const char *from_name,
|
|
|
|
const char *to_name);
|
|
|
|
void rep_hist_note_extend_failed(const char *from_name, const char *to_name);
|
|
|
|
void rep_hist_dump_stats(time_t now, int severity);
|
|
|
|
void rep_hist_note_bytes_read(size_t num_bytes, time_t when);
|
|
|
|
void rep_hist_note_bytes_written(size_t num_bytes, time_t when);
|
2010-08-18 16:06:14 +02:00
|
|
|
|
2010-07-07 14:55:42 +02:00
|
|
|
void rep_hist_note_dir_bytes_read(size_t num_bytes, time_t when);
|
|
|
|
void rep_hist_note_dir_bytes_written(size_t num_bytes, time_t when);
|
2010-08-18 16:06:14 +02:00
|
|
|
|
2010-07-23 22:57:20 +02:00
|
|
|
int rep_hist_bandwidth_assess(void);
|
2010-11-13 22:25:19 +01:00
|
|
|
char *rep_hist_get_bandwidth_lines(void);
|
2010-07-23 22:57:20 +02:00
|
|
|
void rep_hist_update_state(or_state_t *state);
|
|
|
|
int rep_hist_load_state(or_state_t *state, char **err);
|
|
|
|
void rep_history_clean(time_t before);
|
|
|
|
|
2010-11-22 18:30:33 +01:00
|
|
|
void rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
|
2011-02-07 16:31:20 +01:00
|
|
|
uint16_t at_port, time_t when);
|
2010-07-23 22:57:20 +02:00
|
|
|
void rep_hist_note_router_unreachable(const char *id, time_t when);
|
|
|
|
int rep_hist_record_mtbf_data(time_t now, int missing_means_down);
|
|
|
|
int rep_hist_load_mtbf_data(time_t now);
|
|
|
|
|
|
|
|
time_t rep_hist_downrate_old_runs(time_t now);
|
2011-03-09 11:34:04 +01:00
|
|
|
long rep_hist_get_uptime(const char *id, time_t when);
|
2010-07-23 22:57:20 +02:00
|
|
|
double rep_hist_get_stability(const char *id, time_t when);
|
|
|
|
double rep_hist_get_weighted_fractional_uptime(const char *id, time_t when);
|
|
|
|
long rep_hist_get_weighted_time_known(const char *id, time_t when);
|
|
|
|
int rep_hist_have_measured_enough_stability(void);
|
|
|
|
const char *rep_hist_get_router_stability_doc(time_t now);
|
|
|
|
|
|
|
|
void rep_hist_note_used_port(time_t now, uint16_t port);
|
|
|
|
smartlist_t *rep_hist_get_predicted_ports(time_t now);
|
|
|
|
void rep_hist_note_used_resolve(time_t now);
|
|
|
|
void rep_hist_note_used_internal(time_t now, int need_uptime,
|
|
|
|
int need_capacity);
|
|
|
|
int rep_hist_get_predicted_internal(time_t now, int *need_uptime,
|
|
|
|
int *need_capacity);
|
|
|
|
|
|
|
|
int any_predicted_circuits(time_t now);
|
|
|
|
int rep_hist_circbuilding_dormant(time_t now);
|
|
|
|
|
|
|
|
void note_crypto_pk_op(pk_op_t operation);
|
|
|
|
void dump_pk_ops(int severity);
|
|
|
|
|
|
|
|
void rep_hist_free_all(void);
|
|
|
|
|
2010-08-11 14:13:08 +02:00
|
|
|
void rep_hist_exit_stats_init(time_t now);
|
|
|
|
void rep_hist_reset_exit_stats(time_t now);
|
|
|
|
void rep_hist_exit_stats_term(void);
|
2010-08-15 14:15:58 +02:00
|
|
|
char *rep_hist_format_exit_stats(time_t now);
|
2010-08-11 14:13:08 +02:00
|
|
|
time_t rep_hist_exit_stats_write(time_t now);
|
|
|
|
void rep_hist_note_exit_bytes(uint16_t port, size_t num_written,
|
|
|
|
size_t num_read);
|
|
|
|
void rep_hist_note_exit_stream_opened(uint16_t port);
|
|
|
|
|
2010-07-23 22:57:20 +02:00
|
|
|
void rep_hist_buffer_stats_init(time_t now);
|
|
|
|
void rep_hist_buffer_stats_add_circ(circuit_t *circ,
|
|
|
|
time_t end_of_interval);
|
2010-06-21 18:52:46 +02:00
|
|
|
time_t rep_hist_buffer_stats_write(time_t now);
|
|
|
|
void rep_hist_buffer_stats_term(void);
|
2010-07-23 22:57:20 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|