tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

hs_stats.c (1074B)


      1 /* Copyright (c) 2016-2021, The Tor Project, Inc. */
      2 /* See LICENSE for licensing information */
      3 
      4 /**
      5 * \file hs_stats.c
      6 * \brief Keeps stats about the activity of our onion service(s).
      7 **/
      8 
      9 #include "core/or/or.h"
     10 #include "feature/hs/hs_stats.h"
     11 #include "feature/hs/hs_service.h"
     12 
     13 /** Number of v3 INTRODUCE2 cells received */
     14 static uint32_t n_introduce2_v3 = 0;
     15 /** Number of attempts to make a circuit to a rendezvous point */
     16 static uint32_t n_rendezvous_launches = 0;
     17 
     18 /** Note that we received another INTRODUCE2 cell. */
     19 void
     20 hs_stats_note_introduce2_cell(void)
     21 {
     22  n_introduce2_v3++;
     23 }
     24 
     25 /** Return the number of v3 INTRODUCE2 cells we have received. */
     26 uint32_t
     27 hs_stats_get_n_introduce2_v3_cells(void)
     28 {
     29  return n_introduce2_v3;
     30 }
     31 
     32 /** Note that we attempted to launch another circuit to a rendezvous point. */
     33 void
     34 hs_stats_note_service_rendezvous_launch(void)
     35 {
     36  n_rendezvous_launches++;
     37 }
     38 
     39 /** Return the number of rendezvous circuits we have attempted to launch. */
     40 uint32_t
     41 hs_stats_get_n_rendezvous_launches(void)
     42 {
     43  return n_rendezvous_launches;
     44 }