summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2013-05-24 12:29:42 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2013-05-25 19:51:38 +0200
commit26b49f525d5b2a4781755d72738491c016dd15a9 (patch)
tree98fbbb6fe3b79612e2c0adc2a44c5b83480a0720 /src/or/config.c
parent2f893624abb65a0df4f0f8ca6fbbe0c00fbf216a (diff)
downloadtor-26b49f525d5b2a4781755d72738491c016dd15a9.tar.gz
tor-26b49f525d5b2a4781755d72738491c016dd15a9.zip
Tweak CELL_STATS event based on comments by nickm.
- Move cell_command_to_string from control.c to command.c. - Use accessor for global_circuitlist instead of extern. - Add a struct for cell statistics by command instead of six arrays. - Split up control_event_circuit_cell_stats by using two helper functions. - Add TestingEnableCellStatsEvent option. - Prepare functions for testing. - Rename a few variables and document a few things better.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index e7060a5dc4..7a17a9f1f8 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -219,6 +219,7 @@ static config_var_t option_vars_[] = {
V(DNSListenAddress, LINELIST, NULL),
V(DownloadExtraInfo, BOOL, "0"),
V(TestingEnableConnBwEvent, BOOL, "0"),
+ V(TestingEnableCellStatsEvent, BOOL, "0"),
V(EnforceDistinctSubnets, BOOL, "1"),
V(EntryNodes, ROUTERSET, NULL),
V(EntryStatistics, BOOL, "0"),
@@ -463,6 +464,7 @@ static const config_var_t testing_tor_network_defaults[] = {
V(TestingEstimatedDescriptorPropagationTime, INTERVAL, "0 minutes"),
V(MinUptimeHidServDirectoryV2, INTERVAL, "0 minutes"),
V(TestingEnableConnBwEvent, BOOL, "1"),
+ V(TestingEnableCellStatsEvent, BOOL, "1"),
VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "1"),
{ NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
@@ -3244,6 +3246,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
"Tor networks!");
}
+ if (options->TestingEnableCellStatsEvent &&
+ !options->TestingTorNetwork && !options->UsingTestNetworkDefaults_) {
+ REJECT("TestingEnableCellStatsEvent may only be changed in testing "
+ "Tor networks!");
+ }
+
if (options->TestingTorNetwork) {
log_warn(LD_CONFIG, "TestingTorNetwork is set. This will make your node "
"almost unusable in the public Tor network, and is "