aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse/unparseable.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-30 18:15:00 -0500
committerNick Mathewson <nickm@torproject.org>2018-10-01 00:04:58 -0500
commitfec3b3bb9389d9d9f927c370d560fc50ec65c93b (patch)
tree9b8ad08341e8663156592087ab276420edb5e26a /src/feature/dirparse/unparseable.h
parent6785aa4010c141ab8792e41745acc2267ce46ca4 (diff)
downloadtor-fec3b3bb9389d9d9f927c370d560fc50ec65c93b.tar.gz
tor-fec3b3bb9389d9d9f927c370d560fc50ec65c93b.zip
Extract logic for dumping unparseable junk from routerparse.c
Diffstat (limited to 'src/feature/dirparse/unparseable.h')
-rw-r--r--src/feature/dirparse/unparseable.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/feature/dirparse/unparseable.h b/src/feature/dirparse/unparseable.h
new file mode 100644
index 0000000000..831ab67777
--- /dev/null
+++ b/src/feature/dirparse/unparseable.h
@@ -0,0 +1,44 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file unparseable.h
+ * \brief Header file for unparseable.c.
+ **/
+
+#ifndef TOR_UNPARSEABLE_H
+#define TOR_UNPARSEABLE_H
+
+#include "lib/cc/torint.h"
+
+MOCK_DECL(void,dump_desc,(const char *desc, const char *type));
+void dump_desc_fifo_cleanup(void);
+void dump_desc_init(void);
+
+#ifdef UNPARSEABLE_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;
+struct smartlist_t;
+
+EXTERN(uint64_t, len_descs_dumped)
+EXTERN(struct smartlist_t *, descs_dumped)
+
+MOCK_DECL(STATIC dumped_desc_t *, dump_desc_populate_one_file,
+ (const char *dirname, const char *f));
+STATIC void dump_desc_populate_fifo_from_directory(const char *dirname);
+#endif
+
+#endif /* !defined(TOR_UNPARSEABLE_H) */