aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c4
-rw-r--r--src/or/connection_or.c2
-rw-r--r--src/or/main.h6
-rw-r--r--src/or/ntmain.c10
-rw-r--r--src/or/or.h30
-rw-r--r--src/or/routerparse.h2
6 files changed, 46 insertions, 8 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 015dfb479f..28b1e795f9 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -458,7 +458,7 @@ circuit_build_times_rewind_history(circuit_build_times_t *cbt, int n)
* Add a new build time value <b>time</b> to the set of build times. Time
* units are milliseconds.
*
- * circuit_build_times <b>cbt</a> is a circular array, so loop around when
+ * circuit_build_times <b>cbt</b> is a circular array, so loop around when
* array is full.
*/
int
@@ -656,7 +656,7 @@ circuit_build_times_update_state(circuit_build_times_t *cbt,
/**
* Shuffle the build times array.
*
- * Stolen from http://en.wikipedia.org/wiki/Fisher\u2013Yates_shuffle
+ * Adapted from http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
*/
static void
circuit_build_times_shuffle_and_store_array(circuit_build_times_t *cbt,
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 01cc160158..266a73c7fa 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -507,7 +507,7 @@ connection_or_init_conn_from_address(or_connection_t *conn,
* Requires that both input connections are open; not is_bad_for_new_circs,
* and not impossibly non-canonical.
*
- * If </b>forgive_new_connections</b> is true, then we do not call
+ * If <b>forgive_new_connections</b> is true, then we do not call
* <b>a</b>better than <b>b</b> simply because b has no circuits,
* unless b is also relatively old.
*/
diff --git a/src/or/main.h b/src/or/main.h
index 49ed5fea55..ca3f641cef 100644
--- a/src/or/main.h
+++ b/src/or/main.h
@@ -27,10 +27,12 @@ smartlist_t *get_connection_array(void);
uint64_t get_bytes_read(void);
uint64_t get_bytes_written(void);
+/** Bitmask for events that we can turn on and off with
+ * connection_watch_events. */
typedef enum watchable_events {
/* Yes, it is intentional that these match Libevent's EV_READ and EV_WRITE */
- READ_EVENT=0x02,
- WRITE_EVENT=0x04
+ READ_EVENT=0x02, /**< We want to know when a connection is readable */
+ WRITE_EVENT=0x04 /**< We want to know when a connection is writable */
} watchable_events_t;
void connection_watch_events(connection_t *conn, watchable_events_t events);
int connection_is_reading(connection_t *conn);
diff --git a/src/or/ntmain.c b/src/or/ntmain.c
index 88537f3314..4eb487e976 100644
--- a/src/or/ntmain.c
+++ b/src/or/ntmain.c
@@ -54,6 +54,11 @@ static int nt_service_cmd_stop(void);
struct service_fns {
int loaded;
+ /** @{ */
+ /** Function pointers for Windows API functions related to service
+ * management. These are NULL, or they point to the . They're set by
+ * calling the LOAD macro below. */
+
BOOL (WINAPI *ChangeServiceConfig2A_fn)(
SC_HANDLE hService,
DWORD dwInfoLevel,
@@ -122,6 +127,7 @@ struct service_fns {
LPTSTR ReferencedDomainName,
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse);
+ /** @} */
} service_fns = { 0,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
@@ -144,6 +150,10 @@ nt_service_loadlibrary(void)
goto err;
}
+/* Helper macro: try to load a function named <b>f</b> from "library" into
+ * service_functions.<b>f</b>_fn. On failure, log an error message, and goto
+ * err.
+ */
#define LOAD(f) STMT_BEGIN \
if (!(fn = GetProcAddress(library, #f))) { \
log_err(LD_BUG, \
diff --git a/src/or/or.h b/src/or/or.h
index 553afbdb7b..6d06b85e98 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -860,9 +860,13 @@ typedef struct cell_t {
/** Parsed variable-length onion routing cell. */
typedef struct var_cell_t {
+ /** Type of the cell: CELL_VERSIONS, etc. */
uint8_t command;
+ /** Circuit thich received the cell */
circid_t circ_id;
- uint16_t payload_len; /**< The actual length of <b>payload</b>. */
+ /** Number of bytes actually stored in <b>payload</b> */
+ uint16_t payload_len;
+ /** Payload of this cell */
uint8_t payload[FLEXIBLE_ARRAY_MEMBER];
} var_cell_t;
@@ -1832,8 +1836,13 @@ typedef struct networkstatus_v2_t {
* sorted by identity_digest. */
} networkstatus_v2_t;
+/** Linked list of microdesc hash lines for a single router in a directory
+ * vote.
+ */
typedef struct vote_microdesc_hash_t {
+ /** Next element in the list, or NULL. */
struct vote_microdesc_hash_t *next;
+ /** The raw contents of the microdesc hash line, excluding the "m". */
char *microdesc_hash_line;
} vote_microdesc_hash_t;
@@ -1845,6 +1854,7 @@ typedef struct vote_routerstatus_t {
* networkstatus_t.known_flags. */
char *version; /**< The version that the authority says this router is
* running. */
+ /** The hash or hashes that the authority claims this microdesc has. */
vote_microdesc_hash_t *microdesc;
} vote_routerstatus_t;
@@ -3389,8 +3399,19 @@ typedef struct {
} fp_pair_t;
/********************************* dirserv.c ***************************/
+
+/** An enum to describe what format we're generating a routerstatus line in.
+ */
typedef enum {
- NS_V2, NS_V3_CONSENSUS, NS_V3_VOTE, NS_CONTROL_PORT,
+ /** For use in a v2 opinion */
+ NS_V2,
+ /** For use in a consensus networkstatus document (ns flavor) */
+ NS_V3_CONSENSUS,
+ /** For use in a vote networkstatus document */
+ NS_V3_VOTE,
+ /** For passing to the controlport in response to a GETINFO request */
+ NS_CONTROL_PORT,
+ /** For use in a consensus networkstatus document (microdesc flavor) */
NS_V3_CONSENSUS_MICRODESC
} routerstatus_format_type_t;
@@ -3407,9 +3428,14 @@ typedef struct measured_bw_line_t {
/** Describes the schedule by which votes should be generated. */
typedef struct vote_timing_t {
+ /** Length in seconds between one consensus becoming valid and the next
+ * becoming valid. */
int vote_interval;
+ /** For how many intervals is a consensus valid? */
int n_intervals_valid;
+ /** Time in seconds allowed to propagate votes */
int vote_delay;
+ /** Time in seconds allowed to propagate signatures */
int dist_delay;
} vote_timing_t;
diff --git a/src/or/routerparse.h b/src/or/routerparse.h
index bde7800b7d..3499f18c7c 100644
--- a/src/or/routerparse.h
+++ b/src/or/routerparse.h
@@ -5,7 +5,7 @@
/* See LICENSE for licensing information */
/**
- * \file routerpase.h
+ * \file routerparse.h
* \brief Header file for routerparse.c.
**/