diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-07-23 20:04:12 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-07-27 07:58:16 +0200 |
commit | 86d6bfe448ec945957b23555f14e79f64896aca9 (patch) | |
tree | 0afd6f7843947ac25df6739d50f5026fef469845 | |
parent | 0f1548ab18c09efda944def3597bafc2cd9552c8 (diff) | |
download | tor-86d6bfe448ec945957b23555f14e79f64896aca9.tar tor-86d6bfe448ec945957b23555f14e79f64896aca9.tar.gz |
Create microdesc.h
-rw-r--r-- | src/or/dirserv.c | 1 | ||||
-rw-r--r-- | src/or/dirvote.c | 1 | ||||
-rw-r--r-- | src/or/main.c | 1 | ||||
-rw-r--r-- | src/or/microdesc.c | 1 | ||||
-rw-r--r-- | src/or/microdesc.h | 37 | ||||
-rw-r--r-- | src/or/or.h | 21 | ||||
-rw-r--r-- | src/or/routerparse.c | 1 |
7 files changed, 42 insertions, 21 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index d3fe0a709..5f2c78917 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 b0c467984..394029812 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 ccfd1bc6e..8e4f35cc0 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 0e478bf2a..ead0f9ffa 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 000000000..2d1a60ad0 --- /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 461c55c82..2b3b38480 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 6021ef2a9..c3b6ffbb3 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> |