Commit 558e9899 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Document most undocumented variables.

svn:r17754
parent d7f55daf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1392,7 +1392,8 @@ ftime_definitely_after(time_t now, time_t when)
   * after when. */
  return (now + ftime_skew - ftime_slop) >= when;
}
/** Return true if we think that <b>now</b> is definitely before <b>when</b>. */
/** Return true if we think that <b>now</b> is definitely before <b>when</b>.
 */
int
ftime_definitely_before(time_t now, time_t when)
{
+7 −7
Original line number Diff line number Diff line
@@ -20,19 +20,19 @@ const char command_c_id[] =

#include "or.h"

/** Keep statistics about how many of each type of cell we've received. */
/** How many CELL_PADDING cells have we received, ever? */
uint64_t stats_n_padding_cells_processed = 0;
/* DOCDOC stats_n_create_cells_processed */
/** How many CELL_CREATE cells have we received, ever? */
uint64_t stats_n_create_cells_processed = 0;
/* DOCDOC stats_n_created_cells_processed */
/** How many CELL_CREATED cells have we received, ever? */
uint64_t stats_n_created_cells_processed = 0;
/* DOCDOC stats_n_relay_cells_processed */
/** How many CELL_RELAY cells have we received, ever? */
uint64_t stats_n_relay_cells_processed = 0;
/* DOCDOC stats_n_destroy_cells_processed */
/** How many CELL_DESTROY cells have we received, ever? */
uint64_t stats_n_destroy_cells_processed = 0;
/* DOCDOC stats_n_versions_cells_processed */
/** How many CELL_VERSIONS cells have we received, ever? */
uint64_t stats_n_versions_cells_processed = 0;
/* DOCDOC stats_n_netinfo_cells_processed */
/** How many CELL_NETINFO cells have we received, ever? */
uint64_t stats_n_netinfo_cells_processed = 0;

/* These are the main functions for processing cells */
+18 −14
Original line number Diff line number Diff line
@@ -54,8 +54,8 @@ typedef struct config_abbrev_t {
 * you can abbreviate <b>tok</b>s as <b>tok</b>". */
#define PLURAL(tok) { #tok, #tok "s", 0, 0 }

/* A list of command-line abbreviations. */
/* DOCDOC _option_abbrevs */
/** A list of abbreviations and aliases to map command-line options, obsolete
 * option names, or alternative option names, to their current values. */
static config_abbrev_t _option_abbrevs[] = {
  PLURAL(ExitNode),
  PLURAL(EntryNode),
@@ -92,8 +92,8 @@ static config_abbrev_t _option_abbrevs[] = {
  { "HashedControlPassword", "__HashedControlSessionPassword", 1, 0},
  { NULL, NULL, 0, 0},
};
/* A list of state-file abbreviations, for compatibility. */
/* DOCDOC _state_abbrevs */

/** A list of state-file "abbreviations," for compatibility. */
static config_abbrev_t _state_abbrevs[] = {
  { "AccountingBytesReadInterval", "AccountingBytesReadInInterval", 0, 0 },
  { "HelperNode", "EntryGuard", 0, 0 },
@@ -346,8 +346,8 @@ static config_var_t _option_vars[] = {
  { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
};

/* Keep defaults synchronous with man page and config value check. */
/* DOCDOC testing_tor_network_defaults */
/** Override default values with these if the user sets the TestingTorNetwork
 * option. */
static config_var_t testing_tor_network_defaults[] = {
  V(ServerDNSAllowBrokenConfig,  BOOL,  "1"),
  V(DirAllowPrivateAddresses,    BOOL,     "1"),
@@ -372,7 +372,8 @@ static config_var_t testing_tor_network_defaults[] = {
#define VAR(name,conftype,member,initvalue)                             \
  { name, CONFIG_TYPE_ ## conftype, STRUCT_OFFSET(or_state_t, member),  \
      initvalue }
/* DOCDOC _state_vars */

/** Array of "state" variables saved to the ~/.tor/state file. */
static config_var_t _state_vars[] = {
  V(AccountingBytesReadInInterval,    MEMUNIT,  NULL),
  V(AccountingBytesWrittenInInterval, MEMUNIT,  NULL),
@@ -412,7 +413,9 @@ typedef struct config_var_description_t {
  const char *description;
} config_var_description_t;

/* DOCDOC options_description */
/** Descriptions of the configuration options, to be displayed by online
 * option browsers */
/* XXXX022 did anybody want this? at all? If not, kill it.*/
static config_var_description_t options_description[] = {
  /* ==== general options */
  { "AvoidDiskWrites", "If non-zero, try to write to disk less frequently than"
@@ -584,7 +587,7 @@ static config_var_description_t options_description[] = {
  { NULL, NULL },
};

/* DOCDOC state_description */
/** Online description of state variables. */
static config_var_description_t state_description[] = {
  { "AccountingBytesReadInInterval",
    "How many bytes have we read in this accounting period?" },
@@ -814,13 +817,12 @@ set_options(or_options_t *new_val, char **msg)
  return 0;
}

/* DOCDOC tor_svn_revision */
extern const char tor_svn_revision[]; /* from tor_main.c */

/* DOCDOC _version */
/** The version of this Tor process, as parsed. */
static char *_version = NULL;

/** Return the current Tor version, possibly */
/** Return the current Tor version. */
const char *
get_version(void)
{
@@ -4617,7 +4619,8 @@ struct unit_table_t {
  uint64_t multiplier;
};

/* DOCDOC memory_units */
/** Table to map the names of memory units to the number of bytes they
 * contain. */
static struct unit_table_t memory_units[] = {
  { "",          1 },
  { "b",         1<< 0 },
@@ -4645,7 +4648,8 @@ static struct unit_table_t memory_units[] = {
  { NULL, 0 },
};

/* DOCDOC time_units */
/** Table to map the names of time units to the number of seconds they
 * contain. */
static struct unit_table_t time_units[] = {
  { "",         1 },
  { "second",   1 },
+13 −3
Original line number Diff line number Diff line
@@ -54,9 +54,13 @@ const char control_c_id[] =
 * list to find out.
 **/
typedef uint32_t event_mask_t;
/* DOCDOC global_event_mask1long */

/** An event mask of all the events that controller with the LONG_NAMES option
 * set is interested in receiving. */
static event_mask_t global_event_mask1long = 0;
/* DOCDOC global_event_mask1short */

/** An event mask of all the events that controller with the SHORT_NAMES option
 * set is interested in receiving. */
static event_mask_t global_event_mask1short = 0;

/** True iff we have disabled log messages from being sent to the controller */
@@ -66,7 +70,11 @@ static int disable_log_messages = 0;
 * <b>e</b>. */
#define EVENT_IS_INTERESTING(e) \
  ((global_event_mask1long|global_event_mask1short) & (1<<(e)))
/** Macro: true if any control connection with the LONG_NAMES option is
 * interested in events of type <b>e</b>. */
#define EVENT_IS_INTERESTING1L(e) (global_event_mask1long & (1<<(e)))
/** Macro: true if any control connection with the SHORT_NAMES option is
 * interested in events of type <b>e</b>. */
#define EVENT_IS_INTERESTING1S(e) (global_event_mask1short & (1<<(e)))

/** If we're using cookie-type authentication, how long should our cookies be?
@@ -76,7 +84,9 @@ static int disable_log_messages = 0;
/** If true, we've set authentication_cookie to a secret code and
 * stored it to disk. */
static int authentication_cookie_is_set = 0;
/* DOCDOC authentication_cookie */
/** If authentication_cookie_is_set, a secret cookie that we've stored to disk
 * and which we're using to authenticate controllers.  (If the controller can
 * read it off disk, it has permission to connect. */
static char authentication_cookie[AUTHENTICATION_COOKIE_LEN];

/** A sufficiently large size to record the last bootstrap phase string. */
+4 −4
Original line number Diff line number Diff line
@@ -3268,19 +3268,19 @@ dir_networkstatus_download_failed(smartlist_t *failed, int status_code)
  });
}

/* DOCDOC server_dl_schedule */
/** Schedule for when servers should download things in general. */
static const int server_dl_schedule[] = {
  0, 0, 0, 60, 60, 60*2, 60*5, 60*15, INT_MAX
};
/* DOCDOC client_dl_schedule */
/** Schedule for when clients should download things in general. */
static const int client_dl_schedule[] = {
  0, 0, 60, 60*5, 60*10, INT_MAX
};
/* DOCDOC server_consensus_dl_schedule */
/** Schedule for when servers should download consensuses. */
static const int server_consensus_dl_schedule[] = {
  0, 0, 60, 60*5, 60*10, 60*30, 60*30, 60*30, 60*30, 60*30, 60*60, 60*60*2
};
/* DOCDOC client_consensus_dl_schedule */
/** Schedule for when clients should download consensuses. */
static const int client_consensus_dl_schedule[] = {
  0, 0, 60, 60*5, 60*10, 60*30, 60*60, 60*60, 60*60, 60*60*3, 60*60*6, 60*60*12
};
Loading