diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-06-24 19:51:45 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-07-02 12:37:05 -0400 |
commit | 4d6af73db88e409764f43fc6cdaa432d667becf3 (patch) | |
tree | de8f80573fc939975f8e6e8bb0d6becf39621045 /src/or/or.h | |
parent | 078c34e28e02bcb3a9fd28f3fee3c5e956ec8e1f (diff) | |
download | tor-4d6af73db88e409764f43fc6cdaa432d667becf3.tar.gz tor-4d6af73db88e409764f43fc6cdaa432d667becf3.zip |
If configured, write per-port exit statistics to disk periodically.
[Original patch series from Karsten, revised and squashed by Nick]
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 091264a4ef..935ea523df 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2475,6 +2475,9 @@ typedef struct { * exit allows it, we use it. */ int AllowSingleHopCircuits; + /** If true, the user wants us to collect statistics on port usage. */ + int ExitPortStatistics; + /** If true, do not believe anybody who tells us that a domain resolves * to an internal address, or that an internal address has a PTR mapping. * Helps avoid some cross-site attacks. */ @@ -3961,6 +3964,17 @@ 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); +#ifdef ENABLE_EXIT_STATS +void rep_hist_note_exit_bytes_read(uint16_t port, size_t num_bytes, + time_t now); +void rep_hist_note_exit_bytes_written(uint16_t port, size_t num_bytes, + time_t now); +void rep_hist_note_exit_stream_opened(uint16_t port, time_t now); +#else +#define rep_hist_note_exit_bytes_read(p,n,t) STMT_NIL +#define rep_hist_note_exit_bytes_written(p,n,t) STMT_NIL +#define rep_hist_note_exit_stream_opened(p,t) STMT_NIL +#endif int rep_hist_bandwidth_assess(void); char *rep_hist_get_bandwidth_lines(int for_extrainfo); void rep_hist_update_state(or_state_t *state); |