rephist.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2010, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file rephist.h
  8. * \brief Header file for rephist.c.
  9. **/
  10. #ifndef _TOR_REPHIST_H
  11. #define _TOR_REPHIST_H
  12. void rep_hist_init(void);
  13. void rep_hist_note_connect_failed(const char* nickname, time_t when);
  14. void rep_hist_note_connect_succeeded(const char* nickname, time_t when);
  15. void rep_hist_note_disconnect(const char* nickname, time_t when);
  16. void rep_hist_note_connection_died(const char* nickname, time_t when);
  17. void rep_hist_note_extend_succeeded(const char *from_name,
  18. const char *to_name);
  19. void rep_hist_note_extend_failed(const char *from_name, const char *to_name);
  20. void rep_hist_dump_stats(time_t now, int severity);
  21. void rep_hist_note_bytes_read(size_t num_bytes, time_t when);
  22. void rep_hist_note_bytes_written(size_t num_bytes, time_t when);
  23. int rep_hist_bandwidth_assess(void);
  24. char *rep_hist_get_bandwidth_lines(int for_extrainfo);
  25. void rep_hist_update_state(or_state_t *state);
  26. int rep_hist_load_state(or_state_t *state, char **err);
  27. void rep_history_clean(time_t before);
  28. void rep_hist_note_router_reachable(const char *id, time_t when);
  29. void rep_hist_note_router_unreachable(const char *id, time_t when);
  30. int rep_hist_record_mtbf_data(time_t now, int missing_means_down);
  31. int rep_hist_load_mtbf_data(time_t now);
  32. time_t rep_hist_downrate_old_runs(time_t now);
  33. double rep_hist_get_stability(const char *id, time_t when);
  34. double rep_hist_get_weighted_fractional_uptime(const char *id, time_t when);
  35. long rep_hist_get_weighted_time_known(const char *id, time_t when);
  36. int rep_hist_have_measured_enough_stability(void);
  37. const char *rep_hist_get_router_stability_doc(time_t now);
  38. void rep_hist_note_used_port(time_t now, uint16_t port);
  39. smartlist_t *rep_hist_get_predicted_ports(time_t now);
  40. void rep_hist_note_used_resolve(time_t now);
  41. void rep_hist_note_used_internal(time_t now, int need_uptime,
  42. int need_capacity);
  43. int rep_hist_get_predicted_internal(time_t now, int *need_uptime,
  44. int *need_capacity);
  45. int any_predicted_circuits(time_t now);
  46. int rep_hist_circbuilding_dormant(time_t now);
  47. void note_crypto_pk_op(pk_op_t operation);
  48. void dump_pk_ops(int severity);
  49. void rep_hist_free_all(void);
  50. void rep_hist_exit_stats_init(time_t now);
  51. void rep_hist_reset_exit_stats(time_t now);
  52. void rep_hist_exit_stats_term(void);
  53. char *rep_hist_format_exit_stats(time_t now);
  54. time_t rep_hist_exit_stats_write(time_t now);
  55. void rep_hist_note_exit_bytes(uint16_t port, size_t num_written,
  56. size_t num_read);
  57. void rep_hist_note_exit_stream_opened(uint16_t port);
  58. void rep_hist_buffer_stats_init(time_t now);
  59. void rep_hist_buffer_stats_add_circ(circuit_t *circ,
  60. time_t end_of_interval);
  61. time_t rep_hist_buffer_stats_write(time_t now);
  62. void rep_hist_buffer_stats_term(void);
  63. #endif