diff options
Diffstat (limited to 'src/or/reasons.c')
-rw-r--r-- | src/or/reasons.c | 21 |
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"; + } +} + |