[or-cvs] [tor/master 26/40] Create microdesc.h

nickm at torproject.org nickm at torproject.org
Fri Jul 30 01:56:58 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Fri, 23 Jul 2010 20:04:12 +0200
Subject: Create microdesc.h
Commit: 86d6bfe448ec945957b23555f14e79f64896aca9

---
 src/or/dirserv.c     |    1 +
 src/or/dirvote.c     |    1 +
 src/or/main.c        |    1 +
 src/or/microdesc.c   |    1 +
 src/or/microdesc.h   |   37 +++++++++++++++++++++++++++++++++++++
 src/or/or.h          |   21 ---------------------
 src/or/routerparse.c |    1 +
 7 files changed, 42 insertions(+), 21 deletions(-)
 create mode 100644 src/or/microdesc.h

diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index d3fe0a7..5f2c789 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -14,6 +14,7 @@
 #include "dirserv.h"
 #include "dirvote.h"
 #include "hibernate.h"
+#include "microdesc.h"
 #include "router.h"
 #include "routerlist.h"
 
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index b0c4679..3940298 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -9,6 +9,7 @@
 #include "directory.h"
 #include "dirserv.h"
 #include "dirvote.h"
+#include "microdesc.h"
 #include "router.h"
 #include "routerlist.h"
 
diff --git a/src/or/main.c b/src/or/main.c
index ccfd1bc..8e4f35c 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -31,6 +31,7 @@
 #include "geoip.h"
 #include "hibernate.h"
 #include "main.h"
+#include "microdesc.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 0e478bf..ead0f9f 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -3,6 +3,7 @@
 
 #include "or.h"
 #include "config.h"
+#include "microdesc.h"
 
 /** A data structure to hold a bunch of cached microdescriptors.  There are
  * two active files in the cache: a "cache file" that we mmap, and a "journal
diff --git a/src/or/microdesc.h b/src/or/microdesc.h
new file mode 100644
index 0000000..2d1a60a
--- /dev/null
+++ b/src/or/microdesc.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2010, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file microdesc.h
+ * \brief Header file for microdesc.c.
+ **/
+
+#ifndef _TOR_MICRODESC_H
+#define _TOR_MICRODESC_H
+
+microdesc_cache_t *get_microdesc_cache(void);
+
+smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
+                        const char *s, const char *eos, saved_location_t where,
+                        int no_save);
+smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
+                        smartlist_t *descriptors, saved_location_t where,
+                        int no_save);
+
+int microdesc_cache_rebuild(microdesc_cache_t *cache);
+int microdesc_cache_reload(microdesc_cache_t *cache);
+void microdesc_cache_clear(microdesc_cache_t *cache);
+
+microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
+                                                 const char *d);
+
+size_t microdesc_average_size(microdesc_cache_t *cache);
+
+void microdesc_free(microdesc_t *md);
+void microdesc_free_all(void);
+
+#endif
+
diff --git a/src/or/or.h b/src/or/or.h
index 461c55c..2b3b384 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3272,27 +3272,6 @@ typedef enum {
 
 typedef struct microdesc_cache_t microdesc_cache_t;
 
-microdesc_cache_t *get_microdesc_cache(void);
-
-smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
-                        const char *s, const char *eos, saved_location_t where,
-                        int no_save);
-smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
-                        smartlist_t *descriptors, saved_location_t where,
-                        int no_save);
-
-int microdesc_cache_rebuild(microdesc_cache_t *cache);
-int microdesc_cache_reload(microdesc_cache_t *cache);
-void microdesc_cache_clear(microdesc_cache_t *cache);
-
-microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
-                                                 const char *d);
-
-size_t microdesc_average_size(microdesc_cache_t *cache);
-
-void microdesc_free(microdesc_t *md);
-void microdesc_free_all(void);
-
 /********************************* networkstatus.c *********************/
 
 /** How old do we allow a v2 network-status to get before removing it
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 6021ef2..c3b6ffb 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -17,6 +17,7 @@
 #include "router.h"
 #include "routerlist.h"
 #include "memarea.h"
+#include "microdesc.h"
 #undef log
 #include <math.h>
 
-- 
1.7.1




More information about the tor-commits mailing list