summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-02-16 20:39:37 +0000
committerNick Mathewson <nickm@torproject.org>2007-02-16 20:39:37 +0000
commitd2893398f6c98f4ad82f05c41fb9ca40c5020015 (patch)
tree1600a6f6ab31cff26dd6a3c4710a3fd1cd5e530f /src/or/dirserv.c
parenta3ec172e1ac0e1ae2b2a09c05edb4e7f2fef4a1e (diff)
downloadtor-d2893398f6c98f4ad82f05c41fb9ca40c5020015.tar.gz
tor-d2893398f6c98f4ad82f05c41fb9ca40c5020015.zip
r11832@catbus: nickm | 2007-02-16 15:31:59 -0500
Fix 35 remaining DOCDOC comments. Yowza. svn:r9596
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index e7ac7bccc2..2107f9e4ac 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -52,23 +52,24 @@ static void clear_cached_dir(cached_dir_t *d);
#define FP_REJECT 4 /**< We will not publish this router. */
#define FP_BADEXIT 8 /**< We'll tell clients not to use this as an exit. */
-/** DOCDOC */
+/** Encapsulate a nickname and an FP_* status; target of status_by_digest
+ * map. */
typedef struct router_status_t {
char nickname[MAX_NICKNAME_LEN+1];
uint32_t status;
} router_status_t;
/** List of nickname-\>identity fingerprint mappings for all the routers
- * that we name. Used to prevent router impersonation. DODDOC */
+ * that we name. Used to prevent router impersonation. */
typedef struct authdir_config_t {
strmap_t *fp_by_name; /* Map from lc nickname to fingerprint */
- digestmap_t *status_by_digest; /* Map from digest to FP_x mask */
+ digestmap_t *status_by_digest; /* Map from digest to router_status_t. */
} authdir_config_t;
/** Should be static; exposed for testing */
authdir_config_t *fingerprint_list = NULL;
-/** DOCDOC */
+/** Allocate and return a new, empty, authdir_config_t. */
static authdir_config_t *
authdir_config_new(void)
{
@@ -576,11 +577,12 @@ dirserv_add_descriptor(const char *desc, const char **msg)
}
}
-/** DOCDOC */
+/** Helper: return true iff the boolean values of <b>a</b> and <b>b</b> are
+ * different. */
static INLINE int
bool_neq(int a, int b)
{
- return (a && !b) || (!a && b);
+ return (a) ? !b : b;
}
/** Remove all descriptors whose nicknames or fingerprints no longer
@@ -1338,7 +1340,8 @@ dirserv_get_runningrouters(const char **rr, int compress)
/** For authoritative directories: the current (v2) network status */
static cached_dir_t *the_v2_networkstatus = NULL;
-/** DOCDOC */
+/** Return true iff our opinion of the routers has been stale for long
+ * enough that we should generate a new network status doc. */
static int
should_generate_v2_networkstatus(void)
{
@@ -1488,11 +1491,11 @@ dirserv_compute_performance_thresholds(routerlist_t *rl)
static cached_dir_t *
generate_v2_networkstatus(void)
{
-/** DOCDOC */
+/** Longest status flag name that we generate. */
#define LONGEST_STATUS_FLAG_NAME_LEN 9
-/** DOCDOC */
-#define N_STATUS_FLAGS 9
-/** DOCDOC */
+/** Maximum number of status flags we'll apply to one router. */
+#define N_STATUS_FLAGS 10
+/** Amount of space to allocate for each entry. (r line and s line.) */
#define RS_ENTRY_LEN \
( /* first line */ \
MAX_NICKNAME_LEN+BASE64_DIGEST_LEN*2+ISO_TIME_LEN+INET_NTOA_BUF_LEN+ \