aboutsummaryrefslogtreecommitdiff
path: root/src/or/reasons.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-04-12 18:12:49 -0400
committerNick Mathewson <nickm@torproject.org>2010-04-12 18:12:49 -0400
commit311aca5a3472cd318b72ca21d7a530182154e75c (patch)
treec31ca2855df8bf1d84a2d5a6fcf2cabdbf742b6c /src/or/reasons.c
parent8aec982f910f918785158038e5afafe55f869372 (diff)
downloadtor-311aca5a3472cd318b72ca21d7a530182154e75c.tar.gz
tor-311aca5a3472cd318b72ca21d7a530182154e75c.zip
Log bandwidth_weight_rule_t as a string, not an integer.
I'm adding this because I can never remember what stuff like 'rule 3' means. That's the one where if somebody goes limp or taps out, the fight is over, right?
Diffstat (limited to 'src/or/reasons.c')
-rw-r--r--src/or/reasons.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/reasons.c b/src/or/reasons.c
index 46483b2770..e1c64ebff3 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -372,3 +372,24 @@ socks5_response_code_to_string(uint8_t code)
}
}
+/** Return a string corresponding to a bandwidht_weight_rule_t */
+const char *
+bandwidth_weight_rule_to_string(bandwidth_weight_rule_t rule)
+{
+ switch (rule)
+ {
+ case NO_WEIGHTING:
+ return "no weighting";
+ case WEIGHT_FOR_EXIT:
+ return "weight as exit";
+ case WEIGHT_FOR_MID:
+ return "weight as middle node";
+ case WEIGHT_FOR_GUARD:
+ return "weight as guard";
+ case WEIGHT_FOR_DIR:
+ return "weight as directory";
+ default:
+ return "unknown rule";
+ }
+}
+