aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2013-05-31 15:51:25 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2013-05-31 16:12:28 +0200
commite39292f21dd363bd7601b63b4f43a95705c3332b (patch)
treea54ba8d1b8a066f556113968fdcde05b7f22df2b /src/or/control.c
parentb33b366a7f8bcab1c9b4859788e3b2c7d3dcf180 (diff)
downloadtor-e39292f21dd363bd7601b63b4f43a95705c3332b.tar
tor-e39292f21dd363bd7601b63b4f43a95705c3332b.tar.gz
Test functions used for TB_EMPTY and CELL_STATS events.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 5e2020f7c..495b7d7b0 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4015,27 +4015,11 @@ control_event_conn_bandwidth_used(void)
return 0;
}
-/** Helper structure: temporarily stores cell statistics for a circuit. */
-typedef struct cell_stats_t {
- /** Number of cells added in app-ward direction by command. */
- uint64_t added_cells_appward[CELL_COMMAND_MAX_ + 1];
- /** Number of cells added in exit-ward direction by command. */
- uint64_t added_cells_exitward[CELL_COMMAND_MAX_ + 1];
- /** Number of cells removed in app-ward direction by command. */
- uint64_t removed_cells_appward[CELL_COMMAND_MAX_ + 1];
- /** Number of cells removed in exit-ward direction by command. */
- uint64_t removed_cells_exitward[CELL_COMMAND_MAX_ + 1];
- /** Total waiting time of cells in app-ward direction by command. */
- uint64_t total_time_appward[CELL_COMMAND_MAX_ + 1];
- /** Total waiting time of cells in exit-ward direction by command. */
- uint64_t total_time_exitward[CELL_COMMAND_MAX_ + 1];
-} cell_stats_t;
-
/** Helper: iterate over cell statistics of <b>circ</b> and sum up added
* cells, removed cells, and waiting times by cell command and direction.
* Store results in <b>cell_stats</b>. Free cell statistics of the
* circuit afterwards. */
-static void
+void
sum_up_cell_stats_by_command(circuit_t *circ, cell_stats_t *cell_stats)
{
memset(cell_stats, 0, sizeof(cell_stats_t));
@@ -4067,7 +4051,7 @@ sum_up_cell_stats_by_command(circuit_t *circ, cell_stats_t *cell_stats)
* the (possibly zero) entry from <code>number_to_include</code>. If no
* entry in <code>include_if_non_zero</code> is positive, no string will
* be added to <code>event_parts</code>. */
-static void
+void
append_cell_stats_by_command(smartlist_t *event_parts, const char *key,
uint64_t *include_if_non_zero,
uint64_t *number_to_include)
@@ -4092,7 +4076,7 @@ append_cell_stats_by_command(smartlist_t *event_parts, const char *key,
/** Helper: format <b>cell_stats</b> for <b>circ</b> for inclusion in a
* CELL_STATS event and write result string to <b>event_string</b>. */
-static void
+void
format_cell_stats(char **event_string, circuit_t *circ,
cell_stats_t *cell_stats)
{