]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge commit 'karsten/entrystats-master'
authorNick Mathewson <nickm@torproject.org>
Tue, 7 Jul 2009 18:26:50 +0000 (14:26 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 7 Jul 2009 18:26:50 +0000 (14:26 -0400)
Conflicts:
ChangeLog
configure.in
src/or/config.c
src/or/or.h

1  2 
ChangeLog
configure.in
src/or/config.c
src/or/or.h

diff --cc ChangeLog
index 18ae52187a673bab670f6d6ff05000976962767d,a5f35fbeefdcbcf5b90ed6ca7bdd0a4143ea5e9f..c0a1a9e0cc9a1043fbe429f58c48242c7a719032
+++ b/ChangeLog
@@@ -21,10 -21,10 +21,14 @@@ Changes in version 0.2.2.1-alpha - 2009
        transferred bytes per port to disk every 24 hours.  To enable this,
        run configure with the --enable-exit-stats option, and set
        "ExitPortStatistics 1" in your torrc.
 +    - Relays write statistics on how long cells spend in their circuit
 +      queues to disk every 24 hours. To enable this, run configure with
 +      the --enable-buffer-stats option, and set "CellStatistics 1" in your
 +      torrc.
+     - Entry nodes can write statistics on the rough number and origins of
+       connecting clients to disk every 24 hours. To enable this, run
+       configure with the --enable-entry-stats option, and set
+       "EntryStatistics 1" in your torrc.
  
    o Minor bugfixes
      - Hidden service clients didn't use a cached service descriptor that
diff --cc configure.in
index 10b05aeffb9ecc2ef4c47357e309cddeb5f0cc2a,0f83207991f338d2ec25febb5dfd40fb937d6e1d..0f6ed8065743dbf0979de4cc7700887cc9740c91
@@@ -99,11 -99,11 +99,18 @@@ if test "$enable_geoip_stats" = "yes"; 
    AC_DEFINE(ENABLE_GEOIP_STATS, 1, [Defined if we try to collect per-country statistics])
  fi
  
 +AC_ARG_ENABLE(buffer-stats,
 +     AS_HELP_STRING(--enable-buffer-stats, enable code for relays to collect buffer statistics))
 +
 +if test "$enable_buffer_stats" = "yes"; then
 +  AC_DEFINE(ENABLE_BUFFER_STATS, 1, [Defined if we try to collect buffer statistics])
++fi
++
+ AC_ARG_ENABLE(entry-stats,
+      AS_HELP_STRING(--enable-entry-stats, enable code for entry guards to collect per-country statistics))
+ if test "$enable_entry_stats" = "yes"; then
+   AC_DEFINE(ENABLE_ENTRY_STATS, 1, [Defined if we try to collect per-country statistics])
  fi
  
  AC_ARG_ENABLE(gcc-warnings,
diff --cc src/or/config.c
index f7a5745262c44e52e66fa99685afc78e38f18a59,c9ef21bb8c0510c34890081d6f79418c56ffbc31..5137f747929abb6e5127fa02cd4942275e45ce00
@@@ -1396,16 -1396,25 +1397,37 @@@ options_act(or_options_t *old_options
      log_warn(LD_CONFIG, "ExitPortStatistics enabled, but Tor was built "
               "without port statistics support.");
  #endif
++
 +#ifdef ENABLE_BUFFER_STATS
 +  if (options->CellStatistics)
 +    log_notice(LD_CONFIG, "Configured to measure cell statistics. Look "
 +               "for the buffer-stats file that will first be written to "
 +               "the data directory in 24 hours from now.");
 +#else
 +  if (options->CellStatistics)
 +    log_warn(LD_CONFIG, "CellStatistics enabled, but Tor was built "
 +             "without cell statistics support.");
 +#endif
++
+ #ifdef ENABLE_ENTRY_STATS
+   if (options->EntryStatistics) {
+     if (should_record_bridge_info(options)) {
+       /* Don't allow measuring statistics on entry guards when configured
+        * as bridge. */
+       log_warn(LD_CONFIG, "Bridges cannot be configured to measure "
+                "additional GeoIP statistics as entry guards.");
+       return -1;
+     } else
+       log_notice(LD_CONFIG, "Configured to measure entry node "
+                  "statistics. Look for the entry-stats file that will "
+                  "first be written to the data directory in 24 hours "
+                  "from now.");
+   }
+ #else
+   if (options->EntryStatistics)
+     log_warn(LD_CONFIG, "EntryStatistics enabled, but Tor was built "
+              "without entry node statistics support.");
+ #endif
    /* Check if we need to parse and add the EntryNodes config option. */
    if (options->EntryNodes &&
        (!old_options ||
diff --cc src/or/or.h
index 2954b125bdb3c164bc61174485b94fd8b37b3bc3,65eac0e9e9b5d94b04eb9ed3fb2a1e47f6457098..f298d53c27342c1efa65fb1318d48e3b2cc09db5
@@@ -2495,9 -2478,9 +2495,12 @@@ typedef struct 
    /** If true, the user wants us to collect statistics on port usage. */
    int ExitPortStatistics;
  
 +  /** If true, the user wants us to collect cell statistics. */
 +  int CellStatistics;
 +
+   /** If true, the user wants us to collect statistics as entry node. */
+   int EntryStatistics;
    /** 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. */