* E' = E + (1-F)*B, if N has the exit flag
*
* In this block of code, we prepare the bandwidth values by setting
- * the default_bandwidth to F*B and guardfraction_bandwidth to (1-F)*B. */
+ * the default_bandwidth to F*B and guardfraction_bandwidth to (1-F)*B.
+ */
if (rs->has_guardfraction) {
guardfraction_bandwidth_t guardfraction_bw;
}
/* Now calculate the total bandwidth weights with or without
- guardfraction. Depending on the flags of the relay, add its
- bandwidth to the appropriate weight pool. If it's a guard and
- guardfraction is enabled, add its bandwidth to both pools as
- indicated by the previous comment. */
+ * guardfraction. Depending on the flags of the relay, add its
+ * bandwidth to the appropriate weight pool. If it's a guard and
+ * guardfraction is enabled, add its bandwidth to both pools as
+ * indicated by the previous comment.
+ */
*T += default_bandwidth;
if (is_exit && is_guard) {
double pathbias_get_use_success_count(entry_guard_t *guard);
/** Contains the bandwidth of a relay as a guard and as a non-guard
- * after the guardfraction has been considered. */
+ * after the guardfraction has been considered. */
typedef struct guardfraction_bandwidth_t {
- /* Bandwidth as a guard after guardfraction has been considered. */
+ /** Bandwidth as a guard after guardfraction has been considered. */
int guard_bw;
- /* Bandwidth as a non-guard after guardfraction has been considered. */
+ /** Bandwidth as a non-guard after guardfraction has been considered. */
int non_guard_bw;
} guardfraction_bandwidth_t;
}
guardfraction = (uint32_t)tor_parse_ulong(end_of_header+1,
- 10, 0, 100, &ok, NULL);
+ 10, 0, 100, &ok, NULL);
if (!ok) {
log_warn(LD_DIR, "Invalid GuardFraction %s", escaped(guardfraction_str));
return -1;
#include "test.h"
#include "test_helpers.h"
-/* Generate a vote_routerstatus_t for a router with identity digest
- <b>digest_in_hex</b>. */
+/** Generate a vote_routerstatus_t for a router with identity digest
+ * <b>digest_in_hex</b>. */
static vote_routerstatus_t *
gen_vote_routerstatus_for_tests(const char *digest_in_hex, int is_guard)
{
tor_free(guardfraction_bad);
}
-/* Make sure that our test guardfraction file gets parsed properly, and
+/** Make sure that our test guardfraction file gets parsed properly, and
* its information are applied properly to our routerstatuses. */
static void
test_parse_guardfraction_file_good(void *arg)
}
/** Parse the GuardFraction element of the consensus, and make sure it
- * gets parsed correctly. */
+ * gets parsed correctly. */
static void
test_parse_guardfraction_consensus(void *arg)
{
;
}
-/* Make sure that we use GuardFraction information when we should,
- according to the torrc option and consensus parameter. */
+/** Make sure that we use GuardFraction information when we should,
+ * according to the torrc option and consensus parameter. */
static void
test_should_apply_guardfraction(void *arg)
{