Commit 81922a12 authored by Nick Mathewson's avatar Nick Mathewson 🥄
Browse files

More doxygenation.


svn:r1832
parent 397466a2
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
extern or_options_t options; /**< command-line and config-file options */ extern or_options_t options; /**< command-line and config-file options */
/** Array of strings to make conn->type human-readable */ /** Array of strings to make conn-\>type human-readable */
char *conn_type_to_string[] = { char *conn_type_to_string[] = {
"", /* 0 */ "", /* 0 */
"OP listener", /* 1 */ "OP listener", /* 1 */
...@@ -29,7 +29,7 @@ char *conn_type_to_string[] = { ...@@ -29,7 +29,7 @@ char *conn_type_to_string[] = {
"CPU worker", /* 11 */ "CPU worker", /* 11 */
}; };
/** Array of string arrays to make {conn->type,conn->state} human-readable */ /** Array of string arrays to make {conn-\>type,conn-\>state} human-readable */
char *conn_state_to_string[][_CONN_TYPE_MAX+1] = { char *conn_state_to_string[][_CONN_TYPE_MAX+1] = {
{ NULL }, /* no type associated with 0 */ { NULL }, /* no type associated with 0 */
{ NULL }, /* op listener, obsolete */ { NULL }, /* op listener, obsolete */
...@@ -82,7 +82,7 @@ static int connection_receiver_bucket_should_increase(connection_t *conn); ...@@ -82,7 +82,7 @@ static int connection_receiver_bucket_should_increase(connection_t *conn);
/** Allocate space for a new connection_t. This function just initializes /** Allocate space for a new connection_t. This function just initializes
* conn; you must call connection_add() to link it into the main array. * conn; you must call connection_add() to link it into the main array.
* *
* Set conn->type to 'type'. Set conn->s and conn->poll_index to * Set conn-\>type to <b>type</b>. Set conn-\>s and conn-\>poll_index to
* -1 to signify they are not yet assigned. * -1 to signify they are not yet assigned.
* *
* If conn is not a listener type, allocate buffers for it. If it's * If conn is not a listener type, allocate buffers for it. If it's
...@@ -357,7 +357,7 @@ int connection_create_listener(char *bindaddress, uint16_t bindport, int type) { ...@@ -357,7 +357,7 @@ int connection_create_listener(char *bindaddress, uint16_t bindport, int type) {
} }
/** The listener connection <b>conn</b> told poll() it wanted to read. /** The listener connection <b>conn</b> told poll() it wanted to read.
* Call accept() on conn->s, and add the new connection if necessary. * Call accept() on conn-\>s, and add the new connection if necessary.
*/ */
static int connection_handle_listener_read(connection_t *conn, int new_type) { static int connection_handle_listener_read(connection_t *conn, int new_type) {
int news; /* the new socket */ int news; /* the new socket */
...@@ -421,11 +421,11 @@ static int connection_init_accepted_conn(connection_t *conn) { ...@@ -421,11 +421,11 @@ static int connection_init_accepted_conn(connection_t *conn) {
/** Take conn, make a nonblocking socket; try to connect to /** Take conn, make a nonblocking socket; try to connect to
* addr:port (they arrive in *host order*). If fail, return -1. Else * addr:port (they arrive in *host order*). If fail, return -1. Else
* assign s to conn->s: if connected return 1, if eagain return 0. * assign s to conn->\s: if connected return 1, if EAGAIN return 0.
* *
* address is used to make the logs useful. * address is used to make the logs useful.
* *
* On success, add 'conn' to the list of polled connections. * On success, add conn to the list of polled connections.
*/ */
int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_t port) { int connection_connect(connection_t *conn, char *address, uint32_t addr, uint16_t port) {
int s; int s;
...@@ -522,7 +522,7 @@ int retry_all_connections(void) { ...@@ -522,7 +522,7 @@ int retry_all_connections(void) {
return 0; return 0;
} }
extern int global_read_bucket; /**< from main.c */ extern int global_read_bucket;
/** How many bytes at most can we read onto this connection? */ /** How many bytes at most can we read onto this connection? */
int connection_bucket_read_limit(connection_t *conn) { int connection_bucket_read_limit(connection_t *conn) {
...@@ -643,7 +643,7 @@ static int connection_receiver_bucket_should_increase(connection_t *conn) { ...@@ -643,7 +643,7 @@ static int connection_receiver_bucket_should_increase(connection_t *conn) {
return 1; return 1;
} }
/** Read bytes from conn->s and process them. /** Read bytes from conn->\s and process them.
* *
* This function gets called from conn_read() in main.c, either * This function gets called from conn_read() in main.c, either
* when poll() has declared that conn wants to read, or (for OR conns) * when poll() has declared that conn wants to read, or (for OR conns)
...@@ -687,7 +687,7 @@ int connection_handle_read(connection_t *conn) { ...@@ -687,7 +687,7 @@ int connection_handle_read(connection_t *conn) {
return 0; return 0;
} }
/** Pull in new bytes from conn->s onto conn->inbuf, either /** Pull in new bytes from conn-\>s onto conn-\>inbuf, either
* directly or via TLS. Reduce the token buckets by the number of * directly or via TLS. Reduce the token buckets by the number of
* bytes read. * bytes read.
* *
...@@ -745,7 +745,7 @@ int connection_fetch_from_buf(char *string, int len, connection_t *conn) { ...@@ -745,7 +745,7 @@ int connection_fetch_from_buf(char *string, int len, connection_t *conn) {
return fetch_from_buf(string, len, conn->inbuf); return fetch_from_buf(string, len, conn->inbuf);
} }
/** Return conn->outbuf_flushlen: how many bytes conn wants to flush /** Return conn-\>outbuf_flushlen: how many bytes conn wants to flush
* from its outbuf. */ * from its outbuf. */
int connection_wants_to_flush(connection_t *conn) { int connection_wants_to_flush(connection_t *conn) {
return conn->outbuf_flushlen; return conn->outbuf_flushlen;
...@@ -759,13 +759,13 @@ int connection_outbuf_too_full(connection_t *conn) { ...@@ -759,13 +759,13 @@ int connection_outbuf_too_full(connection_t *conn) {
return (conn->outbuf_flushlen > 10*CELL_PAYLOAD_SIZE); return (conn->outbuf_flushlen > 10*CELL_PAYLOAD_SIZE);
} }
/** Try to flush more bytes onto conn->s. /** Try to flush more bytes onto conn-\>s.
* *
* This function gets called either from conn_write() in main.c * This function gets called either from conn_write() in main.c
* when poll() has declared that conn wants to write, or below * when poll() has declared that conn wants to write, or below
* from connection_write_to_buf() when an entire TLS record is ready. * from connection_write_to_buf() when an entire TLS record is ready.
* *
* Update conn->timestamp_lastwritten to now, and call flush_buf * Update conn-\>timestamp_lastwritten to now, and call flush_buf
* or flush_buf_tls appropriately. If it succeeds and there no more * or flush_buf_tls appropriately. If it succeeds and there no more
* more bytes on conn->outbuf, then call connection_finished_flushing * more bytes on conn->outbuf, then call connection_finished_flushing
* on it too. * on it too.
...@@ -895,7 +895,7 @@ connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port) { ...@@ -895,7 +895,7 @@ connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port) {
/** Find a connection to the router described by addr and port, /** Find a connection to the router described by addr and port,
* or alternately any router with the same identity key. * or alternately any router with the same identity key.
* This connection *must* be in 'open' state. * This connection <em>must</em> be in an "open" state.
* If not, return NULL. * If not, return NULL.
*/ */
/* XXX this twin thing is busted, now that we're rotating onion /* XXX this twin thing is busted, now that we're rotating onion
...@@ -1013,7 +1013,7 @@ int connection_is_listener(connection_t *conn) { ...@@ -1013,7 +1013,7 @@ int connection_is_listener(connection_t *conn) {
return 0; return 0;
} }
/** Return 1 if <b>conn</b> is in state 'open' and is not marked /** Return 1 if <b>conn</b> is in state "open" and is not marked
* for close, else return 0. * for close, else return 0.
*/ */
int connection_state_is_open(connection_t *conn) { int connection_state_is_open(connection_t *conn) {
...@@ -1030,7 +1030,7 @@ int connection_state_is_open(connection_t *conn) { ...@@ -1030,7 +1030,7 @@ int connection_state_is_open(connection_t *conn) {
return 0; return 0;
} }
/** Write a 'destroy' cell with circ ID <b>circ_id</b> onto OR connection /** Write a destroy cell with circ ID <b>circ_id</b> onto OR connection
* <b>conn</b>. * <b>conn</b>.
* *
* Return 0. * Return 0.
...@@ -1049,7 +1049,7 @@ int connection_send_destroy(uint16_t circ_id, connection_t *conn) { ...@@ -1049,7 +1049,7 @@ int connection_send_destroy(uint16_t circ_id, connection_t *conn) {
return 0; return 0;
} }
/** Process new bytes that have arrived on conn->inbuf. /** Process new bytes that have arrived on conn-\>inbuf.
* *
* This function just passes conn to the connection-specific * This function just passes conn to the connection-specific
* connection_*_process_inbuf() function. * connection_*_process_inbuf() function.
...@@ -1076,7 +1076,7 @@ int connection_process_inbuf(connection_t *conn) { ...@@ -1076,7 +1076,7 @@ int connection_process_inbuf(connection_t *conn) {
} }
} }
/** We just finished flushing bytes from conn->outbuf, and there /** We just finished flushing bytes from conn-\>outbuf, and there
* are no more bytes remaining. * are no more bytes remaining.
* *
* This function just passes conn to the connection-specific * This function just passes conn to the connection-specific
......
...@@ -59,10 +59,10 @@ int connection_or_process_inbuf(connection_t *conn) { ...@@ -59,10 +59,10 @@ int connection_or_process_inbuf(connection_t *conn) {
/** Connection <b>conn</b> has finished writing and has no bytes left on /** Connection <b>conn</b> has finished writing and has no bytes left on
* its outbuf. * its outbuf.
* *
* If it's in state 'connecting', then take a look at the socket, and * If it's in state "connecting", then take a look at the socket, and
* begin the tls handshake if the connect succeeded. * begin the tls handshake if the connect succeeded.
* *
* Otherwise it's in state 'open': stop writing and return. * Otherwise it's in state "open": stop writing and return.
* *
* If <b>conn</b> is broken, mark it for close and return -1, else * If <b>conn</b> is broken, mark it for close and return -1, else
* return 0. * return 0.
......
...@@ -61,7 +61,7 @@ static void tag_pack(char *tag, uint32_t addr, uint16_t port, uint16_t circ_id) ...@@ -61,7 +61,7 @@ static void tag_pack(char *tag, uint32_t addr, uint16_t port, uint16_t circ_id)
*(uint16_t *)(tag+6) = circ_id; *(uint16_t *)(tag+6) = circ_id;
} }
/** Unpack 'tag' into addr, port, and circ_id. /** Unpack <b>tag</b> into addr, port, and circ_id.
*/ */
static void tag_unpack(const char *tag, uint32_t *addr, uint16_t *port, uint16_t *circ_id) { static void tag_unpack(const char *tag, uint32_t *addr, uint16_t *port, uint16_t *circ_id) {
struct in_addr in; struct in_addr in;
......
...@@ -27,14 +27,14 @@ char rend_fetch_url[] = "/rendezvous/"; ...@@ -27,14 +27,14 @@ char rend_fetch_url[] = "/rendezvous/";
/********* END VARIABLES ************/ /********* END VARIABLES ************/
/** Launch a new connection to the directory server 'router' to upload /** Launch a new connection to the directory server <b>router</b> to upload or
* or download a service or rendezvous descriptor. 'purpose' determines what * download a service or rendezvous descriptor. <b>purpose</b> determines what
* kind of directory connection we're launching, and must be one of * kind of directory connection we're launching, and must be one of
* DIR_PURPOSE_{FETCH|UPLOAD}_{DIR|RENDDESC}. * DIR_PURPOSE_{FETCH|UPLOAD}_{DIR|RENDDESC}.
* *
* When uploading, 'payload' and 'payload_len' determine the content * When uploading, <b>payload</b> and <b>payload_len</b> determine the content
* of the HTTP post. When fetching a rendezvous descriptor, 'payload' * of the HTTP post. When fetching a rendezvous descriptor, <b>payload</b>
* and 'payload_len' are the service ID we want to fetch. * and <b>payload_len</b> are the service ID we want to fetch.
*/ */
void directory_initiate_command(routerinfo_t *router, int purpose, void directory_initiate_command(routerinfo_t *router, int purpose,
const char *payload, int payload_len) { const char *payload, int payload_len) {
...@@ -118,8 +118,8 @@ void directory_initiate_command(routerinfo_t *router, int purpose, ...@@ -118,8 +118,8 @@ void directory_initiate_command(routerinfo_t *router, int purpose,
} }
} }
/** Queue an appropriate HTTP command on conn->outbuf. The args /** Queue an appropriate HTTP command on conn-\>outbuf. The args
* 'purpose', 'payload', and 'payload_len' are as in * <b>purpose</b>, <b>payload</b>, and <b>payload_len</b> are as in
* directory_initiate_command. * directory_initiate_command.
*/ */
static void directory_send_command(connection_t *conn, int purpose, static void directory_send_command(connection_t *conn, int purpose,
...@@ -164,8 +164,8 @@ static void directory_send_command(connection_t *conn, int purpose, ...@@ -164,8 +164,8 @@ static void directory_send_command(connection_t *conn, int purpose,
} }
} }
/** Parse an HTTP request string 'headers' of the form "%s %s HTTP/1..." /** Parse an HTTP request string <b>headers</b> of the form "\%s \%s HTTP/1..."
* If it's well-formed, point *url to the second %s, * If it's well-formed, point *<b>url</b> to the second \%s,
* null-terminate it (this modifies headers!) and return 0. * null-terminate it (this modifies headers!) and return 0.
* Otherwise, return -1. * Otherwise, return -1.
*/ */
...@@ -186,8 +186,9 @@ int parse_http_url(char *headers, char **url) { ...@@ -186,8 +186,9 @@ int parse_http_url(char *headers, char **url) {
return 0; return 0;
} }
/** Parse an HTTP response string 'headers' of the form "HTTP/1.%d %d%s\r\n...". /** Parse an HTTP response string <b>headers</b> of the form
* If it's well-formed, assign *code, point *message to the first * "HTTP/1.\%d \%d\%s\r\n...".
* If it's well-formed, assign *<b>code</b>, point *<b>message</b> to the first
* non-space character after code if there is one and message is non-NULL * non-space character after code if there is one and message is non-NULL
* (else leave it alone), and return 0. * (else leave it alone), and return 0.
* Otherwise, return -1. * Otherwise, return -1.
...@@ -211,8 +212,8 @@ int parse_http_response(char *headers, int *code, char **message) { ...@@ -211,8 +212,8 @@ int parse_http_response(char *headers, int *code, char **message) {
return 0; return 0;
} }
/** Read handler for directory connections. (That's connections *to* /** Read handler for directory connections. (That's connections <em>to</em>
* directory servers and connections *at* directory servers.) * directory servers and connections <em>at</em> directory servers.)
*/ */
int connection_dir_process_inbuf(connection_t *conn) { int connection_dir_process_inbuf(connection_t *conn) {
char *body; char *body;
...@@ -365,7 +366,7 @@ static char answer503[] = "HTTP/1.0 503 Directory unavailable\r\n\r\n"; ...@@ -365,7 +366,7 @@ static char answer503[] = "HTTP/1.0 503 Directory unavailable\r\n\r\n";
/** Helper function: called when a dirserver gets a complete HTTP GET /** Helper function: called when a dirserver gets a complete HTTP GET
* request. Look for a request for a directory or for a rendezvous * request. Look for a request for a directory or for a rendezvous
* service descriptor. On finding one, write a response into * service descriptor. On finding one, write a response into
* conn->outbuf. If the request is unrecognized, send a 404. * conn-\>outbuf. If the request is unrecognized, send a 404.
* Always return 0. */ * Always return 0. */
static int directory_handle_command_get(connection_t *conn, static int directory_handle_command_get(connection_t *conn,
char *headers, char *body, char *headers, char *body,
...@@ -431,7 +432,7 @@ static int directory_handle_command_get(connection_t *conn, ...@@ -431,7 +432,7 @@ static int directory_handle_command_get(connection_t *conn,
/** Helper function: called when a dirserver gets a complete HTTP POST /** Helper function: called when a dirserver gets a complete HTTP POST
* request. Look for an uploaded server descriptor or rendezvous * request. Look for an uploaded server descriptor or rendezvous
* service descriptor. On finding one, process it and write a * service descriptor. On finding one, process it and write a
* response into conn->outbuf. If the request is unrecognized, send a * response into conn-\>outbuf. If the request is unrecognized, send a
* 404. Always return 0. */ * 404. Always return 0. */
static int directory_handle_command_post(connection_t *conn, static int directory_handle_command_post(connection_t *conn,
char *headers, char *body, char *headers, char *body,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
/** /**
* \file dirserv.c * \file dirserv.c
* \brief Directory server core implementation. * \brief Directory server core implementation.
*****/ **/
/** How old do we allow a router to get before removing it? (seconds) */ /** How old do we allow a router to get before removing it? (seconds) */
#define ROUTER_MAX_AGE (60*60*24) #define ROUTER_MAX_AGE (60*60*24)
...@@ -30,13 +30,13 @@ typedef struct fingerprint_entry_t { ...@@ -30,13 +30,13 @@ typedef struct fingerprint_entry_t {
char *fingerprint; char *fingerprint;
} fingerprint_entry_t; } 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. */ * that we recognize. Used to prevent Sybil attacks. */
static fingerprint_entry_t fingerprint_list[MAX_ROUTERS_IN_DIR]; static fingerprint_entry_t fingerprint_list[MAX_ROUTERS_IN_DIR];
static int n_fingerprints = 0; static int n_fingerprints = 0;
/** Add the fingerprint 'fp' for the nickname 'nickname' to the global /** Add the fingerprint <b>fp</b> for the nickname <b>nickname</b> to
* list of recognized identity key fingerprints. * the global list of recognized identity key fingerprints.
*/ */
void /* Should be static; exposed for testing */ void /* Should be static; exposed for testing */
add_fingerprint_to_dir(const char *nickname, const char *fp) 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) ...@@ -68,11 +68,11 @@ dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk)
return 0; return 0;
} }
/** Parse the nickname->fingerprint mappings stored in the file named /** Parse the nickname-\>fingerprint mappings stored in the file named
* 'fname'. The file format is line-based, with each non-blank * <b>fname</b>. The file format is line-based, with each non-blank
* holding one nickname, some space, and a fingerprint for that * holding one nickname, some space, and a fingerprint for that
* nickname. On success, replace the current fingerprint list with * 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. */ * current fingerprint list untouched, and return -1. */
int int
dirserv_parse_fingerprint_file(const char *fname) dirserv_parse_fingerprint_file(const char *fname)
...@@ -130,7 +130,7 @@ dirserv_parse_fingerprint_file(const char *fname) ...@@ -130,7 +130,7 @@ dirserv_parse_fingerprint_file(const char *fname)
return -1; 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 * we recognize from the fingerprint list. Return 1 if router's
* identity and nickname match, -1 if we recognize the nickname but * identity and nickname match, -1 if we recognize the nickname but
* the identity key is wrong, and 0 if the nickname is not known. */ * 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) ...@@ -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. */ * list. */
static int static int
router_nickname_is_approved(const char *nickname) router_nickname_is_approved(const char *nickname)
...@@ -211,7 +211,7 @@ typedef struct descriptor_entry_t { ...@@ -211,7 +211,7 @@ typedef struct descriptor_entry_t {
static descriptor_entry_t *descriptor_list[MAX_ROUTERS_IN_DIR]; static descriptor_entry_t *descriptor_list[MAX_ROUTERS_IN_DIR];
static int n_descriptors = 0; 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) static void free_descriptor_entry(descriptor_entry_t *desc)
{ {
tor_free(desc->descriptor); tor_free(desc->descriptor);
...@@ -368,7 +368,7 @@ directory_remove_unrecognized(void) ...@@ -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 * directory, we will rebuild it instead of reusing the most recently
* generated one. * generated one.
*/ */
...@@ -379,7 +379,7 @@ directory_set_dirty() ...@@ -379,7 +379,7 @@ directory_set_dirty()
} }
/** Load all descriptors from an earlier directory stored in the string /** Load all descriptors from an earlier directory stored in the string
* 'dir'. * <b>dir</b>.
*/ */
int int
dirserv_init_from_directory_string(const char *dir) dirserv_init_from_directory_string(const char *dir)
...@@ -397,7 +397,7 @@ dirserv_init_from_directory_string(const char *dir) ...@@ -397,7 +397,7 @@ dirserv_init_from_directory_string(const char *dir)
return 0; 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 * believe are currently running (because we have open connections to
* them). Return 0 on success; -1 on error. * them). Return 0 on success; -1 on error.
*/ */
...@@ -462,9 +462,10 @@ dirserv_remove_old_servers(void) ...@@ -462,9 +462,10 @@ dirserv_remove_old_servers(void)
} }
} }
/** Dump all routers currently in the directory into the string <s>, using /** Dump all routers currently in the directory into the string
* at most <maxlen> characters, and signing the directory with <private_key>. * <b>s</b>, using at most <b>maxlen</b> characters, and signing the
* Return 0 on success, -1 on failure. * directory with <b>private_key</b>. Return 0 on success, -1 on
* failure.
*/ */
int int
dirserv_dump_directory_to_string(char *s, unsigned int maxlen, dirserv_dump_directory_to_string(char *s, unsigned int maxlen,
...@@ -536,11 +537,12 @@ 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; return -1;
} }
/** XXX */ /** Most recently generated encoded signed directory. */
static char *the_directory = NULL; static char *the_directory = NULL;
static int the_directory_len = -1; 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) size_t dirserv_get_directory(const char **directory)
{ {
char *new_directory; char *new_directory;
......
...@@ -99,7 +99,7 @@ void dns_init(void) { ...@@ -99,7 +99,7 @@ void dns_init(void) {
static struct cached_resolve *oldest_cached_resolve = NULL; static struct cached_resolve *oldest_cached_resolve = NULL;
static struct cached_resolve *newest_cached_resolve = NULL; static struct cached_resolve *newest_cached_resolve = NULL;
/** Remove every cached_resolve whose 'expire' time is before 'now' /** Remove every cached_resolve whose <b>expire</b> time is before <b>now</b>
* from the cache. */ * from the cache. */
static void purge_expired_resolves(uint32_t now) { static void purge_expired_resolves(uint32_t now) {
struct cached_resolve *resolve; struct cached_resolve *resolve;
...@@ -124,8 +124,8 @@ static void purge_expired_resolves(uint32_t now) { ...@@ -124,8 +124,8 @@ static void purge_expired_resolves(uint32_t now) {
} }
} }
/** See if we have a cache entry for 'exitconn->address'. if so, /** See if we have a cache entry for <b>exitconn</b>-\>address. if so,
* if resolve valid, put it into exitconn->addr and return 1. * if resolve valid, put it into <b>exitconn</b>-\>addr and return 1.
* If resolve failed, return -1. * If resolve failed, return -1.
* *
* Else, if seen before and pending, add conn to the pending list, * Else, if seen before and pending, add conn to the pending list,
...@@ -206,7 +206,7 @@ int dns_resolve(connection_t *exitconn) { ...@@ -206,7 +206,7 @@ int dns_resolve(connection_t *exitconn) {
} }
/** Find or spawn a dns worker process to handle resolving /** Find or spawn a dns worker process to handle resolving
* exitconn->address; tell that dns worker to begin resolving. * <b>exitconn</b>-\>address; tell that dns worker to begin resolving.
*/ */
static int assign_to_dnsworker(connection_t *exitconn) { static int assign_to_dnsworker(connection_t *exitconn) {
connection_t *dnsconn; connection_t *dnsconn;
...@@ -240,7 +240,7 @@ static int assign_to_dnsworker(connection_t *exitconn) { ...@@ -240,7 +240,7 @@ static int assign_to_dnsworker(connection_t *exitconn) {
return 0; return 0;
} }
/** Remove 'conn' from the list of connections waiting for conn->address. /** Remove <b>conn</b> from the list of connections waiting for conn-\>address.
*/ */
void connection_dns_remove(connection_t *conn) void connection_dns_remove(connection_t *conn)
{ {
...@@ -313,9 +313,9 @@ void assert_all_pending_dns_resolves_ok(void) { ...@@ -313,9 +313,9 @@ void assert_all_pending_dns_resolves_ok(void) {
} }
} }
/** Mark all connections waiting for 'address' for close. Then cancel /** Mark all connections waiting for <b>address</b> for close. Then cancel
* the resolve for 'address' itself, and remove any cached results for * the resolve for <b>address</b> itself, and remove any cached results for
* 'address' from the cache. * <b>address</b> from the cache.
*/ */
void dns_cancel_pending_resolve(char *address) { void dns_cancel_pending_resolve(char *address) {
struct pending_connection_t *pend; struct pending_connection_t *pend;
...@@ -351,7 +351,7 @@ void dns_cancel_pending_resolve(char *address) { ...@@ -351,7 +351,7 @@ void dns_cancel_pending_resolve(char *address) {
dns_purge_resolve(resolve); dns_purge_resolve(resolve);
} }
/** Remove 'resolve' from the cache. /** Remove <b>resolve</b> from the cache.
*/ */
static void dns_purge_resolve(struct cached_resolve *resolve) { static void dns_purge_resolve(struct cached_resolve *resolve) {
struct cached_resolve *tmp; struct cached_resolve *tmp;
...@@ -379,9 +379,10 @@ static void dns_purge_resolve(struct cached_resolve *resolve) { ...@@ -379,9 +379,10 @@ static void dns_purge_resolve(struct cached_resolve *resolve) {
/** Called on the OR side when a DNS worker tells us the outcome of a DNS /** Called on the OR side when a DNS worker tells us the outcome of a DNS
* resolve: tell all pending connections about the result of the lookup, and * resolve: tell all pending connections about the result of the lookup, and
* cache the value. ('address' is a NUL-terminated string containing the * cache the value. (<b>address</b> is a NUL-terminated string containing the
* address to look up; 'addr' is an IPv4 address in host order; 'outcome' is * address to look up; <b>addr</b> is an IPv4 address in host order;
* one of DNS_RESOLVE_{FAILED_TRANSIENT|FAILED_PERMANENT|SUCCEEDED}. * <b>outcome</b> is one of
* DNS_RESOLVE_{FAILED_TRANSIENT|FAILED_PERMANENT|SUCCEEDED}.
*/ */
static void dns_found_answer(char *address, uint32_t addr, char outcome) { static void dns_found_answer(char *address, uint32_t addr, char outcome) {
struct pending_connection_t *pend; struct pending_connection_t *pend;
...@@ -459,9 +460,9 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) { ...@@ -459,9 +460,9 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) {