From 14e83e626be84c4f311b8e8f0d80ca141675fa9e Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Tue, 2 Dec 2014 12:20:35 +0000 Subject: Add two hidden-service related statistics. The two statistics are: 1. number of RELAY cells observed on successfully established rendezvous circuits; and 2. number of .onion addresses observed as hidden-service directory. Both statistics are accumulated over 24 hours, obfuscated by rounding up to the next multiple of a given number and adding random noise, and written to local file stats/hidserv-stats. Notably, no statistics will be gathered on clients or services, but only on relays. --- src/or/rendmid.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/or/rendmid.c') diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 6a701e7a77..1c56471b8c 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -281,6 +281,7 @@ int rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, size_t request_len) { + const or_options_t *options = get_options(); or_circuit_t *rend_circ; char hexid[9]; int reason = END_CIRC_REASON_INTERNAL; @@ -316,6 +317,12 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, goto err; } + /* Statistics: Mark this circuit as an RP circuit so that we collect + stats from it. */ + if (options->HiddenServiceStatistics) { + circ->circuit_carries_hs_traffic_stats = 1; + } + /* Send the RENDEZVOUS2 cell to Alice. */ if (relay_send_command_from_edge(0, TO_CIRCUIT(rend_circ), RELAY_COMMAND_RENDEZVOUS2, -- cgit v1.2.3-54-g00ecf