aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-05-10 04:34:48 +0000
committerNick Mathewson <nickm@torproject.org>2004-05-10 04:34:48 +0000
commit81922a125ca17d6d46a378f9e7bf609d884524c2 (patch)
tree086e0919f6f039963320870bc74270dcd98e6ae6 /src/or/dirserv.c
parent397466a23d0ce16f007cffccc9bf812bd4a56ef5 (diff)
downloadtor-81922a125ca17d6d46a378f9e7bf609d884524c2.tar
tor-81922a125ca17d6d46a378f9e7bf609d884524c2.tar.gz
More doxygenation.
svn:r1832
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 9c4612aea..9959fe77b 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -7,7 +7,7 @@
/**
* \file dirserv.c
* \brief Directory server core implementation.
- *****/
+ **/
/** How old do we allow a router to get before removing it? (seconds) */
#define ROUTER_MAX_AGE (60*60*24)
@@ -30,13 +30,13 @@ typedef struct fingerprint_entry_t {
char *fingerprint;
} fingerprint_entry_t;
-/** List of nickname->identity fingerprint mappings for all the routers
+/** List of nickname-\>identity fingerprint mappings for all the routers
* that we recognize. Used to prevent Sybil attacks. */
static fingerprint_entry_t fingerprint_list[MAX_ROUTERS_IN_DIR];
static int n_fingerprints = 0;
-/** Add the fingerprint 'fp' for the nickname 'nickname' to the global
- * list of recognized identity key fingerprints.
+/** Add the fingerprint <b>fp</b> for the nickname <b>nickname</b> to
+ * the global list of recognized identity key fingerprints.
*/
void /* Should be static; exposed for testing */
add_fingerprint_to_dir(const char *nickname, const char *fp)
@@ -68,11 +68,11 @@ dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk)
return 0;
}
-/** Parse the nickname->fingerprint mappings stored in the file named
- * 'fname'. The file format is line-based, with each non-blank
+/** Parse the nickname-\>fingerprint mappings stored in the file named
+ * <b>fname</b>. The file format is line-based, with each non-blank
* holding one nickname, some space, and a fingerprint for that
* nickname. On success, replace the current fingerprint list with
- * the contents of 'fname' and return 0. On failure, leave the
+ * the contents of <b>fname</b> and return 0. On failure, leave the
* current fingerprint list untouched, and return -1. */
int
dirserv_parse_fingerprint_file(const char *fname)
@@ -130,7 +130,7 @@ dirserv_parse_fingerprint_file(const char *fname)
return -1;
}
-/** Check whether 'router' has a nickname/identity key combination that
+/** Check whether <b>router</b> has a nickname/identity key combination that
* we recognize from the fingerprint list. Return 1 if router's
* identity and nickname match, -1 if we recognize the nickname but
* the identity key is wrong, and 0 if the nickname is not known. */
@@ -167,7 +167,7 @@ dirserv_router_fingerprint_is_known(const routerinfo_t *router)
}
}
-/** Return true iff any router named 'nickname' is in the fingerprint
+/** Return true iff any router named <b>nickname</b> is in the fingerprint
* list. */
static int
router_nickname_is_approved(const char *nickname)
@@ -211,7 +211,7 @@ typedef struct descriptor_entry_t {
static descriptor_entry_t *descriptor_list[MAX_ROUTERS_IN_DIR];
static int n_descriptors = 0;
-/** Release the storage held by 'desc' */
+/** Release the storage held by <b>desc</b> */
static void free_descriptor_entry(descriptor_entry_t *desc)
{
tor_free(desc->descriptor);
@@ -368,7 +368,7 @@ directory_remove_unrecognized(void)
}
}
-/** Mark the directory as 'dirty' -- when we're next asked for a
+/** Mark the directory as <b>dirty</b> -- when we're next asked for a
* directory, we will rebuild it instead of reusing the most recently
* generated one.
*/
@@ -379,7 +379,7 @@ directory_set_dirty()
}
/** Load all descriptors from an earlier directory stored in the string
- * 'dir'.
+ * <b>dir</b>.
*/
int
dirserv_init_from_directory_string(const char *dir)
@@ -397,7 +397,7 @@ dirserv_init_from_directory_string(const char *dir)
return 0;
}
-/** Set *nicknames_out to a comma-separated list of all the ORs that we
+/** Set *<b>nicknames_out</b> to a comma-separated list of all the ORs that we
* believe are currently running (because we have open connections to
* them). Return 0 on success; -1 on error.
*/
@@ -462,9 +462,10 @@ dirserv_remove_old_servers(void)
}
}
-/** Dump all routers currently in the directory into the string <s>, using
- * at most <maxlen> characters, and signing the directory with <private_key>.
- * Return 0 on success, -1 on failure.
+/** Dump all routers currently in the directory into the string
+ * <b>s</b>, using at most <b>maxlen</b> characters, and signing the
+ * directory with <b>private_key</b>. Return 0 on success, -1 on
+ * failure.
*/
int
dirserv_dump_directory_to_string(char *s, unsigned int maxlen,
@@ -536,11 +537,12 @@ dirserv_dump_directory_to_string(char *s, unsigned int maxlen,
return -1;
}
-/** XXX */
+/** Most recently generated encoded signed directory. */
static char *the_directory = NULL;
static int the_directory_len = -1;
-/** XXX */
+/** Set *<b>directory</b> to the most recently generated encoded signed
+ * directory, generating a new one as necessary. */
size_t dirserv_get_directory(const char **directory)
{
char *new_directory;