summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2016-06-30 06:13:44 +0000
committerAndrea Shepard <andrea@torproject.org>2016-06-30 07:03:26 +0000
commit42f089473a50613ae62875ede386861e91123b78 (patch)
tree4a4a69cb6a2c709d4fcaab24edec254ddf1f25c6 /src/or
parent2154160a2484d852e4a0b509a5f046001d52fd11 (diff)
downloadtor-42f089473a50613ae62875ede386861e91123b78.tar.gz
tor-42f089473a50613ae62875ede386861e91123b78.zip
Unit test for dump_desc_populate_one_file()
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerparse.c14
-rw-r--r--src/or/routerparse.h14
2 files changed, 15 insertions, 13 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index cedcfe04c7..f3f003eede 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -601,18 +601,6 @@ static int problem_with_dump_desc_dir = 0;
#define DESC_DUMP_DATADIR_SUBDIR "unparseable-descs"
#define DESC_DUMP_BASE_FILENAME "unparseable-desc"
-/*
- * One entry in the list of dumped descriptors; filename dumped to, length
- * and SHA-256.
- */
-
-typedef struct {
- char *filename;
- size_t len;
- uint8_t digest_sha256[DIGEST256_LEN];
- time_t when;
-} dumped_desc_t;
-
/** Find the dump directory and check if we'll be able to create it */
static void
dump_desc_init(void)
@@ -835,7 +823,7 @@ dump_desc_fifo_cleanup(void)
* the filename is sensibly formed and matches the file content, and either
* return a dumped_desc_t for it or remove the file and return NULL.
*/
-static dumped_desc_t *
+STATIC dumped_desc_t *
dump_desc_populate_one_file(const char *dirname, const char *f)
{
dumped_desc_t *ent = NULL;
diff --git a/src/or/routerparse.h b/src/or/routerparse.h
index a96146acf2..6167e5148b 100644
--- a/src/or/routerparse.h
+++ b/src/or/routerparse.h
@@ -89,12 +89,26 @@ void routerparse_init(void);
void routerparse_free_all(void);
#ifdef ROUTERPARSE_PRIVATE
+/*
+ * One entry in the list of dumped descriptors; filename dumped to, length,
+ * SHA-256 and timestamp.
+ */
+
+typedef struct {
+ char *filename;
+ size_t len;
+ uint8_t digest_sha256[DIGEST256_LEN];
+ time_t when;
+} dumped_desc_t;
+
EXTERN(size_t, len_descs_dumped);
EXTERN(smartlist_t *, descs_dumped);
STATIC int routerstatus_parse_guardfraction(const char *guardfraction_str,
networkstatus_t *vote,
vote_routerstatus_t *vote_rs,
routerstatus_t *rs);
+STATIC dumped_desc_t * dump_desc_populate_one_file(const char *dirname,
+ const char *f);
STATIC void dump_desc(const char *desc, const char *type);
STATIC void dump_desc_fifo_cleanup(void);
#endif