mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-22 14:23:04 +01:00
Add DOCDOC entries for undocumented static and global variables.
svn:r17739
This commit is contained in:
parent
e5100bc6b5
commit
b68379b13b
21 changed files with 112 additions and 3 deletions
|
@ -41,12 +41,13 @@ SKIP_FILES = [ "OpenBSD_malloc_Linux.c",
|
||||||
"aes.h" ]
|
"aes.h" ]
|
||||||
|
|
||||||
# What names of things never need javadoc
|
# What names of things never need javadoc
|
||||||
SKIP_NAME_PATTERNS = [ r'^.*_c_id$' ]
|
SKIP_NAME_PATTERNS = [ r'^.*_c_id$',
|
||||||
|
r'^.*_H_ID$' ]
|
||||||
|
|
||||||
# Which types of things should get DOCDOC comments added if they are
|
# Which types of things should get DOCDOC comments added if they are
|
||||||
# missing documentation? Recognized types are in KINDS below.
|
# missing documentation? Recognized types are in KINDS below.
|
||||||
ADD_DOCDOCS_TO_TYPES = [ 'function', 'type', 'typedef' ]
|
#ADD_DOCDOCS_TO_TYPES = [ 'function', 'type', 'typedef' ]
|
||||||
# ADD_DOCDOCS_TO_TYPES += [ 'variable', 'define' ]
|
ADD_DOCDOCS_TO_TYPES = [ 'variable' ]
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# The rest of this should not need hacking.
|
# The rest of this should not need hacking.
|
||||||
|
|
|
@ -1829,7 +1829,9 @@ tor_get_thread_id(void)
|
||||||
return (unsigned long)GetCurrentThreadId();
|
return (unsigned long)GetCurrentThreadId();
|
||||||
}
|
}
|
||||||
#elif defined(USE_PTHREADS)
|
#elif defined(USE_PTHREADS)
|
||||||
|
/* DOCDOC attr_reentrant */
|
||||||
static pthread_mutexattr_t attr_reentrant;
|
static pthread_mutexattr_t attr_reentrant;
|
||||||
|
/* DOCDOC threads_initialized */
|
||||||
static int threads_initialized = 0;
|
static int threads_initialized = 0;
|
||||||
/** Initialize <b>mutex</b> so it can be locked. Every mutex must be set
|
/** Initialize <b>mutex</b> so it can be locked. Every mutex must be set
|
||||||
* up eith tor_mutex_init() or tor_mutex_new(); not both. */
|
* up eith tor_mutex_init() or tor_mutex_new(); not both. */
|
||||||
|
|
|
@ -104,6 +104,7 @@ static tor_mutex_t *log_mutex = NULL;
|
||||||
/** Linked list of logfile_t. */
|
/** Linked list of logfile_t. */
|
||||||
static logfile_t *logfiles = NULL;
|
static logfile_t *logfiles = NULL;
|
||||||
#ifdef HAVE_SYSLOG_H
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
/* DOCDOC syslog_count */
|
||||||
static int syslog_count = 0;
|
static int syslog_count = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -118,6 +119,7 @@ static int syslog_count = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* What's the lowest log level anybody cares about? */
|
/* What's the lowest log level anybody cares about? */
|
||||||
|
/* DOCDOC _log_global_min_severity */
|
||||||
int _log_global_min_severity = LOG_NOTICE;
|
int _log_global_min_severity = LOG_NOTICE;
|
||||||
|
|
||||||
static void delete_log(logfile_t *victim);
|
static void delete_log(logfile_t *victim);
|
||||||
|
|
|
@ -62,7 +62,9 @@ struct memarea_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_FREELIST_LEN 4
|
#define MAX_FREELIST_LEN 4
|
||||||
|
/* DOCDOC freelist_len */
|
||||||
int freelist_len=0;
|
int freelist_len=0;
|
||||||
|
/* DOCDOC freelist */
|
||||||
static memarea_chunk_t *freelist = NULL;
|
static memarea_chunk_t *freelist = NULL;
|
||||||
|
|
||||||
/** Helper: allocate a new memarea chunk of around <b>chunk_size</b> bytes. */
|
/** Helper: allocate a new memarea chunk of around <b>chunk_size</b> bytes. */
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define PRETTY_FUNCTION ""
|
#define PRETTY_FUNCTION ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* DOCDOC have_failed */
|
||||||
extern int have_failed;
|
extern int have_failed;
|
||||||
|
|
||||||
#define test_fail_msg(msg) \
|
#define test_fail_msg(msg) \
|
||||||
|
|
|
@ -1054,8 +1054,10 @@ tor_timegm(struct tm *tm)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* strftime is locale-specific, so we need to replace those parts */
|
/* strftime is locale-specific, so we need to replace those parts */
|
||||||
|
/* DOCDOC WEEKDAY_NAMES */
|
||||||
static const char *WEEKDAY_NAMES[] =
|
static const char *WEEKDAY_NAMES[] =
|
||||||
{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||||
|
/* DOCDOC MONTH_NAMES */
|
||||||
static const char *MONTH_NAMES[] =
|
static const char *MONTH_NAMES[] =
|
||||||
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||||
|
@ -1339,7 +1341,9 @@ update_approx_time(time_t now)
|
||||||
* have up to <b>ftime_slop</b> seconds of inaccuracy; IOW, our window of
|
* have up to <b>ftime_slop</b> seconds of inaccuracy; IOW, our window of
|
||||||
* estimate for the current time is now + ftime_skew +/- ftime_slop.
|
* estimate for the current time is now + ftime_skew +/- ftime_slop.
|
||||||
*/
|
*/
|
||||||
|
/* DOCDOC ftime_skew */
|
||||||
static int ftime_skew = 0;
|
static int ftime_skew = 0;
|
||||||
|
/* DOCDOC ftime_slop */
|
||||||
static int ftime_slop = 60;
|
static int ftime_slop = 60;
|
||||||
/** Set the largest amount of sloppiness we'll allow in fuzzy time
|
/** Set the largest amount of sloppiness we'll allow in fuzzy time
|
||||||
* comparisons. */
|
* comparisons. */
|
||||||
|
|
|
@ -22,11 +22,17 @@ const char command_c_id[] =
|
||||||
|
|
||||||
/** Keep statistics about how many of each type of cell we've received. */
|
/** Keep statistics about how many of each type of cell we've received. */
|
||||||
uint64_t stats_n_padding_cells_processed = 0;
|
uint64_t stats_n_padding_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_create_cells_processed */
|
||||||
uint64_t stats_n_create_cells_processed = 0;
|
uint64_t stats_n_create_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_created_cells_processed */
|
||||||
uint64_t stats_n_created_cells_processed = 0;
|
uint64_t stats_n_created_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_relay_cells_processed */
|
||||||
uint64_t stats_n_relay_cells_processed = 0;
|
uint64_t stats_n_relay_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_destroy_cells_processed */
|
||||||
uint64_t stats_n_destroy_cells_processed = 0;
|
uint64_t stats_n_destroy_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_versions_cells_processed */
|
||||||
uint64_t stats_n_versions_cells_processed = 0;
|
uint64_t stats_n_versions_cells_processed = 0;
|
||||||
|
/* DOCDOC stats_n_netinfo_cells_processed */
|
||||||
uint64_t stats_n_netinfo_cells_processed = 0;
|
uint64_t stats_n_netinfo_cells_processed = 0;
|
||||||
|
|
||||||
/* These are the main functions for processing cells */
|
/* These are the main functions for processing cells */
|
||||||
|
|
|
@ -55,6 +55,7 @@ typedef struct config_abbrev_t {
|
||||||
#define PLURAL(tok) { #tok, #tok "s", 0, 0 }
|
#define PLURAL(tok) { #tok, #tok "s", 0, 0 }
|
||||||
|
|
||||||
/* A list of command-line abbreviations. */
|
/* A list of command-line abbreviations. */
|
||||||
|
/* DOCDOC _option_abbrevs */
|
||||||
static config_abbrev_t _option_abbrevs[] = {
|
static config_abbrev_t _option_abbrevs[] = {
|
||||||
PLURAL(ExitNode),
|
PLURAL(ExitNode),
|
||||||
PLURAL(EntryNode),
|
PLURAL(EntryNode),
|
||||||
|
@ -92,6 +93,7 @@ static config_abbrev_t _option_abbrevs[] = {
|
||||||
{ NULL, NULL, 0, 0},
|
{ NULL, NULL, 0, 0},
|
||||||
};
|
};
|
||||||
/* A list of state-file abbreviations, for compatibility. */
|
/* A list of state-file abbreviations, for compatibility. */
|
||||||
|
/* DOCDOC _state_abbrevs */
|
||||||
static config_abbrev_t _state_abbrevs[] = {
|
static config_abbrev_t _state_abbrevs[] = {
|
||||||
{ "AccountingBytesReadInterval", "AccountingBytesReadInInterval", 0, 0 },
|
{ "AccountingBytesReadInterval", "AccountingBytesReadInInterval", 0, 0 },
|
||||||
{ "HelperNode", "EntryGuard", 0, 0 },
|
{ "HelperNode", "EntryGuard", 0, 0 },
|
||||||
|
@ -345,6 +347,7 @@ static config_var_t _option_vars[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Keep defaults synchronous with man page and config value check. */
|
/* Keep defaults synchronous with man page and config value check. */
|
||||||
|
/* DOCDOC testing_tor_network_defaults */
|
||||||
static config_var_t testing_tor_network_defaults[] = {
|
static config_var_t testing_tor_network_defaults[] = {
|
||||||
V(ServerDNSAllowBrokenConfig, BOOL, "1"),
|
V(ServerDNSAllowBrokenConfig, BOOL, "1"),
|
||||||
V(DirAllowPrivateAddresses, BOOL, "1"),
|
V(DirAllowPrivateAddresses, BOOL, "1"),
|
||||||
|
@ -369,6 +372,7 @@ static config_var_t testing_tor_network_defaults[] = {
|
||||||
#define VAR(name,conftype,member,initvalue) \
|
#define VAR(name,conftype,member,initvalue) \
|
||||||
{ name, CONFIG_TYPE_ ## conftype, STRUCT_OFFSET(or_state_t, member), \
|
{ name, CONFIG_TYPE_ ## conftype, STRUCT_OFFSET(or_state_t, member), \
|
||||||
initvalue }
|
initvalue }
|
||||||
|
/* DOCDOC _state_vars */
|
||||||
static config_var_t _state_vars[] = {
|
static config_var_t _state_vars[] = {
|
||||||
V(AccountingBytesReadInInterval, MEMUNIT, NULL),
|
V(AccountingBytesReadInInterval, MEMUNIT, NULL),
|
||||||
V(AccountingBytesWrittenInInterval, MEMUNIT, NULL),
|
V(AccountingBytesWrittenInInterval, MEMUNIT, NULL),
|
||||||
|
@ -408,6 +412,7 @@ typedef struct config_var_description_t {
|
||||||
const char *description;
|
const char *description;
|
||||||
} config_var_description_t;
|
} config_var_description_t;
|
||||||
|
|
||||||
|
/* DOCDOC options_description */
|
||||||
static config_var_description_t options_description[] = {
|
static config_var_description_t options_description[] = {
|
||||||
/* ==== general options */
|
/* ==== general options */
|
||||||
{ "AvoidDiskWrites", "If non-zero, try to write to disk less frequently than"
|
{ "AvoidDiskWrites", "If non-zero, try to write to disk less frequently than"
|
||||||
|
@ -579,6 +584,7 @@ static config_var_description_t options_description[] = {
|
||||||
{ NULL, NULL },
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* DOCDOC state_description */
|
||||||
static config_var_description_t state_description[] = {
|
static config_var_description_t state_description[] = {
|
||||||
{ "AccountingBytesReadInInterval",
|
{ "AccountingBytesReadInInterval",
|
||||||
"How many bytes have we read in this accounting period?" },
|
"How many bytes have we read in this accounting period?" },
|
||||||
|
@ -808,8 +814,10 @@ set_options(or_options_t *new_val, char **msg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC tor_svn_revision */
|
||||||
extern const char tor_svn_revision[]; /* from tor_main.c */
|
extern const char tor_svn_revision[]; /* from tor_main.c */
|
||||||
|
|
||||||
|
/* DOCDOC _version */
|
||||||
static char *_version = NULL;
|
static char *_version = NULL;
|
||||||
|
|
||||||
/** Return the current Tor version, possibly */
|
/** Return the current Tor version, possibly */
|
||||||
|
@ -4609,6 +4617,7 @@ struct unit_table_t {
|
||||||
uint64_t multiplier;
|
uint64_t multiplier;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* DOCDOC memory_units */
|
||||||
static struct unit_table_t memory_units[] = {
|
static struct unit_table_t memory_units[] = {
|
||||||
{ "", 1 },
|
{ "", 1 },
|
||||||
{ "b", 1<< 0 },
|
{ "b", 1<< 0 },
|
||||||
|
@ -4636,6 +4645,7 @@ static struct unit_table_t memory_units[] = {
|
||||||
{ NULL, 0 },
|
{ NULL, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* DOCDOC time_units */
|
||||||
static struct unit_table_t time_units[] = {
|
static struct unit_table_t time_units[] = {
|
||||||
{ "", 1 },
|
{ "", 1 },
|
||||||
{ "second", 1 },
|
{ "second", 1 },
|
||||||
|
|
|
@ -34,7 +34,9 @@ static int connection_process_inbuf(connection_t *conn, int package_partial);
|
||||||
static void client_check_address_changed(int sock);
|
static void client_check_address_changed(int sock);
|
||||||
static void set_constrained_socket_buffers(int sock, int size);
|
static void set_constrained_socket_buffers(int sock, int size);
|
||||||
|
|
||||||
|
/* DOCDOC last_interface_ip */
|
||||||
static uint32_t last_interface_ip = 0;
|
static uint32_t last_interface_ip = 0;
|
||||||
|
/* DOCDOC outgoing_addrs */
|
||||||
static smartlist_t *outgoing_addrs = NULL;
|
static smartlist_t *outgoing_addrs = NULL;
|
||||||
|
|
||||||
/**************************************************************/
|
/**************************************************************/
|
||||||
|
|
|
@ -54,7 +54,9 @@ const char control_c_id[] =
|
||||||
* list to find out.
|
* list to find out.
|
||||||
**/
|
**/
|
||||||
typedef uint32_t event_mask_t;
|
typedef uint32_t event_mask_t;
|
||||||
|
/* DOCDOC global_event_mask1long */
|
||||||
static event_mask_t global_event_mask1long = 0;
|
static event_mask_t global_event_mask1long = 0;
|
||||||
|
/* DOCDOC global_event_mask1short */
|
||||||
static event_mask_t global_event_mask1short = 0;
|
static event_mask_t global_event_mask1short = 0;
|
||||||
|
|
||||||
/** True iff we have disabled log messages from being sent to the controller */
|
/** True iff we have disabled log messages from being sent to the controller */
|
||||||
|
@ -74,6 +76,7 @@ static int disable_log_messages = 0;
|
||||||
/** If true, we've set authentication_cookie to a secret code and
|
/** If true, we've set authentication_cookie to a secret code and
|
||||||
* stored it to disk. */
|
* stored it to disk. */
|
||||||
static int authentication_cookie_is_set = 0;
|
static int authentication_cookie_is_set = 0;
|
||||||
|
/* DOCDOC authentication_cookie */
|
||||||
static char authentication_cookie[AUTHENTICATION_COOKIE_LEN];
|
static char authentication_cookie[AUTHENTICATION_COOKIE_LEN];
|
||||||
|
|
||||||
/** A sufficiently large size to record the last bootstrap phase string. */
|
/** A sufficiently large size to record the last bootstrap phase string. */
|
||||||
|
|
|
@ -3268,15 +3268,19 @@ dir_networkstatus_download_failed(smartlist_t *failed, int status_code)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC server_dl_schedule */
|
||||||
static const int server_dl_schedule[] = {
|
static const int server_dl_schedule[] = {
|
||||||
0, 0, 0, 60, 60, 60*2, 60*5, 60*15, INT_MAX
|
0, 0, 0, 60, 60, 60*2, 60*5, 60*15, INT_MAX
|
||||||
};
|
};
|
||||||
|
/* DOCDOC client_dl_schedule */
|
||||||
static const int client_dl_schedule[] = {
|
static const int client_dl_schedule[] = {
|
||||||
0, 0, 60, 60*5, 60*10, INT_MAX
|
0, 0, 60, 60*5, 60*10, INT_MAX
|
||||||
};
|
};
|
||||||
|
/* DOCDOC server_consensus_dl_schedule */
|
||||||
static const int server_consensus_dl_schedule[] = {
|
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
|
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 */
|
||||||
static const int client_consensus_dl_schedule[] = {
|
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
|
0, 0, 60, 60*5, 60*10, 60*30, 60*60, 60*60, 60*60, 60*60*3, 60*60*6, 60*60*12
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,9 @@ extern time_t time_of_process_start; /* from main.c */
|
||||||
|
|
||||||
/** Do we need to regenerate the directory when someone asks for it? */
|
/** Do we need to regenerate the directory when someone asks for it? */
|
||||||
static time_t the_directory_is_dirty = 1;
|
static time_t the_directory_is_dirty = 1;
|
||||||
|
/* DOCDOC runningrouters_is_dirty */
|
||||||
static time_t runningrouters_is_dirty = 1;
|
static time_t runningrouters_is_dirty = 1;
|
||||||
|
/* DOCDOC the_v2_networkstatus_is_dirty */
|
||||||
static time_t the_v2_networkstatus_is_dirty = 1;
|
static time_t the_v2_networkstatus_is_dirty = 1;
|
||||||
|
|
||||||
/** Most recently generated encoded signed v1 directory. (v1 auth dirservers
|
/** Most recently generated encoded signed v1 directory. (v1 auth dirservers
|
||||||
|
@ -1222,7 +1224,9 @@ directory_too_idle_to_fetch_descriptors(or_options_t *options, time_t now)
|
||||||
|
|
||||||
/* Used only by non-v1-auth dirservers: The v1 directory and
|
/* Used only by non-v1-auth dirservers: The v1 directory and
|
||||||
* runningrouters we'll serve when requested. */
|
* runningrouters we'll serve when requested. */
|
||||||
|
/* DOCDOC cached_directory */
|
||||||
static cached_dir_t *cached_directory = NULL;
|
static cached_dir_t *cached_directory = NULL;
|
||||||
|
/* DOCDOC cached_runningrouters */
|
||||||
static cached_dir_t cached_runningrouters = { NULL, NULL, 0, 0, 0, -1 };
|
static cached_dir_t cached_runningrouters = { NULL, NULL, 0, 0, 0, -1 };
|
||||||
|
|
||||||
/** Used for other dirservers' v2 network statuses. Map from hexdigest to
|
/** Used for other dirservers' v2 network statuses. Map from hexdigest to
|
||||||
|
@ -1637,15 +1641,25 @@ should_generate_v2_networkstatus(void)
|
||||||
* dirserv_compute_performance_thresholds, and used by
|
* dirserv_compute_performance_thresholds, and used by
|
||||||
* generate_v2_networkstatus */
|
* generate_v2_networkstatus */
|
||||||
/* XXXX stick these all in a struct. */
|
/* XXXX stick these all in a struct. */
|
||||||
|
/* DOCDOC stable_uptime */
|
||||||
static uint32_t stable_uptime = 0; /* start at a safe value */
|
static uint32_t stable_uptime = 0; /* start at a safe value */
|
||||||
|
/* DOCDOC stable_mtbf */
|
||||||
static double stable_mtbf = 0.0;
|
static double stable_mtbf = 0.0;
|
||||||
|
/* DOCDOC enough_mtbf_info */
|
||||||
static int enough_mtbf_info = 0;
|
static int enough_mtbf_info = 0;
|
||||||
|
/* DOCDOC guard_wfu */
|
||||||
static double guard_wfu = 0.0;
|
static double guard_wfu = 0.0;
|
||||||
|
/* DOCDOC guard_tk */
|
||||||
static long guard_tk = 0;
|
static long guard_tk = 0;
|
||||||
|
/* DOCDOC fast_bandwidth */
|
||||||
static uint32_t fast_bandwidth = 0;
|
static uint32_t fast_bandwidth = 0;
|
||||||
|
/* DOCDOC guard_bandwidth_including_exits */
|
||||||
static uint32_t guard_bandwidth_including_exits = 0;
|
static uint32_t guard_bandwidth_including_exits = 0;
|
||||||
|
/* DOCDOC guard_bandwidth_excluding_exits */
|
||||||
static uint32_t guard_bandwidth_excluding_exits = 0;
|
static uint32_t guard_bandwidth_excluding_exits = 0;
|
||||||
|
/* DOCDOC total_bandwidth */
|
||||||
static uint64_t total_bandwidth = 0;
|
static uint64_t total_bandwidth = 0;
|
||||||
|
/* DOCDOC total_exit_bandwidth */
|
||||||
static uint64_t total_exit_bandwidth = 0;
|
static uint64_t total_exit_bandwidth = 0;
|
||||||
|
|
||||||
/** Helper: estimate the uptime of a router given its stated uptime and the
|
/** Helper: estimate the uptime of a router given its stated uptime and the
|
||||||
|
|
|
@ -106,7 +106,9 @@ static time_unit_t cfg_unit = UNIT_MONTH;
|
||||||
/** How many days,hours,minutes into each unit does our accounting interval
|
/** How many days,hours,minutes into each unit does our accounting interval
|
||||||
* start? */
|
* start? */
|
||||||
static int cfg_start_day = 0;
|
static int cfg_start_day = 0;
|
||||||
|
/* DOCDOC cfg_start_hour */
|
||||||
static int cfg_start_hour = 0;
|
static int cfg_start_hour = 0;
|
||||||
|
/* DOCDOC cfg_start_min */
|
||||||
static int cfg_start_min = 0;
|
static int cfg_start_min = 0;
|
||||||
|
|
||||||
static void reset_accounting(time_t now);
|
static void reset_accounting(time_t now);
|
||||||
|
|
|
@ -54,6 +54,7 @@ static int stats_prev_global_write_bucket;
|
||||||
/* XXX we might want to keep stats about global_relayed_*_bucket too. Or not.*/
|
/* XXX we might want to keep stats about global_relayed_*_bucket too. Or not.*/
|
||||||
/** How many bytes have we read/written since we started the process? */
|
/** How many bytes have we read/written since we started the process? */
|
||||||
static uint64_t stats_n_bytes_read = 0;
|
static uint64_t stats_n_bytes_read = 0;
|
||||||
|
/* DOCDOC stats_n_bytes_written */
|
||||||
static uint64_t stats_n_bytes_written = 0;
|
static uint64_t stats_n_bytes_written = 0;
|
||||||
/** What time did this process start up? */
|
/** What time did this process start up? */
|
||||||
time_t time_of_process_start = 0;
|
time_t time_of_process_start = 0;
|
||||||
|
@ -1860,6 +1861,7 @@ tor_init(int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC lockfile */
|
||||||
static tor_lockfile_t *lockfile = NULL;
|
static tor_lockfile_t *lockfile = NULL;
|
||||||
|
|
||||||
/** Try to grab the lock file described in <b>options</b>, if we do not
|
/** Try to grab the lock file described in <b>options</b>, if we do not
|
||||||
|
|
|
@ -39,8 +39,11 @@ static networkstatus_t *current_consensus = NULL;
|
||||||
/** A v3 consensus networkstatus that we've received, but which we don't
|
/** A v3 consensus networkstatus that we've received, but which we don't
|
||||||
* have enough certificates to be happy about. */
|
* have enough certificates to be happy about. */
|
||||||
static networkstatus_t *consensus_waiting_for_certs = NULL;
|
static networkstatus_t *consensus_waiting_for_certs = NULL;
|
||||||
|
/* DOCDOC consensus_waiting_for_certs_body */
|
||||||
static char *consensus_waiting_for_certs_body = NULL;
|
static char *consensus_waiting_for_certs_body = NULL;
|
||||||
|
/* DOCDOC consensus_waiting_for_certs_set_at */
|
||||||
static time_t consensus_waiting_for_certs_set_at = 0;
|
static time_t consensus_waiting_for_certs_set_at = 0;
|
||||||
|
/* DOCDOC consensus_waiting_for_certs_dl_failed */
|
||||||
static int consensus_waiting_for_certs_dl_failed = 0;
|
static int consensus_waiting_for_certs_dl_failed = 0;
|
||||||
|
|
||||||
/** The last time we tried to download a networkstatus, or 0 for "never". We
|
/** The last time we tried to download a networkstatus, or 0 for "never". We
|
||||||
|
|
|
@ -1163,9 +1163,13 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
|
||||||
return 0; /* for forward compatibility, don't kill the circuit */
|
return 0; /* for forward compatibility, don't kill the circuit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC stats_n_data_cells_packaged */
|
||||||
uint64_t stats_n_data_cells_packaged = 0;
|
uint64_t stats_n_data_cells_packaged = 0;
|
||||||
|
/* DOCDOC stats_n_data_bytes_packaged */
|
||||||
uint64_t stats_n_data_bytes_packaged = 0;
|
uint64_t stats_n_data_bytes_packaged = 0;
|
||||||
|
/* DOCDOC stats_n_data_cells_received */
|
||||||
uint64_t stats_n_data_cells_received = 0;
|
uint64_t stats_n_data_cells_received = 0;
|
||||||
|
/* DOCDOC stats_n_data_bytes_received */
|
||||||
uint64_t stats_n_data_bytes_received = 0;
|
uint64_t stats_n_data_bytes_received = 0;
|
||||||
|
|
||||||
/** While conn->inbuf has an entire relay payload of bytes on it,
|
/** While conn->inbuf has an entire relay payload of bytes on it,
|
||||||
|
@ -1426,6 +1430,7 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint)
|
||||||
/** The total number of cells we have allocated from the memory pool. */
|
/** The total number of cells we have allocated from the memory pool. */
|
||||||
static int total_cells_allocated = 0;
|
static int total_cells_allocated = 0;
|
||||||
|
|
||||||
|
/* DOCDOC cell_pool */
|
||||||
static mp_pool_t *cell_pool = NULL;
|
static mp_pool_t *cell_pool = NULL;
|
||||||
|
|
||||||
/** Allocate structures to hold cells. */
|
/** Allocate structures to hold cells. */
|
||||||
|
|
|
@ -1263,7 +1263,9 @@ bw_array_new(void)
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC read_array */
|
||||||
static bw_array_t *read_array = NULL;
|
static bw_array_t *read_array = NULL;
|
||||||
|
/* DOCDOC write_array */
|
||||||
static bw_array_t *write_array = NULL;
|
static bw_array_t *write_array = NULL;
|
||||||
|
|
||||||
/** Set up read_array and write_array. */
|
/** Set up read_array and write_array. */
|
||||||
|
@ -1731,16 +1733,27 @@ rep_hist_circbuilding_dormant(time_t now)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC n_signed_dir_objs */
|
||||||
static uint32_t n_signed_dir_objs = 0;
|
static uint32_t n_signed_dir_objs = 0;
|
||||||
|
/* DOCDOC n_signed_routerdescs */
|
||||||
static uint32_t n_signed_routerdescs = 0;
|
static uint32_t n_signed_routerdescs = 0;
|
||||||
|
/* DOCDOC n_verified_dir_objs */
|
||||||
static uint32_t n_verified_dir_objs = 0;
|
static uint32_t n_verified_dir_objs = 0;
|
||||||
|
/* DOCDOC n_verified_routerdescs */
|
||||||
static uint32_t n_verified_routerdescs = 0;
|
static uint32_t n_verified_routerdescs = 0;
|
||||||
|
/* DOCDOC n_onionskins_encrypted */
|
||||||
static uint32_t n_onionskins_encrypted = 0;
|
static uint32_t n_onionskins_encrypted = 0;
|
||||||
|
/* DOCDOC n_onionskins_decrypted */
|
||||||
static uint32_t n_onionskins_decrypted = 0;
|
static uint32_t n_onionskins_decrypted = 0;
|
||||||
|
/* DOCDOC n_tls_client_handshakes */
|
||||||
static uint32_t n_tls_client_handshakes = 0;
|
static uint32_t n_tls_client_handshakes = 0;
|
||||||
|
/* DOCDOC n_tls_server_handshakes */
|
||||||
static uint32_t n_tls_server_handshakes = 0;
|
static uint32_t n_tls_server_handshakes = 0;
|
||||||
|
/* DOCDOC n_rend_client_ops */
|
||||||
static uint32_t n_rend_client_ops = 0;
|
static uint32_t n_rend_client_ops = 0;
|
||||||
|
/* DOCDOC n_rend_mid_ops */
|
||||||
static uint32_t n_rend_mid_ops = 0;
|
static uint32_t n_rend_mid_ops = 0;
|
||||||
|
/* DOCDOC n_rend_server_ops */
|
||||||
static uint32_t n_rend_server_ops = 0;
|
static uint32_t n_rend_server_ops = 0;
|
||||||
|
|
||||||
/** Increment the count of the number of times we've done <b>operation</b>. */
|
/** Increment the count of the number of times we've done <b>operation</b>. */
|
||||||
|
@ -1900,11 +1913,17 @@ typedef struct hs_usage_current_observation_period_t {
|
||||||
time_t start_of_next_period;
|
time_t start_of_next_period;
|
||||||
} hs_usage_current_observation_period_t;
|
} hs_usage_current_observation_period_t;
|
||||||
|
|
||||||
|
/* DOCDOC current_period */
|
||||||
static hs_usage_current_observation_period_t *current_period = NULL;
|
static hs_usage_current_observation_period_t *current_period = NULL;
|
||||||
|
/* DOCDOC publish_total */
|
||||||
static hs_usage_service_related_observation_t *publish_total = NULL;
|
static hs_usage_service_related_observation_t *publish_total = NULL;
|
||||||
|
/* DOCDOC publish_novel */
|
||||||
static hs_usage_service_related_observation_t *publish_novel = NULL;
|
static hs_usage_service_related_observation_t *publish_novel = NULL;
|
||||||
|
/* DOCDOC fetch_total */
|
||||||
static hs_usage_service_related_observation_t *fetch_total = NULL;
|
static hs_usage_service_related_observation_t *fetch_total = NULL;
|
||||||
|
/* DOCDOC fetch_successful */
|
||||||
static hs_usage_service_related_observation_t *fetch_successful = NULL;
|
static hs_usage_service_related_observation_t *fetch_successful = NULL;
|
||||||
|
/* DOCDOC descs */
|
||||||
static hs_usage_general_period_related_observations_t *descs = NULL;
|
static hs_usage_general_period_related_observations_t *descs = NULL;
|
||||||
|
|
||||||
/** Creates an empty ordered list element. */
|
/** Creates an empty ordered list element. */
|
||||||
|
|
|
@ -45,7 +45,9 @@ static crypto_pk_env_t *authority_signing_key = NULL;
|
||||||
* authorities. */
|
* authorities. */
|
||||||
static authority_cert_t *authority_key_certificate = NULL;
|
static authority_cert_t *authority_key_certificate = NULL;
|
||||||
|
|
||||||
|
/* DOCDOC legacy_signing_key */
|
||||||
static crypto_pk_env_t *legacy_signing_key = NULL;
|
static crypto_pk_env_t *legacy_signing_key = NULL;
|
||||||
|
/* DOCDOC legacy_key_certificate */
|
||||||
static authority_cert_t *legacy_key_certificate = NULL;
|
static authority_cert_t *legacy_key_certificate = NULL;
|
||||||
|
|
||||||
/* (Note that v3 authorities also have a separate "authority identity key",
|
/* (Note that v3 authorities also have a separate "authority identity key",
|
||||||
|
@ -1604,6 +1606,7 @@ router_guess_address_from_dir_headers(uint32_t *guess)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC tor_svn_revision */
|
||||||
extern const char tor_svn_revision[]; /* from main.c */
|
extern const char tor_svn_revision[]; /* from main.c */
|
||||||
|
|
||||||
/** Set <b>platform</b> (max length <b>len</b>) to a NUL-terminated short
|
/** Set <b>platform</b> (max length <b>len</b>) to a NUL-terminated short
|
||||||
|
|
|
@ -333,6 +333,7 @@ static token_rule_t dir_token_table[] = {
|
||||||
NO_ARGS, NEED_OBJ), \
|
NO_ARGS, NEED_OBJ), \
|
||||||
T01("dir-address", K_DIR_ADDRESS, GE(1), NO_OBJ),
|
T01("dir-address", K_DIR_ADDRESS, GE(1), NO_OBJ),
|
||||||
|
|
||||||
|
/* DOCDOC dir_key_certificate_table */
|
||||||
static token_rule_t dir_key_certificate_table[] = {
|
static token_rule_t dir_key_certificate_table[] = {
|
||||||
CERTIFICATE_MEMBERS
|
CERTIFICATE_MEMBERS
|
||||||
T1("fingerprint", K_FINGERPRINT, CONCAT_ARGS, NO_OBJ ),
|
T1("fingerprint", K_FINGERPRINT, CONCAT_ARGS, NO_OBJ ),
|
||||||
|
@ -373,6 +374,7 @@ static token_rule_t client_keys_token_table[] = {
|
||||||
END_OF_TABLE
|
END_OF_TABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* DOCDOC networkstatus_token_table */
|
||||||
static token_rule_t networkstatus_token_table[] = {
|
static token_rule_t networkstatus_token_table[] = {
|
||||||
T1("network-status-version", K_NETWORK_STATUS_VERSION,
|
T1("network-status-version", K_NETWORK_STATUS_VERSION,
|
||||||
GE(1), NO_OBJ ),
|
GE(1), NO_OBJ ),
|
||||||
|
@ -398,6 +400,7 @@ static token_rule_t networkstatus_token_table[] = {
|
||||||
|
|
||||||
END_OF_TABLE
|
END_OF_TABLE
|
||||||
};
|
};
|
||||||
|
/* DOCDOC networkstatus_consensus_token_table */
|
||||||
static token_rule_t networkstatus_consensus_token_table[] = {
|
static token_rule_t networkstatus_consensus_token_table[] = {
|
||||||
T1("network-status-version", K_NETWORK_STATUS_VERSION,
|
T1("network-status-version", K_NETWORK_STATUS_VERSION,
|
||||||
GE(1), NO_OBJ ),
|
GE(1), NO_OBJ ),
|
||||||
|
@ -429,6 +432,7 @@ static token_rule_t networkstatus_vote_footer_token_table[] = {
|
||||||
END_OF_TABLE
|
END_OF_TABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* DOCDOC networkstatus_detached_signature_token_table */
|
||||||
static token_rule_t networkstatus_detached_signature_token_table[] = {
|
static token_rule_t networkstatus_detached_signature_token_table[] = {
|
||||||
T1_START("consensus-digest", K_CONSENSUS_DIGEST, GE(1), NO_OBJ ),
|
T1_START("consensus-digest", K_CONSENSUS_DIGEST, GE(1), NO_OBJ ),
|
||||||
T1("valid-after", K_VALID_AFTER, CONCAT_ARGS, NO_OBJ ),
|
T1("valid-after", K_VALID_AFTER, CONCAT_ARGS, NO_OBJ ),
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
const char test_c_id[] =
|
const char test_c_id[] =
|
||||||
"$Id$";
|
"$Id$";
|
||||||
|
|
||||||
|
/* DOCDOC tor_svn_revision */
|
||||||
const char tor_svn_revision[] = "";
|
const char tor_svn_revision[] = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,8 +51,10 @@ const char tor_svn_revision[] = "";
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* DOCDOC have_failed */
|
||||||
int have_failed = 0;
|
int have_failed = 0;
|
||||||
|
|
||||||
|
/* DOCDOC temp_dir */
|
||||||
static char temp_dir[256];
|
static char temp_dir[256];
|
||||||
|
|
||||||
/** Select and create the temporary directory we'll use to run our unit tests.
|
/** Select and create the temporary directory we'll use to run our unit tests.
|
||||||
|
@ -2257,17 +2260,25 @@ test_util_digestset(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stop threads running at once. */
|
/* stop threads running at once. */
|
||||||
|
/* DOCDOC _thread_test_mutex */
|
||||||
static tor_mutex_t *_thread_test_mutex = NULL;
|
static tor_mutex_t *_thread_test_mutex = NULL;
|
||||||
/* make sure that threads have to run at the same time. */
|
/* make sure that threads have to run at the same time. */
|
||||||
|
/* DOCDOC _thread_test_start1 */
|
||||||
static tor_mutex_t *_thread_test_start1 = NULL;
|
static tor_mutex_t *_thread_test_start1 = NULL;
|
||||||
|
/* DOCDOC _thread_test_start2 */
|
||||||
static tor_mutex_t *_thread_test_start2 = NULL;
|
static tor_mutex_t *_thread_test_start2 = NULL;
|
||||||
|
/* DOCDOC _thread_test_strmap */
|
||||||
static strmap_t *_thread_test_strmap = NULL;
|
static strmap_t *_thread_test_strmap = NULL;
|
||||||
|
/* DOCDOC _thread1_name */
|
||||||
static char *_thread1_name = NULL;
|
static char *_thread1_name = NULL;
|
||||||
|
/* DOCDOC _thread2_name */
|
||||||
static char *_thread2_name = NULL;
|
static char *_thread2_name = NULL;
|
||||||
|
|
||||||
static void _thread_test_func(void* _s) ATTR_NORETURN;
|
static void _thread_test_func(void* _s) ATTR_NORETURN;
|
||||||
|
|
||||||
|
/* DOCDOC t1_count */
|
||||||
static int t1_count = 0;
|
static int t1_count = 0;
|
||||||
|
/* DOCDOC t2_count */
|
||||||
static int t2_count = 0;
|
static int t2_count = 0;
|
||||||
|
|
||||||
/** Helper function for threading unit tests: This function runs in a
|
/** Helper function for threading unit tests: This function runs in a
|
||||||
|
@ -2788,6 +2799,7 @@ test_onion_handshake(void)
|
||||||
crypto_free_pk_env(pk);
|
crypto_free_pk_env(pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC fingerprint_list */
|
||||||
extern smartlist_t *fingerprint_list;
|
extern smartlist_t *fingerprint_list;
|
||||||
|
|
||||||
/** Run unit tests for router descriptor generation logic. */
|
/** Run unit tests for router descriptor generation logic. */
|
||||||
|
@ -3140,11 +3152,17 @@ test_dirutil(void)
|
||||||
smartlist_free(sl);
|
smartlist_free(sl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DOCDOC AUTHORITY_CERT_1 */
|
||||||
extern const char AUTHORITY_CERT_1[];
|
extern const char AUTHORITY_CERT_1[];
|
||||||
|
/* DOCDOC AUTHORITY_SIGNKEY_1 */
|
||||||
extern const char AUTHORITY_SIGNKEY_1[];
|
extern const char AUTHORITY_SIGNKEY_1[];
|
||||||
|
/* DOCDOC AUTHORITY_CERT_2 */
|
||||||
extern const char AUTHORITY_CERT_2[];
|
extern const char AUTHORITY_CERT_2[];
|
||||||
|
/* DOCDOC AUTHORITY_SIGNKEY_2 */
|
||||||
extern const char AUTHORITY_SIGNKEY_2[];
|
extern const char AUTHORITY_SIGNKEY_2[];
|
||||||
|
/* DOCDOC AUTHORITY_CERT_3 */
|
||||||
extern const char AUTHORITY_CERT_3[];
|
extern const char AUTHORITY_CERT_3[];
|
||||||
|
/* DOCDOC AUTHORITY_SIGNKEY_3 */
|
||||||
extern const char AUTHORITY_SIGNKEY_3[];
|
extern const char AUTHORITY_SIGNKEY_3[];
|
||||||
|
|
||||||
/** Helper: Test that two networkstatus_voter_info_t do in fact represent the
|
/** Helper: Test that two networkstatus_voter_info_t do in fact represent the
|
||||||
|
@ -4597,6 +4615,7 @@ static struct {
|
||||||
int is_subent;
|
int is_subent;
|
||||||
int selected;
|
int selected;
|
||||||
int is_default;
|
int is_default;
|
||||||
|
/* DOCDOC test_array */
|
||||||
} test_array[] = {
|
} test_array[] = {
|
||||||
ENT(buffers),
|
ENT(buffers),
|
||||||
ENT(crypto),
|
ENT(crypto),
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
const char tor_main_c_id[] =
|
const char tor_main_c_id[] =
|
||||||
"$Id$";
|
"$Id$";
|
||||||
|
|
||||||
|
/* DOCDOC tor_svn_revision */
|
||||||
const char tor_svn_revision[] =
|
const char tor_svn_revision[] =
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#include "micro-revision.i"
|
#include "micro-revision.i"
|
||||||
|
|
Loading…
Add table
Reference in a new issue